代码拉取完成,页面将自动刷新
package gopdf
import (
"fmt"
"io"
)
// CIDFontObj is a CID-keyed font.
// cf. https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf
type CIDFontObj struct {
PtrToSubsetFontObj *SubsetFontObj
indexObjSubfontDescriptor int
}
func (ci *CIDFontObj) init(funcGetRoot func() *GoPdf) {
}
// SetIndexObjSubfontDescriptor set indexObjSubfontDescriptor
func (ci *CIDFontObj) SetIndexObjSubfontDescriptor(index int) {
ci.indexObjSubfontDescriptor = index
}
func (ci *CIDFontObj) getType() string {
return "CIDFont"
}
func (ci *CIDFontObj) write(w io.Writer, objID int) error {
io.WriteString(w, "<<\n")
fmt.Fprintf(w, "/BaseFont /%s\n", CreateEmbeddedFontSubsetName(ci.PtrToSubsetFontObj.GetFamily()))
io.WriteString(w, "/CIDSystemInfo\n")
io.WriteString(w, "<<\n")
io.WriteString(w, " /Ordering (Identity)\n")
io.WriteString(w, " /Registry (Adobe)\n")
io.WriteString(w, " /Supplement 0\n")
io.WriteString(w, ">>\n")
fmt.Fprintf(w, "/FontDescriptor %d 0 R\n", ci.indexObjSubfontDescriptor+1) //TODO fix
io.WriteString(w, "/Subtype /CIDFontType2\n")
io.WriteString(w, "/Type /Font\n")
glyphIndexs := ci.PtrToSubsetFontObj.CharacterToGlyphIndex.AllVals()
io.WriteString(w, "/W [")
for _, v := range glyphIndexs {
width := ci.PtrToSubsetFontObj.GlyphIndexToPdfWidth(v)
fmt.Fprintf(w, "%d[%d]", v, width)
}
io.WriteString(w, "]\n")
io.WriteString(w, ">>\n")
return nil
}
// SetPtrToSubsetFontObj set PtrToSubsetFontObj
func (ci *CIDFontObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj) {
ci.PtrToSubsetFontObj = ptr
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。