[wxPython-users] sorting out fonts
Raffaello Barella
barbarossa.platz at gmail.com
Sat Dec 22 22:49:26 PST 2007
Thanks, Jonhattan: your code works nicely.
2007/12/23, jonhattan <jonhattan at faita.net>:
>
> Raffaello Barella escribi=F3:
> > Merry Xmas to everybody
> > I'm trying to build an application to sort out the existing fonts
> > according to their properties .
> > Working in Windows XP Home, I tried with the following code:
> >
> > e =3D wx.FontEnumerator ()
> > e.EnumerateFacenames ()
> > listA =3D e.GetFacenames()
> >
> > e.EnumerateFacenames(wx.FONTENCODING_SYSTEM, fixedWidthOnly =
=3D
> > True)
> > listF =3D e.GetFacenames()
> >
> > but unfortunately all I get is listA =3D=3D listF, i.e. all the exist=
ing
> > fonts, no sorting.
> > Where is my mistake?
> >
> > Raffaello
>
> You have to subclass wx.FontEnumerator and override OnFacename:
>
> class FE(wx.FontEnumerator):
> def OnFacename(self, fontname):
> print fontname
>
> fe =3D FE()
> fe.EnumerateFacenames(wx.FONTENCODING_SYSTEM, fixedWidthOnly =3D True)
> Andale Mono
> Bitstream Vera Sans Mono
> Counterscraps
> Courier
> Courier 10 Pitch
> Courier New
> DejaVu Sans Mono
> FreeMono
> Larabiefont
> Lucida Sans Typewriter
> Mitra Mono
> Monofonto
> Monospace
> Nimbus Mono L
> TlwgMono
> TlwgTypewriter
> Unispace
>
>
>
> -- jonhattan
>
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200712=
23/3515e0e1/attachment.htm
More information about the wxpython-users
mailing list