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

Flycheck incompatible with fonts containing dashes in the fontname #6065

Closed
maerten opened this issue May 16, 2016 · 7 comments
Closed

Flycheck incompatible with fonts containing dashes in the fontname #6065

maerten opened this issue May 16, 2016 · 7 comments
Labels
macOS stale marked as a stale issue/pr (usually by a bot) Syntax-checking To be reproduced

Comments

@maerten
Copy link

maerten commented May 16, 2016

Description

Flycheck gives me an error in Spacemacs on OS X El Capitan:

Flycheck error display error: (error Invalid font name: --Inconsolata-dz for Powerline-normal-normal-normal--12 .... etc

After searching a bit around, the only solution I found was to rename the font on the system, or use it as the default Monospace font.
Please let me know if you need any more information or if there is any way I can help.

Reproduction guide

  • Start Emacs
  • Install font Inconsolata-dz for Powerline and set as the font
  • Activate flycheck and try to get it to display a popup with syntaxchecking message

Observed behaviour:
Flycheck doesn't display a popup, but instead gives the error in the statusbar:

Flycheck error display error: (error Invalid font name: --Inconsolata-dz for Powerline-normal-normal-normal--12 .... etc

Expected behaviour:
Expected behavior woudl be to see a flycheck popup with the syntaxchecking message

System Info

  • OS: darwin
  • Emacs: 24.5.1
  • Spacemacs: 0.105.20
  • Spacemacs branch: master (rev. 9c7250a)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(auto-completion markdown emacs-lisp git osx haskell-mode git-gutter-fringe  syntax-checking flycheck flycheck-hdevtools js2-mode handlebars-mode
                 (haskell haskell-enable-shm-support f)
                 ujelly-theme stylus-mode php-mode flymake-php scss-mode flymake-sass)

Backtrace

BACKTRACE IF RELEVANT
@maerten
Copy link
Author

maerten commented May 16, 2016

According to the maintainer of flycheck it is probably not an issue with flycheck itself; flycheck/flycheck#967

@StreakyCobra
Copy link
Contributor

The font is probably not listed as Inconsolata-dz in your system as - is used for separating fields in the font specification.

On linux you can get the list with fc-list | grep Inconsolata and select the one you want, it usually contain spaces, as in Inconsolata for Powerline for instance. I can't help you for OS X though.

@maerten
Copy link
Author

maerten commented May 16, 2016

Hi, so I get this output:

$ fc-list : |grep -i inconsolata
/Users/maarten/Library/Fonts/Inconsolata-dz.otf: Inconsolata\-dz:style=dz
/Users/maarten/Library/Fonts/Inconsolata-dz-Powerline.otf: Inconsolata\-dz for Powerline:style=dzForPowerline

some more details with fc-list -v

Pattern has 22 elts (size 32)
    family: "Inconsolata-dz for Powerline"(s)
    familylang: "en"(s)
    style: "dzForPowerline"(s)
    stylelang: "en"(s)
    fullname: "Inconsolata-dz for Powerline"(s)
    fullnamelang: "en"(s)
    slant: 0(i)(s)
    weight: 100(i)(s)
    width: 100(i)(s)
    spacing: 100(i)(s)
    foundry: "unknown"(s)
    file: "/Users/maarten/Library/Fonts/Inconsolata-dz-Powerline.otf"(s)
    index: 0(i)(s)
    outline: True(s)
    scalable: True(s)
    charset: 
        (.....)
    lang: aa|ay|bi|br|bs|ch|co|cs|da|de|en|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|io|is|it|lb|mg|nb|nds|nl|nn|no|nr|nso|oc|om|pl|pt|rm|sk|sl|sma|smj|smn|so|sq|ss|st|sv|sw|tk|tl|tn|tr|ts|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|ms|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
    fontversion: 66191(i)(s)
    fontformat: "CFF"(s)
    decorative: False(s)
    hash: "sha256:2d0d9649aa7f386562e8ad24f4ff5c26ccabe6420e536d7db87823edef295e66"(s)
    postscriptname: "Inconsolata-dzForPowerline"(s)

I don't see any names without the dash unfortunately. I tried using "dzForPowerline" but that doesn't work, spacemacs reverts to the default Monaco font.
Also prefixing the dash with a backslash doesn't solve the problem unfortunately.

Perhaps i'll just try to rename the font.

@StreakyCobra
Copy link
Contributor

Ok, I don't know how to handle such cases then, sorry.

@JP-Ellis
Copy link
Contributor

I can confirm this issue exists also on Linux. I believe that the error is with FlyCheck though as it appears to be independent on the default font within Spacemacs.

In my case, I'm trying to use Inconsolata-g and I get the same error:

Flycheck error display error: (error Invalid font name: -PfEd-Inconsolata-g-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1)

I load the font with:

   dotspacemacs-default-font '("Inconsolata-g"
                               :size 24
                               :weight normal
                               :width normal
                               :powerline-scale 1.1)

I have tried escaping the - as well with "Inconsolata\-g" which Spacemacs loads fine, but FlyCheck still has the same error. I have tried to double escape the dash with "Inconsolata\\-g", and this time Spacemacs doesn't like it.

In both cases, FlyCheck has the same error message. As a result, I started suspecting that FlyCheck was getting the font from somewhere else and indeed it seems to be the case. I changed my default monospace font on my system (within Gnome Tweak Tools) to Fira Code, and FlyCheck no longer has the issue, despite Inconsolata-g still being used by Spacemacs.

@sid-kap
Copy link
Contributor

sid-kap commented Dec 19, 2016

@JP-Ellis The only solution I know of is renaming the font to something that doesn't contain a hyphen. I wrote a StackExchange answer that accomplishes this using Python fonttools.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS stale marked as a stale issue/pr (usually by a bot) Syntax-checking To be reproduced
Projects
None yet
Development

No branches or pull requests

4 participants