Sublime Forum

Cannot select desired font face style "Retina" on Linux

#1

Hi,

So I’ve run into a problem. I want to use font face Fira Code with Retina style. However, using the font settings I have not been able to get it. I have tried any combination conceivable of the following:

"font_face": "Fira Code Retina",  // "Fira Code", "FiraCode-Retina", "Fira Code, Fira Code Retina, style=Retina"
"font_options": [],  // ["Retina"], ["retina"], ["style=retina"], ["style=Retina"], [...]

And many more. Nothing seems to work. The only thing that worked was to substitute the Monospace font by name inside /etc/fonts/fonts.conf with:

</fontconfig>
  <match target="pattern">
    <test qual="any" name="family">
      <string>Monospace</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>Fira Code Retina</string>
    </edit>
  </match>
</fontconfig>

and then delibarately misspell the font inside the settings:

// currently overridden from Monospace to Fira Code Retina
// using /etc/fonts/fonts.conf
// so name must be wrong, using "Monospace" directly fails as well
"font_face": "Fire Cod",

as in the above comment, setting the font to Monospace directly also does not work. I have to force SublimeText to fail the search and give me the error:

font face "Fira Cod" could not be found, defaulting to "Monospace"

to make sure the font substitution works.

Any ideas why this is? Looks to me like a bug for the error and a missing feature to support freely named font style.

EDIT: That workaround, however, results in the fonts passed to the plugins to break and default to system serif font. Also, somehow breaks the syntax highligthing for some elements in some languages (e.g. JSON). Thus, I am forced to use the Fira Code (“Fira Code Regular”), which is not optimal for my HiDPi screen.

1 Like

#2

Did you ever figure it out @goliath969? I am currently using Fira Code Light and it works fine. Changing it to Fira Code Retina also seems to work.

0 Likes

#3

@mhenrixon well, it still doesn’t work. If you do sublime.log_commands(True) in console and have "font_face": "Fira Code Retina" in settings, you then get:

reloading settings Packages/User/Preferences.sublime-settings
font face "Fira Code Retina" could not be found, defaulting to "Monospace"

Only Fira Code works. I did manage to get the attention of a dev here - https://github.com/tonsky/FiraCode/issues/641. Unfortunately, that did not help much until now.

0 Likes