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

Support font ligatures #181

Merged
merged 1 commit into from
Dec 18, 2021
Merged

Support font ligatures #181

merged 1 commit into from
Dec 18, 2021

Conversation

tizee
Copy link
Contributor

@tizee tizee commented Dec 15, 2021

close #102
Support monospace ligatures by including harfbuzz.

To render font features like ligature, it's required to use a font shaping engine. Here I use Harfbuzz for both shaping and cross-platform. So instead of writing the same logic using platform-specific shaping engine which I am also unfamiliar with, I just need to write a simple wrapper around harfbuzz-sys in hb_wrapper.rs.

Notice that I also enforce the use of freetype feature for font-kit as font-kit would use platform-specific rasterization library by default which would breaks the logic of harfbuzz.

The application works well in macOS. However, I haven't test it on Windows or Linux yet. I would give it a test on these platforms when I have time.

JetBrains Mono:
Jetbrains

Iosevka:
Iosevka

Fira Code:
Fira

@Aloxaf Aloxaf merged commit e3311d7 into Aloxaf:master Dec 18, 2021
@Aloxaf
Copy link
Owner

Aloxaf commented Dec 18, 2021

Thanks! That's so cool!

Tested on Linux, works well.

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

Successfully merging this pull request may close these issues.

Font ligatures
2 participants