Top
Best
New

Posted by remywang 2 days ago

GNU Unifont(unifoundry.com)
342 points | 78 comments
phkahler 2 days ago|
We use GNU Unifont in Solvespace for the text window/property browser. It's built right into the executable. This turned out to be amazingly useful. Some people have CJK stuff in their designs and it "just works" on all platforms. I was also looking into hole annotations in CAD and was pleased to see the symbols for counter-bore and counter-sink are both already there in unifont.

You can see unifont in the experimental web version here: https://cad.apps.dgramop.xyz/

stn8188 2 days ago||
Wow, the web version is neat in its simplicity! Thank you for the work on Solvespace. It's far and away my favorite MCAD program and always my first go-to when I need to crank out a quick fixture to test PCBs. It's really so pleasant and easy to work with as long as my geometry is relatively basic (which it almost always is given my limited scope of work with mechanical design). I'm sorry I don't have any comments on the relevant topic of the fonts, just was excited to see Solvespace mentioned.
hackshack 2 days ago||
+1; thanks from another satisfied user. I have an annual SOLIDWORKS plan, but SolveSpace is my go-to for quick stuff. It makes CAD fun. There is a clarity of design behind the software that gives it a zen-like feel.
graypegg 2 days ago|||
That's such a cool effect from just the choice of font. (Though I guess there are countless human hours spent on unifont and unicode as a whole)

But I love the idea that even if your bronze age CAD guy wrote all the solid names in Linear A, no problem!

somat 2 days ago|||
That web version is very neat. Solvespace is by far my favorite cad, it ls hard to explain exactly why because it really is quite limited compared to other cad packages, but I think it is mainly because of the fluidity and shear joy of operation while expressing constraints.

One of these days I need to dive into the code and figure out a replacement for the modal "can not create constraint" dialogs as those are the worst part of the whole experience.

torstenvl 1 day ago||
This is awesome!

(Just so you know, RTL doesn't work. حبيبي comes out as ي ب ي ب ح. See https://imgur.com/a/HiXxqZ2 )

ripe 2 days ago||
For others who might be as confused as me:

GNU Unifont is a bitmap font. It provides a fixed glyph for every code point in the BMP. It also covers additional code points in other planes.

I am guessing this is useful for writing editors that can edit Unicode text without knowing anything about various languages and their conventions. Authors who try to use this font to compose documents in (say) devanagari will have to learn the Unicode characters "in the raw", because I don't see a shaper for devanagari, so they won't get feedback that looks like real text.

If anyone can explain this better, please do!

eviks 2 days ago||
and BMP in this context is not BitMap, but Unicode Basic Multilingual Plane (BMP) of the first 65,536 code points of the Unicode
Sharlin 2 days ago||
Amusingly, here it is also BitMap [1]. Why they use an obsolete noncompressed proprietary format instead of PNG I don't know.

Edit: looks like it's because BMP supports 1-bit packed pixels and ~~PNG doesn't~~ (Edit to edit: this is wrong). The file sizes are almost identical; the 8x difference in the number of bits is exactly balanced by PNG compression! On the other hand, PBM [2] would've been a properly Unixy format, and trivial to decode, but I guess "the browser knows how to render it" is a pretty good argument for BMP. macOS Preview, BTW, supports all the NetPBM formats, which I did not expect.

[1] eg. https://unifoundry.com/pub/unifont/unifont-17.0.03/unifont-1...

[2] https://en.wikipedia.org/wiki/Netpbm

eviks 2 days ago|||
Maybe they set everything up before png was popular and never changed the workflow since then (or didn't care about the website to adjust anything)? After all, the PNG is only about 2 years younger than the font
Sharlin 2 days ago||
That's plausible. Or maybe they just liked the BMP vs. BMP coincidence.
sltkr 2 days ago|||
> Edit: looks like it's because BMP supports 1-bit packed pixels and PNG doesn't. The file sizes are almost identical

That's nonsense, PNG supports 1-bit pixels just fine, and the resulting file is a lot smaller (when using ImageMagick):

    $ file unifont-17.0.03.bmp 
    unifont-17.0.03.bmp: PC bitmap, Windows 3.x format, 4128 x 4160 x 1, image size 2146560, resolution 4724 x 4724 px/m, 2 important colors, cbSize 2146622, bits offset 62
    $ magick unifont-17.0.03.bmp unifont-17.0.03.png
    $ file unifont-17.0.03.png 
    unifont-17.0.03.png: PNG image data, 4128 x 4160, 1-bit grayscale, non-interlaced
    $ wc -c unifont-17.0.03.*
    2146622 unifont-17.0.03.bmp
     878350 unifont-17.0.03.png
    3024972 total
Sharlin 2 days ago||
Thanks! I definitely should've double-checked. Apparently it was just the image viewer that didn't bother converting the 1-bit BMP to 1-bit PNG.
kristianp 2 days ago||
Does that mean there is a separate file for each point size?

I'm realising I know very little about fonts.

Kwpolska 2 days ago||
Nah, there’s just one size in this case (16x16).
nycticorax 2 days ago||
Shouldn't the first sentence on that website describe what GNU Unifont actually is? I guess it's a single copyleft font designed to have coverage of all (or nearly all?) unicode code points?
adrian_b 2 days ago||
Well, the second and the third sentence describe very precisely what Unifont is:

"This page contains the latest release of GNU Unifont, with glyphs for every printable code point in the Unicode Basic Multilingual Plane (BMP). The BMP occupies the first 65,536 code points of the Unicode space, denoted as U+0000..U+FFFF."

This is suitable as a last resort font, which should display any character for which no match was found in the other available fonts.

This is normally preferable to a last resort font that just displays the number of a character not available in your preferred fonts.

modeless 2 days ago|||
No mention there of the fact that this is a bitmap font. I think that's kind of important.
crazygringo 2 days ago||
Indeed. Plus basic facts like: is it serif or sans? Proportional or monospace? Designed for GUI interfaces, terminals, or print? I still don't know.

Just showing a single screenshot of it in its intended use would go a long way.

I clicked on one of the charts and had no idea if the font itself was bitmap, or if it had just been rendered at a tiny size without antialiasing.

notpushkin 2 days ago|||
> Designed for GUI interfaces, terminals, or print?

Given it’s a last resort font, I think it doesn’t make too much sense for print (unless you’re printing something that could be in any possible language).

crazygringo 2 days ago||
Saying a font is designed for print doesn't mean it's for literal professional printing.

It just indicates that the x-height isn't increased the way it often is for a font designed specifically for screens, and that you can have finer details like serifs and thinner strokes. It just means it's intended for high-resolution viewing.

01HNNWZ0MV43FF 2 days ago||||
Yeah I thought maybe the "uni" in "unifont" meant it was a single font that would morph between serif and sans somehow. I guess it stands for "unicode", from an era when Unicode support was not table stakes.
Kwpolska 2 days ago||
While virtually all fonts support characters outside of ASCII, there are few fonts that support all of Unicode. Unifont aims to be one of them.
user_7832 1 day ago|||
Unfortunately I’ve often seen such things in tech - the more “purist” or deep or nerdy something is, the worse he explanations, UX/UI, and explanations.

A GitHub readme for some software that sells a subscription (or is meant for “average” users) will have way more explanations and screenshots than something that’s more technical. HN has a “leaner” (worse for mobile) interface than old reddit, while both are way better than new reddit.

And god help you if you want to understand the chain of context on a Linux mailing list (email?) thread. “What, you’re not savvy enough to know the arcane and totally unintuitive stuff we use to format and can’t make sense of it? Too bad, sounds like user error.”

Yeah this turned into a rant, but seriously, little polish goes a long way in usability.

charlieyu1 2 days ago|||
I don’t think covering only BMP is enough these days
account42 6 hours ago||
That's why it doesn't cover only the BMP.
hnfong 2 days ago|||
Note that "nearly all" isn't "all". I have some side project that require rendering of very uncommon CJK characters, and Unifont does not display them as expected. (For that project, I used https://kamichikoichi.github.io/jigmo/ which was the font that was most complete in terms of CJK glyphs )

Unifont seems to have about the same glyph coverage as my system default CJK font (unfortunately I don't know what it is).

syncsynchalt 2 days ago||
Do you know if those characters are in supplemental planes? The BMP would only be glyphs from U+0000 through U+FFFF (though the first 32 and last two aren't printable, and wouldn't be included in this font).

Another example would be emoji, which would probably now be considered "basic" by most people but have always been in a supplemental plane.

amake 2 days ago||
Lots of the rarer CJK ideographs are outside the BMP.
runarberg 2 days ago||
This was actually the first issue for my kanji learning app

https://github.com/runarberg/shodoku/issues/1

A classic utf-16 bug, where I failed to grab the two remaining bytes of these ideographs.

jayde2767 2 days ago|||
I was also confused, until I clicked “Home” and realized the link was not to the landing page.
Suppafly 2 days ago|||
>Shouldn't the first sentence on that website describe what GNU Unifont actually is?

Tons of these open source projects have the same issue.

leephillips 2 days ago||
https://lee-phillips.org/ghparty
IvyMike 2 days ago||
> GNU Unifont is part of the GNU Project. This page contains the latest release of GNU Unifont, with glyphs for every printable code point in the Unicode Basic Multilingual Plane (BMP)

I mean that's pretty close no?

smlacy 2 days ago|||
Still doesn't exactly say what it is? I get that it's glyphs for printable characters, but honestly it could be a PDF, video, collection of PNGs or SVG files, an Adobe Illustrator file, a linux distribution, a web browser, or pretty much any other piece of software or data format. I presume it's a TTF or OTF font file?
mariusor 2 days ago||
It's a bitmap font: https://en.wikipedia.org/wiki/Computer_font#BITMAP
onetom 1 day ago|||
no. as others have stated too, the following should be mentioned

- what's the 2 meaning in BMP

- it's designed as a monospaced (or proportional?) bitmap font

- designed in a single 16x16 size only (or also 8x16? it's a bit unclear)

- provided as an OTF/TTF font format, which can be scaled by most font rendering engines to other sizes, but u need antialiasing to make it look smooth (this is mentioned, but under the download section only)

- use as a "last resort" default font, according to wikipedia at least

edent 2 days ago||
It also looks beautiful when printed out - I made it into a spiral which hangs on my wall.

https://shkspr.mobi/blog/2022/07/the-mostly-complete-unicode...

pilaf 2 days ago||
That's awesome, what size did you print it?

Are the random sparse Chinese characters floating around the main spiral a natural part of Unicode, or did you put them there for effect? I like how the whole thing looks like a galaxy and those characters like background space debris.

I also like how emoji fall neatly around the outer rim. I had fun finding the Earth emoji.

n2h4 2 days ago||
your blog is really cool
TheRealPomax 2 days ago||
The problem with Unifont is that is was never designed to actually support real text, it just has glyph support. So if you need "it can do every language I might want, while looking pretty good" you're far better off with the (much newer) family of NoTo fonts, which aren't just free to use, but explicitly use the modern SIL Open Font License.
duskwuff 2 days ago||
Noto is also a scalable font with multiple weights and styles (e.g. bold, italic, etc). Unifont is a 16-pixel bitmap with no styles, so it's only really usable at one size (or maybe two if you want 32px text).
shiomiru 2 days ago|||
> which aren't just free to use, but explicitly use the modern SIL Open Font License.

Unifont is also dual-licensed under GPLv2/SIL OFL.

ErroneousBosh 2 days ago|||
The only problem with the Noto fonts (installed in Ubuntu for example by default) is that now you have to scroll through hundreds of useless squiggle fonts in your font picker.
TheRealPomax 21 hours ago||
That's not a problem, that's a learning opportunity.
foxrider 2 days ago||
Yeah, I can't really speak well about other languages, but these Armenian letters look really rough.
ErroneousBosh 2 days ago|||
They all look really rough. It's like a font from a 1980s home computer.
Kwpolska 2 days ago|||
The Latin letters look rough too.
swiftcoder 2 days ago||
> Unifont only stores one glyph per printable Unicode code point. This means that complex scripts with special forms for letter combinations including consonant combinations and floating vowel marks such as with Indic scripts (Devanagari, Bengali, Tamil, etc.) or letters that change shape depending upon their position in a word (Indic and Arabic scripts) will not render well in Unifont. In those cases, Unifont is only suitable as a font of last resort. Users wishing to properly render such complex scripts should use full OpenType fonts that faithfully display such alternate forms.

An important caveat, that while this is potentially a useful fallback font to at least something for unknown glyphs, without any sort of combining/shaping, it's not going to usefully render a whole bunch of languages (i.e. languages like Arabic will be a disaster)

sundarurfriend 1 day ago|
And just in case the wording "special forms" makes someone think these are edge cases or just fancy-but-non-essential ligature type stuff, these are basic core syllables and sounds in these languages that go from their familiar form to a form where you have to mentally do some detective work to figure out what's being said. 1t'5 1!k3 !f 3v3ry 0th3r w0r<| w@5 wr!tt3n l!k3 th!5. (Not a great analogy but it's the best I got.)
ekjhgkejhgk 2 days ago||
You know, when I see GNU, I don't necessarily think it's the best software in all dimensions, but it's almost the best in terms of respecting its users.
magios 2 days ago||
i use this font system wide, forced as the only font in firefox, with web or downloadable fonts disabled. i also have my some of my own characters in csur, the conscript unicode registry, that is mapped to u+e000 thru u+f8ff so the unicode codepoints used by random webpages for various glyphs show up as my own. qt is a pain to use sometimes with unifont only but iirc QT_FONT_DPI=128 environment variable fixes that. i just wish i could get unifont only to work in games like rimworld.
oconnore 2 days ago||
Why do you do this?
magios 2 days ago||
because i prefer monospaced pixel fonts, tho the underlying engine requires the ttf and now otf font, which is a vector format in order to render.
luqtas 2 days ago||
how can you? i just installed it and i had to bring HN to 200% zoom... the rest of my system (XFCE) feels somewhat OK with it
magios 2 days ago||
i use 1920x1080 screen res as i see no point to any higher res.
aidenn0 2 days ago||
I had to uninstall unifont to get nice looking CJK fonts in Firefox; somehow the font-fallback for my font was picking unifont over all of the other fonts installed...
adrian_b 2 days ago||
The right way to solve your problem is to go to Firefox Settings/Language and Apperance/Fonts, then click on "Advanced".

There you can set what fonts should be used by Firefox to display each script/language, including Chinese, Japanese and other CJK variants.

If you do not configure this, then it is indeed unpredictable which fonts will be used by Firefox to render the Web pages, unless it can match exactly a font requested by the page.

Elfener 2 days ago||
I've reproduced issues with Unifont's glyphs being invisible in firefox and chrome (at different times, on what seems like certain versions), with much confusion. There are a few issues on the nixpkgs issue tracker about this, including one about Noto Color Emoji doing the same thing.

I love fonts...

remywang 2 days ago|
I also made some fonts for playdate based on unifont: https://github.com/remysucre/cuniform
More comments...