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

Simplify and fix kerning of curved text #4006

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

10110111
Copy link
Contributor

Description

While reading the discussion of Oxford-13 I saw an example of very bad kerning of the so called "gravity labels". Additionally, baseline was uneven from character to character in a word, but this I've fixed and pushed already.

This PR is now only concerned with the kerning itself. Instead of using bounding rectangles of the characters the new code employs the proper horizontal advances. Also, now the limit of curvature is done in a bit smoother way, without sudden jump of density in text when it approaches the center of the screen, and the char density is now kept constant.

Screenshots

The code had two special branches for RTL and LTR texts, so the screenshots below take two different sky culture languages to compare.

English old

stellarium-018

English new

stellarium-019

Arabic old

stellarium-016

Arabic new

stellarium-017

Type of change

  • 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 change)
  • This change requires a documentation update
  • Housekeeping

How Has This Been Tested?

Test Configuration:

  • Operating system: Ubuntu 20.04 LTS
  • Graphics Card: Intel UHD Graphics 620

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@alex-w alex-w added this to the 24.4 milestone Dec 14, 2024
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

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

Yes, much nicer, thanks!

@10110111
Copy link
Contributor Author

Yes, much nicer, thanks!

Did you check on your machine?

@gzotti
Copy link
Member

gzotti commented Dec 14, 2024

Oops. Now I have. While the screenshot looks good, try the following. Center on zenith, switch on constellation labels and rotate the view around zenith. One would expect the labels were fixed w.r.t. dome center/zenith. ... Hmm, the solution in master has the same problem. So, confirm approval, but the gravity labels have always faced more than this problem. And I cannot check on the 4k screen (where the ugly screenshot came from) before next week.

@10110111 10110111 merged commit 8ed9545 into Stellarium:master Dec 14, 2024
14 of 15 checks passed
@10110111 10110111 deleted the fix-curved-text-kerning branch December 14, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants