# Interesting Font for Code

**URL:** <https://discourse.joplinapp.org/t/interesting-font-for-code/5513>\
**Category:** Lounge\
**Created:** [29 January 2020 21:12 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513 "2020-01-29T21:12:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpoulton](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/dpoulton/32/30800_2.png) [@dpoulton](https://discourse.joplinapp.org/u/dpoulton)\
**Post date:** [29 January 2020 21:12 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/1 "2020-01-29T21:12:09Z")

</div>

Back in May19 @bladewolf55 mentioned in a post the font [Fira Code](https://github.com/tonsky/FiraCode/releases/tag/2). This was recently highlighted by @bedwardly-down on [GitHub](https://github.com/laurent22/joplin/issues/2399) who suggested I post this on the forum.

Basically using this font as your editor font, as well as in `userstyle.css` as a font for code blocks, adds quite a lot of interesting functionality to Joplin. I guess that this is because the editor and renderer Joplin uses is equipped to handle this type of font.

It enables you to use ligatures in your code. Rather than using `<=` or `~=` the editor / font combo changes the text to the proper notation. Below is a graphic showing some “translations”.

 ![firacode](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/a/a2b556e26a21443ace92e8f150e84128e8b7b9f2.png)

You can use settings to apply it as your editor font by specifying “Fira Code” as your editor font after installing the it (available as either .ttf & .otf). It’s unlikely you will want it as your base / body font for rendered notes as it is monospace, but if you use inline code or code blocks, adding it to your `userstyle.css` means that your notes will use the ligatures as well.

```css
code {
font-family: "Fira Code";
}

```

Below is a screenshot where I have **NOT** used the font as the editor font but applied it to my `userstyle.css` for the element `code`.

![pre](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/c/c79ca331188a60a049205bcd5d604dcde281cf5e.png)

Here is where it has been applied to both the editor and the rendered pane.

![post](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/b/b5656800bd2be7a7d2e18acb59c1976a914096d5.png)

Sure it is a bit specialised, but for some I am sure it would be very useful.

Finally, even if you do not use it for ligatures it is a very nice and readable editor font.

---

<div class="post-metadata">

**Author:** ![bladewolf55](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/bladewolf55/32/1514_2.png) [@bladewolf55](https://discourse.joplinapp.org/u/bladewolf55)\
**Post date:** [29 January 2020 22:56 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/2 "2020-01-29T22:56:35Z")

</div>

Nice to see this. I like adding the font to the Markdown stylesheet, it looks good.

Another good developer font with ligatures that recently came out is JetBrains Mono. It seems thoughtfully designed; I’m liking it so far, especially the classic not-equals sign.

> **[JetBrains Mono: A free and open source typeface for developers](https://www.jetbrains.com/lp/mono/)**
>
> Try JetBrains Mono in your IDE. Its simple forms and attention to every detail make coding a nice experience for developers’ eyes, no matter which IDE you choose.

![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/1/13df1d4d82efd34bdd5e08d2e8b42acbe4d32cf8.png)

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [29 January 2020 23:08 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/3 "2020-01-29T23:08:21Z")

</div>

I’ve been using `Fira Code` for about a year now as the editor font. Adding it to the `userstyle.css` for the code blocks is a great idea.

---

<div class="post-metadata">

**Author:** ![navarrothiago](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/navarrothiago/32/5165_2.png) [@navarrothiago](https://discourse.joplinapp.org/u/navarrothiago)\
**Post date:** [29 September 2020 20:01 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/4 "2020-09-29T20:01:00Z")

</div>

Is it possible to enable this ligatures in the body text? Are there any cons?

---

<div class="post-metadata">

**Author:** ![dpoulton](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/dpoulton/32/30800_2.png) [@dpoulton](https://discourse.joplinapp.org/u/dpoulton)\
**Post date:** [29 September 2020 22:36 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/5 "2020-09-29T22:36:45Z")

</div>

@navarrothiago welcome to the forum.

You can use Fira Code as the font for rendered notes. The main "con" would be that it is a [monospaced font](https://en.wikipedia.org/wiki/Monospaced_font) and so not ideal for body text.

---

<div class="post-metadata">

**Author:** ![t0dd](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/t0dd/32/743_2.png) [@t0dd](https://discourse.joplinapp.org/u/t0dd)\
**Post date:** [30 September 2020 14:00 UTC](https://discourse.joplinapp.org/t/interesting-font-for-code/5513/6 "2020-09-30T14:00:21Z")

</div>

I had fun with Fira Code for a while, but usually when I am rendering code, I need it to render as useable code and not with the special glyphs. I.e., the Python language understands `!=` but not a crossed-out equals sign. I suppose what I am trying to say is that Fira Code is more useful for monospaced plaintext than it is for actual code (I think it is misnamed). But it also isn't really monospace either, is it?

I find it more novelty than useful. But, it can be cool to do something like this:

\<style\>  
&nbsp;&nbsp; .fira code { font-family: "Fira Code"; }  
\</style\>

\<div class="fira"\>  
```plaintext  
&nbsp;&nbsp;i \>= 0  
&nbsp;&nbsp;i != 0  
```
