From: Jesper S. <je...@no...> - 2003-05-09 00:19:43
|
Tony Graham wrote: > Jesper Stigberg wrote at 8 May 2003 14:39:29 +0200: .... > > Great. What do gnome-print use as a unit? > > So far I've found that the PDF and PostScript outputs use different > units. GNOME Print is under-documented, so there may be something > that I'm missing. > > See pangogp-to-pdf.c in pangopdf/examples. > > > > 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. > > And the logical unit is a 'twip', i.e., a logical pixel? A logical unit can be mapped to twips, pixels, mm, etc or a unit of your own. ex: move_to(0,0); /* (x,y), in logical units */ line_to(0,20); this could draw a 20 pixel or a 20 twips long line, depending on what a logical unit is mapped to. I don't know what a logical pixel is, a twip is, as far as I know, 1/1440 of an inch. Jesper. |