http://bugs.winehq.org/show_bug.cgi?id=33117
Bug #: 33117 Summary: Can't load Bach41.ttf with CreateFontIndirect under Wine - this works fine in Windows Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: forums@robertinventor.com Classification: Unclassified
Created attachment 43794 --> http://bugs.winehq.org/attachment.cgi?id=43794 Bach41 True Type Musicological Font
The code is simple:
Basically I'm just using hFont=CreateFontIndirect(&lfTest); with strcpy(lfTest.lfFaceName,"Bach");
When I select this font into an example hdc, then use GetTextFace(..) to check which font was selected, then it reports that it found Martlett. Under Windows it finds the Bach font.
Why can't it find the Bach font, and why does it find Marlett instead?
It seems to be installed okay in my version of Wine since it shows up fine in the font dialog launched from within my program (using ChooseFont).
It displays the characters fine within that dialog too.
But I can't seem to use it within my application under Wine.
Also - may be related - if I try to set the font for a selection of text in a rich text field to the Bach font, again this doesn't work in Wine though it works fine in Windows.
Everything is fine in Windows.
I also tried using AddFontResourceEx(szFontPFile,FR_PRIVATE,0); - but wasn't able to load it from
I attach the Bach41.ttf font as an attachment.
Thanks for your help. I have been puzzling over this for several days now and can't find a solution, but as you see, I have reduced the issue to a few lines of code, which should help.
Here is the actual source code I used for testing this bug:
---------------------------------------------------- /** Extract from the code: (where SpecialDebugLogLine() just outputs a time stamped version of the line to a file). **/ #define ONE_K 1024
void TestCreateFontIndirectFor(char *szfont,int ichar_set) { LOGFONT lfTest; HFONT hFont=NULL,hFontWas=NULL; char szt[ONE_K]; char szfont_found[ONE_K]; HDC hdc=GetDC(NULL); memset(&lfTest,0,sizeof(lfTest)); lfTest.lfHeight=12; lfTest.lfCharSet=ichar_set; strcpy(lfTest.lfFaceName,szfont); hFont=CreateFontIndirect(&lfTest); hFontWas=SelectObject(hdc,hFont); GetTextFace(hdc,1024,szfont_found); sprintf (szt,"***Test of CreateFontIndirect for %s***\n" "Font found: %s\n\n",szfont,szfont_found ); SpecialDebugLogLine(szt); SelectObject(hdc,hFontWas); DeleteObject(hFont); hFont=NULL; ReleaseDC(NULL,hdc); }
void TestCreateFontIndirect(void) { SpecialDebugLogLine("\n\n****TestCreateFontIndirect****\n\n"); TestCreateFontIndirectFor("Courier",0); TestCreateFontIndirectFor("Arial",0); TestCreateFontIndirectFor("Bach",SYMBOL_CHARSET); }
/** and the output from Wine is:
****TestCreateFontIndirect****
2.06.41 AM March 04, 2013 (2746.3):***Test of CreateFontIndirect for Courier*** Font found: Courier
2.06.41 AM March 04, 2013 (2746.32):***Test of CreateFontIndirect for Arial*** Font found: Arial
2.06.41 AM March 04, 2013 (2746.34):***Test of CreateFontIndirect for Bach*** Font found: Marlett
2.06.41 AM March 04, 2013 (2746.35):
Test of AddFontResourceEx for CreateFontIndirect*** 2.06.41 AM March 04, 2013 (2746.35):***Test of CreateFontIndirect for Bach*** Font found: Marlett **/