1. RE: win32lib problem (fonts) HELP

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 message » categorize

2. RE: win32lib problem (fonts) HELP

Daryl,

A (long) while back I wanted to use this font in one of my programs.  
The only way I could get it was by changing Win32Lib's default font to 
OEM_FIXED_FONT.  This can now be done without modifying the library 
using "setStartupFont( OEM_FIXED_FONT )".

However, here is an interesting note from MS:
http://support.microsoft.com/support/kb/articles/Q196/2/80.ASP

-- Brian


Daryl van den Brink 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
> 
>

new topic     » goto parent     » topic index » view message » categorize

3. RE: win32lib problem (fonts) HELP

daryl_vdb at HOTMAIL.COM wrote:
> Thanks for your help.  The reason why I want to use terminal is because
> it is the only font that has the same set of characters as a dos prompt. 
>  If
> you know a better one, can you please tell me about it?
> 
> by the way, would this work?
> 
> setFont(window1, "OEM_FIXED_FONT")
> 
> ----- Original Message ----- 
> From: "Al Getz" <Xaxo at aol.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Saturday, April 28, 2001 4:12 AM
> Subject: RE: win32lib problem (fonts) HELP
> 
> 
> > > 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)
> > 
<snip>

I dont think that would work, but as someone else pointed out
setDefaultFont(integer id) is a global procedure so you can call it
right from your program without modifying the winlib file.

setStartupFont(OEM_FIXED_FONT)
    then for the window:
setDefaultFont(Window1) --for example

Again, the only problem is that anything that uses the
default font now must put up with OEM_FIXED_FONT.
If you need to keep the default font set at something else,
you have to use the GetStockObject/SetObject as i was
saying in the last post, and then use c style calls to
print text.

A better way for winlib to handle this is to provide 
name recognition within a regular setFont() call, or
during the font creation.
Shouldnt be that hard, but then i doubt anyone really wants
to use these fonts anymore smile

You can try "Courier New" and see if that satisfies your
app requirement.  Its installed with every Windows9X package.
Its a fixed width font with several sizes and is very readable.


You dont need all those special graphic symbols do you?
If you do i guess that could be a problem, you may have to
do some drawing with lines or rectangles to acheive this.


Good luck with it.
--Al

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu