The gallant console font got supercharged

hello, world\n

A few days ago I committed src/share/vt/fonts/gallant.hex to -CURRENT. This increased the glyph count from 502 to more than 4500.

This is the Gallant font, as used by the Sun Microsystems SPARCstation console, extended with glyphs for many Unicode blocks. It is a raster font with a 22x12 pixel character cell, descent 5 and ascent 17.
Major additions:
  • Greek
  • Cyrillic
  • International Phonetic Association Extensions
  • Extended Latin characters
  • Zapf Dingbats
  • Tons of arrows
  • Tons of mathematical symbols
  • Letterlike symbols and enclosed alphanumerics
  • Pixel-perfect box drawing
  • Currency symbols
  • More punctuation
  • Just enough Katakana to say コンニチハ
  • Powerline glyphs in the Private Use Area at U+e0a0
I would like to encourage people to load this font and tell me what you think, especially if you can read Greek or Cyrillic (because I can't and may have drawn some funky glyphs there...)
The attached zip contains gallant.fnt which you load with vidcontrol -f /path/to/gallant.fnt
Known issues with vt(4): double width characters outside of CJK show only the left half. This is a bug in vt(4) which uses a simplistic algorithm to determine whether a character is double width, when it should mimick libc's wcwidth(). The font contains them as double width characters. You may start with Markus Kuhn's UTF-8-demo.txt.
To explore, you can list codepoints with my little lscp.c program (also in the zip). It'll show something like this:

$ lscp 0x2a00 0x2a10
U+2a00 1 a ⨀ b N-ARY CIRCLED DOT OPERATOR
U+2a01 1 a ⨁ b N-ARY CIRCLED PLUS OPERATOR
U+2a02 1 a ⨂ b N-ARY CIRCLED TIMES OPERATOR
U+2a03 1 a ⨃ b N-ARY UNION OPERATOR WITH DOT
U+2a04 1 a ⨄ b N-ARY UNION OPERATOR WITH PLUS
U+2a05 1 a ⨅ b N-ARY SQUARE INTERSECTION OPERATOR
U+2a06 1 a ⨆ b N-ARY SQUARE UNION OPERATOR
U+2a07 1 a ⨇ b TWO LOGICAL AND OPERATOR
U+2a08 1 a ⨈ b TWO LOGICAL OR OPERATOR
U+2a09 1 a ⨉ b N-ARY TIMES OPERATOR
U+2a0a 1 a ⨊ b MODULO TWO SUM
U+2a0b 1 a ⨋ b SUMMATION WITH INTEGRAL
U+2a0c 1 a ⨌ b QUADRUPLE INTEGRAL OPERATOR
U+2a0d 1 a ⨍ b FINITE PART INTEGRAL
U+2a0e 1 a ⨎ b INTEGRAL WITH DOUBLE STROKE
U+2a0f 1 a ⨏ b INTEGRAL AVERAGE WITH SLASH



The status so far:

BlockNameStatus
U+0000 - U+007FBasic LatinComplete
U+0080 - U+00FFLatin-1 SupplementComplete
U+0100 - U+017FLatin Extended-AComplete
U+0180 - U+024FLatin Extended-BComplete
U+0250 - U+02AFIPA ExtensionsComplete
U+02B0 - U+02FFSpacing Modifier LettersComplete
U+0300 - U+036FCombining Diacritical MarksComplete
U+0370 - U+03FFGreek and CopticComplete
U+0400 - U+04FFCyrillicComplete
U+0500 - U+052FCyrillic SupplementTODO
U+0530 - U+1CFF...Many foreign alphabets...TODO
U+1D00 - U+1D7FPhonetic ExtensionsTODO
U+1D80 - U+1DBFPhonetic Extensions SupplementTODO
U+1DC0 - U+1DFFCombining Diacritical Marks SupplementTODO
U+1E00 - U+1EFFLatin Extended AdditionalComplete
U+1F00 - U+1FFFGreek ExtendedComplete
U+2000 - U+206FGeneral PunctuationComplete
U+2070 - U+209FSuperscripts and SubscriptsComplete
U+20A0 - U+20CFCurrency SymbolsComplete
U+20D0 - U+20FFCombining Diacritical Marks for SymbolsComplete
U+2100 - U+214FLetterlike SymbolsComplete
U+2150 - U+218FNumber FormsComplete
U+2190 - U+21FFArrowsComplete
U+2200 - U+22FFMathematical OperatorsComplete
U+2300 - U+23FFMiscellaneous TechnicalComplete
U+2400 - U+243FControl PicturesComplete
U+2440 - U+245FOptical Character RecognitionComplete
U+2460 - U+24FFEnclosed AlphanumericsComplete
U+2500 - U+257FBox DrawingComplete
U+2580 - U+259FBlock ElementsComplete
U+25A0 - U+25FFGeometric ShapesComplete
U+2600 - U+26FFMiscellaneous SymbolsPartial
U+2700 - U+27BFDingbatsComplete
U+27C0 - U+27EFMiscellaneous Mathematical Symbols-AComplete
U+27F0 - U+27FFSupplemental Arrows-AComplete
U+2800 - U+28FFBraille PatternsComplete
U+2900 - U+297FSupplemental Arrows-BComplete
U+2980 - U+29FFMiscellaneous Mathematical Symbols-AComplete
U+2A00 - U+2AFFSupplemental Mathematical OperatorsTODO
U+2B00 - U+2BFFMiscellaneous Symbols and ArrowsPartial
U+2C00 - U+2C5FGlagoliticTODO
U+2C60 - U+2C7FLatin Extended-CTODO
U+2C80 - U+30BF...Many foreign alphabets...TODO
U+30A0 - U+30FFKatakanaPartial
U+3100 - U+A6FF...Many foreign alphabets...TODO
U+A700 - U+A71FModifier Tone LettersTODO
U+A720 - U+A7FFLatin Extended-DTODO
U+A800 - U+AB2F...Many foreign alphabets...TODO
U+AB30 - U+AB6FLatin Extended-ETODO
U+AB70 - U+FAFF...Many foreign alphabets...TODO
U+FB00 - U+FB4FAlphabetic Presentation FormsPartial
U+FB50 - U+FFEF...Many foreign alphabets...TODO
U+FFF0 - U+FFFFSpecialsComplete

Have fun!
Jens
 

Attachments

Wow! This is amazing! Thank you, thank you, thank you so much! I just tested it in vt with w3m on Serbian Cyrillic Wikipedia – it works great, only thing that I can complain about is that Cyrillic small z (з) has very strange shape, looks more like Russian “э оборотное” (rotated e).

Will we also get smaller sizes, if this is not too much to ask for? This size will be perfect for my laptop, but for the desktop is slightly too big.
 
Wow! This is amazing! Thank you, thank you, thank you so much! I just tested it in vt with w3m on Serbian Cyrillic Wikipedia – it works great, only thing that I can complain about is that Cyrillic small z (з) has very strange shape, looks more like Russian “э оборотное” (rotated e).

Will we also get smaller sizes, if this is not too much to ask for? This size will be perfect for my laptop, but for the desktop is slightly too big.
I'll have a look at the glyph you referenced.

As for smaller sizes: reducing a raster font's size is basically starting over from scratch, with even less pixels to work with. I'm afraid at least for gallant that is not going to happen.
 
Screenshot of Serbian Cyrillic Wikipedia page about Immanuel Kant in vt w3m using new gallant.fnt:
new_gallant_in_vt.png
 
You mean this glyph? It does look like in the Unicode reference Chart at Unicode.org to my eyes but if you make a detailed suggestion what looks odd... The serifs? Is it too round? How would you improve it?

Code:
STARTCHAR U0437 CYRILLIC SMALL LETTER ZE
22 |            |
21 |            |
20 |            |
19 |            |
18 |            |
17 |            |
16 | █  █████   |
15 | █████████  |
14 | ██      ██ |
13 |         ██ |
12 |     █████  |
11 |    ██████  |
10 |         ██ |
09 | █       ██ |
08 | ██      █  |
07 |  ███████   |
06 |   █████    |
05 |            |
04 |            |
03 |            |
02 |            |
01 |            |
ENDCHAR

I'm in the process of making public my github page with this font (watch this space for the announcement). Then everybody can hack on it and improve what I messed up :-)
 
Another thing about Cyrillic, Serbian is almost perfect, but some shapes for Bulgarian are wrong. Dr. Uwe Waldmann, author of UW ttyp0 – Monospace Bitmap Screen Fonts for X11 (from which is easy to generate vt .fnt using vtfontcvt(8)) solved that problem by including stylistic variants which can be set at install time. Quote from INSTALL:
You can, for instance, choose whether you want a regular, a dotted or a slashed zero, a raised or a centered tilde, russian, serbian, or bulgarian cyrillic characters, and so on. Edit the file "VARIANTS.dat" to select your preferred stylistic variants. (If you don't, you have to live with my preferred stylistic variants.)” /q

UW ttyp0 – Stylistic Variants:
variants.png
 
You mean this glyph? It does look like in the Unicode reference Chart at Unicode.org to my eyes but if you make a detailed suggestion what looks odd... The serifs? Is it too round? How would you improve it?

Code:
STARTCHAR U0437 CYRILLIC SMALL LETTER ZE
22 |            |
21 |            |
20 |            |
19 |            |
18 |            |
17 |            |
16 | █  █████   |
15 | █████████  |
14 | ██      ██ |
13 |         ██ |
12 |     █████  |
11 |    ██████  |
10 |         ██ |
09 | █       ██ |
08 | ██      █  |
07 |  ███████   |
06 |   █████    |
05 |            |
04 |            |
03 |            |
02 |            |
01 |            |
ENDCHAR

I'm in the process of making public my github page with this font (watch this space for the announcement). Then everybody can hack on it and improve what I messed up :-)
Well, I’m not sure how this will look on the screen reduced to proper size, but IMHO something like this will be more like “з”:
22 | |
21 | |
20 | |
19 | |
18 | |
17 | |
16 | █████ |
15 | ████████ |
14 | ██ ██ |
13 | ██ |
12 | ██ |
11 | █████ |
10 | ███ |
09 | ██ |
08 | ██ █ |
07 | ███████ |
06 | █████ |
05 | |
04 | |
03 | |
02 | |
01 | |

That small serif in the top left is hard to reproduce in the bitmap, esp. in such small size, so IMHO it's better to drop that serif.
 
The lack of stylistic variants seems to be a part of Unicode, since they only specify a block under the name "Cyrillic", no separate "Bulgarian" nor a set of deviating glyphs.
 
The lack of stylistic variants seems to be a part of Unicode, since they only specify a block under the name "Cyrillic", no separate "Bulgarian" nor a set of deviating glyphs.
Maybe (just an idea), since new gallant.fnt is too big to be called from /boot/loader.conf at boot time (but rc.local will be okay), you can ship it not as part of the base, but as a port with stylistic options to choose at make config and pkgs with different flavors?
 
Thanks, much, much better, it's just one pixel too high:
View attachment 23536
Alright, let's reduce the ze to match the x-height.
And could you expand on your remark about the size being too big for loader.conf? Is there an error message? I haven't tested it there, I'm loading it via rc.conf.
 

Attachments

Alright, let's reduce the ze to match the x-height.
Thanks, IMHO this is as good as bitmap serif can go 👍
New-z-ok.png


And could you expand on your remark about the size being too big for loader.conf? Is there an error message? I haven't tested it there, I'm loading it via rc.conf.
I read somewhere (maybe on Klara? Can’t remember) few years ago that there is a limit on how big font can be to be loaded at boot from /boot/loader.conf. I didn’t test with new gallant.fnt, but I remember that I always called ttyp0 fonts from rc.local for that reason.

I think (but I’m not sure) that limit is more about number of characters present in the font than about font’s file size.
 
And could you expand on your remark about the size being too big for loader.conf? Is there an error message? I haven't tested it there, I'm loading it via rc.conf.
I read somewhere (maybe on Klara? Can’t remember) few years ago that there is a limit on how big font can be to be loaded at boot from /boot/loader.conf. I didn’t test with new gallant.fnt, but I remember that I always called ttyp0 fonts from rc.local for that reason.

I think (but I’m not sure) that limit is more about number of characters present in the font than about font’s file size.

Ha, I found it! I mean article that I read. So, it’s not talking about particular limit for fonts in /boot/fonts to be loaded from loader.conf, but it mentions that fonts are limited to ASCII to save space; quote:
The loader has a built-in 8x16 font, but to save space, the built-in font only provides an ASCII set” /q

Article is “Is There a New Loader in FreeBSD 13.0?” (pdf) by Toomas Soome , published in “FreeBSD JOURNAL March/April 2021”, hosted on FreeBSD FOUNDATION. Maybe you can contact him and ask for clarification about proper size for a font in /boot/fonts?

P.S. I remembered that once I already forgot where I read about this, and complained on X, where Allan Jude pointed me in the right direction. That was some 4 years ago. Thanks again Allan!
 
Update: It looks like that loading new gallant.fnt actually works at boot when is loaded from /boot/loader.conf. I tried only in VBox, EFI boot VM, to be able to rollback easily if something went wrong. What I did:

~/> cp gallant.fnt 12x22.fnt
~/> gzip -k 12x22.fnt
~/> sudo cp 12x22.fnt.gz /boot/fonts/
~/> sudo vim /boot/fonts/INDEX.fonts

added there

12x22.fnt:en:Gallant BSD Console, size 22
12x22.fnt:da:Gallant BSD-konsol, størrelse 22
12x22.fnt:de:Gallant BSD Console, Größe 22

So cat /boot/fonts/INDEX.fonts now reads:

#
#
# database for vidfont(8)
#
# Format <file>:<lang>:<description>
#
# lang: ar bg cs da de el en es fi fr hr hu hy is it iw ja ko nl no pl
# pt ro ru sh sk sl sv tr uk zh
# lang: lang,lang
#
# Example:
# terminus-b32.fnt:de:Terminus Schriftart
# terminus-b32.fnt:en:Terminus font
#
# If lang is empty use 'en' (us-english) as default.
#
# See also setlocale(3),
# /usr/share/locale, /usr/X11/lib/X11/locale/locale.alias
#
################################
# Language support: MENU, FONT
#
MENU:en:Choose your terminal font
MENU:da:Vælg skrifttypen til din terminal
MENU:de:Wählen Sie Ihre Schrift
MENU:fr:Choisissez votre fonte écran

#
# The font definition for "en" is the fall-back font for
# all languages.
# Add language specific font definitions only where required!
#
FONT:en:8x16v.fnt
#

6x12.fnt:en:Terminus BSD Console, size 12
6x12.fnt:da:Terminus BSD-konsol, størrelse 12
6x12.fnt:de:Terminus BSD Console, Größe 12
8x14.fnt:en:Terminus BSD Console, size 14
8x14.fnt:da:Terminus BSD-konsol, størrelse 14
8x14.fnt:de:Terminus BSD Console, Größe 14
8x16.fnt:en:Terminus BSD Console, size 16
8x16.fnt:da:Terminus BSD-konsol, størrelse 16
8x16.fnt:de:Terminus BSD Console, Größe 16
10x18.fnt:en:Terminus BSD Console, size 18
10x18.fnt:da:Terminus BSD-konsol, størrelse 18
10x18.fnt:de:Terminus BSD Console, Größe 18
10x20.fnt:en:Terminus BSD Console, size 20
10x20.fnt:da:Terminus BSD-konsol, størrelse 20
10x20.fnt:de:Terminus BSD Console, Größe 20
11x22.fnt:en:Terminus BSD Console, size 22
11x22.fnt:da:Terminus BSD-konsol, størrelse 22
11x22.fnt:de:Terminus BSD Console, Größe 22
12x22.fnt:en:Gallant BSD Console, size 22
12x22.fnt:da:Gallant BSD-konsol, størrelse 22
12x22.fnt:de:Gallant BSD Console, Größe 22
12x24.fnt:en:Terminus BSD Console, size 24
12x24.fnt:da:Terminus BSD-konsol, størrelse 24
12x24.fnt:de:Terminus BSD Console, Größe 24
14x28.fnt:en:Terminus BSD Console, size 28
14x28.fnt:da:Terminus BSD-konsol, størrelse 28
14x28.fnt:de:Terminus BSD Console, Größe 28
16x32.fnt:en:Terminus BSD Console, size 32
16x32.fnt:da:Terminus BSD-konsol, størrelse 32
16x32.fnt:de:Terminus BSD Console, Größe 32

# (fset 'langnew
# "\M-}\C-p\C-k\C-y\C-m\C-y\M-}")

Then edited
~/> sudo vim /boot/loader.conf

and changed there
#screen.font=8x16
screen.font=12x22
:wq
~/> shutdown -r now

Result (ta-da!):
FreeBSD_boot_menu_new_Gallant.png

Note: Without editing /boot/fonts/INDEX.fonts and adding Gallant there, just with cp 12x22.fnt.gz /boot/fonts/ and adding screen.font=12x22 to the /boot/loader.conf , loader ignores it and chooses first bigger Terminus, so setting right /boot/fonts/INDEX.fonts is important
 
schweikh recommended testing his new Gallant font with UTF-8-demo.txt so here are screenshots.
UTF-Demo_1-55.png

UTF-Demo_56-108.png

UTF-Demo_109-161.png

UTF-Demo_160-212.png


Also, not I this test, and not mentioned in #1, but looks like that Hebrew is there as well, I tried it with he Wikipedia, looks ok, although I can’t read it and I don’t know how to flip it to right-to-left in w3m 🤷‍♂️
 
I finally managed to compile and link lscp.c that is included in the attached gallant.zip in #1 . I already had devel/libunistring installed, but first compile, then linking was failing for me. Mind you, I’m not a dev, took me hour or two of googling to find solution.

This produced working lscp binary:

cc -I/usr/local/include -L/usr/local/lib/ -lunistring lscp.c -o lscp

sacha-baron.gif
 
Thank you for the very detailed explanation, this is very valuable. Also for the screenshots!

Looking at Unicode again in my table above, would some of the Bulgarian Cyrillic characters be in the Cyrillic Supplement block? I might give drawing them a go in a weekend session.
 
Thank you for the very detailed explanation, this is very valuable. Also for the screenshots!
You are welcome, it’s only my pleasure!

Looking at Unicode again in my table above, would some of the Bulgarian Cyrillic characters be in the Cyrillic Supplement block? I might give drawing them a go in a weekend session.
Nope, I see nothing there that is from Bulgarian. Good starting point can be Wikipedia article Bulgarian alphabet, especially this image with a caption “A modern form of the Bulgarian alphabet
Bulgarian_cursive_alphabet.png


and this one with a caption “Differences from other Cyrillic alphabets
Cyrillic_alternates.svg.png

Blue: default Belarusian/Russian/Ukrainian forms; Orange: alternate Bulgarian upright forms; Yellow: alternate Serbian/Macedonian italic forms

BTW, vt default Terminus has most of the Cyrillic letters based on Bulgarin variant.

Dealing with this is very hard as Unicode is not providing solution for this (that I know of). AFAIK, only app that can handle (up to some point, and not completely) differences in various Cyrillic alphabets per specific language is InDesign (if configured properly for that, and using fonts that have those variants). And we are talking here about full GUIs (Win/OS X) with excellent Unicode support and OTF fonts.

For example, it’s driving me crazy that in Serbian italic a lot of letters are different from Russian italic, yet it’s not uncommon here to use Russian variant because that’s default in most TTF/OTF fonts.

That’s why I mentioned earlier Dr. Uwe Waldmann ‘UW ttyp0’ way: select your variant at make/install time and use that (or make multiple fonts with variants and change font as per need).
 
Well, since Cyrillic is hard, we deserve something positive here, so another eye candy – all of APL symbols are present in the new Gallant!
(I hope I got all of APL Unicode points right)
Kudos schweikh!
APL-Gallant.png

BTW, u2337 and u2395 are not empty chars, they do look like that:
u2337 ⌷ APL FUNCTIONAL SYMBOL SQUISH QUAD and u2395 ⎕ APL FUNCTIONAL SYMBOL QUAD
 
Well, since Cyrillic is hard, we deserve something positive here, so another eye candy – all of APL symbols are present in the new Gallant!
(I hope I got all of APL Unicode points right)
Kudos schweikh!
Well, I'm German. If it's worth doing, it's worth doing right. That's why everybody likes our quality products :-)

I have tested your steps how to make the loader use gallant early. Now the boot almost looks like I've seen the SPARCstations boot 30 years ago! Memories...
 
Well, I'm German. If it's worth doing, it's worth doing right. That's why everybody likes our quality products :-)

I have tested your steps how to make the loader use gallant early. Now the boot almost looks like I've seen the SPARCstations boot 30 years ago! Memories...
To make it look like a real Sun Sparc, we’ll need to recompile a kernel with something like options TERMINAL_NORM_ATTR=(FG_BLACK|BG_WHITE). I do have my custom RGB palette defined in loader.conf, but kern.vt.color.*.rgb="#*" options are applied only after loader starts kernel, they won’t change boot screen. Maybe I’m wrong about this, but I don’t know about better way.

BTW, when talking about retro nostalgia, here is an image from some years ago how my FreeBSD LARPed Atari ST 😁
DhSywSnXcAUWshD.jpg
 
As promised, for all those watching this space for an announcement, my github repo for gallant is now public.
Please point your browser to https://github.com/NanoBillion/gallant and let me know if you have any problems accessing it.
Thanks, that’s great! I only quickly glanced over your repo, but I liked what I saw. Only suggestion: please include in lscp.c in the /* comments */ or in the README, how to build lscp binary, some less experienced people could get confused about it without clear instructions:
cc -I/usr/local/include -L/usr/local/lib/ -lunistring lscp.c -o lscp worked for me.
In time I’ll browse the whole repo and further comment on the findings.
Thanks again for your hard work 🙏
 
To make it look like a real Sun Sparc, we’ll need to recompile a kernel with something like options TERMINAL_NORM_ATTR=(FG_BLACK|BG_WHITE). I do have my custom RGB palette defined in loader.conf, but kern.vt.color.*.rgb="#*" options are applied only after loader starts kernel, they won’t change boot screen. Maybe I’m wrong about this, but I don’t know about better way.
Oh, I was so wrong about this 🤦‍♂️ It’s actually very simple to do, and doesn’t require custom kernel.
Trick is to add to the /boot/loader.conf
teken.fg_color="0"
teken.bg_color="7"
and to change in /boot/lua/drawer.lua
image = "/boot/images/freebsd-brand-rev.png",
to
image = "/boot/images/freebsd-brand.png",
and voilà:
FreeBSD-white_1.png

FreeBSD-white_2.png
 
Back
Top