cutecode wrote: ↑Fri Jul 12, 2019 2:48 pm
With wxPdfDocument wich fonts can I use?
wxPdfDocument supports the standard PDF fonts (Courier, Times Roman, Helvetica - each in 4 variants: normal/bold/italic/bold-italic; Symbol, and ZapfDingBats). Additionally fonts in the formats Type1, TrueType, and OpenType are supported. The fonts can be installed in your operating system, or can be provided explicitly by your application.
cutecode wrote: ↑Fri Jul 12, 2019 2:48 pm
In my project wxPdfDocument does not know "Arial" font, I see only '?' signes.
The standard Adobe/PDF fonts can be used without providing a font file and without embedding the font in the resulting PDF. Arial is used as a synonym for Helvetica, because the main font characteristics are identical. The problem with the standard fonts is that they do not fully support Unicode. For example, cyrillic characters are not part of the standard fonts. This could explain, why you see questionmarks instead of the expected characters.
cutecode wrote: ↑Fri Jul 12, 2019 2:48 pm
But if I use 'Microsoft Sans Serif' font then PDF file looks as it expected.
How did you use the font?
cutecode wrote: ↑Fri Jul 12, 2019 2:48 pm
I added font path to variable, but in sane
Code: Select all
if(wxDirExists(fontPath))
wxSetEnv(_T("WXPDF_FONTPATH"), fontPath);
else
wxMessageBox("Folder " + fontPath + L" does not exist");
Which font path did you use? Does the folder really contain the font files you intend to use?
cutecode wrote: ↑Fri Jul 12, 2019 2:48 pm
As readme.md states
Code: Select all
In addition to the 14 standard Adobe fonts it is possible to use other Type1, TrueType
or OpenType fonts - with or without embedding them into the generated document
Or should I insert Arial font in my project manually? Then how to do it?
Yes. Usually the font Arial is provided by the operating system. That is using the following code
Code: Select all
wxPdfFontManager::GetFontManager()->RegisterSystemFonts();
allows you to use (almost) all fonts installed on your operating system.
Alternatively, you may use method
wxPdfFontManager::GetFontManager()->RegisterFont to explicitly load only those fonts you actually want to use. For example, under Windows fonts files are usually located in directory "C:\Windows\Fonts".
Regards,
Ulrich