Remove wxCreateFontFromLogFont() and wxFillLogFont()
These functions are not really useful as converting between wxFont and LOGFONT can be done trivially by passing via wxNativeFontInfo and, in fact, wxCreateFontFromLogFont() managed to do the conversion wrongly by forgetting to update wxNativeFontInfo::pointSize member when changing wxNativeFontInfo::lf. This fixes one unit test failure after the latest changes, although not yet the other one, see the upcoming commit for this.
This commit is contained in:
@@ -264,35 +264,3 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
|
||||
|
||||
return fontEncoding;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFont <-> LOGFONT conversion
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFillLogFont(LOGFONT *logFont, const wxFont *font)
|
||||
{
|
||||
wxNativeFontInfo fi;
|
||||
|
||||
// maybe we already have LOGFONT for this font?
|
||||
const wxNativeFontInfo *pFI = font->GetNativeFontInfo();
|
||||
if ( !pFI )
|
||||
{
|
||||
// use wxNativeFontInfo methods to build a LOGFONT for this font
|
||||
fi.InitFromFont(*font);
|
||||
|
||||
pFI = &fi;
|
||||
}
|
||||
|
||||
// transfer all the data to LOGFONT
|
||||
*logFont = pFI->lf;
|
||||
}
|
||||
|
||||
wxFont wxCreateFontFromLogFont(const LOGFONT *logFont)
|
||||
{
|
||||
wxNativeFontInfo info;
|
||||
|
||||
info.lf = *logFont;
|
||||
|
||||
return wxFont(info);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user