question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Noto Emoji Color confuses libXft

See original GitHub issue

Hi,

attempting to add color emoji support to an existing application using Xft, I got this error after an XftDrawString:

X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  18
  Current serial number in output stream:  19

I’ve tracked it down (using Xephyr -listen tcp :1, DISPLAY=localhost:1 and wireshark) to libXft calling XRenderCreateGlyphSet with format 0x22, which resolves to

  pict format:
        format id:    0x22
        type:         Direct
        depth:        1
        alpha:         0 mask 0x1
        red:           0 mask 0x0
        green:         0 mask 0x0
        blue:          0 mask 0x0

in my case.

AddGlyph is then called on this GylphSet for U+263A and a 136x128 bitmap, although with 17626 bytes of bitmap data, which would be a depth 8 bitmap. In XftFontLoadGlyphs, a render mode of FT_RENDER_MODE_MONO is assumed, unless font->info.antialias is true, but the bitmap doesn’t actually get downsampled to 1bpp.

I’m not sure whether this is a problem in Xft or Noto Emoji Color setting some flag wrong.

Here is the sample program I’ve been using for this test case: https://gist.github.com/yath/a0d0b4839b030ef4e76b36abb556bacc

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tinmarinocommented, Aug 7, 2020

Hi, sorry to contaminate noto-emoji but other issues redirect here.

The merge request is pending on libXft https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1

0reactions
behdadcommented, Dec 10, 2017

@behdad, doesn’t the Xft library use the Render extension when available, so it could in theory (if somebody did the work) support color fonts? See Xft on freedesktop.org. I’m totally not volunteering myself, just curious why Xft couldn’t be fixed if somebody wants to do it.

Even then this is not a noto-emoji bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BadLength X error in Xft when trying to render emoji (#6) · Issues
BadLength X error in Xft when trying to render emoji ... a.out XFT_DEBUG=1 XftFontOpenName "Noto Color Emoji": Pattern has 1 elts (size 16) ......
Read more >
subject:"\[PATCH\] Fix emoji font support" - The Mail Archive
Now if you swap the fonts: URxvt.font: xft:Noto Color Emoji:pixelsize=11 ... Now I am getting confused as well, do you mean rxvt-unicode can...
Read more >
libxft2: fonts-noto-color-emoji causes protocol error in libxft
libxft seems to have a known issue where color emojis cause it crash the app with an X11 protocol error, e.g.:
Read more >
Confused Face on Google Noto Color Emoji Android 11.0
This is how the 😕 Confused Face emoji appears on Google Noto Color Emoji Android 11.0. It may appear differently on other platforms....
Read more >
Noto Color Emoji and Noto Emoji fixed fonts cause a X error in ...
When the google-noto-emoji-fonts became part of the standard install for Fedora, the ncid client would cause an X error and crash every time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found