summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-07 14:05:44 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-25 00:47:48 -0400
commitc7a2b41a22b78bd74956c02f2960859fbe0c9112 (patch)
treeb58c2be788789a742a730f432a9b960b8a9e551b /pango/pangocairo-font.c
parenta1b3306be686047a9bed9af038db2b0b6e23ee86 (diff)
downloadpango-c7a2b41a22b78bd74956c02f2960859fbe0c9112.tar.gz
cairo: Better hex boxes for ignorables
For ignorable characters such as U+00AD, Soft Hyphen, render a hex box with their 'nickname', which is a 2-6 character short form such as SHY.
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 8b1f12d3..3bf83857 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -735,11 +735,20 @@ _pango_cairo_font_private_get_glyph_extents_missing (PangoCairoFontPrivate *cf_p
ch = glyph & ~PANGO_GLYPH_UNKNOWN_FLAG;
- rows = hbi->rows;
if (G_UNLIKELY (glyph == PANGO_GLYPH_INVALID_INPUT || ch > 0x10FFFF))
- cols = 1;
+ {
+ rows = hbi->rows;
+ cols = 1;
+ }
+ else if (pango_get_ignorable_size (ch, &rows, &cols))
+ {
+ /* We special-case ignorables when rendering hex boxes */
+ }
else
- cols = ((glyph & ~PANGO_GLYPH_UNKNOWN_FLAG) > 0xffff ? 6 : 4) / rows;
+ {
+ rows = hbi->rows;
+ cols = ((glyph & ~PANGO_GLYPH_UNKNOWN_FLAG) > 0xffff ? 6 : 4) / rows;
+ }
if (ink_rect)
{