FreeType is a toggleable option which is disabled by default #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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
ImGuiFreeTypeBuilderFlags
, which were previously missing.resolves #244
Type of change