[cairo] cairo_show_text and Chinese
spitzak at thefoundry.co.uk
Fri Oct 3 19:33:15 PDT 2008
Another thing that would be very useful in this FAQ is an indication as
to how long Pango objects can/should live.
If the user wants to draw the same text more than once, should they keep
the PangoLayout object? What if they want to draw different pieces of
text, should they call set_text more than once? What if they want to
change the font, can they call set_font_description more than once? If
any of these are true is it more efficient to test for changes and not
call if the font/text is the same?
Or perhaps Pango has been purposly designed so that creating/destroying
these is really cheap (ie maybe they are in a freelist so malloc/free is
not done). That would be ideal but unless you clearly state it, most
programmers are not going to believe it.
Whatever the answer, it would help a lot if the FAQ answered these
questions. A log of people are going to start from this FAQ and never
study Pango enough to find out the answer (and in fact it is likely the
answer cannot be figured out from Pango's documentation). Programmers
guessing what is best will probably mean that 50% of them will guess
wrong about how Pango is implemented and produce a slower program.
Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027
More information about the cairo