summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-29 14:36:25 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-29 15:05:08 -0400
commit9ff4bdb34201b24ee6c4c8a7e7a65db95cf1b75e (patch)
tree94dbb16d44733e7cdcc6f4d0f490d8c3bb068a02
parentd5a7518b84c29e5877c7408d3bbf97f9dc8c153e (diff)
downloadpango-9ff4bdb34201b24ee6c4c8a7e7a65db95cf1b75e.tar.gz
Slightly tweak pango_hb_font_get_nominal_glyph
-rw-r--r--pango/pangofc-shape.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index 5c716b24..0a5ce7f9 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -151,18 +151,10 @@ pango_hb_font_get_nominal_glyph (hb_font_t *font,
{
PangoHbShapeContext *context = (PangoHbShapeContext *) font_data;
- if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0)
+ if (context->show_flags != 0)
{
- if (pango_get_ignorable (unicode))
- {
- *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode);
- return TRUE;
- }
- }
-
- if ((context->show_flags & PANGO_SHOW_SPACES) != 0)
- {
- if (g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR)
+ if ((context->show_flags & PANGO_SHOW_SPACES) != 0 &&
+ g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR)
{
/* Replace 0x20 by visible space, since we
* don't draw a hex box for 0x20
@@ -173,11 +165,16 @@ pango_hb_font_get_nominal_glyph (hb_font_t *font,
*glyph = PANGO_GET_UNKNOWN_GLYPH (unicode);
return TRUE;
}
- }
- if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0)
- {
- if (unicode == 0x2028)
+ if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0 &&
+ pango_get_ignorable (unicode))
+ {
+ *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode);
+ return TRUE;
+ }
+
+ if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0 &&
+ unicode == 0x2028)
{
/* Always mark LS as unknown. If it ends up
* at the line end, PangoLayout takes care of