Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CJK glyphs rendering as "glyph not found" ("tofu") characters #100

Open
ssokolow opened this issue Jan 1, 2022 · 6 comments
Open

CJK glyphs rendering as "glyph not found" ("tofu") characters #100

ssokolow opened this issue Jan 1, 2022 · 6 comments

Comments

@ssokolow
Copy link

ssokolow commented Jan 1, 2022

When I switched from the Ubuntu-packaged release of Inkscape to the Flathub-packaged copy, CJK glyphs went from rendering properly to displaying "tofu" characters. (i.e. Windows-style empty rectangle renderings of the .notdef glyph)

For example, 文字化け renders as four blank rectangles. (e.g. Just try pasting that string into the Filename field in the Export PNG Image panel.)

Apparently the Inkscape Flatpak is missing some fonts or font settings that are present in the AntiMicroX, Arduino IDE, Blender, Firefox, FocusWriter, Godot, JDownloader, KCachegrind, Krita, LMMS, MEGAsync, Okteta, Sweet Home 3D, Thunderbird, Tor Browser, and Ungoogled Chromium flatpaks... though Bustle, Deluge, Flatseal, HandBrake, and jstest-gtk do have the same problem.

(Hopefully that list of "works here" and "doesn't work here" will help you narrow down the cause.)

Note that I'm running with a filesystems=~/Desktop/Stuff to Sort/Graphics to Sort:rw;xdg-documents:rw;~/src/source_materials:ro;!host override to narrow the filesystem permissions so try adding that if you have trouble replicating the problem. (It's standard practice for me to install as many apps as is viable through Flatpak, use Flatseal to narrow permissions, and ensure that every application has either access to paths shared with other applications or network access but not both.)

@hfiguiere
Copy link
Collaborator

I get this:

image

And I disallowed host.

I have vl-gothic on the host though.

@ssokolow
Copy link
Author

ssokolow commented May 26, 2022

Which distro are you on and could you check where in the font fallback chain your VL Gothic is?

(Starting with "If you're on a Debian family distro, what does update-alternatives --list fonts-japanese-gothic.ttf say?")

Given the applications I've observed this in since posting this bug, it's almost certainly a bad interaction between Flatpak's Pango and VL Gothic. (Hence my later opening flatpak/flatpak#4641)

Specifically, all the applications I've tested since opening this, which display the bug, including Inkscape 1.2, print this to the console when you Ctrl+V the test string:

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.263: failed to create cairo scaled font, expect ugly output. the offending font is 'VL Gothic 9.9990234375'

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.264: font_face status is: file not found

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.264: scaled_font status is: file not found

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.273: failed to create cairo scaled font, expect ugly output. the offending font is 'VL Gothic 9.9990234375'

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.274: font_face status is: file not found

(org.inkscape.Inkscape:2): Pango-WARNING **: 04:37:05.274: scaled_font status is: file not found

...and sudo apt-get remove fonts-vlgothic prevents the problem from manifesting.

@hfiguiere
Copy link
Collaborator

Maybe it's a problem with your system. Given that you filed this bug on multiple other package, where the common vairiable is whatever distro you are using.

I don't have these Pango messages.

@ssokolow
Copy link
Author

It's possible but, as far as font customization goes, I should have a stock Kubuntu Linux 20.04 LTS configuration. I installed a new SSD less than two years ago and reinstalled from scratch when I did so, only moving over bits of $HOME bit-by-bit from my copy of my old homedir as necessary.

I'll see if I can make time to see if I can reproduce with a 100% fresh Kubuntu 20.04 LTS in VirtualBox at some point in the near future.

@hfiguiere
Copy link
Collaborator

I was unclear. Maybe it's the distro you use that is broken. Now that you mention it, make sure your flatpak is recent, given that you use a 2 year old distro that doesn't participate in flatpak.

@ssokolow
Copy link
Author

ssokolow commented May 26, 2022

I was unclear. Maybe it's the distro you use that is broken.

That's possible, but, given that the same apps outside Flatpak didn't have any problem with VL Gothic, I'd blame Flatpak either way, since making apps work portably is part of its mission statement. (I've been migrating apps I already used to Flatpak for easier sandboxing. I first noticed it in the Deluge torrent client where I shut down the distro version, moved the dotdir over, fired up the Flatpak version, and noticed tofu in my torrent names.)

Now that you mention it, make sure your flatpak is recent, given that you use a 2 year old distro that doesn't participate in flatpak.

I'm using the PPA. The version of Flatpak in the base 20.04 repos is old enough that I'd know if I'd forgotten to because some of the apps I use would have refused to install. (And it took a while for me to get around to reporting it. I think, at the time, either 20.10 or 21.04 was the newest version on the non-LTS track.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants