[cairo] Rendering line fonts

Ian Britten britten at caris.com
Fri Nov 21 05:32:50 PST 2008


Behdad Esfahbod wrote:
> You are basically abusing the FreeType driver model to render stroke fonts
> when it doesn't really support them.

Probably... ? :(  [ Admittedly, I don't think this issue was discussed
with FT when we encountered it, so I'm not sure of their position... ]

Unfortunately, that's the reality of commercial development: Certain
things _must_ be supported (In this case, our stroke fonts), and if
the underlying tools don't handle what's needed, then you're left
doing... unpleasant things...  Dirty, nasty, evil things...  :(

So, as such, I hope you'll be patient as I pursue this a bit more,
especially since I seem to be *so* close!  ;)


After thinking about this a bit more, I've been able to get a bit
further.
Since the root of my problem is my own font driver, and its stroke
fonts, I made a change to it so that the path it returns now also
includes all the points from the last point back to the first point.
This makes it a (zero area) closed polygon, which I'm hoping is
more acceptable.  It certainly looks better!

My only issue is that the fonts draw almost invisibly thin, and I'm
looking to get a lineweight applied to it (See screenshots).  Given
that I can set the thickness of lines and polygon boundaries in Cairo,
is there anything I can set that will be used when these fonts are
rendered?  For example, I tried calling cairo_set_line_width() before
calling cairo_show_glyphs(), but it didn't seem to have any effect.

We love the fact that our text is actually coming out as text in the
PDF (Rather than just lines, or an image), and would really like to
be able to keep this!  [ Without having to rewrite vast amounts of
our existing text handling code ;) ]

As always, thanks for any help/suggestions! (And patience!)
Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: desired.png
Type: image/png
Size: 1176 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20081121/ab15a258/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo.png
Type: image/png
Size: 1098 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20081121/ab15a258/attachment-0001.png 


More information about the cairo mailing list