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

Fix resizing bold and italic #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gsbernstein
Copy link

@gsbernstein gsbernstein commented Jan 31, 2024

Before After
Simulator Screenshot - iPhone 15 Pro - 2024-01-31 at 15 06 42 Simulator Screenshot - iPhone 15 Pro - 2024-01-31 at 15 06 12

Comment on lines +141 to +142
let fontMetrics = UIFontMetrics(forTextStyle: textStyle)
font = fontMetrics.scaledFont(for: customFont)
Copy link
Author

Choose a reason for hiding this comment

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

just copied this from above on lines 123-124.

Comment on lines +133 to +138
if globalItalic {
traits.insert(.traitItalic)
}
if globalBold {
traits.insert(.traitBold)
}
Copy link
Author

Choose a reason for hiding this comment

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

In theory this would also allow text to be both bold and italic, which wouldn't work before, however it seems like other bugs in the parsing prevent that.

@gsbernstein gsbernstein force-pushed the fix-resizing-bold-and-italic branch from c831c14 to 202f34a Compare March 26, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant