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

Improved glyph coverage with system-provided fonts (v1.8 has downloadable fonts) #195

Open
handicraftsman opened this issue Mar 5, 2021 · 8 comments
Labels
enhancement New feature or request priority High-priority issue

Comments

@handicraftsman
Copy link

As you can see below, there are heavy issues with rendering Chinese characters and slightly less issues with Korean characters.

Снимок экрана от 2021-03-05 18-07-38

@skyjake skyjake added the enhancement New feature or request label Mar 5, 2021
@skyjake
Copy link
Owner

skyjake commented Mar 5, 2021

Missing CJK glyphs is a known issue at the moment. It's happening because Lagrange only uses fonts from its own resources. For better CJK coverage, system-provided fonts should be used.

I'm hesistant to package a large number of CJK fonts with the app because font data is already taking 20+ MB in the distribution, which is a lot compared to the app itself.

@skyjake skyjake changed the title Font rendering issues for CJK characters Improved CJK character coverage with system-provided fonts Mar 5, 2021
@bortzmeyer
Copy link

What about arabic characters? Currently, Lagrange does not seem to display them at all, I get question marks (other programs on my system can do it, even xterm).

@skyjake
Copy link
Owner

skyjake commented Mar 14, 2021

Arabic is fundamentally the same problem, although there’s also the RTL text rendering challenge.

I’ve been thinking about this. When it comes to using system fonts, it is actually not a great solution for Lagrange. Font/text APIs either require platform-specific code or addition of new libraries like FreeType. While I may adopt FreeType at some point, this doesn’t solve the issue that the user may not have all the needed fonts installed on their system.

A better solution than bundling 50-100 MB of fonts with the app could be to add a mechanism to download additional fonts from a manually curated collection. The UI could offer to do this automatically when encountering missing glyphs.

This would work with any platform Lagrange runs on without additional dependencies.

@handicraftsman
Copy link
Author

Technically FreeType can be bundled together with Lagrange, it's not that much of the effort.

Same comes to harfbuzz, which implements the text shaping engine missing in FreeType.

@skyjake
Copy link
Owner

skyjake commented Mar 14, 2021

Indeed, but my concern is the addition of new dependencies and therefore increased complexity, which need to be managed both in source code and in distribution over time, across all platforms. My goal is to keep things minimal in this regard, if at all possible.

@handicraftsman
Copy link
Author

That's a nice goal actually for such a Unix-like app actually!

@skyjake skyjake changed the title Improved CJK character coverage with system-provided fonts Improved CJK character coverage with downloadable or system-provided fonts Mar 15, 2021
@skyjake skyjake added the priority High-priority issue label Mar 18, 2021
@skyjake skyjake changed the title Improved CJK character coverage with downloadable or system-provided fonts Improved glyph coverage with downloadable or system-provided fonts Mar 28, 2021
skyjake added a commit that referenced this issue Mar 28, 2021
Added a font for Arabic, making the glyphs available for rendering.

Of course, this doesn't solve Arabic text rendering yet. There is still the RTL direction to work out and possibly some missing glyph combining rules.

IssueID #195
@skyjake
Copy link
Owner

skyjake commented Mar 28, 2021

4756b0a is a small step forward here.

I've previously also added a Simplified Chinese variant of Noto Sans CJK.

@skyjake skyjake changed the title Improved glyph coverage with downloadable or system-provided fonts Improved glyph coverage with system-provided fonts (v1.8 has downloadable fonts) Nov 2, 2021
@skyjake
Copy link
Owner

skyjake commented Nov 2, 2021

Version 1.8 now has full support for downloadable and local TrueType fonts (as long as they are single-color, non-bitmap, and unhinted).

The Noto fonts have quite good Unicode coverage for a wide selection of languages, and a more complete version of Noto Sans CJK is also available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority High-priority issue
Projects
None yet
Development

No branches or pull requests

3 participants