Article View: comp.windows.ms.programmer
Article #2155Re: MDI devloper Pen Pal
From: Bruce Wright
Date: Wed, 17 Apr 1991 15:46
Date: Wed, 17 Apr 1991 15:46
37 lines
1866 bytes
1866 bytes
In article <DSAMPSON.91Apr16105552@x102a.harris-atd.com>, dsampson@x102a.harris-atd.com (sampson david 58163) writes:
>
> [Text, lines, and aliasing]
>
> If you look at the diagram in the Petzold book where he explains the
> tmHeight, tmInternalLeading, and tmExternalLeading, you can see that
> the area you have to play with in terms of drawing a line, is
> somewhere in the tmExternalLeading region. So as plan B, I tried to
> trigger the line drawing off of a fractional relationship like this:
>
> /* this is declared somewhere in the code */
> yChar = tmHeight + tmInternalLeading + tmExternalLeading;
>
> /* now for the loop to draw the line between rows of text */
> for (y = 1; y <= someMaxNum; y++)
> {
> /* location to draw line */
> yLine = (yChar + .3 * tmExternalLeading) * y;
>
> /* then draw the line at yLine */
> }
One other thing - I don't know if this is just a typo when you
typed in your article, or if it's actually in your program (in
which case this could be most of your problem right there).
Shouldn't the location to draw the line be computed as
yLine = yChar * y + .3 * tmExternalLeading;
Seems to me you have an extra factor of y * .3 * tmExternalLeading
in your expression (since tmExternalLeading is also part of the
computation of yChar).
Good luck -
Bruce C. Wright
Technical Details
Message-ID:
<1991Apr17.154621.903@rti.rti.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!bcwReferences:
<25920007@hpkslx.mayfield.HP.COM> <DSAMPSON.91Apr16105552@x102a.harris-atd.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!bcw From: bcw@rti.rti.org (Bruce Wright) Newsgroups: comp.windows.ms.programmer Subject: Re: MDI devloper Pen Pal Summary: One other thing ... Message-ID: <1991Apr17.154621.903@rti.rti.org> Date: 17 Apr 91 15:46:21 GMT References: <25920007@hpkslx.mayfield.HP.COM> <DSAMPSON.91Apr16105552@x102a.harris-atd.com> Organization: Research Triangle Institute, RTP, NC Lines: 37