spleen

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

Makefile (2886B)


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