# Free monospace font for 𝐀 etc

**URL:** <https://discourse.julialang.org/t/free-monospace-font-for-etc/19058>\
**Category:** Tooling\
**Tags:** question\
**Created:** [December 28, 2018, 11:17am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058 "2018-12-28T11:17:52Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 28, 2018, 11:17am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/1 "2018-12-28T11:17:52Z")

</div>

I am looking for a free monospace font that supports the Unicode chars starting at `#x1D400`, eg 𝐀 (`\bfA`). I am using [Iosevka](http://typeof.net/Iosevka/) for my main font in Emacs, just need it as a fallback for chars which are not available.

---

<div class="post-metadata">

**Author:** ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Post date:** [December 28, 2018, 1:46pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/2 "2018-12-28T13:46:24Z")

</div>

DejaVu Sans Mono has them.

Edit: for the record, my mistake here arose from the fact that when one specifies a font in the Gnome character map application, it defaults to showing glyphs from _other_ fonts.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 28, 2018, 1:59pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/3 "2018-12-28T13:59:10Z")

</div>

I don’t think so, at least version 2.37-1 (Ubuntu package) doesn’t (that glyph is empty). Where did you get yours?

---

<div class="post-metadata">

**Author:** ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Post date:** [December 28, 2018, 2:26pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/4 "2018-12-28T14:26:22Z")

</div>

That’s strange; I have fonts-dejavu-core and fonts-dejavu-extra 2.37-1 on Debian and they look fine here.  
Do you also have the -extra package?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 28, 2018, 2:33pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/5 "2018-12-28T14:33:26Z")

</div>

> [@Ralph\_Smith](#):
>
> they look fine here

What are you using to determine that? Could be a fallback.

If you open `/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf` in eg `fontforge`, the glyph for `#x1D400` is empty, and the same for almost all codepoints in the block.

In Emacs, use `M-x describe-char` to see which font provided the fallback.

---

<div class="post-metadata">

**Author:** ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Post date:** [December 28, 2018, 2:41pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/6 "2018-12-28T14:41:52Z")

</div>

I think you’re right, although it looks like an extension rather than a fallback: emacs says

```
xft:-unknown-DejaVu Math TeX Gyre-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x1EA)

```

which presumably comes from the fonts-texgyre package.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 28, 2018, 2:54pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/7 "2018-12-28T14:54:43Z")

</div>

Yes, that’s the default fallback (see `M-x describe-fontset fontset-default`). I am using `DejaVu Serif` as a fallback instead, which is also proportional but is more condensed.

Monospace support for [Mathematical Alphanumeric Symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols) seems to be nonexistent (apart from some low-quality fonts and GNU Unifont, which is a bitmap font).

I thought that Julia programmers are most likely to use these characters, which is why I asked here.

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [December 28, 2018, 3:03pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/8 "2018-12-28T15:03:19Z")

</div>

Doing Math symbols in a monospaced font is hard, even commercial fonts don’t have this option.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 28, 2018, 4:11pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/9 "2018-12-28T16:11:39Z")

</div>

Possibly, but also the lack of demand (programming languages which allow a lot of Unicode in code). Julia is, again, ahead of most of the crowd here.

This is just a minor issue though, stuff does not align but I can live with this.

---

<div class="post-metadata">

**Author:** ![YongHee-Kim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yonghee-kim/32/5965_2.png) [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Post date:** [December 29, 2018, 3:25am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/10 "2018-12-29T03:25:13Z")

</div>

[https://github.com/naver/d2codingfont](https://github.com/naver/d2codingfont)

I’m using D2coding for my editor.  
It includes korean, english +additional 332 letters.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 29, 2018, 8:46am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/11 "2018-12-29T08:46:36Z")

</div>

Not sure why you suggested this font, as it does not seem to have _any_ glyphs in the `U+1D400`–`U+1D7FF` range.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 29, 2018, 11:10am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/12 "2018-12-29T11:10:55Z")

</div>

