Exemplo n.º 1
0
def set_layout(text, width, text_style, markup, layout=PANGO_LAYOUT):
    if not width == -1: width *= PANGO_UNITS
    _libpango.set_layout_width(layout, width)
    fnt_descr = get_font_description(text_style)
    _libpango.set_layout_font_description(layout, fnt_descr)
    _libpango.set_layout_alignment(layout, text_style[3])
    markuped_text = apply_markup(text, markup)
    _libpango.set_layout_markup(layout, markuped_text)
Exemplo n.º 2
0
def _set_layout(layout, text, width, text_style, attributes):
	text = text.encode('utf-8')
	_libpango.set_layout_width(layout, width)
	fnt_descr = _get_font_description(text_style)
	_libpango.set_layout_font_description(layout, fnt_descr)
	_libpango.set_layout_alignment(layout, text_style[3])
	markup = cgi.escape(text)
	_libpango.set_layout_markup(layout, markup)
Exemplo n.º 3
0
def set_glyph_layout(text, width, text_style, markup, text_range=[],
                     check_nt=False, layout=PANGO_LAYOUT):
    if not width == -1: width *= PANGO_UNITS
    _libpango.set_layout_width(layout, width)
    fnt_descr = get_font_description(text_style, check_nt)
    _libpango.set_layout_font_description(layout, fnt_descr)
    _libpango.set_layout_alignment(layout, text_style[3])
    markuped_text, vpos = apply_glyph_markup(text, text_range, markup, check_nt)
    _libpango.set_layout_markup(layout, markuped_text)
    return vpos