[cairo] About cairo_show_text and UTF-8...
cworth at cworth.org
Thu Jan 5 08:43:29 PST 2006
On Thu, 5 Jan 2006 09:36:13 -0600, Mike Emmel wrote:
> On 1/5/06, Scott Robert Ladd <graphics at coyotegulch.com> wrote:
> > However, when I try to display the same encoding using cairo_show_text,
> > I see a rectangle instead of the expected theta character:
> > cairo_show_text(drawing_cr, "\316\270");
> > I am using the system font (Sans) in Cairo.
> The system font in cairo does not have those glyphs.
> Pango uses a collection of fonts to meet the unicode requirements of a string.
That's a correct assessment of the current implementation of
cairo_show_text---it uses glyphs only from a single font.
I'd be glad to see cairo_show_text improved to get glyphs from
multiple fonts in order to provide better glyph coverage. But this
work has not been done yet.
PS. With systems that use fontconfig, the results should be quite
good, as it already provides a sorted list of "best match" fonts. So
it's basically just a matter a noticing that the current font doesn't
include the glyph of interest, then marching down the list until the
glyph is found. (And one final step would be to draw _something_ when
the glyph is not available in any font. This could be the "missing
glyph" glyph from a font, or something like the hex boxes that pango
once had (and may soon/now have again)).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060105/7b65c2fe/attachment.pgp
More information about the cairo