feat: optionally use typographical width#826
Open
erics118 wants to merge 1 commit into
Open
Conversation
khaneliman
added a commit
to khaneliman/khanelinix
that referenced
this pull request
Jun 11, 2026
Apply temporary SketchyBar patches for upstream font feature work so local config can exercise OpenType tags and typographical widths. References upstream PRs: - FelixKratz/SketchyBar#826 - FelixKratz/SketchyBar#828
khaneliman
added a commit
to khaneliman/khanelinix
that referenced
this pull request
Jun 11, 2026
Use fixed label, icon, and stack widths so font-feature-enabled SketchyBar metrics stay aligned after typographical width support. Trim command output before rendering memory and disk percentages to avoid newline artifacts in labels. Builds on upstream SketchyBar PRs: - FelixKratz/SketchyBar#826 - FelixKratz/SketchyBar#828
|
Works well in my testing, solves some issues i've had with aligning things that change values constantly in the bar. Thanks for doing this. |
|
Great pr fixes a long standing issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #692 that added font features like tnum.
After that PR,
tnumwould not work properly, because we weren't using the right attribute to decide on character width.CTLineGetBoundsWithOptionsgets us the actual bounds where the character is drawn, but we actually need to useCTLineGetTypographicBoundsso that we can properly render the extra spacing for each character.This PR introduces a
typographical_widthoption to the font field that enables using the slightly larger bounds for each character.I added this as off by default because this otherwise, it would be a breaking change and makes every (most?) item slightly wider than before.
Now,
tnumwill actually work properly.example using the SF Pro font:
Before this patch (without
tnum): observe lots of jumping aroundCleanShot.2026-06-10.at.11.48.28.mp4
Before the patch (with
tnum): exact same as without tnumCleanShot.2026-06-10.at.11.47.17.mp4
After the patch (with
typographical_widthand `tnum): no jumping aroundCleanShot.2026-06-10.at.11.45.25.mp4
Looking at the actual widths, the issue and fix is a lot more clear: