discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text label mis-sizing / clipping


From: Jeff Teunissen
Subject: Re: Text label mis-sizing / clipping
Date: Thu, 23 Sep 2004 02:08:55 -0400

Adrian Robert wrote:

(the quoted portion was private, but it is posted with permission)

> > This problem never raised its head until the "art" graphics target was
> > created. That reason is that every X server comes with "Helvetica",
> > "Times", and "Courier" fonts -- which were the same fonts that NeXT
> > had as standard. But there are no such fonts in scalable forms
> > available freely, so there needed to be a replacement.
> 
> Hmm, I experience the clipping nearly as much on back-xlib as back-art.
>   I'm beginning to think it just might be that the developers of many
> apps actually set their fontsize smaller (e.g. NSFontSize=11), perhaps
> without anti-aliasing, though I think anti-aliased fonts being larger
> is a myth..

Nope. It's not a myth.

There are 72 points in an inch. The "point" is the basic unit of measurement
in PostScript and OpenStep. From any place in the system, a point is exactly
1/72 of an inch, from screen to printed output. This is what makes OpenStep
device-independant.

At 75 dots per inch (dpi), a point is 1.041666[...] pixels. This resolution
is the standard X server DPI setting, and it happens to be the same value
semi-hardcoded into NeXTstep/OPENSTEP for the display. Anyway, at this
resolution, points and pixels are fairly close to being the same thing. It
takes 12 points to round off to 13 pixels. 24 points are exactly 25 pixels.

At 100 DPI, a point is 1.38888[...] pixels. This means that it happens after
only 3 points (4.16 pixels, rounding down to 4). By the time you reach 12
points, you get 16.6[...] pixels. 18 points is a full 25 px. in height.

The problem with back-xlib and AA is that the fonts and the rest of the
drawing are using two completely different measuring systems! Xft is using
the X server's DPI setting. -xlib assumes 1 pixel == 1 point.

back-art makes the same assumption, but back-art actually chooses fonts on
its own. Which means that any conflict is caused by actual conflicts.

Xft (and -xlib when it's compiled to use AA fonts) uses the X server's DPI
setting to do text. So if you're using a 100DPI X server, Xft will give you
a 12-point font that is 17 pixels tall, while the original setup used pixels
to arrive at its font sizes. So a "12-point" font with the original setup,
or with back-art, is actually 12 pixels tall -- not 17.

The odd thing is that back-art and the original back-xlib are more correct,
because the whole display system of OpenStep is in points, not pixels. A
12-point vertical line should be about the same height as a 12-point letter
form, no matter what font system is in use.

In OpenStep, you have to change the whole display resolution -- not just the
fonts. back-art is capable of doing this, but I think it currently requires
some code changes. The fonts are drawn to their proper finished sizes, and
everything else gets bigger too.

> Didn't NeXT use a custom font called "Olfs" for its system font?

No.

The Ohlfs (named for Keith Ohlfs) font is the standard font set for Terminal
(but it is not the "system" font -- that is Helvetica 12pt). It is a set of
screen fonts, and it dynamically adds the PostScript code for Courier for
printing and non-covered sizes. It also does some odd things to the font
metrics when doing so, so printed output looks something like the Ohlfs
screen font even though it's actually Courier.

> BTW, since 'art' uses its own fonts, a standard "gnustep" distribution
> might be a bit easier to put together and manage here than for Xlib.
> Maybe not.

Yes, it is a lot easier to do with art.

-- 
| Jeff Teunissen  -=-  Pres., Dusk To Dawn Computing  -=-  deek @ d2dc.net
| GPG: 1024D/9840105A   7102 808A 7733 C2F3 097B  161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project        http://www.quakeforge.net/
| Specializing in Debian GNU/Linux              http://www.d2dc.net/~deek/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]