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

Render modes missing FT_RENDER_MODE_SDF #256

Open
kantholz44mm opened this issue Jul 17, 2023 · 1 comment
Open

Render modes missing FT_RENDER_MODE_SDF #256

kantholz44mm opened this issue Jul 17, 2023 · 1 comment

Comments

@kantholz44mm
Copy link

As seen in the FreeType documentation, there is a render mode for creating SDFs. This enum is missing in the rust binding as of yet

@AustinEvansWX
Copy link

AustinEvansWX commented Apr 29, 2024

For anyone stumbling upon this you can set the render SDF flag with the following

let load_flags = freetype::face::LoadFlag::from_bits((0x1 << 2) | ((5 & 15) << 16)).unwrap();

Where:

  1. 0x1 << 2 is equivalent to LoadFlag::RENDER
  2. ((5 & 15) << 16) is equivalent to FT_LOAD_TARGET_(FT_RENDER_MODE_SDF) in C

Then you can use the load_flags with load_glyph() or load_char().

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