diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-04-26 03:18:48 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-04-26 03:18:48 +0000 |
| commit | c4ba6e605a07c177d773323d138f0caa0f334c97 (patch) | |
| tree | 37b3e1877baed8169a835dd6c6e087f1d916164d /render/font.c | |
| parent | baa9ad14803fd3019f8da364439dafe9c0e1a9f7 (diff) | |
assume a valid utf8 char is at the shortcut position. the menu parser makes sure of this
Diffstat (limited to 'render/font.c')
| -rw-r--r-- | render/font.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/render/font.c b/render/font.c index 8692a9d1..50b4208f 100644 --- a/render/font.c +++ b/render/font.c @@ -252,19 +252,17 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area) if (t->shortcut) { const gchar *c = t->string + t->shortcut_pos; - if (g_utf8_validate(c, -1, NULL)) { - t->font->shortcut_underline->start_index = t->shortcut_pos; - t->font->shortcut_underline->end_index = t->shortcut_pos + - (g_utf8_next_char(c) - c); - - /* the attributes are owned by the layout. - re-add the attributes to the layout after changing the - start and end index */ - attrlist = pango_layout_get_attributes(t->font->layout); - pango_attr_list_ref(attrlist); - pango_layout_set_attributes(t->font->layout, attrlist); - pango_attr_list_unref(attrlist); - } + t->font->shortcut_underline->start_index = t->shortcut_pos; + t->font->shortcut_underline->end_index = t->shortcut_pos + + (g_utf8_next_char(c) - c); + + /* the attributes are owned by the layout. + re-add the attributes to the layout after changing the + start and end index */ + attrlist = pango_layout_get_attributes(t->font->layout); + pango_attr_list_ref(attrlist); + pango_layout_set_attributes(t->font->layout, attrlist); + pango_attr_list_unref(attrlist); } /* layout_line() uses y to specify the baseline |
