Using Pango+Cairo to layout non-standard / international text
- From: robertk54 aol com
- To: gtk-i18n-list gnome org
- Subject: Using Pango+Cairo to layout non-standard / international text
- Date: Thu, 10 Apr 2008 16:04:50 -0400
I am prototyping functionality which will be used to overlay text onto video.
The text can be of any font / language and will support various forms of
animation. I currently have Pango and Cairo working together. Pango provides
the font and layout and Cairo supports the rendering onto an ARGB surface. Most
of the basics are working. I can select and render any installed font, scroll,
fade, and resize the text. My next effort is to be able to do 'non-standard'
(horzontal / left-to-right, vertical) layouts and support international fonts.
I assumed that to handle right-to-left (i.e. Hebrew) or vertical (i.e. Chinese or even English)
fonts I would need toadjust the gravity attribute (and possibly rotate the
text?) but this does not seem to work. I am currently using english fonts such
(i.e. Arial) and would hope to see the text rendered vertically instead of
horizontally (I am not yet rotating so I guess I would expect the characters to
be rotated but the text layed out horizontally?). If I use anything but the
default setting the text is rendered as small, hollow boxes. Can anyone provide
some insight into how to properly achieve this?
In addition, I would like to implement some code which could adjust the text on
a character-by-character basis. This would be to allow for wrapping text around
a curved surface, etc. Hopefully this is doable using Pango and Cairo alone. I am able to use the markup features to alter contents of the text to be rendered. Can't get the gravity working here either though. Also, is the markup color limited to RGB or can I specify ARGB as well?
Thanks,
Bob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]