CJK fonts aren't found when running inside a Flatpak sandbox
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- desktop, internationalization
Research direction
Start with cjk_candidates and FONT_ROOTS in crates/render/src/fonts.rs, then inspect how the existing font paths are selected. Reproduce in a Flatpak with a CJK locale and host Noto Sans CJK installed. Done when CJK interface text and map labels render in the sandbox; check any font lookup tests around those paths.
Written by the indexing model from the issue text.
Description
When RustGIS runs inside a Flatpak sandbox, an interface in Chinese, Japanese or Korean draws as empty boxes, and CJK map labels are left out. This happens even though the host has Noto Sans CJK installed.
Why: in a Flatpak, /usr/share/fonts is the runtime's own folder, and the freedesktop runtime has no CJK font. The host's fonts are mounted elsewhere:
/run/host/fonts: the system's fonts, e.g./run/host/fonts/opentype/noto/NotoSansCJK-Regular.ttc/run/host/user-fonts: the user's~/.local/share/fonts/run/host/local-fonts:/usr/local/share/fonts
RustGIS looks for CJK faces at fixed paths under /usr/share/fonts (cjk_candidates in crates/render/src/fonts.rs), so it doesn't find them there. Toolkits that go through fontconfig pick these folders up from the runtime's fonts.conf, but RustGIS reads font files directly, which is fine everywhere else.
Suggestion: could the CJK lookup, and FONT_ROOTS, also try the same relative paths under /run/host/fonts, /run/host/user-fonts and $XDG_DATA_HOME/fonts? Searching those roots for the known file names, rather than only the fixed full paths, would also cover distributions that keep Noto CJK in a different subfolder.
To reproduce (RustGIS 0.7.0):
flatpak install flatpark org.rustgis.RustGIS
flatpak run --env=LANG=zh_CN.UTF-8 org.rustgis.RustGIS
For now the package page suggests --env=RUSTGIS_LANGUAGE=en to CJK users. On our side this is tracked in flatpark/flatpark#1309. Once a release with the change is out, the package picks it up automatically and needs no change of its own.
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 11h 1m
- Merged PRs (30d)
- 942
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPossibly taken @jgregoriorincon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opengeos/RustGIS#2621 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
opengeos/RustGIS#1446 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
postgresql-rules / queue-rules: implicit KEY SHARE before a parent key update, and job self-overlapOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jonathanong/no-mistakes#3879 ·
Maintainers usually reply within 1 day
-
area:index v0.35.0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
nautechsystems/nautilus_trader#5741 ·
Maintainers usually reply within 1 day
-
RunPlugin derives Hash over all fields while PartialEq compares only location and configurationOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
zellij-org/zellij#5969 ·
Maintainers usually reply within 1 day
-
eth_get_proof reports another account's fields for an absent accountPossibly taken @Indian-boult claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day