> However, I relatively easily add this to the wxWidgets API only, as a method
> of the wxPLplotstream class.

do you mean that you are able to use the wxWidgets fonts with plplot?
That's interesting.

I would like to use plplot to print the plots on the screen but also
in a pdf document with wxPdfDocument. And it is there where the font
is more important to me because the rest of the document is printed
with a single font so I would be happy if the plots could also use the
same font.

I set the font in the pdf with its name:
pdf.SetFont(font_name, font_style, size);

To register the custom fonts, I do the following:
auto font_manager = wxPdfFontManager::GetFontManager();
font_manager->AddSearchPath(font_path);
font_manager->SetDefaultEmbed(true);
font_manager->RegisterFontDirectory(font_path);
font_manager->RegisterFont("OpenSans-Regular.xml", font_name, 0);

It required me to build some special files OpenSans-Regular.{ctg.z,xml,z}:
http://wxcode.sourceforge.net/docs/wxpdfdoc/makefont.html

F

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to