spleen

Monospaced bitmap fonts for consoles, terminals, and code editors
Log | Files | Refs | README | LICENSE

Makefile (3065B)


      1 #
      2 # Spleen 1.9.1
      3 # Copyright (c) 2018-2021, Frederic Cambus
      4 # https://www.cambus.net/
      5 #
      6 # Created:      2019-01-29
      7 # Last Updated: 2021-06-11
      8 #
      9 # Spleen is released under the BSD 2-Clause license.
     10 # See LICENSE file for details.
     11 #
     12 # SPDX-License-Identifier: BSD-2-Clause
     13 #
     14 
     15 BDFTOPCF ?=	bdftopcf
     16 BDF2PSF ?=	bdf2psf
     17 BDF2SFD ?=	bdf2sfd
     18 FONTFORGE ?=	fontforge
     19 OPTIPNG ?=	optipng
     20 FONTTOSFNT ?=	fonttosfnt
     21 
     22 PBMTEXT ?=	pbmtext
     23 PPMCHANGE ?=	ppmchange
     24 PNMCAT ?=	pnmcat
     25 PNMPASTE ?=	pnmpaste
     26 PNMSCALE ?=	pnmscale
     27 PNMTOPNG ?=	pnmtopng
     28 
     29 PREFIX ?=	/usr
     30 DATADIR ?=	$(PREFIX)/share/bdf2psf
     31 
     32 EQUIVALENT =	$(DATADIR)/standard.equivalents
     33 
     34 ASCII =		$(DATADIR)/ascii.set
     35 LINUX =		$(DATADIR)/linux.set
     36 USEFUL =	$(DATADIR)/useful.set
     37 FONTSET =	$(DATADIR)/fontsets/Uni1.512+:$(ASCII)+:$(LINUX)+:$(USEFUL)
     38 
     39 OPTIONS =	$(EQUIVALENT) $(FONTSET) 512
     40 
     41 SIZES =		5x8 6x12 8x16 12x24 16x32 32x64
     42 OTFSIZES =	6x12 8x16 12x24 16x32 32x64
     43 
     44 TARGET =	all
     45 
     46 all:	pcf psf sfd otf
     47 
     48 pcf:
     49 .for size in $(SIZES)
     50 	$(BDFTOPCF) -t -o spleen-${size}.pcf spleen-${size}.bdf
     51 .endfor
     52 
     53 psf:
     54 .for size in $(SIZES)
     55 	$(BDF2PSF) --fb spleen-${size}.bdf $(OPTIONS) spleen-${size}.psfu
     56 .endfor
     57 
     58 otb:
     59 .for size in $(SIZES)
     60 	$(FONTTOSFNT) -b -c -o spleen-${size}.otb spleen-${size}.bdf
     61 .endfor
     62 
     63 sfd:
     64 .for size in $(OTFSIZES)
     65 	$(BDF2SFD) -f "Spleen ${size}" -p "Spleen${size}" spleen-${size}.bdf > spleen-${size}.sfd
     66 	$(FONTFORGE) -lang ff -c 'Open("spleen-${size}.sfd"); SelectAll(); RemoveOverlap(); Simplify(-1, 1); Save("spleen-${size}.sfd")'
     67 .endfor
     68 
     69 otf:
     70 .for size in $(OTFSIZES)
     71 	$(FONTFORGE) -lang ff -c 'Open("spleen-${size}.sfd"); Generate("spleen-${size}.otf")'
     72 .endfor
     73 
     74 screenshots:
     75 .for size in $(SIZES)
     76 	awk 'BEGIN { for(chr = 32; chr < 127; chr++) printf "%c", chr }' | \
     77 	$(PBMTEXT) -font spleen-${size}.bdf -nomargins | \
     78 	$(PPMCHANGE) black "#aaa" | \
     79 	$(PPMCHANGE) white black | \
     80 	$(PNMTOPNG) > spleen-${size}.png
     81 .endfor
     82 	$(OPTIPNG) *.png
     83 
     84 specimen:
     85 	echo "\n  Spleen         " | \
     86 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
     87 	$(PPMCHANGE) white "#ff7f2a" | \
     88 	$(PPMCHANGE) black "#fff" > spleen.pnm
     89 
     90 	echo "\n  Aa Ee Gg       \n  Qq Rr Ss" | \
     91 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
     92 	$(PPMCHANGE) white "#ff7f2a" > examples.pnm
     93 
     94 	echo "\n     The future  " | \
     95 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
     96 	$(PPMCHANGE) white "#ff7f2a" | \
     97 	$(PPMCHANGE) black "#fff" > future.pnm
     98 
     99 	echo "  abcdefghijklm  \n  nopqrstuvwxyz" | \
    100 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
    101 	$(PPMCHANGE) white "#ff2a7f" > letters.pnm
    102 
    103 	echo "     0123456789  " | \
    104 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
    105 	$(PPMCHANGE) white "#ff2a7f" | \
    106 	$(PPMCHANGE) black "#fff"  > digits.pnm
    107 
    108 	$(PNMCAT) -tb spleen.pnm examples.pnm future.pnm letters.pnm digits.pnm > specimen.pnm
    109 
    110 	echo "a" | \
    111 	$(PBMTEXT) -font spleen-32x64.bdf -nomargins | \
    112 	$(PPMCHANGE) white "#ff7f2a" | \
    113 	$(PPMCHANGE) black "#fff" | \
    114 	$(PNMSCALE) 4 | \
    115 	$(PNMPASTE) - 364 100 specimen.pnm | \
    116 	$(PNMTOPNG) > specimen.png
    117 	rm *.pnm
    118 	$(OPTIPNG) *.png
    119 
    120 clean:
    121 	rm -f *.bak *.dfont *.gz *.sfd *.otb *.otf *.pcf *.psfu *.png