Re: Pango crossplatform layout size query




On 27/03/2010, at 10:20 AM, Behdad Esfahbod wrote:

Should I raise a bug about this? I had assumed that identical fonts and layout algorithms could (and should) guarantee identically sized layouts
irrespective of the underlying font rasteriser, but I don't want to
clutter up bugzilla with unreasonable bug reports.

Well, wrong. The rasterizers may, and typically do, return different metrics
for the same font.

Good to know.

Your best bet is to use the FreeType backend on all
systems. And even then, same version of FreeType and cairo and pango...

I suspected as much; thanks for confirming. As the freetype backend is deprecated, though, that is not a viable option for me over the longer term (*). This all implies that cairo/pango is not designed for applications that require invariant text extents
across platforms.

Presumably it is possible, though, as there are applications that do it. The English text extents of a PDF for example are identical between OS X 10.4 Preview and Acrobat 5.0 on an old Windows 2000 machine, despite the lack of subpixel rendering on the later. SVG would also be largely useless for UML
diagrams (perhaps it is?) without cross-platform text extent guarantees.

For example, SVG text rendered in Firefox 3.6.2 using the same Arial font file does fit nicely within the same fixed-size box across OS X 10.4 and Windows 2000
(at least, English text does; Hebrew and Arabic show more varied
results), whereas the width of the HTML text varies. Obviously, the SVG renderer
is doing something different.

I am obviously fairly ignorant about this stuff. Can anyone recommend a reference for these sorts of design issues? I have read the freetype and pango documentation.

Lastly, if anyone has any pointers on how to layout text for UML-like diagrams using cairo (via pango or something else) such that at least English text can be guaranteed to stay within its box across platforms, I'd really appreciate them - even if it's to say
'my friend, you're a madman; that's crazy talk'.

best regards,
Richard.

*
http://mail.gnome.org/archives/gtk-i18n-list/2008-June/msg00003.html
"That's what the pangoft2 backend does. Check the pango_ft2_* functions. However, I don't recommend using that backend anymore. The only *supported* backend at this time is pangocairo, and the only one seeing future development."




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