Device-independent text layout



Hi,

For my goocanvas widget I really need device-independent text layout
(i.e. the layout must remain the same on every monitor/printer and at
any zoom setting).

By using the CAIRO_HINT_METRICS_OFF and CAIRO_HINT_STYLE_NONE font
options it works OK 95% of the time, but there are still problems
(mainly at small zoom settings < ~65%).

The glyph metrics still seem to change slightly at every zoom setting.
I'm not sure exactly what is causing the changes, and if it is a bug or
not.

So, firstly, is Pango supposed to currently support device-independent
text layout? If so, how?

If not, one solution may be to add a "device-independent" option to
PangoLayout. If set, it would do all line-breaking using the original
font without any scaling (and using the original font metrics without
any hinting). It would then do the actual layout using the real
scaled/transformed font.

So we'd get a device-independent layout, though the line widths may be
slightly incorrect (but for justified text we could adjust them).

Comments?

Damon





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