19 points

That texture healing looks super nice. Is that something fonts can just do or does it require special editor support?

permalink
report
reply
19 points
*

Texture healing works by finding each pair of adjacent characters where one wants more space, and one has too much. Narrow characters are swapped for ones that cede some of their whitespace, and wider characters are swapped for ones that extend to the very edge of their box. This swapping is powered by an OpenType feature called “contextual alternates,” which is widely supported by both operating systems and browser engines.

Contextual alternates are normally used for certain scripts, like Arabic, where the shape of each glyph depends on the surrounding glyphs. And they are also used for cursive handwriting fonts where the stroke of the “pen” might have different connection points across letters. Texture healing is a novel application of this technology to code.

basically fonts were already capable of using alternate versions of characters based on their nearby characters, so they used that for these fonts to allow for seemingly-dynamic sizing/spacing

permalink
report
parent
reply
22 points

It’s basically a different type of ligature - it is standard to OTF fonts, but requires ligature support in your editor/terminal. Just need to enable ligatures and/or enable specific ligature sets. See https://github.com/githubnext/monaspace#editors or maybe https://wezfurlong.org/wezterm/config/font-shaping.html for the general procedure in a supporting terminal.

permalink
report
parent
reply
1 point

Is there a way to disable it but keep ligatures?

permalink
report
parent
reply
2 points

From https://github.com/githubnext/monaspace#editors :

If you want coding ligatures but do not want texture healing, you can omit the calt setting:

permalink
report
parent
reply
8 points

It’s an OpenType standard feature but the font rendering system has to support it and the app has to enable it. The page has a link to instructions for enabling it in VS Code but I have no idea about support status on different OS and desktop environments. I could see it working on webview on Android fwiw, I’m guessing it’s either well supported in general or at least by browsers.

permalink
report
parent
reply
6 points

Here is the comprehensive editor compatibility list for Fira Code. Should be the same.

permalink
report
parent
reply
2 points

It is well supported in all browsers and operating systems. At least VS Code and IntelliJ support it, and even some terminals.

permalink
report
parent
reply
11 points

The fonts are nice but I absolutely hate the “copilot voice” text moving around idea, it’s absolutely terrible to read.

permalink
report
reply
11 points

I don’t think the intention is that Copilot voice would be animated, I think they just had a dumb idea to highlight it that way in the demo. Look closely, and you’ll see the Copilot voice is the only text there written in the “Krypton” font. The animation indeed looks godawful.

permalink
report
parent
reply
3 points

I hope you’re right

permalink
report
parent
reply
16 points
*

Hmm nothing really jumped out at me at first glance, I don’t mind the ligature stuff, but also love monospace for the aesthetic.

But I am glad they’re experimenting with this stuff. Ive always wanted a sarcastica font, we’re almost there with sArCAsm. But it’s a pain to write :)

permalink
report
reply
1 point
*
1 point

ZMK actually… But thanks for the idea.

permalink
report
parent
reply
1 point

Holy shit, I never even thought to do something like this. Hahaha. I’m gonna try it later.

permalink
report
parent
reply
21 points
*

I like all of it, except for that awful “texture healing”. Imagine having words above & below like

i=mins
w=maxs

But the m’s just slightly don’t line up because the top one is wider than the bottom one. I’d feel like my editor was gaslighting me 🤢

permalink
report
reply
3 points

They would still line up, wouldn’t they? Or am I misunderstanding how the texture healing would work… Would they not take the same total amount of space?

permalink
report
parent
reply
16 points

permalink
report
parent
reply
10 points
*

Each line is the same total length but the “m” in “mi” would be wider than the m in “ma”

permalink
report
parent
reply
14 points
*

Here’s your code example in the editor. I don’t personally think the difference between the 'm’s is super noticable. But what did strike me a lot more is the difference in height between the two 'i’s in the first line. I think that difference is pretty bad.

permalink
report
parent
reply
6 points
*

thanks for rendering that! and yeah that height difference is really weird. That almost seems like a bug.

Also Idk if the ='s make the m smaller or bigger.

If the streching is so small as to be unnoticable (and I agree it’s pretty subtle) then I also don’t really understand the benefit.

permalink
report
parent
reply
6 points

If the streching is so small as to be unnoticable (and I agree it’s pretty subtle) then I also don’t really understand the benefit.

Typically, the idea behind this sort of design is that it should be unnoticeable. The motivation is that, with other monospace fonts, the differences in character width, along with the inconsistent spacing and line thicknesses are both noticable and distracting. Some of this badness is avoidable, and this is what this font attempts.

and yeah that height difference is really weird. That almost seems like a bug.

I’ve been informed, (and had to double check because I didn’t believe it,) that the two "i"s are actually the exact same height. The first looking larger than the second is an optical illusion. Font design is hard.

permalink
report
parent
reply
9 points

It looks like it’s not an actual height difference, but the smaller width makes the second i look significantly smaller than the first, also implying a lower height.

permalink
report
parent
reply
5 points
*

True, they are the exact same height. Holy optical illusion, Batman!

I suppose this is part of what makes font design so difficult.

permalink
report
parent
reply
3 points

Welp, another reason I will absolutely not be using glyph-streching or whatever Microsoft called it.

permalink
report
parent
reply

they look nice, I especially like Krypton, but to be honest cascadia code was already great. If it ain’t broke, don’t fix it

permalink
report
reply
4 points

There’s even caskaydia cove for nerd fonts.

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.5K

    Monthly active users

  • 1.7K

    Posts

  • 28K

    Comments