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

FreeType is a toggleable option which is disabled by default #254

Merged
merged 4 commits into from
Aug 18, 2024

Conversation

SpaiR
Copy link
Owner

@SpaiR SpaiR commented Aug 18, 2024

Description

This PR modifies the approach to working with the FreeType font renderer, which has been enabled by default in the library since version v1.86.12. A new method, ImFontAtlas#setFreeTypeRenderer(boolean), has been added, allowing FreeType to be enabled or disabled for specific font atlases. By default, FreeType is now DISABLED again. An example of how to enable it can be found in the updated example code class.

This should be called during fonts configuration:

ImGui.getIO().getFonts().setFreeTypeRenderer(true);
// fonts config
ImGui.getIO().getFonts().build();

Details on the Decision

In issue #244, it was noted that on macOS, the font rendering quality with FreeType, compared to STB_TrueType, actually worsened. It's difficult to determine the exact cause, likely due to specific OS characteristics. However, this issue highlighted the need to bring back the ability to use STB_TrueType in some way. Reverting to providing a separate library build without FreeType was not a preferred option, as it complicates overall maintenance routine, increases CI build times, and requires additional explanation to users of the differences between the builds with and without FreeType.

Given that including FreeType to the final build only slightly increases the binary size, this approach was chosen instead.
The decision may be revisited in the future, as I don't have a firmly fixed position on this matter.

Other Changes

  • The FreeType library has been updated to the latest version, v2.13.3. While there may not be visible differences in the example code, there could be some changes with more complex fonts.
  • Fixed the generation of ImGuiFreeTypeBuilderFlags, which were previously missing.

resolves #244

Type of change

  • Minor changes or tweaks (quality of life stuff)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@SpaiR SpaiR added feat New feature or request api labels Aug 18, 2024
@SpaiR SpaiR merged commit d252c14 into main Aug 18, 2024
7 checks passed
@SpaiR SpaiR deleted the feat/freetype-with-stb branch August 18, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: freetype rendering much worse
1 participant