Commit 45b3e175 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Fix Font.RichTextSize().

[GB.GTK]
* BUG: Fix Font.RichTextSize().

[GB.GTK3]
* BUG: Fix Font.RichTextSize().
parent fbf3479c
Pipeline #342382163 passed with stage
in 24 minutes and 16 seconds
......@@ -1119,18 +1119,24 @@ static void get_text_extents(GB_PAINT *d, bool rich, const char *text, int len,
if (rich)
{
html = gt_html_to_pango_string(text, len, false);
pango_layout_set_text(layout, "", 0);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
html = gt_html_to_pango_string(text, len, false);
pango_layout_set_markup(layout, html, -1);
}
else
{
pango_layout_set_markup(layout, "", 0);
pango_layout_set_text(layout, text, len);
update_layout(d);
//gt_add_layout_from_font(layout, dx->font, d->resolutionY);
}
if (width > 0)
pango_layout_set_width(layout, width * PANGO_SCALE);
else
pango_layout_set_width(layout, -1);
update_layout(d);
//gt_add_layout_from_font(layout, dx->font, d->resolutionY);
pango_layout_get_extents(layout, &rect, NULL);
......
......@@ -782,7 +782,7 @@ void gFont::richTextSize(const char *text, int len, float sw, float *w, float *h
}
html = gt_html_to_pango_string(text, len, false);
pango_layout_set_markup(ly, html, -1);
gt_set_layout_from_font(ly, this);
gt_add_layout_from_font(ly, this);
pango_layout_get_extents(ly, &ink_rect, &rect);
g_free(html);
g_object_unref(ly);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment