diff options
| author | Jens Schweikhardt <schweikh@schweikhardt.net> | 2025-09-03 21:40:10 +0200 |
|---|---|---|
| committer | Jens Schweikhardt <schweikh@schweikhardt.net> | 2025-09-03 21:40:10 +0200 |
| commit | b26c6e24b365a8d5334d6d145ef8e79ff87b2db3 (patch) | |
| tree | 6e3c3a0101d3c7d7369fb9ef6735a18336369178 | |
| parent | b6820a81f394c3a4fc86f70ecb4db3535bbc4ae8 (diff) | |
Fix cyrillic small letter ze (adjust x-height and tune).
| -rw-r--r-- | 12x22.fnt.gz | bin | 0 -> 42429 bytes | |||
| -rw-r--r-- | GNUmakefile | 117 | ||||
| -rw-r--r-- | Images/0400-Cyrillic-Inverted.png | bin | 56096 -> 56098 bytes | |||
| -rw-r--r-- | Images/0400-Cyrillic.png | bin | 54949 -> 54950 bytes | |||
| -rw-r--r-- | README.md | 36 | ||||
| -rw-r--r-- | gallant.bdf | 10 | ||||
| -rw-r--r-- | gallant.fnt | bin | 194964 -> 194964 bytes | |||
| -rw-r--r-- | gallant.hex | 2 | ||||
| -rw-r--r-- | gallant.pcf | bin | 641556 -> 641556 bytes | |||
| -rw-r--r-- | gallant.pcf.gz | bin | 0 -> 91598 bytes | |||
| -rw-r--r-- | gallant.src | 28 | ||||
| -rw-r--r-- | gallant.ttf | bin | 219700 -> 219700 bytes |
12 files changed, 112 insertions, 81 deletions
diff --git a/12x22.fnt.gz b/12x22.fnt.gz Binary files differnew file mode 100644 index 0000000..cd3d99a --- /dev/null +++ b/12x22.fnt.gz diff --git a/GNUmakefile b/GNUmakefile index 282dc81..753ea48 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,30 +7,33 @@ unexport C_INCLUDE_PATH # Remove from shell environment; confuses gcc. export LANG = C.UTF-8 export LC_ALL = C.UTF-8 -.DEFAULT_GOAL = install +.DEFAULT_GOAL = all +# My helper binaries. +# TOOLS = lscp hextobdf hextosrc srctohex txttopng -TOOLS_C = $(addsuffix .c,$(TOOLS)) + +# And their corresponding C language source files. +# +TOOLS_C = $(addsuffix .c,$(TOOLS)) + +# And the preprocessed source for tag generation, etc. +# PREPROCESSED = $(addsuffix .i,$(TOOLS)) +# What to build by default. +# TOP_LEVEL_TARGETS = gallant.bdf TOP_LEVEL_TARGETS += gallant.fnt -TOP_LEVEL_TARGETS += gallant.pcf +TOP_LEVEL_TARGETS += gallant.pcf.gz TOP_LEVEL_TARGETS += gallant.ttf +TOP_LEVEL_TARGETS += 12x22.fnt.gz TOP_LEVEL_TARGETS += images TOP_LEVEL_TARGETS += README.html .PHONY: all all: $(TOP_LEVEL_TARGETS) -lscp: lscp.o - -srctohex: srctohex.o - -hextobdf: hextobdf.o - -txttopng: txttopng.o - gallant.bdf: gallant.hex hextobdf ./hextobdf < $< > $@ @@ -43,6 +46,9 @@ gallant.fnt: gallant.hex gallant.pcf: gallant.bdf bdftopcf -o $@ $^ +gallant.pcf.gz: gallant.pcf + gzip -cv9 $^ > $@ + gallant.src: hextosrc ./hextosrc < gallant.hex > $@ @@ -55,21 +61,26 @@ gallant.ttf: gallant.bdf SOURCE_DATE_EPOCH=$(TIMESTAMP) fontforge -lang=ff -script - fontlint $@ -.PHONY: install -install: gallant.bdf gallant.fnt gallant.ttf - cp gallant.bdf gallant.ttf ~/.fonts +# make 12x22.fnt.gz: build the font the FreeBSD loader can use. +# +12x22.fnt.gz: gallant.fnt + gzip -cv9 $^ > $@ + +# make install-maintainer: install files on maintainer's system. +# +.PHONY: install-maintainer +install-maintainer: gallant.pcf.gz gallant.ttf gallant.fnt gallant.hex 12x22.fnt.gz + cp gallant.pcf.gz gallant.ttf ~/.fonts cd ~/.fonts && mkfontdir && xset fp rehash && fc-cache if test $$(uname -s) = FreeBSD; then \ - if test -w /dev/ttyv7; then \ - vidcontrol -f gallant.fnt < /dev/ttyv7; \ - fi; \ + vidcontrol -f gallant.fnt < /dev/ttyv0; \ + sudo cp gallant.fnt /usr/share/vt/fonts/gallant.fnt; \ + sudo cp gallant.hex /home/toor/FreeBSD/head/src/share/vt/fonts/gallant.hex; \ + sudo cp 12x22.fnt.gz /boot/fonts/12x22.fnt.gz; \ fi -.PHONY: install-maintainer -install-maintainer: gallant.fnt gallant.hex - sudo cp gallant.fnt /usr/share/vt/fonts/gallant.fnt - sudo cp gallant.hex /home/toor/FreeBSD/head/src/share/vt/fonts/gallant.hex - +# make images: create the PNG files in Images/ for each block +# .PHONY: images images: gallant.hex lscp txttopng printf '%s\n' \ @@ -117,6 +128,8 @@ images: gallant.hex lscp txttopng ./txttopng -f "$<" -t "$$name.txt" -p "Images/$$first-$$name-Inverted.png" -i; \ done +# make README.html: turn markdown into HTML. +# README.html: README.md comrak --gfm --syntax-highlighting base16-ocean.light $^ > $@ @@ -155,29 +168,6 @@ APP_SOURCE_INCDIRS = -I /usr/local/include APP_LIBDIRS = -L /usr/local/lib APP_MACROS += -DVERSION='"$(VERSION)"' -tools: $(TOOLS) - -lscp: lscp.o - $(CC) -o $@ $(APP_LIBDIRS) -luninameslist -lunistring $^ - -hextobdf: hextobdf.o - $(CC) -o $@ $^ - -hextosrc: hextosrc.o - $(CC) -o $@ $(APP_LIBDIRS) -luninameslist -lunistring $^ - -srctohex: srctohex.o - $(CC) -o $@ $^ - -txttopng: txttopng.o - $(CC) -o $@ $(APP_LIBDIRS) -lpng $^ - -lint: $(TOOLS_C) - @for c in $^; do flexelint lint.lnt $$c; done - -# X11 in x.out: -# BDF Error on line 114938: char 'U+10000' has encoding too large (65536) - ################################################################################ # ____ _ # # | _ \ _ _| | ___ ___ # @@ -205,6 +195,22 @@ MAKEFLAGS += --no-builtin-rules %.i: %.c $(CC) -E $(APP_CFLAGS) $(APP_WARNS) $(APP_SOURCE_INCDIRS) $(APP_MACROS) -o $@ $< + +lscp: lscp.o + $(CC) -o $@ $(APP_LIBDIRS) -luninameslist -lunistring $^ + +hextobdf: hextobdf.o + $(CC) -o $@ $^ + +hextosrc: hextosrc.o + $(CC) -o $@ $(APP_LIBDIRS) -luninameslist -lunistring $^ + +srctohex: srctohex.o + $(CC) -o $@ $^ + +txttopng: txttopng.o + $(CC) -o $@ $(APP_LIBDIRS) -lpng $^ + ################################################################################ # _ _ _ _____ _ # # | | | | ___| |_ __ ___ _ __ |_ _|_ _ _ __ __ _ ___| |_ ___ # @@ -215,14 +221,31 @@ MAKEFLAGS += --no-builtin-rules # # ################################################################################ +# make tools: just compile the TOOLS. +# +.PHONY: tools +tools: $(TOOLS) + #------------------------------------------------------------------------------# # Clean # #------------------------------------------------------------------------------# +# make clean: remove what can be regenerated. +# .PHONY: clean clean: - rm -f *.i *.o $(TOOLS) - rm -f gallant.bdf gallant.hex gallant.fnt gallant.pcf gallant.ttf + rm -f *.i *.o *.gz $(TOOLS) + rm -f gallant.bdf gallant.fnt gallant.hex gallant.pcf gallant.ttf + +#------------------------------------------------------------------------------# +# Lint # +#------------------------------------------------------------------------------# + +# make lint: run lint for each of the tool source files. +# +.PHONY: lint +lint: $(TOOLS_C) + @for c in $^; do flexelint lint.lnt $$c; done #------------------------------------------------------------------------------# # Tags - Create tags for vi # diff --git a/Images/0400-Cyrillic-Inverted.png b/Images/0400-Cyrillic-Inverted.png Binary files differindex 6cc2209..8dba4fe 100644 --- a/Images/0400-Cyrillic-Inverted.png +++ b/Images/0400-Cyrillic-Inverted.png diff --git a/Images/0400-Cyrillic.png b/Images/0400-Cyrillic.png Binary files differindex 3fbeedc..6b637d1 100644 --- a/Images/0400-Cyrillic.png +++ b/Images/0400-Cyrillic.png @@ -164,15 +164,11 @@ characters. [OpenBSD's wscons](https://man.openbsd.org/wscons) was inherited from NetBSD, so similar restrictions apply. -The glyphs in this gallant project would have to be severely reduced in +The glyphs in this Gallant project would have to be severely reduced in number to fit. If someone wants to contribute a stripped down font in the appropriate format, I'm willing to add it to this project. -### What about the TrueType gallant.ttf? - -Some systems no longer support BDF (or PCF) fonts. The days of raster -fonts are numbered, it would seem. With high DPI displays these days, -rendered anti-aliased fonts are the new norm. +### The TrueType gallant.ttf The `gallant.ttf` file is a conversion from BDF to TTF using [FontForge](https://fontforge.org/en-US/). (See the @@ -193,10 +189,21 @@ drawing characters, where there will be vertical gaps. The same applies to all glyphs that connect to glyphs above and below, such as large parentheses, braces, brackets, integrals, etc. -Due to a Windows quirk, I have added six fake Hiraga glyphs that Windows -tests the existence of (and would otherwise reject as a font). I'd be -extremely delighted if someone contributed the full set of Hiragana -glyphs. +### The TrueType gallant.ttf does not work on Windows. What's going on? + +The symptom is that Windows displays a popup along "gallant.ttf is not a +valid font file" when you want to copy `gallant.ttf` to +`C:\Windows\Fonts` or install it some other way. + +There seem to be at least two issues. + +1. I'm told Windows considers a font invalid if it does not contain + a certain set of six Hiragana glyphs. I have added them to the BDF + but this is not enough to solve the "gallant.ttf is not a valid + font file" popup. +2. Windows wants a scalable outline font. A bitmap-only TrueType font + file is invalid. I have yet to find an automated way, preferably + with `fontforge` script commands, to add an outline font. ### Is there a gallant.fon for Windows? @@ -207,10 +214,10 @@ would only contain 256 glyphs. I'm an ex-Sun Microsystems software engineer who had a stint in the company shortly before Oracle took over (2008/2009). I was nowhere near -the OpenBoot PROM files which contained the gallant font. My first +the OpenBoot PROM files which contained the Gallant font. My first contact with SUN hardware was in the late 80's and early 90's at university with the 3/60 and the SPARCstations. It was then and there -that the gallant font and the Trinitron CRT raster were burnt in my +that the Gallant font and the Trinitron CRT raster were burnt in my retina. ## How did you edit the glyphs? @@ -279,7 +286,7 @@ which reads: ``` In private conversation with the author, Jef said he guessed that the -gallant font was designed by someone at Sun Microsystems before it made +Gallant font was designed by someone at Sun Microsystems before it made its way to Berkeley. Further research examining the Unix history site @@ -356,4 +363,5 @@ need to render them. This is the mapping: ## TODO -* Describe how to contribute +* Describe how to contribute. +* Build a FreeBSD Port `x11-fonts/gallant` with `gallant.pcf.gz` for X11. diff --git a/gallant.bdf b/gallant.bdf index 6052cd7..d867f5c 100644 --- a/gallant.bdf +++ b/gallant.bdf @@ -30108,14 +30108,14 @@ BITMAP 0000 0000 0000 -4f80 -7fc0 +0000 +0f80 +3fc0 6060 0060 -07c0 -0fc0 +0f80 +00c0 0060 -4060 6040 3f80 1f00 diff --git a/gallant.fnt b/gallant.fnt Binary files differindex da239ab..31f6a9e 100644 --- a/gallant.fnt +++ b/gallant.fnt diff --git a/gallant.hex b/gallant.hex index aba3926..a65f606 100644 --- a/gallant.hex +++ b/gallant.hex @@ -1037,7 +1037,7 @@ 0434:00000000000000000000000000003ff0118011801180118011802180218021807ff060606060402000000000 0435:00000000000000000000000000000f0030c0606060607fe060006000300018600f8000000000000000000000 0436:0000000000000000000000000000ef30c610662066403f801fc0266046608630cf7000000000000000000000 -0437:0000000000000000000000004f807fc06060006007c00fc00060406060403f801f0000000000000000000000 +0437:00000000000000000000000000000f803fc0606000600f8000c0006060403f801f0000000000000000000000 0438:0000000000000000000000000000f0f0606060e0616062606460686070606060f0f000000000000000000000 0439:00000000606030c00f0000000000f0f0606060e0616062606460686070606060f0f000000000000000000000 043a:0000000000000000000000000000f1c0630066007c0078007c006e0067006380f1e000000000000000000000 diff --git a/gallant.pcf b/gallant.pcf Binary files differindex af68c5c..0d59b16 100644 --- a/gallant.pcf +++ b/gallant.pcf diff --git a/gallant.pcf.gz b/gallant.pcf.gz Binary files differnew file mode 100644 index 0000000..82de9c2 --- /dev/null +++ b/gallant.pcf.gz diff --git a/gallant.src b/gallant.src index 4cca0dc..45f071f 100644 --- a/gallant.src +++ b/gallant.src @@ -24893,14 +24893,14 @@ STARTCHAR U0437 CYRILLIC SMALL LETTER ZE 19 | | 18 | | 17 | | -16 | █ █████ | -15 | █████████ | -14 | ██ ██ | -13 | ██ | -12 | █████ | -11 | ██████ | -10 | ██ | -09 | █ ██ | +16 | | +15 | █████ | +14 | ████████ | +13 | ██ ██ | +12 | ██ | +11 | █████ | +10 | ██ | +09 | ██ | 08 | ██ █ | 07 | ███████ | 06 | █████ | @@ -108550,7 +108550,7 @@ STARTCHAR U2bff HELLSCHREIBER PAUSE SYMBOL 02 | | 01 | | ENDCHAR -STARTCHAR U3044 +STARTCHAR U3044 HIRAGANA LETTER I 22 | | 21 | | 20 | | @@ -108574,7 +108574,7 @@ STARTCHAR U3044 02 | | 01 | | ENDCHAR -STARTCHAR U3046 +STARTCHAR U3046 HIRAGANA LETTER U 22 | | 21 | | 20 | | @@ -108598,7 +108598,7 @@ STARTCHAR U3046 02 | | 01 | | ENDCHAR -STARTCHAR U304b +STARTCHAR U304b HIRAGANA LETTER KA 22 | | 21 | | 20 | | @@ -108622,7 +108622,7 @@ STARTCHAR U304b 02 | | 01 | | ENDCHAR -STARTCHAR U3057 +STARTCHAR U3057 HIRAGANA LETTER SI 22 | | 21 | | 20 | | @@ -108646,7 +108646,7 @@ STARTCHAR U3057 02 | | 01 | | ENDCHAR -STARTCHAR U306e +STARTCHAR U306e HIRAGANA LETTER NO 22 | | 21 | | 20 | | @@ -108670,7 +108670,7 @@ STARTCHAR U306e 02 | | 01 | | ENDCHAR -STARTCHAR U3093 +STARTCHAR U3093 HIRAGANA LETTER N 22 | | 21 | | 20 | | diff --git a/gallant.ttf b/gallant.ttf Binary files differindex b9f4dbf..8442291 100644 --- a/gallant.ttf +++ b/gallant.ttf |
