tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
76.87k stars 3.09k forks source link

Removal of fonts from `master` branch causes issues where hard coded. #1276

Closed ClashTheBunny closed 3 years ago

ClashTheBunny commented 3 years ago

I've been using FiraCode for a few years on my chromebook and it just stopped working. Lo and behold, your latest couple commits just removed it from the repo. I tried to find a way to get to the files directly from CSS, but couldn't figure out a place that has direct file access for the latest version. What I eventually ended up doing was to set the CSS to the 5.2 tag. I assume that Google, in all their infinite wisdom, didn't expect people with custom CSS set up to need to edit it after adding a "fancy" control panel, and only left in the old javascript adder/getter methods. This also means that they don't have a good way of editing the previously working fonts that still existed on the master branch. I had to do CTRL-ALT-T followed by CTRL-SHIFT-J and then run the following javascript in the console REPL:

term_.prefs_.set('user-css-text', `@font-face{\n    font-family: 'Fira Code';\n    src: url('https://raw.githubusercontent.com/tonsky/FiraCode/5.2/distr/woff2/FiraCode-Regular.woff2') format('woff2'),\n         url('https://raw.githubusercontent.com/tonsky/FiraCode/5.2/distr/woff/FiraCode-Regular.woff') format('woff'),\n         url('https://raw.githubusercontent.com/tonsky/FiraCode/5.2/distr/ttf/FiraCode-Regular.ttf') format('truetype');\n    font-weight: normal;\n    font-style: normal;\n}\n\n* {\n    -webkit-font-feature-settings: "liga" on, "calt" on;\n    -webkit-font-smoothing: antialiased;\n    text-rendering: optimizeLegibility;\n    font-family: 'Fira Code';\n}`)

Could the releases from now on have individual files that can be referenced from CSS and not just a zip? Would it be possible to keep the fonts in the repo for historical usage like the above, so that people who have master hardcoded in an inconvenient place won't all have their terminals break?

ClashTheBunny commented 3 years ago

I updated all of the wiki pages referencing master to reference 5.2: https://github.com/tonsky/FiraCode/search?q=https%3A%2F%2Fraw.githubusercontent.com%2Ftonsky%2FFiraCode&type=wikis

thiagowfx commented 3 years ago

Same issue here.

Is there an up-to-date source we could use, even if in another (non-official) repo? Ideally we should be able to use fonts from ChromeOS Secure Shell App even beyond v5.2. It's a bit of a bummer we cannot download custom fonts to ChromeOS, having to always fetch them, but that's the way it works today.

tonsky commented 3 years ago

Probably not a good idea to link to master. Even before removal, fonts got borken there from time to time.

I suggest CDN (https://cdn.jsdelivr.net/gh/tonsky/FiraCode@5.2/distr/fira_code.css is mentioned in the README) or Google Fonts.

If for some reason it doesn’t work, let me know, we’ll discuss it further.

thiagowfx commented 3 years ago

Thanks! Updated accordingly. Here's one example diff with Google Fonts for others who run into this: https://github.com/thiagowfx/.dotfiles/commit/0348bd5057d633e90698edc5d7ebb430dd8b7c91

ClashTheBunny commented 3 years ago

Updated the wiki for chromeos: https://github.com/tonsky/FiraCode/wiki/ChromeOS-Terminal/_compare/8fd49606c6031614f2714d75f29032c5564d68e2...7a7e359eb972097ead41c38fde8ff12eef0b6349 to match how https://github.com/wernight/powerline-web-fonts#usage-example-for-crosh-window configures it.

ClashTheBunny commented 3 years ago

They are also hard coded in the wiki install instructions: https://github.com/tonsky/FiraCode/wiki/Installing