HowTo: PDFDocument.AddFonts

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

If you use the Xojo 2021r1+ you don’t need to use PDFDocument.AddFonts, since the PDF Framework automagically embeds fonts, but only supported font files (TTF, TTC, OTF). But note that the Xojo PDF Framework does not currently work correctly with all fonts (some fonts show up, some don’t, and that’s even though they’re embedded). This is something they are working on right now.

I’m using 2021 R3.1. The Font is a Honey.ttf File which is not installed on the System.

Is it this font?

No. This one:

https://www.dafont.com/de/honey-i-stole-your-.font

Created a FR: <https://xojo.com/issue/67267>