Re: patch -- fix resolution in pango (win32 backend)
- From: Joaquin Cuenca Abela <e98cuenc yahoo com>
- To: tml iki fi
- Cc: otaylor redhat com, gtk-i18n-list gnome org
- Subject: Re: patch -- fix resolution in pango (win32 backend)
- Date: Tue, 21 May 2002 01:21:58 -0700 (PDT)
> Joaquín Cuenca Abela writes:
> > when you render text in a printer, you want a
point to be 1/72.0
> > inches. If you try to do the same thing in the
screen, you finish with
> > text that it's hard to read (look at X11 :),
because a screen don't have
> > the same resolution than a printer
> But surely only the most naive of programmers would
write code like
> that, assuming that the same resolution (or fonts,
even) can be used
> directly on a screen as well as on a printer.
The problem is not in code that assumes the same
resolution in printers as in screen, but code that
assumes that the same physical size is readable in
screen only because it's readable in a printer (and
that's what pango is doing right now).
> > With your calculation, you finish having in the
screen text that has the
> > same physical size as if it have been printed
> I think that is the intention. It's the application
(or library, like
> GTK+) that uses Pango that should know to handle
If it was the intention to render text in screen at
the same size as in a printer, then you end with the
below "conference mode" problem.
> > > > To solve this problem, windows invented the
> But isn't some vaguely defined "logical resolution"
much worse than
> having the indicated dpi being as true as possible?
> > Not exactly. X11 uses by default a resolution of
75dpi for fonts.
> Err.... I think you are confused here. 75dpi and
100dpi might be the
> *design resolutions* for some common X11 bitmap
fonts, but surely the
> X11 protocol does not contain any such default
assumption about screen
yes, it does. It picks a default value for your
physical screen size to match 75x75dpi. I've changed
it in my computer to have 96x96dpi and now gtk+ 2
applications renders text at a much more comfortable
> > think that it comes from Apple, who did the same
thing in Macintosh,
> > presumably to make a typographical point be a
pixel on screen
> That was a bad design issue, forever confusing
people about points and
> pixels, yes?
of course :)
> > So if a X11 app is using 1 typographical point =
1 pixel, then this app
> > is broken (even in X11).
> > > There usually is a way tell X11 the actual
physical size of your
> > > display area. Maybe Windows can get the
physical size from newish
> > > monitors through some fancy plug-and-play
protocol? Anyway, I do
> > > think that Pango should try to get as close to
the asked for size
> > > as it can.
> > oh, no. Imagine that you have a 50" monitor that
you want to use for
> > conferences, and that you have windows returning
you the right size of
> > your monitor.
> > Now, imagine that you have this monitor with a
resolution of only
> > 1024x768 pixels. You can run with this
resolution your apps (who will
> > still use the same pixels as in your usual
monitor) and the users will
> > see them ok because they're far from the screen
(ie, the angular size is
> > the same for people seeing the big monitor, and
for people seeing a
> > normal monitor).
> > But, applications that use pango will then try to
draw text using the
> > real resolution of the screen, so in the big
monitor pango will render a
> > text of 12points with a height of 4 pixels!!
> > Your presentation that looked wonderful in your
little screen has just
> > been screwed in your conference.
> Hmm. I do see your point here. But probably one
should then just lie
> to X11 that the huge monitor is of normal size?
Maybe one should think
> of the monitor physical size as not necessarily the
> size, but the size a 'virtual' monitor would have if
located at normal
> viewing distance (20 cm or so) and spanning the same
viewing angle as
> the monitor in question when viewed at *its* normal
> (which would be several metres in your case). Owen
somebody... opinions please?
And once you define the size of a 'virtual' monitor,
you want to lye a bit more, and don't put the size of
a typical monitor, but the size of a somewhat little
monitor to get fonts a bit more readable and then you
end having... a logical resolution and not a real one.
That's just what MS did.
> But still, I don't see how using Windows' fuzzily
> inches" would help.
it gives you a way to have comfortable sizes for your
text in devices that have not enough resolution.
> > There are several articles in msdn devoted to
this issue. I think that
> > there's also a book chapter that explains all
that stuff (something as
> > "The logical font").
> > Maybe you will also find something in the doc
> I will have a look...
I've found several references:
* Background on Fonts (just at the end, the "The
Logical Inch Problem" section)
* Windows Font Mapping:
To define a height for a font with a given point size,
MyFont.lfHeight = -((PointSize * GetDeviceCaps(hDC,
And in the doc about LOGFONT (when it explains the
For the MM_TEXT mapping mode, you can use the
following formula to specify a height for a font with
a specified point size:
lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC,
I've not able to find anything more detailed than
these references right now, but once I find a more
detailed explanation... or was it in a real book? I
Joaquin Cuenca Abela
e98cuenc yahoo com
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
] [Thread Prev