I'm writing my own print preview. When I made some tests and I discovered
the following problem with wxFont.
This is not a problem with wxFont. In fact, it is not a problem at all.
Problem: the dc does not render the correct font size, when
a fixed pitch font is choosen. Below a short, but complete, application
to show the phenomenon. A course, the font is a ttf font.
This exemple shows, it'is impossible to select a font size 9, 13, 17, ...
Of course it is possible, and your program demonstrates that fact.
Everything is working correctly here.
I assume you objecting to the fact that a character at 12 points happens to
be the same width as a character at 13 points. This should not surprise you.
TextOut in Windows does not handle fractional coordinates. In Courier New 12
point, each character probably comes out to 8.7 pixels wide. At 13 points,
it probably comes out to 9.3 pixels wide. In each case, it rounds to 9
pixels. Because it is fixed-pitch, every character is the same width, and
the string width does not change.
The characters DO look different at each point size. Get a copy of the
"zoomin" magnifier app from the Platform SDK and you can prove this.
You don't see this same effect with variable-pitch fonts, because the
individual characters cross the round-off boundary at different spots, so the
overall string length increases more smoothly. With a fixed-pitch fonts, you
make a sudden jump from a width of 8 pixels to a width of 9 pixels.
A course, the font is a ttf font.
The correct idiom here is "Of course", not "A course". My wife has the same
problem typing "I should of known" instead of the proper "I should have
known".
ยทยทยท
On Mon, 16 Sep 2002 15:40:05 +0200, "Jean-Michel Fauth" <jmfauth@bluewin.ch> wrote:
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.