- wxNativeFont font = wxLoadQueryFont( pointSize, family, style, weight,
+ // OK, we have the correct xregistry/xencoding in info structure
+ wxNativeFont font = 0;
+
+ // if we already have the X font name, try to use it
+ if( xFontName && !xFontName->IsEmpty() )
+ {
+ //
+ // Make sure point size is correct for scale factor.
+ //
+ wxStringTokenizer tokenizer(*xFontName, _T("-"), wxTOKEN_RET_DELIMS);
+ wxString newFontName;
+
+ for(int i = 0; i < 8; i++)
+ newFontName += tokenizer.NextToken();
+
+ (void) tokenizer.NextToken();
+
+ newFontName += wxString::Format("%d-", pointSize);
+
+ while(tokenizer.HasMoreTokens())
+ newFontName += tokenizer.GetNextToken();
+
+ font = wxLoadFont(newFontName);
+
+ if(font)
+ *xFontName = newFontName;
+ }
+
+ if( !font )
+ font = wxLoadQueryFont( pointSize, family, style, weight,