[wxPython] font info and questions

I'm trying to complete the Font class for PythonCard, so I'm going back over
what I do and don't know about fonts in wxPython/wxWindows. Hopefully, Robin
or someone else can shed some additional light where I've made a mistake
below, point out bugs or workarounds, etc. Tests were done with wxPython
2.3.1

ka

···

---

wxDECORATIVE appears to just use a wxSWISS family font (Arial)

wxSCRIPT also appears to use a wxSWISS family font, but the faceName
returned says "Script" and that faceName is not returned by the
FontEnumerator and is obviously not being used to display text.

wxSLANT appears to be the same as wxITALIC.

wxLIGHT appears to be the same as wxNORMAL.

Underline is only available on Windows; Linux and Solaris don't support
underline?

Is there a way to create a font and just specify the faceName, but not the
family? Alternatively, is there a way to determine the font family for a
given font just given the faceName? Basically, I need to build a list of
fonts with their family info at startup so I can keep track of all of the
monospace, serif, and sans-serif fonts. If wxSCRIPT and wxDECORATIVE would
work, I'll track those to. This is necessary so that I can support CSS style
lists of fonts.

It is possible to specify the faceName for a control using some fonts not
returned by the FontEnumerator, such as "Small Fonts" and get a correct
display, but others such any symbol-style fonts like Marlett and Webdings
don't appear to work. Is this a known bug?

Windows Font list (lines prefixed with - (dash) were not returned by the
Font enumerator):
Arial
Arial Black
Arial Narrow
Book Antiqua
Bookman Old Style
Century Gothic
Comic Sans MS
Courier New
-Fixedsys
Garamond
Georgia
Haettenschweiler
Impact
Lucida Blackletter
Lucida Bright
Lucida Calligraphy
Lucida Console
Lucida Sans
Lucida Sans Typewriter
Lucida Sans Unicode
-Marlett
Microsoft Sans Serif
-Modern
-MS Outlook
-MS Sans Serif
-MS Serif
OCR A Extended
Palatino Linotype
Papyrus
Poor Richard
-Roman
-Script
-Small Fonts
Sydnie
-Symbol
-System
Tahoma
-Terminal
Times New Roman
Trebuchet MS
Verdana
Viner Hand ITC
-Webdings
-Wingdings
-WST_Czec
-WST_Engl
-WST_Fren
-WST_Germ
-WST_Ital
-WST_Span
-WST_Swed

wxDECORATIVE appears to just use a wxSWISS family font (Arial)

wxSCRIPT also appears to use a wxSWISS family font, but the faceName
returned says "Script" and that faceName is not returned by the
FontEnumerator and is obviously not being used to display text.

wxSLANT appears to be the same as wxITALIC.

wxLIGHT appears to be the same as wxNORMAL.

Underline is only available on Windows; Linux and Solaris don't support
underline?

For all of the above: I don't know, check the source.

Is there a way to create a font and just specify the faceName, but not the
family?

I believe that if the facename is specifed then it takes precedence.

Alternatively, is there a way to determine the font family for a
given font just given the faceName?

Try creating the font with wxDEFAULT family and the face name and then call
GetFamily. There may be a better way though, ask on wx-users.

It is possible to specify the faceName for a control using some fonts not
returned by the FontEnumerator, such as "Small Fonts" and get a correct
display, but others such any symbol-style fonts like Marlett and Webdings
don't appear to work. Is this a known bug?

Not that I know of. Look at the SF bug tracker.

Windows Font list (lines prefixed with - (dash) were not returned by the
Font enumerator):

wxWindows only deals with TrueType fonts on Windows.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!