DeanH,
You have to know the font filename to be able to load it into the pdf. You don't need the font family name or better put, font family name is currently not working.
it's easy to find the filename on windows:
Start->Settings->fonts then click on the font you want and it will give you the filename. Currently "Font Family Name" is the name pbPDF will use to access the font you loaded, so if you call the font "FUNNY" instead of "Comic" it will find and use "FUNNY".
Only Underline works with loaded fonts. Not Bold or Italic.
Code: Select all
XIncludeFile "..\pbPDFModule.pbi"
Define File$="pbPDF-EmbedFont-1.pdf"
;
;On windows, From start button click on settings cog then click on fonts. to the right click on the font you want
; it will give you the "Font file name"
;
; currently EmbedFont works this way {filename of font}{name to identify font}{style (not working)}{UNICODE FLAG}
;
#PDF = 1
If PDF::Create(#PDF)
PDF::AddPage(#PDF)
PDF::EmbedFont(#PDF,"c:\windows\fonts\BAHNSCHRIFT.TTF", "bahc"); There is something wrong with loading other font faces like "condensed" or "Bold"
PDF::EmbedFont(#PDF,"c:\windows\fonts\BROADW.TTF", "bro","U") ; "U" is the style here, but it seems to ignore it
PDF::EmbedFont(#PDF, "l_10646.ttf", "Luci", "", PDF::#Unicode); unicode example
PDF::SetFont(#PDF, "bahc", "", 16)
PDF::PlaceText(#PDF, "This is an embedded TrueType-font (BAHNSCHRIFT)", 10, 20)
PDF::SetFont(#PDF, "bro", "", 16)
PDF::PlaceText(#PDF, "This is an embedded TrueType-font (BROADWAY)", 10, 35)
PDF::SetFont(#PDF, "Luci", "", 14)
PDF::PlaceText(#PDF, "This is an embedded Unicode-font (LucidaSans)", 10, 50)
PDF::SetFont(#PDF, "Luci", "U", 11)
PDF::PlaceText(#PDF, "This is an embedded Unicode-font (LucidaSans Underlined)", 10, 60)
PDF::Close(#PDF, File$)
EndIf
RunProgram(File$)
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari