Skip to content

Add text size modifier #1061

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

Merged
merged 7 commits into from
Sep 28, 2023
Merged

Add text size modifier #1061

merged 7 commits into from
Sep 28, 2023

Conversation

khaykov
Copy link
Contributor

@khaykov khaykov commented Sep 27, 2023

This PR adds a text size modifier, that is applied to base font size, and scales all the text accordingly. This is mainly aimed at use cases where you have specific heading sizes defined, instead of relying on default scaling behavior.

If you don't have a manually set heading sizes, all the text will scale with base font size.

Modifier can be negative, for downscaling.

To test:

  • Try setting the modifier using setTextSizeModifier (eg visualEditor.setTextSizeModifier(25)) and confirm that the text scales as expected.

  • Try settings custom heading font sized using headingOneFontSize, headingTwoFontSize, etc. Confirm that heading size is scaling properly.

  • If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

@khaykov khaykov requested a review from nbradbury September 27, 2023 23:41
@khaykov khaykov marked this pull request as ready for review September 27, 2023 23:41
@nbradbury nbradbury self-assigned this Sep 28, 2023
Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

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

All good, thanks for this change! :shipit:

@nbradbury nbradbury merged commit caf8f43 into trunk Sep 28, 2023
@nbradbury nbradbury deleted the feature/text-size-modifier branch September 28, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants