🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1836

Re: Lining up rows and columns of characters

#1836
From: LIBCRN
Date: Mon, 25 Mar 1991 14:32
29 lines
1736 bytes
In article <27561@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook)
writes:
>| Now, the problem is that when I do a TextOut or a DrawText, the letters do
>| not align themselves correctly vertically because of the fonts.  This
>| becoming a very important issue...is there a way to make the characters
>| line up (assign 8x8 bit maps to everything?)....

>You want to use a font with fixed spacing.

>Try:

>SelectObject(hdc, GetStockObject(OEM_FIXED_FONT)); // or SYSTEM_FIXED_FONT or
>ANSI_FIXED_FONT

>For more information, see the Petzold book, pages 654-655.

>Curt Johnson == curt@cctb.wa.com

   There is another solution.  Instead of using a fixed font, split your
output strings into a number of fields (each collumn should be a seperate
field).  Then when you draw the string on the screen, instead of calling
TextOut() once for the entire string, you call it a number of times (as
many times as you have collumns).  Each time that you call TextOut(), you
supply it with the part of the output string which corresponds with the
collumn you are drawing at that time.  It takes a little more work, but if
you do it this way, you can still use proportional fonts instead of those
ugly fixed fonts.

--Cory (libcrn@byuvm.bitnet)
Technical Details
Message-ID: <91084.073252LIBCRN@BYUVM.BITNET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!psuvax1!psuvm!cunyvm!byuvm!libcrn
References: <27561@uflorida.cis.ufl.EDU> <yva6g814c@cctb.wa.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!psuvax1!psuvm!cunyvm!byuvm!libcrn
From: LIBCRN@BYUVM.BITNET
Newsgroups: comp.windows.ms.programmer
Subject: Re: Lining up rows and columns of characters
Message-ID: <91084.073252LIBCRN@BYUVM.BITNET>
Date: 25 Mar 91 14:32:52 GMT
References: <27561@uflorida.cis.ufl.EDU> <yva6g814c@cctb.wa.com>
Organization: Brigham Young University
Lines: 29