Multiple font related optimization and improvements #491
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.
Changes in this PR:
The automatic fixed-width font detection feature is now disabled by default. Users can enable it by passing the "AUTOMONO" flag. Additionally, font flag changes are now correctly passed upstream to
libqb
.Font baseline calculation no longer relies on floating-point math. Instead, we utilize
FreeType
fixed-point functions such asFT_MulDiv()
andFT_MulFix()
. The baseline calculation method has also been refined for greater accuracy, ensuring precise baseline values.Significant enhancements have been made to the
_U*
functions. They now give more precise baseline-to-baseline height and font height measurements for both built-in andFreeType
supported fonts. Superfluous adjustments that were previously applied have been eliminated, and all calculations now avoid floating-point math.Various quality-of-life enhancements have been implemented, including the usage of defined values instead of numeric literals and the use of
std::string
instead ofqbs
infunc__loadfont()
.