-
Notifications
You must be signed in to change notification settings - Fork 85
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
🐞 Line number font is incorrect #58
Comments
Just want to leave this here. Did some research a while back and this might help: private var lineGutterFont: NSFont {
let fontSize: Double = 10
// TODO: calculate the font size depending on the editors font size.
let font = NSFont.monospacedSystemFont(ofSize: fontSize, weight: .medium)
let alt0NoSlash: [NSFontDescriptor.FeatureKey: Int] = [
.selectorIdentifier: 6,
.typeIdentifier: kStylisticAlternativesType,
]
let alt1NoSerif: [NSFontDescriptor.FeatureKey: Int] = [
.selectorIdentifier: 8,
.typeIdentifier: kStylisticAlternativesType,
]
let descriptor = font.fontDescriptor.addingAttributes([.featureSettings: [alt0NoSlash, alt1NoSerif]])
return NSFont(descriptor: descriptor, size: 0) ?? font
} |
That gets me the alternate characters like the open 4 however I still need to be able to reduce the width and tracking. Any idea how I might do that? |
Maybe something here |
@austincondiff, @lukepistrol - I believe the font you're looking for is actually sneakily bundled into Xcode. take a look in: and say hello to this little guy: I would guess that it's proprietary. |
I am aware of Xcode Digits after digging through the app contents. I have thought about sneaking it in, but probably not as I think you are right in that it might be proprietary (not clear if it is or isn't). I think we can get a look like this with the SF variable font (not sure if we can use it now or if we need to wait). |
Looks like variable fonts are only available in OS 13+... https://developer.apple.com/documentation/appkit/nsfont/width?changes=latest_3_5_2 |
We will be using ExtensionKit and the new form style in Settings. The though it once we are out of beta, 13 will be standard by that point. So I'd say let's try to achieve the same look with variable fonts! |
@ben-p-commits we will be increasing our minimum target to macOS 13 if you wanted to take a stab at doing this via variable fonts. |
I just updated to ventura- happy to dive back in!
…On Thu, Feb 16, 2023 at 6:30 PM Austin Condiff ***@***.***> wrote:
@ben-p-commits <https://github.com/ben-p-commits> we will be increasing
our minimum target to macOS 13 if you wanted to take a stab at doing this
via variable fonts.
—
Reply to this email directly, view it on GitHub
<CodeEditApp/CodeEditTextView#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGVDZJTIPDW7RS4TQ5BD43WX22BTANCNFSM6AAAAAAQMVPYSY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@ben-p-commits Perfect, I am assigning this to you. |
@Eliulm would you like to try to include this in your PR (#163) or should we tackle this later? If so let me know. You might look at variable fonts as mentioned. |
@austincondiff Yeah, I will see what I can do. |
The open 4 is an alternate character. Screen.Recording.2023-03-18.at.11.55.11.AM.movI forget how, but there is a way to do this in Swift. |
@Eliulm It looks like your alt469 is enabling the high legibility setting ( let alt4: [NSFontDescriptor.FeatureKey: Int] = [
.selectorIdentifier: kStylisticAltOneOnSelector,
.typeIdentifier: kStylisticAlternativesType
]
let alt6and9: [NSFontDescriptor.FeatureKey: Int] = [
.selectorIdentifier: kStylisticAltTwoOnSelector,
.typeIdentifier: kStylisticAlternativesType
] |
@thecoolwinter Awesome, thank you! |
@Eliulm how are we looking with this? |
Done, going to create a PR soon |
The line number font does not align with Xcode.
Left: Xcode | Right: CodeEdit
The font needs to be sans-serif, narrower, with the color less prominent.
The text was updated successfully, but these errors were encountered: