Pango documentation & a few questions



> -----
> QUOTE:
> -----
> "
> PANGO_SCALE
> 
> #define PANGO_SCALE 1024
> 
> The PANGO_SCALE macro represents the scale between dimensions used for
> Pango distances and device units. (The definition of device units is
> dependent on the output device; it will typically be pixels for a
> screen, and points for a printer.) PANGO_SCALE is currently 1000, but
> this may be changed in the future.
> 
> When setting font sizes, device units are always considered to be points
> (as in "12 point font"), rather than pixels.
> "
> 
> -----
> ELSEWHERE:
> -----
> "
> The PangoGlyphUnit type is used to store dimensions within Pango.
> Dimensions are stored in 1/64ths of a point. 
> "
> 
> ----
> DOES THIS MEAN ....
> ----
> 1pt = 1/72 inch
> 1/72/64 = 1/4608 inch per Pango dimension unit
> 
> to find device units multiply by PANGO_SCALE:
> 1/4608 * 1024 = 1/4.5 pixel per Pango dimension unit (for a screen)
> 1/4608 * 1024 = 1/4.5 points per Pango dimension unit (for a printer)
> 
> 
> -----
> QUESTION
> -----
> I may be confused here. First, I think the comment for PANGO_SCALE
> should read 1024 not 1000. However, thousandeths of a device unit
> appears elsewhere in the API docs so maybe there is some other
> explanation?
> 
> Secondly, I'm not confident on how PANGO_SCALE enters the equation. It
> appears to only show up in PangoLayout and the various rendering methods
> (pangox, pangowin32, pangoft2, pangoxft2).
> 
> My guess is that it is only used in the high-level functions of Pango
> where layout x,y arguments are passed in the form of device coordinates.
> If this is the case, using any function lower-than PangoLayout should
> avoid PANGO_SCALE right? In particular, if pango_shape is called, it
> will be using the currently set rendering method to do the shaping. Is
> this shaping process independent of PANGO_SCALE?
> 
> I'm still grokking all of the factors influencing WYSIWYG and typography
> terms in general so may I missing something, but I'm not understanding
> why it would be beneficial to define the meaning of a device unit
> differently for a screen or a printer. You could convert between the two
> if the resolution of the screen is known but why wouldn't you want to
> keep everything in physical units (ie. 1/4608 of an inch) instead and
> only convert to device units as a final step (on the application's side
> away from Pango)? This seems like it only needlessly complicates the
> relationship between a screen and a printer. I'd like to make a canvas
> that does everything in terms of physical units and only converts when
> appropriate to the final display device units. After all, doesn't it
> make sense to treat printers and screens in the same manner - ie. as
> devices which can handle a certain colourspace, with a certain horz and
> vert resolution, which ultimately rasterize everything to pixels/dots?
> 
> 
> ---
> Patrick






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