Skip to content
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

font_options: Support "slashed zero" OpenType layout feature #2302

Open
jenskutilek opened this issue May 9, 2018 · 25 comments
Open

font_options: Support "slashed zero" OpenType layout feature #2302

jenskutilek opened this issue May 9, 2018 · 25 comments

Comments

@jenskutilek
Copy link

I was happy to see support for OpenType Stylistic Sets in the current ST version. Could you also add support for the "slashed zero" OpenType feature (feature tag: "zero")? The code for stylistic sets should be the same that's needed to support "zero".

Font makers could duplicate the "slashed zero" replacement into a stylistic set and thus make it accessible in the current ST builds, but it is better to use a more specific OT feature than a general one. The contents of stylistic set is not specified, and varies between different fonts, while the slashed zero feature is identical across fonts.

@tonsky
Copy link

tonsky commented May 28, 2019

Just want to add it would be great to see other open-type features as well, namely:

onum (old-style figures)

@AlsoScratch
Copy link

AlsoScratch commented Jan 4, 2020

I really hope these brilliant suggestions are not being plainly ignored! Just because it's trivial does not mean we can pretend they don't exist.

@NetOpWibby
Copy link

NetOpWibby commented Jan 16, 2020

Is there any progress on this? I opened an issue on the JetBrains Mono repo for slashed-zero support in the typeface and it apparently already has it.

I found this reference guide on enabling stylistic sets in Fira Code for usage in Sublime Text helpful, but the suggestion doesn't seem to work.

I don't know much about native software development but it seems like additional ligature support is relatively minor to implement. Hopefully, Panic's Nova comes out supporting what we want.

@Sharklops
Copy link

Sharklops commented Jan 21, 2020

Is there any progress on this? I opened an issue on the JetBrains Mono repo for slashed-zero support in the typeface and it apparently already has it.

I found this reference guide on enabling stylistic sets in Fira Code fur usage in Sublime Text helpful, but the suggestion doesn't seem to work.

I thought it wasn't working either, but then realized that the stylistic sets don't work on JSON files for some reason. And I was doing all my testing right there in the Settings file.

When I created a new Plain Text file it worked just fine, and seems to work on the majority of extensions that can be selected in the bottom right corner of the Sublime Text window. Hope that helps!

@AlsoScratch
Copy link

Curious... Are you saying there is actually a way to do it?

@NetOpWibby
Copy link

I was doing my testing on several file extensions and the zero never changed. Here are the relevant settings:

{
  "font_face": "JetBrains Mono Regular",
  "font_options":
  [
    "dlig",
    "ss01",
    "ss02",
    "ss03",
    "ss04",
    "ss05",
    "ss06",
    "ss19",
    "ss20",
    "onum",
    "zero"
  ],
  "font_size": 13,
}

@Sharklops
Copy link

Ah, I'm sorry. I originally linked to this issue from the Fira Code page and had assumed it was specific to that font.

I definitely recommend it if you aren't married to JetBrains. It's got a working slashed zero by default as well as programming ligatures

image

@NetOpWibby
Copy link

Oh yeah I know about Fira Code and while I've tried it before I really like how JetBrains Mono feels.

@wbond
Copy link
Member

wbond commented Jan 21, 2020

I was doing my testing on several file extensions and the zero never changed. Here are the relevant settings:

Currently only ss01 to ss10 are implemented. zero and onum are not. This is currently an implementation detail in that font_options is implemented as a 32bit int using bits as flags. To add support for ss11 to ss20 plus other open type flags, we'd have to refactor a number of chunks of code to use a 64bit int or some other data structure.

Generally such changes happen because we are doing a chunk of related work (in this case on font handling), we have a bug that needs to be fixed, or we get more than a few people asking for a feature.

I'm not opposed to adding such support in the future, I just don't know exactly when that will happen. Partially just because there are plenty of competing feature requests and bug reports to pay attention to also.

@Sharklops
Copy link

I guess you could use something like FontForge (free and open source) to edit the zero glyph to bake in the slash.

@NetOpWibby
Copy link

NetOpWibby commented Jan 21, 2020

To add support for ss11 to ss20 plus other open type flags, we'd have to refactor a number of chunks of code to use a 64bit int or some other data structure.

Ahh, I was under the incorrect assumption that implementation would be trivial. Thanks for the insight.

For my end, I could see about swapping the default zero with the slash. A small bit of legwork but a helluva lot easier than flagging bits.

EDIT: FontForge doesn't seem to support ttf files. Oh well.

@Sharklops
Copy link

It definitely supports ttf files, but I'm pretty sure the stylistic sets this issue is discussing pertains only to Opentype fonts.

@NetOpWibby
Copy link

NetOpWibby commented Jan 21, 2020

@Sharklops Ah, must be an issue with the app (it's been installed for a while). I just installed the latest FontLab and am using the trial to figure things out.

EDIT: My fudging around in FontLab worked!

@jenskutilek
Copy link
Author

You can remap characters in a font without using a graphical font editor. It’s better to do it with scripting because that way you can be fairly sure nothing else is changed/broken in the fonts. I have an example Python script to switch a slashed zero with the default zero in my Sudo font repo. You can switch any other character by adding its info like in line 36, you just have to know its Unicode value (0x0030) and the glyph name of the glyph to substitute (zero.zero).

@Sharklops
Copy link

Sharklops commented Jan 21, 2020

@jenskutilek - thanks, I only just realized that after messing around in FontForge for way too long.

But I did manage to get the slashed/dotted zero in Fira Code working right with Sublime Text. Fira Code uses the zero and ss19 flags, but doesn't have anything set for ss10. I just copied over the info from ss19 into a new lookup for ss10 I created and it seems to be working just fine.

@be5invis
Copy link

be5invis commented Feb 14, 2020

Iosevka has a set of non-standard tags for language-specific ligations, 14 ss## stylistic set features and 87 cv## character-variant cherry-picking features.
The mechanism of enabling OT features really needs to be more flexible...

@MatheusAvellar
Copy link

Just had the same issue trying to toggle specific character variants (cv##) with Iosevka... 😪

I get that this is probably not a very high priority issue since it's mostly an aesthetics thing, but hopefully it's tackled at some point

@bpsbais
Copy link

bpsbais commented Jun 29, 2023

It's 2023, still waiting for "slashed zero" support.

@siddhpant
Copy link

siddhpant commented Aug 1, 2023

This is needed for Verilog assignment ligature (<= is an assignment arrow to the left, and not ≤).

@njgwinter
Copy link

Just adding a 2024 bump to this request for more complete opentype feature support. Thanks!

@MrDowntempo
Copy link

Cascadia Code is another font affected by this.
https://github.com/microsoft/cascadia-code

@DeraJSP
Copy link

DeraJSP commented Mar 15, 2024

Still nothing?

@markmcb
Copy link

markmcb commented Aug 21, 2024

+1. I think OpenType support should be a baseline expectation for a non-free text editor in 2024. Fingers crossed I'll see it in the changelogs soon.

@siddhpant
Copy link

Fingers crossed I'll see it in the changelogs soon.

Won't hold my breath. This issue was opened in 2018. Clearly this is something they are unwilling to support or consider. It requires some refactoring -> #2302 (comment).

@markmcb
Copy link

markmcb commented Aug 23, 2024

Fingers crossed I'll see it in the changelogs soon.

Won't hold my breath. This issue was opened in 2018. Clearly this is something they are unwilling to support or consider. It requires some refactoring -> #2302 (comment).

Yeah, you're probably right. My license just expired. I think this is a "vote with my wallet" situation for me. I'll upgrade when this is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests