[ wxwindows-Patches-1671684 ] wxFontRefData::Init() Load font (unicode-mode) with facename

SourceForge.net noreply at sourceforge.net
Thu Mar 1 04:41:16 PST 2007


Patches item #1671684, was opened at 2007-03-01 13:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1671684&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: X11 specific
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gerd (gerd-alber)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxFontRefData::Init() Load font (unicode-mode) with facename

Initial Comment:
In wxX11univ_unicode it isn't possible to load a font with a given facename. Only three static facename (fonts) can be load on the base font-family. 
I extended wxFontRefData::Init() so far, which is possible to load a font with wanted facename. If no font with this facename exists on the system, I try to load the default font (wxSYS_DEFAULT_GUI_FONT). 
When facename is empty, a static font will be load (old way). Here it would be better to look for an installed font, which fits to the family and not to set a fix facename (font). 
	
I am rather new at wxWidgets and must train myself first to do such things :).

Another point is the point size of a font. I have install pange 1.10.0-3. Pango can't (in this version) load font with a fontsize < 1, so I change the checking in wxFontRefData::Init() and wxFontRefData::SetPointSize().

Wouldn't it be better, to make possible Pango API calls over the class wxNativeFontInfo? For example:

void wxFontRefData::SetPointSize(int pointSize)
{
    m_pointSize = pointSize == wxDEFAULT || pointSize < 1
        ? wxDEFAULT_FONT_SIZE
        : pointSize;

#if wxUSE_UNICODE
    // Get native info
    m_nativeFontInfo.SetPointSize(m_pointSize);
#endif
}

The access to the Pango-API would be more central. A change on the API of Pango would be simpler.
	
Thanks for feedbacks or improvements 

Regards Gerd 

p.s. There is another bug. When I minimize and then maximize the window, my testapp crashs when I do dc.DrawText() in dcclient.cpp wxWindowDC::DoDrawText() when pango_layout_get_pixel_size(). The the follow message shows:

(process:18223): Pango-WARNING **: Couldn't load font "serif 134591528 0" falling back to "Sans 134591528 0"

(process:18223): Pango-WARNING **: Couldn't load font "Sans 134591528 0" falling back to "Sans 0"

(process:18223): Pango-WARNING **: All font failbacks failed!!!!
	
I can prevent this, by set a font for dc (dc.SetFont(myFont)), bevor I do dc.DrawText(). 
Somebody has an idea? Should I post it in the bug report?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1671684&group_id=9863




More information about the wx-dev mailing list