Typography

RSS for tag

Implement good typography technique, make the most of the advanced features in Apple system fonts, and integrate custom fonts.

Posts under Typography tag

24 Posts
Sort by:
Post not yet marked as solved
0 Replies
553 Views
I am using GeometryReader to calculate the size of font to use to fit several lines of text, however it is always too big. What can be wrong with my calculation? Here's a simply Playground import SwiftUI import PlaygroundSupport struct MainView : View { var body: some View { VStack { SomeView() .frame(width: 508.0, height: 246.5) } } } struct SomeView: View { let newData = ["1", "2", "3", "4", "5", "6", "7", "8"] var lines: Int { newData.count } var body: some View { GeometryReader { geometry in VStack(alignment: .leading, spacing: 0) { ForEach(0..<lines) { idx in Text(newData[idx]) .padding(0) } } .font(.system(size: geometry.size.height / CGFloat(lines))) .onAppear { print(geometry.size) print(lines) print(geometry.size.height / CGFloat(lines)) } } } } PlaygroundPage.current.setLiveView(MainView()) This gives me this result which I need to show all 8 lines:  The GeometryReader correctly reports the height of the box to be 246.5 and the number of lines to be 8 which results in a 30.8125 font size. It seems the font size needs some additional padding but how do I calculate this? I want to be able to supply an unknown amount of data and have it fill the box. (Well I am actually using a LazyVGrid which is suffering the same issue).
Posted
by dazboj.
Last updated
.
Post not yet marked as solved
1 Replies
340 Views
Each MacOS has over the last few years has made it harder and harder to parse down the unnecessary fonts in the System folder to the point where Big Sur has no work around to remove any of them. While I can recognize that the trade off has been a more secure operating system which I'm certainly not suggesting Apple doesn't continue improving, really would like control back over these system fonts in some way. Some may think this is no big deal, but as a designer who is in fonts every day for multiple clients and using font management software to activate and deactivate fonts regularly, having a terribly long list of fonts always present hampers workflow. Ideally via Terminal there would be a way to unlock functionality in the Font Book app Apple pre-loads to unlock the disable function under system fonts. I know which fonts I need to have my system run so maybe we can get a way to control these back some day??
Posted Last updated
.
Post not yet marked as solved
0 Replies
457 Views
Hi, I'm a developer working on a plugin that maps the tracking values based on font size in Figma (design tool). I want to support the New York font, however I realize there are 4 optical sizes: Small, Medium, Large, and Extra Large. Is there a documentation that outlines which font sizes are mapped to which variation when rendered on iOS? I'm assuming it's similar to how SF Pro Display is used at size 20 instead of SF Pro Text. Knowing the mapping will help designers see a more accurate representation of the text in Figma. Thanks.
Posted
by charliecm.
Last updated
.