I will try it. Now i understand the mechanism.
If i want to use for example Tahoma, that has all Unicode chars i want, how i choose font?
Great, i just did it.
Tahoma have family ... Tahoma, when open file tahomabd.ttf with Fontforge.
Trying wxFont fontTahoma(16, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _T("Tahoma"), wxFONTENCODING_DEFAULT); i did nothing.
So with code bellow runs fine.
Code: Select all
wxFont fontTahoma("/home/a/.fonts/tahomabd.ttf");
wxPdfFontManager* fntTahoma = wxPdfFontManager::GetFontManager();
fntTahoma->RegisterFont(fontTahoma,_T("Tahoma"));
pdf.SetFont(wxS("Tahoma"),wxS(""),16);
pdf.Cell(40,10,wxS("Hello World!"));
pdf.Cell(40,10,wxS("Στὸν ἱστοχῶρο αὐτὸν ..."));
But if i want not to link to a certain font file, how i can choose it from OS with current settings automaticaly?
How i can know the FONTFAMILY and FONTSTYLE etc?
Suppose i must use wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL and wxFONTWEIGHT_NORMAL?
The solution is ...
wxFont fontTahoma;
wxPdfFontManager* fntTahoma = wxPdfFontManager::GetFontManager();
fntTahoma->RegisterFont(fontTahoma,_T("Tahoma"));
Also if i try...
Code: Select all
wxFont fontTahoma(16, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _T("Tahoma132432"), wxFONTENCODING_DEFAULT);
wxPdfFontManager* fntTahoma = wxPdfFontManager::GetFontManager();
fntTahoma->RegisterFont(fontTahoma,_T("Tahoma"));
pdf.SetFont(wxS("Tahoma"),wxS(""),16);
pdf.Cell(40,10,wxS("Hello World!"));
pdf.Cell(40,10,wxS("Στὸν ἱστοχῶρο αὐτὸν ..."));
fntTahoma->RegisterFont(fontTahoma,_T("Tahoma")); corrects font init and text put just fine
Thanks very mush.
Jim