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

Multiple font related optimization and improvements #491

Merged
merged 8 commits into from
May 15, 2024

Conversation

a740g
Copy link
Contributor

@a740g a740g commented May 12, 2024

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 as FT_MulDiv() and FT_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 and FreeType 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 of qbs in func__loadfont().

@a740g a740g added bug Something isn't working enhancement New feature or request labels May 12, 2024
@a740g a740g self-assigned this May 12, 2024
Copy link
Member

@RhoSigma-QB64 RhoSigma-QB64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, tested my game with various fonts (fixed and proportional) and all looks as expected again.

Copy link
Member

@SteveMcNeill SteveMcNeill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what little testing I've did of these, they appear to be all working as advertised. Many thanks for keeping on these as much as you have. I appreciate it, and I know the vast majority of our user baser does too. :)

@a740g a740g merged commit 92c09d5 into QB64-Phoenix-Edition:main May 15, 2024
4 checks passed
@a740g a740g mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants