Free monospace font for 𝐀 etc

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

1 Like

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.

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

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?

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.

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.

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 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.

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

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.

1 Like

https://github.com/naver/d2codingfont

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

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

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

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…)

1 Like

Can you provide example code?

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

Edit

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

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… ¯\_(ツ)_/¯ :slight_smile:

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?

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

sample_text

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

You could raise a question like this on the Redirecting to Google Groups
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.

1 Like

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

1 Like

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

1 Like