After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775202 - Pango sometimes shows a replacement character for space (U+0020) when a font lacks a space
Pango sometimes shows a replacement character for space (U+0020) when a font ...
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: pango-view
1.40.x
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2016-11-28 05:55 UTC by Mike FABIAN
Modified: 2018-05-22 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pango-bug.png (249.47 KB, image/png)
2016-11-28 05:55 UTC, Mike FABIAN
Details
OldHungarian.ttf (22.25 KB, application/octet-stream)
2016-11-28 05:56 UTC, Mike FABIAN
Details
rovas.txt (26 bytes, text/utf-8)
2016-11-28 05:57 UTC, Mike FABIAN
Details

Description Mike FABIAN 2016-11-28 05:55:10 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.
Comment 1 Mike FABIAN 2016-11-28 05:56:56 UTC
Created attachment 340875 [details]
OldHungarian.ttf
Comment 2 Mike FABIAN 2016-11-28 05:57:31 UTC
Created attachment 340876 [details]
rovas.txt
Comment 3 Behdad Esfahbod 2016-11-29 21:07:45 UTC
Right.  I'll see if I can fix it quickly.
Comment 4 Behdad Esfahbod 2016-12-18 06:26:17 UTC
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.
Comment 5 GNOME Infrastructure Team 2018-05-22 13:20:37 UTC
-- 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.