Using emojis in pango 1.43.0-1 on Windows

Hi folks,
I maintain a Ruby gem that depends on Pango and we’ve had some regressive behavior over the last year regarding emojis on Windows.

It looks like pango replaces my font string with “emoji”, which silently falls back to Segoe UI no matter what I specify. Looks like this code in pango-context.c does that.

I can see that as of 1.43.0-1, in this commit that pango should read from the Windows registry. I have tried this with no success (and it appears to not be documented?). But I also know that my users won’t like hacking the registry for functionality that worked cleanly in the past.

For the short term: can someone explain to me how to hack my registry to get Segoe UI Symbol to get picked up? If I get it working I’d be happy to write it up for your docs.

For the long term: I see that pango-context.c now has structs for two different font descriptions: one for non-emoji, one for emoji. But the pango font string has no way of specifying the two different families. Is there a way (or can there be a way) to specify this via a font string?

For more context and test cases, I’ve been working with @kou on this on a GitHub issue:


Which backend are you using, win32 or fontconfig? That should probably have major impact on font selection…

I believe the ruby-gnome2/pango gem uses win32, and I don’t think there’s an option to change to fontconfig for windows.

It’s not an option, it’s an environment variable. PANGOCAIRO_BACKEND=fc will switch it to fontconfig. Obviously, you have to have fontconfig installed (and compile Pango with fontconfig support).

I don’t really know much about how Pango works, or how fonts are selected, but if using a different backend fixes the issue, then that at least narrows down the issue somewhat.

Changing the environment variable doesn’t fix the problem. Interestingly, the test script renders the wrong emoji, but shifted slightly. So changing the backend DOES do something, but doesn’t fix it.

I had no idea you could change the backend to fontconfig for ruby’s pango gem. That should be documented on the gem…

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.