SF Pro (and SF UI) doesn't switch between "Text" and "Display"
Closed this issue ยท 10 comments
Sketch Version 44.1 (41455)
Summary
It looks like the plugin is no longer dynamically switching to the correct variation of "Text" or "Display" for SF UI or SF Pro, and if I'm using "Text" when I am >20 pt size, then it does nothing.
This plugin is a life-saver, but it'd be great if this issue could be resolved. Thanks!
Full Description
If I make a new text object... (all good)
- SF Pro Text (or SF UI Text)
- 16 pt
- Default character spacing 0
... then use the SF Font Fixer plugin, it correctly applies the correct character spacing (-0.38).
If I make a new text object... (issue!)
- SF Pro Text (or SF UI Text)
- 24 pt
- Default character spacing of 0
... then use the SF Font Fixer plugin, nothing happens.
It should...
- change my SF Pro Text to SF Pro Display
- apply the correct character spacing (0.33)
Well, this feature technically never existed ๐
I can update it to do that though, hopefully this weekend!
@kylehickinson did you ever get around to making the functionality of font-changing depending on the size?
@raulfunkie I actually made a version which automatically updates character spacing + font face without running the plugin but I'm afraid to release it since it messes around with Sketch internals/private API. ๐
@kylehickinson Heh, actually yesterday I found a similar plugin that did the same thing:
- Detected the font
- Changed the font line-height and kerning depending of size
- It also changed the font from Text to Display if the size of the text layer was equal or above 20pts.
I just hacked it around so if if the plugin found a SFUIDisplay or SFUIText, it would do all the things said above + change the font to the more recent SF Pro Text and SF Pro Display.
But yeah, works as the previous plugin, you have to set a command to run it and it updates everything.
I pushed the branch now (https://github.com/kylehickinson/Sketch-SF-UI-Font-Fixer/tree/framework-testing) if you want to play with it :) It will auto-load and work off of launching Sketch.
Will check it out! :)
@kylehickinson I like your implementation ๐
Any plan to support leading as well? I think auto-apply and changing text leading could be added as plugin preferences in case people just want to apply tracking manually.
@charliecm Technically with the framework implementation, I can edit the entire attributed text to my liking, however the scope of the plugin is to adjust character spacing to mirror how it would render it in iOS.
Is there a reason to adjust the leading based on font size?
@kylehickinson I was thinking the plugin could help emulate how iOS handles text leading as well. However, I can't find any info on what's the default line height iOS applies for font sizes between the predefined dynamic type text styles.
Nonetheless, I'd understand if you just want the plugin to fix font and tracking only, which has a better documented rule than with leading.
@kylehickinson how to run scrip