Re: Writing a Python font viewer/manager

From: Jaime Wyant (programmer.py_at_gmail.com)
Date: 10/29/04


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
>



Relevant Pages

  • Re: Font Component
    ... I found that if I close my app and then run it again, the fonts appear in my ... Could this be because I am running my app as the shell? ... >components and see how the registry key is setup. ... > Windows XP Embedded Supplemental Toolkit Covering XPe SP2 ...
    (microsoft.public.windowsxp.embedded)
  • Re: Problems with screens
    ... If it fixes the issue and you don't want all the extra fonts then backtrack ... removing one at a time to find the one that is needed by your app. ... > On start the main windows maximizes to full screen and sets as "Stay On ... > Are there any differences in windows creating and displaying I should ...
    (microsoft.public.windowsxp.embedded)
  • Re: Font display problem on Linux
    ... >> ones that come with Windows. ... app would be worse. ... figure out what fonts the app might be asking for. ... >> java thingy for getting temporary numbers. ...
    (comp.os.linux.development.apps)
  • Re: What happened to thr Arial Rounded font?
    ... List of default fonts with Windows 98 does not list Arial Rounded. ... it installed it would have come with some other App or you downloaded it. ... >Trond Ruud ...
    (microsoft.public.windowsxp.basics)
  • Re: Windows.. its like coming home!
    ... gradual transition, especially in going from OS 9 to OS X. ... They needed something that could compete with Windows, ... mean by the "2 of every app" comment before - Apple took whatever apps ... I've found that because the Dock shows applications rather than windows, ...
    (comp.sys.mac.advocacy)