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

Calc font size correctly and use it for valign #16485

Merged
merged 2 commits into from May 9, 2019

Conversation

@teinarss
Copy link
Contributor

commented May 2, 2019

Calculate the font height with the ascender and descender values from the font and use that for valign top and middle.

Included a testcase

image

@teinarss teinarss force-pushed the teinarss:calc_font_size branch from 3760fcb to 9a871df May 3, 2019

@pchote

This comment has been minimized.

Copy link
Member

commented May 3, 2019

Something isn't accounting for screen scale properly...

Standard DPI:
Screenshot 2019-05-03 at 23 58 41
HiDPI:
Screenshot 2019-05-03 at 23 58 47

@teinarss teinarss force-pushed the teinarss:calc_font_size branch from 9a871df to 19b73d6 May 4, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2019

Updated

@pchote

This comment has been minimized.

Copy link
Member

commented May 4, 2019

Checking for code style violations in OpenRA.Platforms.Default...
OpenRA.Platforms.Default/FreeTypeFont.cs:L102: [SA1009] Invalid spacing around the closing parenthesis.
OpenRA.Platforms.Default/FreeTypeFont.cs:L102: [SA1008] Invalid spacing around the opening parenthesis.
Makefile:178: recipe for target 'check' failed

@teinarss teinarss force-pushed the teinarss:calc_font_size branch from 19b73d6 to d84fc25 May 4, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2019

Updated...

@pchote pchote added the PR: Needs +2 label May 4, 2019

@reaperrr

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

Looks good to me, 👍 after testcase is removed.

@teinarss teinarss force-pushed the teinarss:calc_font_size branch from d84fc25 to 8a8d893 May 9, 2019

@reaperrr reaperrr merged commit 0e3d343 into OpenRA:bleed May 9, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.