mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00
Added FontName to FontDescriptor when loading TrueType based fonts from file
This commit is contained in:
parent
4d5156c4a0
commit
bb709b4381
@ -472,6 +472,7 @@ func NewCompositePdfFontFromTTFFile(filePath string) (*PdfFont, error) {
|
||||
|
||||
// Make the font descriptor.
|
||||
descriptor := &PdfFontDescriptor{}
|
||||
descriptor.FontName = core.MakeName(ttf.PostScriptName)
|
||||
descriptor.Ascent = core.MakeFloat(k * float64(ttf.TypoAscender))
|
||||
descriptor.Descent = core.MakeFloat(k * float64(ttf.TypoDescender))
|
||||
descriptor.CapHeight = core.MakeFloat(k * float64(ttf.CapHeight))
|
||||
|
@ -377,6 +377,7 @@ func NewPdfFontFromTTFFile(filePath string) (*PdfFont, error) {
|
||||
truefont.Encoding = core.MakeName("WinAnsiEncoding")
|
||||
|
||||
descriptor := &PdfFontDescriptor{}
|
||||
descriptor.FontName = core.MakeName(ttf.PostScriptName)
|
||||
descriptor.Ascent = core.MakeFloat(k * float64(ttf.TypoAscender))
|
||||
descriptor.Descent = core.MakeFloat(k * float64(ttf.TypoDescender))
|
||||
descriptor.CapHeight = core.MakeFloat(k * float64(ttf.CapHeight))
|
||||
|
Loading…
x
Reference in New Issue
Block a user