I try to use a not on my System installed Font in a PDFDocument using AddFonts.
Dim ttFontToEmbed As FolderItem
ttFontToEmbed = GetFontFolder( "Honey" ) // GetFontFolder (see below)
If ttFontToEmbed <> Nil And ttFontToEmbed.Exists Then
pdf.AddFonts(ttFontToEmbed)
End If
Then later i call:
Var myPage As Graphics = pdf.Graphics
Followed by:
myPage.FontName = "Honey I Stole Your Jumper" // the True name of the Font
// myPage.FontName = "Honey"
// myPage.FontName = "Honey.ttf" // the Filename
This works fine using Einhugurs PDF Solution, but not with Xojo’s own implementation.
What am i doing wriong?
GetFontsFolder Method:
Dim f As FolderItem
f = GetFileAtResources("Fonts")
if f = nil then
return nil
end if
f = f.Child(name)
If f <> Nil Then
if f.Exists then
return f
else
return nil
end if
Else
Return Nil
End If