win32ui.CreateFont() question

Discussion in 'Python' started by Chris Gonnerman, Nov 21, 2003.

  1. I am rewriting an antique BASIC program in Python for a
    customer. The main feature of the program is printing a
    work order for a particular assembly; the BASIC program
    uses IBM OEM line-drawing characters.

    The new program must reproduce the work order as closely as
    possible but be able to print to brainless inkjet printers.
    I found the MS Linedraw font online, and am able to print
    the line-drawing characters with it under Windows XP but
    the same code fails to work in Windows 98, printing
    international characters instead.

    I'm not sure what code to post from the application (the
    printing code is a bit long to post), but if nobody has
    an easy answer I'll see what I can boil down.

    I'm calling CreateFont using this function:

    LOGPIXELSY = 90

    def getfont(dc, name, size):
    scaley = dc.GetDeviceCaps(LOGPIXELSY) / 72.0
    return win32ui.CreateFont({
    "name": name,
    "height": int(1.0 * scaley * size),
    })

    If there is a better/more correct way I'd be happy to
    see it.

    Also: How do you know what font Windows actually chose?
    The PyCFont returned by win32ui.CreateFont() does not have
    any properties or methods as far as I can tell, so no way
    to access the underlying MFC CFont object.

    Chris Gonnerman --
    http://newcenturycomputers.net
    Chris Gonnerman, Nov 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sameer
    Replies:
    1
    Views:
    1,651
    rprince
    Aug 12, 2009
  2. Me Mine

    win32ui screen capture

    Me Mine, Jun 27, 2003, in forum: Python
    Replies:
    3
    Views:
    6,591
    Fredrik Lundh
    Jun 27, 2003
  3. Howard Lightstone

    win32ui.CreatePrintDialog argument question

    Howard Lightstone, Jun 28, 2003, in forum: Python
    Replies:
    0
    Views:
    728
    Howard Lightstone
    Jun 28, 2003
  4. EricP
    Replies:
    1
    Views:
    426
    Roger Upole
    Oct 28, 2003
  5. Corwan
    Replies:
    1
    Views:
    466
    Mark Hammond
    Feb 1, 2004
Loading...

Share This Page