[cairo] Using Pango and TrueType Fonts
Michael Gerbracht
smartmails at arcor.de
Thu Mar 5 10:48:12 PST 2015
Dear Olaf,
> Am 26.02.2015 um 19:42 schrieb Michael Gerbracht:
> >>> I would like to use Pango with Cairo to display data in graphs.[...] ..
> >>>
> ...
> > My problem is, that the resulting svg does not use the Wingdings font to
> > display the text.
> The Toy-API seems to work well enough for such simple purposes...
> Using the Windows-Download from:
> http://www.dynaset.org/dogusanh/luacairo
> (on a Win-8-VM) and a slight adaption of example #2, to an SVG-Surface:
> The following SVG-Output was produced:
> http://vbRichClient.com/Downloads/cairo_test.svg
> ... which looks quite "WingDingish" to me...
Ok, thanks, this is a good alternative. I can't remember why I startet using
pango. At least for plotting graphs it could indeed be enough to use the
cairo Toy-API. Thanks for the example!
> Aside from that, you seem to prefer the generation (and positioning)
> of different "Point-Types" in your Graphs per Font-Rendering, ...
> a better alternative would be (IMO), to write your own little LUA-
> function, to construct a regular polygon around a given center-point:
> http://en.wikipedia.org/wiki/Regular_polygon
> Using only 5 Parameters (cx, cy, rInner, rOuter, nSides) you can
> produce a lot of different "Point-Shapes" all with the same function
> (which shouldn't take much more than 15-20 lines of code - then
> generating a less voluminous SVG-output along the way as well).
Yes, this is something I have in my mind, too. It's less flexible but offers
also some advantages. I will probably implement both ways.
thanks again!
Michael
More information about the cairo
mailing list