Re: patch -- fix resolution in pango (win32 backend)



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.

 > 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 printing separately.

 > >  > To solve this problem, windows invented the "logical resolution". 

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
resolution?

 > 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?

 > So if a X11 app is using 1 typographical point = 1 pixel, then this app
 > is broken (even in X11).

Yup.

 > > 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 true physical
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 viewing distance
(which would be several metres in your case). Owen or
somebody... opinions please?

But still, I don't see how using Windows' fuzzily defined "logical
inches" would help.

 > 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 about LOGFONT.

I will have a look...

 > If something is not clear, please just ask.  It's a convoluted issue,
 > and my english doesn't allows for very clear explanations, but I will do
 > my best.

Thanks!. 

Cheers,
--tml




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