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

Make battle buttons translatable #7706

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Conversation

zenseii
Copy link
Collaborator

@zenseii zenseii commented Sep 5, 2023

Relates to and final part of #6105

This has been implemented:

  1. Variable width for the SKIP and AUTO buttons according to their texts.
  2. Variable width of the Status Bar according to the widths of the buttons.

For the Cyrillic font it looks quite good even though the buttons are slightly wider than the originals which means we have 15 pixels less for text:

image

Meanwhile, for the Latin font it is obvious that we have to cram the letters closer together. I found the sweet spot to be 2 pixels closer in the x-direction.

This is what it looks like for the Latin font without cramming:

image

Implementing a feature to cram letters would need a new function for calculating text width because it needs to take into account that the letters are rendered on top of each other, and we need a new function for actually rendering the text with letters on top of each other.

This change would give us 12 pixels more in width in the case when we have two words of 4 letters (ex. AUTO + SKIP), ( 2 pixels * ( 2 words * ( 4 letters - 1 first letter ) ) ). We would then only lose 3 pixels for text.

Such big changes might be better to do in a separate PR.

This change could be used to solve problems like those described here #7548

This is what the SKIP button would look like with 2 pixels closer for letters.
image

@zenseii zenseii added improvement New feature, request or improvement ui UI/GUI related stuff translation Things related to languages and translations labels Sep 5, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

src/fheroes2/agg/agg_image.cpp Outdated Show resolved Hide resolved
@zenseii zenseii added this to the 1.0.8 milestone Sep 5, 2023
@zenseii zenseii modified the milestones: 1.0.8, 1.0.9 Sep 6, 2023
@ihhub ihhub modified the milestones: 1.0.9, 1.1.0 Oct 11, 2023
@ihhub ihhub modified the milestones: 1.1.0, 1.1.1 May 22, 2024
@ihhub ihhub modified the milestones: 1.1.1, 1.1.2 Jul 13, 2024
@ihhub ihhub modified the milestones: 1.1.2, 1.1.3 Sep 15, 2024
@ihhub ihhub modified the milestones: 1.1.3, 1.1.4 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature, request or improvement translation Things related to languages and translations ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants