From: Jesper S. <je...@no...> - 2003-05-08 12:36:36
|
Tony Graham wrote: > Jesper Stigberg wrote at 30 Apr 2003 14:01:55 +0200: > > Tony Graham wrote: > But a device unit is a point for font sizes: > > There are PANGO_SCALE Pango units in one device unit (device unit > is a point, for font sizes). > > (See http://developer.gnome.org/doc/API/2.0/pango/pango-Fonts.html#pango-font-description-set-size) Yes. > .. > > If the pango version in use uses pt as 'device-unit', all is > > fine. But if it uses another unit we have a mix of units. > > Which is why so far it has been fine, and why it creates problems for > your screen rendering backend. > Yup. > I have started a Wiki page to collect in one place all the possibly > differing interpretations of device units from XSL, Pango, and > FreeType (although I haven't got to FreeType yet). You are welcome to > annotate it. Great. What do gnome-print use as a unit? > What do you do in your rendering application if you want to scale the > rendered image, e.g. reduce it so a whole page appears in the window? > A bit simplified. In the win32 GDI (graphics device interface), all drawing, text-output etc is done through a device-context using logical-units. What appears on the screen is measured in device-units. A device-unit==scale*logical-unit ( this mapping is done by the OS ). So by changing the scale you can get a zoom effect without changing the coordinates etc in your drawing code, or use the same code to render to a printer. > .. > > > Also, the XSL Recommendation errata says that 1 px = 1/96 inch. > > Actually, it's a CSS2 erratum > (http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html), > and the XSL 1.0 erratum removes the size recommendation from the XSL > 1.0 Recommendation (so XSL won't be bothered by any future dpi changes > in CSS). > > > Note that in fo-expr-eval.c pt==px. > > > > #define POINT2DEVICE(x) x > > #define PIXEL2DEVICE(x) x > > > > Do you want me to file a bug? > > Sure. Note also that the code for fo:external-graphic has wavered > about the dpi. Noted. Regards, Jesper. |