9 Dec
2003
9 Dec
'03
4:43 a.m.
MenTaLguY wrote:
- redo text handling/rendering using Pango over libnr somehow -- this
either means figuring out a way to get laid-out glyph outlines from Pango, or implementing a libnr backend for Pango
Easy, you create a pangocontext, put the text (including font and style markup) using pango_context_set_markup in, generate a pangolayout and you can access everything (glyphs, line spacing and extents).
import gtk, gtk.gdk import pango
context = widget.create_pango_context()
pfd = pango.FontDescription("Sans 23") pl = pango.Layout(context) context = pl.get_context() context.set_font_description(pfd)
pl.set_markup("<span fontsize="100">Hello World!</span>")
gtk.gdk.Drawable.draw_layout(widget.window, gc, 0, 0, pl)
njh