I can find only a few fonts that have these characters (at least according to the handy UltraCharacterMap app.)

 ![09](https://global.discourse-cdn.com/julialang/original/3X/3/4/3463de4f24a29e5facf615226d099295c01bbbcb.jpeg)

Asana and Stix look like good bets.

(I tried to get these output via Cairo.jl, but didn’t succeed, not sure why I can’t…)

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [December 29, 2018, 1:18pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/13 "2018-12-29T13:18:32Z")

</div>

Can you provide example code?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 29, 2018, 1:30pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/14 "2018-12-29T13:30:48Z")

</div>

Yes, I’ll do that later today. I’ll try both the Toy API and the “other” API this time.

### Edit

```julia-auto
using Cairo

c = CairoRGBSurface(256,256)
cr = CairoContext(c)

save(cr)
set_source_rgb(cr,0.8,0.8,0.8) # light gray
rectangle(cr,0.0,0.0,256.0,256.0) # background
fill(cr)
restore(cr)

# Toy API
select_font_face(cr, "Sans", Cairo.FONT_SLANT_NORMAL, Cairo.FONT_WEIGHT_BOLD)
#select_font_face(cr, "Asana-Math", Cairo.FONT_SLANT_NORMAL, Cairo.FONT_WEIGHT_BOLD)
set_font_size(cr, 30.0)
move_to(cr, 10.0, 110.0)
show_text(cr, string("1> ", Char(0x203d)))
move_to(cr, 10.0, 150.0)
show_text(cr, string("2> ", Char(0x1D400)))

# 'pro' API
set_font_face(cr, "Sans 16")
set_font_face(cr, "Asana-Math 16")
Cairo.text(cr, 100.0, 110.0, string("3> ", Char(0x203d)))
Cairo.text(cr, 100.0, 150.0, string("4> ", Char(0x1D400)))
Cairo.text(cr, 100.0, 180.0, "5> 𝐀")

write_to_png(c, "/tmp/sample_text.png")

```

 ![sample_text](https://global.discourse-cdn.com/julialang/original/3X/7/f/7f2a340c398374617d0bd3578dd4c0c0f0b43f50.png)

### Yet another edit

Wait, it works if I specify the font name differently, not using its PostScript name (“Asana Math”). I wish I understood it all… ¯\_(ツ)\_/¯ 🙂

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [December 29, 2018, 4:28pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/15 "2018-12-29T16:28:06Z")

</div>

I was about to write that. Your example looks like the interfaces work, but you miss to address the correct font. In the simple interface it looks like 203d is found and displayed, in the pango text the missing 1d400 is replaced by id-tag.

Finding fonts by name or similar is a nightmare on every architecture.

But i read you correctly: Asana Math contains the 1d400?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 29, 2018, 4:31pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/16 "2018-12-29T16:31:59Z")

</div>

Yes, using the “pro” API I could draw those characters specifying the correct font “Asana Math”:

![sample_text](https://global.discourse-cdn.com/julialang/original/3X/5/a/5a024f623d00908336bb3e9fe71d52fff233eb0c.png)

The “toy” API draws 203d only if I specify “AsanaMath”. 🙂

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [December 30, 2018, 9:09am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/17 "2018-12-30T09:09:41Z")

</div>

> [@Tamas\_Papp](#):
>
> Possibly, but also the lack of demand (programming languages which allow a lot of Unicode in code).

You could raise a question like this on the [Redirecting to Google Groups](https://groups.google.com/forum/#!forum/googlefonts-discuss)  
Google tries/tried hard to achieve good unicode coverage on the fonts they support, maybe you raise some interest by a designer to work on that.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 30, 2018, 9:46am UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/18 "2018-12-30T09:46:09Z")

</div>

Great idea, I posted there and will link it here once it clears moderation.

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [December 30, 2018, 11:11pm UTC](https://discourse.julialang.org/t/free-monospace-font-for-etc/19058/20 "2018-12-30T23:11:54Z")

</div>

I have Symbola as a fallback, it does 𝐀 (`\bfA`) just fine. I also need to set a wide letter space to see them.
