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

How to specify certain character variants (cv) in VS Code? #1376

Closed
lethefrost opened this issue Jul 8, 2022 · 6 comments
Closed

How to specify certain character variants (cv) in VS Code? #1376

lethefrost opened this issue Jul 8, 2022 · 6 comments
Labels

Comments

@lethefrost
Copy link

Hi, I am sorry for the stupid question, but I just could not find the answer from the internet after googling for a long time.

If I have downloaded an arbitrary released stylistic set, but I want to specify some certain character variants when I use Iosevka in my editor (mainly Visual Studio Code), how could I do that? In the README file of Iosevka it says:

Character Variants

Alongside stylistic sets, Monospace Iosevka can also be configured to cherry-pick variants for each character using OpenType. The variants are shown below. To enable, assign the feature tag to the variant index. For example, setting cv26 to 6 will enable single-storey a.

Caution : Certain software may limit the quantity of OpenType features and drop some of them if the feature list is too long. Please validate your feature configuration to ensure that it worked in your software.

And I found here, VSC finally became able to configure OpenType font feature, by the setting "editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'". It works for other fonts like Cascadia Code, for example, I could set "editor.fontLigatures": "'calt', 'ss01'" to specify the usage of their alternative glyph sets, but how could I set, for example, CV71 to 4 so that Iosevka has a dot inside glyph 0, according to this table?

Thank you so much for creating this.

@be5invis
Copy link
Owner

be5invis commented Jul 8, 2022

"editor.fontLigatures": "'cv01' 1, 'cv02' 2, ..."

@be5invis
Copy link
Owner

be5invis commented Jul 8, 2022

But note that: Harfbuzz (the thing Chromium used to interpret OT features) have bugs that doesn't support too "long" feature list, so be careful.

@lethefrost
Copy link
Author

"editor.fontLigatures": "'cv01' 1, 'cv02' 2, ..."

But note that: Harfbuzz (the thing Chromium used to interpret OT features) have bugs that doesn't support too "long" feature list, so be careful.

@be5invis Thank you so much for clarifying! Would you consider putting this instruction into the README file so that maybe people like me would not be confused about the usage anymore?

@be5invis
Copy link
Owner

In the website there's already an interactive section that shows how to use CV/SS in CSS.

@be5invis
Copy link
Owner

image

@sh1boot
Copy link

sh1boot commented Jul 31, 2023

I had the same question about something that was not CSS-based, but eventually I figured it out for myself.

I don't know if it's worth documenting as a part of this project, but since Google brought me here I'll just paste what [I think] I have figured out.

These all change the style of the & character to one that looks more like Et, and enables the thousand-separator feature if the software happens to support it.

~/.config/fontconfig/fonts.conf (this works on foot, not sure what else):

    <match target="pattern">
         <test name="family" compare="contains"><string>Iosevka</string></test>
         <edit name="fontfeatures" mode="append">
             <string>cv96=8</string>
             <string>THND</string>
         </edit>
     </match>

~/.config/foot/foot.ini:

font=Iosevka Term:size=10:fontfeatures=cv96=8,THND

(don't expect THND to do anything in foot)

~/.config/kitty/kitty.conf

font_features Iosevka-Term cv96=8 +THND

Are these actually right? I don't know. They seem to work with limited testing, but there may be nuance.

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

No branches or pull requests

3 participants