diff --git a/.gitignore b/.gitignore index 4a79983..559b62a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.bak charsets/*.ucm -charsets/Blocks.txt \ No newline at end of file +charsets/Blocks.txt +build/* \ No newline at end of file diff --git a/Makefile b/Makefile index 47e1d61..f81dbe0 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,32 @@ check-coverage-mono : psf : build/consolefonts/Uni2-Salut16.psf psf : build/consolefonts/Uni2-Salut16b.psf -build/consolefonts/Uni2-Salut%.psf : mono/salut-mono%.bdf +build/consolefonts/Uni2-Salut16.psf : build/consolefonts/Uni2-Salut%.psf : mono/salut-mono%.bdf mkdir -p $(@D) bdf2psf $< /usr/share/bdf2psf/standard.equivalents /usr/share/bdf2psf/fontsets/Uni2.512 512 $@ - \ No newline at end of file + +.PHONY : opentype opentype-mono opentype-sans + +opentype : opentype-sans opentype-mono + +opentype-sans : $(patsubst sans/%.bdf,build/opentype/%.otb,$(wildcard sans/*.bdf)) + +build/opentype/salut-sans%.otb : sans/salut-sans%.bdf + mkdir -p $(@D) + fonttosfnt -o $@ -m 2 -- $^ + +opentype-mono : $(patsubst mono/%.bdf,build/opentype/%.otb,$(wildcard mono/*.bdf)) + +build/opentype/salut-mono%.otb : mono/salut-mono%.bdf + mkdir -p $(@D) + fonttosfnt -o $@ -- $^ + +.PHONY : pcf pcf-mono + +pcf : pcf-mono + +pcf-mono : $(patsubst mono/%.bdf,build/pcf/%.pcf,$(wildcard mono/*.bdf)) + +build/pcf/salut-mono%.pcf : mono/salut-mono%.bdf + mkdir -p $(@D) + bdftopcf -o $@ $^ diff --git a/README.md b/README.md index 40b4234..ea6b9d1 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ However, some rendering libraries do not support BDF (notable case is Pango 1.44 dropped support for FreeType in favor of HarfBuzz), so you might not see bitmap fonts in some applications. +There's a method to build OTB (open-type bitmap) font from BDF with `fonttosfnt`. +The `opentype` target converts all fonts to OTB. + +Also conversion to PCF is possible make target `pcf` does this thing to all +fonts by calling `bdftopsf` utility. + +Original inctruction: https://fedoraproject.org/wiki/BitmapFontConversion + 16x8 font can be installed in Linux console. First, convert BDF to PSF (bdf2psf utility needed for this). `make psf` command will do conversion for you.