RE: win32lib problem (fonts) HELP

new topic     » topic index » view thread      » older message » newer message

daryl_vdb at HOTMAIL.COM wrote:
> Hi everyone
> 
> I have found a problem with win32lib to do with drawing fonts to a 
> window.  
> I wanted to use the terminal font, so i wrote:
> 
> setFont(window1, "terminal", 9, Normal)
> 
> to set the font. The trouble is, no matter what i tried i couldn't get 
> my 
> program to use the terminal font.  I even tried using getFontDialog() to 
> get 
> the font name, and it still did not use the right font.  Sure enough, it 
> 
> works perfectly with any other font, true type or bitmap.  I thought the 
> 
> problem might be that terminal is a bitmap font, but I don't think this 
> is 
> it.  Can anyone help?
> 
> thanks in advance,
> Daryl van den Brink
> 

Hi there,
    One simple way would be to find:
        procedure initialize()

    in the winlib file (sort of near the end)

    and change the line:
        setStartupFont(ANSI_VAR_FONT)

    to read:
        setStartupFont(OEM_FIXED_FONT)

    and save the file.

    If your app, just type:
        setDefaultFont(ControlID)

    The only drawback is that the default font is now
    Terminal also.

    (OEM_FIXED_FONT is the new name for the Terminal font)
    
    If you dont mind a little more work, you could
    GetStockObject/SelectObject into the hdc yourself:

    in the onPaint procedure:

    bool=c_func(xSelectObject,{hdc,c_func(xGetStockObject,
                              {OEM_FIXED_FONT})})
    then use native c text functions.
    
You might ask Derek to add more support for stock fonts also.

That font is a bit gaudy though smile  Cant see why anyone would
want to use it.  Is it a compatibility issue?

Good luck with it.
--Al

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu