RE: win32lib problem (fonts) HELP
- Posted by Al Getz <Xaxo at aol.com> Apr 28, 2001
- 627 views
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 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