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

Which library should replace the Cairo toy text API for text layout and rendering? #10

Closed
rylev opened this issue Jan 8, 2019 · 4 comments
Labels
question Further information is requested

Comments

@rylev
Copy link
Collaborator

rylev commented Jan 8, 2019

For simplicity, the back-end currently uses the toy text API in Cairo. Essentially, this means there is no shaping, so complex scripts won't render correctly at all, and Latin will be missing kerning, ligatures, and other refinements. According to the docs, "Any serious application should avoid them."

Fairly soon, @raphlinus hopes to have some type of higher-level text in place. One possibility is pango. From what @raphlinus can tell, this should work well on Linux, but since it has a non-optional glib dependency, it might be non-trivial to get it building portably. It's also not clear how well this approach handles discovering system fonts.

Another possibility is to use HarfBuzz more directly, using the rust-harfbuzz bindings. This will require more work for font discovery and selection but has the possibility to be considerably more native. A good Rust-native candidate for system font discovery is font-kit.

A third possibility is to adapt libTXT from Flutter. This is a state of the art text layout library, with considerable investment in making it work well on mobile. However, it is in C++ and thus at the very least will need nontrivial work to make good Rust bindings.

@rylev rylev added the question Further information is requested label Jan 8, 2019
@SimonSapin
Copy link

#8 has some overlap with this.

@raphlinus
Copy link
Contributor

I'm basically doing the second option here. As I wrote in #8, here is a roadmap for that project.

@JAicewizard
Copy link
Contributor

Isnt this already implemented now? Piet-cairo now uses pango for text.

@cmyr
Copy link
Member

cmyr commented Jul 14, 2021

Thanks!

@cmyr cmyr closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants