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

Increase line spacing of text in the message area #278

Closed
bradtchapman opened this issue Jul 8, 2023 · 6 comments
Closed

Increase line spacing of text in the message area #278

bradtchapman opened this issue Jul 8, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request in progress

Comments

@bradtchapman
Copy link

Why are you requesting this feature?
The line spacing in the Message area is too compact for adequate legibility. Apple's page of "UI Design Do's and Dont's" strongly encourages developers to slightly expand line spacing for better readability: https://developer.apple.com/design/tips/

Describe what you want the feature to do:: Please increase the default spacing of the message area to 1.3 lines, or offer administrators a way to configure it in the --messagefont options. FYI, Apple's standard is 1.3 line spacing across the operating system and in their marketing materials.

Some font families include more or less internal line spacing than others. Without specifying a font family, swiftDialog will use "SF Pro Text" from Apple.

As a side benefit, I found that increasing the line spacing also enables the "Live Text" detection when taking a screenshot of SwiftDialog. When the line spacing is too compact, it doesn't see any text.

Describe workarounds, if any:
The only present alternate is to add a newline \n character after every line, but this adds too much empty space. It would also cause serious text flow issues if the admin decides to resize or adjust the dialog box later.

Any screenshots or recordings?
Why, I'm glad you asked! Here are two "screenshots" of swiftDialog that were mocked up in Photoshop to recreate the problem and set different amounts of line spacing.

Line spacing ratio = line leading (points) ÷ font size (points)

FYI swiftDialog's default line spacing is calculated at ~ 1.03 lines. (17.6 pt leading ÷ 16 pt font size)


Text ~1.03 Line Spacing:

swiftdialog-linespacing-1 03

Text @ ~1.35 Line Spacing:

swiftdialog-linespacing-1 35


Bonus: Live Text detection

Here we see that in QuickLook, the Live Text framework only activates on the screenshot with the greater line spacing.

swiftdialog-livetext-detection

@bradtchapman
Copy link
Author

FYI one text property for line spacing in SwiftUI is Font.Leading. The equivalent in ObjectiveC is lineHeightMultiple. It doesn't appear that SwiftUI offers exact control over leading size; you get "standard, loose, tight" and that's it.

@bartreardon bartreardon self-assigned this Jul 10, 2023
@bartreardon bartreardon added enhancement New feature or request in progress labels Jul 10, 2023
@bartreardon
Copy link
Collaborator

I don't see the issue with screenshots not being picked up for live text but a decent change nontheless. A good opportunity to do it as well since message formatting is getting a decent update in 2.3 (and causing me pain but that's progress for you)

@bartreardon
Copy link
Collaborator

something like this?

image

@bradtchapman
Copy link
Author

Yes. 👏 Looks very nice. Thanks!

@bartreardon
Copy link
Collaborator

fixed in 2.3

@bradtchapman
Copy link
Author

🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

2 participants