Re: Writing a Python font viewer/manager
From: Jaime Wyant (programmer.py_at_gmail.com)
Date: 10/29/04
- Next message: Michael Foord: "Re: Python equivalent of LWP and HTTP in Perl"
- Previous message: Tim Golden: "RE: saving local dir"
- In reply to: Maciej Dziardziel: "Re: Writing a Python font viewer/manager"
- Next in thread: Bats: "Re: Writing a Python font viewer/manager"
- Reply: Bats: "Re: Writing a Python font viewer/manager"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 07:50:30 -0500 To: fiedzia@fiedzia.prv.pl, python-list@python.org
The code below works in windows. I assume it works in linux also.
The code illustrates how to create a "font-picker". If you want
something more advanced, you could roll up your sleeves and create
your own. It wouldn't be too bad. Check out wx.FontEnumerator.
wx.FontEnumerator will enumerate the fonts on your system (duhhh...)
import wx
app = wx.PySimpleApp()
dlg = wx.FontDialog(None, wx.FontData())
if dlg.ShowModal() == wx.ID_OK:
fontdata = dlg.GetFontData()
font = fontdata.GetChosenFont()
wx.MessageBox("You chose the `%s' font." % font.GetFaceName())
else:
wx.MessageBox("You pressed cancel and didn't choose any fonts.")
app.MainLoop()
HTH,
jw
On Thu, 28 Oct 2004 23:14:53 +0200, Maciej Dziardziel
<fiedzia@fiedzia.prv.pl> wrote:
> Bats wrote:
>
> > Hello.
> > On Windows, I used to have a little app that would let me navigate
> > visually through my 20,000+ fonts and I could create groups of them for
> > quick install/remove from the system. It was great to be able to type in a
> > word (say for a logo) and then see it in all the fonts.
>
> Perhaps take a look at gfontview - not python app, but may show you how to
> access fonts.
>
> --
> Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
> www.fiedzia.prv.pl
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
- Next message: Michael Foord: "Re: Python equivalent of LWP and HTTP in Perl"
- Previous message: Tim Golden: "RE: saving local dir"
- In reply to: Maciej Dziardziel: "Re: Writing a Python font viewer/manager"
- Next in thread: Bats: "Re: Writing a Python font viewer/manager"
- Reply: Bats: "Re: Writing a Python font viewer/manager"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|