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

Does not pick up FiraCode v2 #1968

Closed
iyzana opened this issue Sep 13, 2019 · 10 comments
Closed

Does not pick up FiraCode v2 #1968

iyzana opened this issue Sep 13, 2019 · 10 comments

Comments

@iyzana
Copy link

iyzana commented Sep 13, 2019

After updating to fira code 2, it does not seem to be picked up by kitty.
Fira Code does not show up in either kitty list-fonts or kitty --debug-font-fallback.
I read in an older issue that kitty looks for fonts with spacing=100 but the new fira-code seems to set spacing=90 (on my system at least).
I'm not sure if kitty is wrong for not picking up the font or if it's FiraCodes fault for setting a wrong spacing, though.
But VsCode and IntelliJ render FiraCode correctly so the font seems to be picked up by the system in general.
Though Konsole and qterminal both too do not pick up the font as monospace.

I also tried running kitty --config NONE -o "font_family=Fira Code" --debug-font-fallback but that didn't change anything.

kitty version: 0.14.4
os: Arch Linux

kiity.conf font_family line:

font_family      Fira Code

Output of fc-list -v FiraCode (limited to the FiraCode-Regular type):

Pattern has 25 elts (size 32)
        family: "Fira Code"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "Fira Code Regular"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(f)(s)
        width: 100(f)(s)
        spacing: 90(i)(s)
        foundry: "CTDB"(s)
        file: "/usr/share/fonts/OTF/FiraCode-Regular.otf"(s)
        index: 0(i)(s)
        outline: True(s)
        scalable: True(s)
        charset: 
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff 7fffffff 00040000 00000000 00000000 f0000000
        0002: 0f000000 00800000 00000000 00000000 00000000 16000000 3f0002c0 00000000
        0003: 00189dff 006000c0 00000024 fcff0000 ffffd7f0 fffffffb ffffffff ffff0003
        0004: ffffffff ffffffff ffffffff 03ffffff fffffc00 ffffffff ffffffff ffffffff
        0005: ffffffff 0000ffff 00000000 00000000 00000000 00000000 00000000 00000000
        0014: 00000420 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        001e: 00000000 00000000 00000000 00000000 4000003f 00000000 00000000 000c0000
        001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
        0020: 77fc0980 06010047 00000410 fff10000 00007fff 26009000 00000000 00000000
        0021: 00480000 00004004 fff80000 00000000 03ff0c00 00000200 c0000000 000007f0
        0022: 46268044 00300b80 00000100 00000037 00000000 0000fffc 00000000 00000000
        0023: 0101007d 000009f3 00000000 00000000 f8000980 00003fff 0000c000 00000000
        0024: ffffffff 0000007f 00000000 00000000 00000000 00000000 00000000 00000000
        0025: ffffffff ffffffff ffffffff ffffffff ffffffff 1444fc0f feefced1 00ff8fbf
        0026: 00070000 1e000001 00000005 00000c69 00000000 00000000 00000000 00000000
        0027: 00080000 00000000 00000000 00000000 00000000 00000002 00000000 ffff0300
        002b: 000000e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00e0: 0000000f 00000000 00000000 00000000 00000000 000f0007 00000000 00000000
        00fe: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 80000000
        01f3: 00010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(s)
        lang: aa|ab|af|av|ay|ba|be|bg|bi|br|bs|bua|ca|ce|ch|chm|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|kaa|ki|kk|kl|ku-am|kum|kv|ky|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|se|sel|sh|shs|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|ty|za(s)
        fontversion: 131072(i)(s)
        capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:latn otlayout:zinh otlayout:zyyy"(s)
        fontformat: "CFF"(s)
        decorative: False(s)
        postscriptname: "FiraCode-Regular"(s)
        color: False(s)
        symbol: False(s)
        variable: False(s)

Shortened output of kitty list-fonts:

DejaVu Sans Mono
    DejaVu Sans Mono
    [...]
Hack
    Hack Bold
    [...]
Nimbus Mono PS
    NimbusMonoPS-Bold
    [...]
Source Code Pro
    Source Code Pro
    [...]
Source Code Variable
    Source Code Variable
    [...]
@iyzana iyzana changed the title Kitty does not pick up FiraCode v2 Does not pick up FiraCode v2 Sep 13, 2019
@kovidgoyal
Copy link
Owner

See https://sw.kovidgoyal.net/kitty/faq.html#kitty-is-not-able-to-use-my-favorite-font

@Luflosi
Copy link
Contributor

Luflosi commented Sep 14, 2019

For some reason FiraCode v2 works on macOS for me. I haven't tested it on Linux though. I find it weird that they would change the spacing between versions. Did you install the package ttf-fira-code using pacman?

@kovidgoyal
Copy link
Owner

spacing is not set by the font. Spacing is calculated from actual glyph
sizes in the font file by fontconfig. So presumably in v2 the font now
has some non monospace glyphs. On macOS, there is no fontconfig, so
kitty just uses font metadata.

@Meakk
Copy link

Meakk commented Sep 17, 2019

@kovidgoyal thanks for your work! Is it possible to tag a new release in order to have kitty updated on Arch? Thanks again.

@Luflosi
Copy link
Contributor

Luflosi commented Sep 17, 2019

You can use kitty-git from the AUR as long as no new version is released.

@kovidgoyal
Copy link
Owner

Or just setup the fonts.conf file as shown in the linked fira code bug
report to override the spacing.

@Meakk
Copy link

Meakk commented Sep 17, 2019

Awesome, thanks!

@polarathene
Copy link

@kovidgoyal I have tried to follow your advice on the FAQ link. However, fc-list and kitty list-fonts do not return the modified spacing for font below. fc-match does:

> fc-match -s monospace:spacing=100 | head -3

NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"
Hack-Regular.ttf: "Hack" "Regular"
<match target="scan">
    <test name="family">
        <string>Noto Sans Mono</string>
    </test>
    <edit name="spacing">
        <int>100</int>
    </edit>
</match>
> fc-list :spacing=100 family

Droid Sans Mono
Fira Code
Source Code Pro,Source Code Pro Light
Twemoji
Fira Code,Fira Code Retina
Bitstream Vera Sans Mono
Source Code Pro,Source Code Pro ExtraLight
Nimbus Mono PS
Fira Mono
Source Code Pro,Source Code Pro Medium
Fira Code,Fira Code Medium
Source Code Pro
Fira Mono,Fira Mono Medium
Hack
Source Code Variable
Fira Code,Fira Code Light
Noto Color Emoji
Source Code Pro,Source Code Pro Black
Noto Mono
Inconsolata
Source Code Pro,Source Code Pro Semibold

I have used fc-cache -fr but that doesn't appear to have done anything.

Any ideas?

@harryaskham
Copy link

I installed Fira Code v2 as root, and had the same problem - I needed 'sudo fc-cache -fr' before the fontconfig changes would let kitty pick up the font.

@polarathene
Copy link

I found the cause eventually. I had a massive cache(thousands of files) that the fc-cache command even with those flags was not clearing, in my home dir I think, after deleting that, I believe configs worked properly

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

No branches or pull requests

6 participants