GNOME Bugzilla – Bug 775202
Pango sometimes shows a replacement character for space (U+0020) when a font lacks a space
Last modified: 2018-05-22 13:20:37 UTC
Created attachment 340873 [details] pango-bug.png See also: https://bugzilla.redhat.com/show_bug.cgi?id=1398676 Tested on the released version of Fedora 25. pango-1.40.3-1.fc25.x86_64 When using a font which does not have a space, Pango may show a replacement character for space( U+0020). I’ll attach the file rovas.txt which has a first line containing only Old Hungarian script and a space. I’ll also attach an old Hungarian font taken from https://github.com/OldHungarian/old-hungarian-font/releases which lacks a space. Display the test file like this: pango-view --font="Old Hungarian" ~/rovas.txt And you get something as in the also attached screenshot which shows that Pango renders the space as an replacement character.
Created attachment 340875 [details] OldHungarian.ttf
Created attachment 340876 [details] rovas.txt
Right. I'll see if I can fix it quickly.
FWIW, the code involved is this piece in pango-context.c: ``` /* We don't want space characters to affect font selection; in general, * it's always wrong to select a font just to render a space. * We assume that all fonts have the ASCII space, and for other space * characters if they don't, HarfBuzz will compatibility-decompose them * to ASCII space... * See bugs #355987 and #701652. */ type = g_unichar_type (wc); if (G_UNLIKELY (type == G_UNICODE_CONTROL || type == G_UNICODE_FORMAT || type == G_UNICODE_SURROGATE || (type == G_UNICODE_SPACE_SEPARATOR && wc != 0x1680u /* OGHAM SPACE MARK */))) { shape_engine = NULL; font = NULL; } else { get_shaper_and_font (state, wc, &shape_engine, &font); } ``` I don't know how to quickly fix that.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/265.