1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-21 23:30:58 +00:00

started bitmap font generator

This commit is contained in:
Steven Hugg 2018-08-30 09:24:03 -04:00
parent bf584674ab
commit 4d478d72ce
3 changed files with 644 additions and 0 deletions

271
tools/fontgen/fontlist.js Normal file
View File

@ -0,0 +1,271 @@
FONTLIST = `bitocra/4thD.bdf|-aaron-4thD-Medium-R-Normal--4-40-86-86-C-30-ISO8859-1
bitocra/5thElement.bdf|-aaron-5thElement-Medium-R-Normal--5-40-86-86-C-30-ISO8859-1
bitocra/bitbuntu-full.bdf|-aaron-bitbuntufull-medium-r-normal--10-100-72-72-C-90-UTF8-1
bitocra/bitbuntu.bdf|-aaron-bitbuntu-medium-r-normal--10-100-72-72-C-90-iSO8859-1
bitocra/bitocra-13-full.bdf|-aaron-bitocra13full-Medium-R-Normal--13-130-84-84-C-90-ISO8859-1
bitocra/bitocra-13.bdf|-aaron-bitocra13-Medium-R-Normal--13-130-84-84-C-90-ISO8859-1
bitocra/bitocra-full.bdf|-aaron-bitocrafull-medium-r-normal--11-100-72-72-M-90-ISO8859-1
bitocra/bitocra.bdf|-aaron-bitocra-medium-r-normal--11-100-72-72-M-90-ISO8859-1
bitocra/bitocra7.bdf|-aaron-bitocra7-Medium-R-Normal--7-60-75-75-C-40-ISO8859-1
boxxy/boxxy-bold.bdf|-ark-boxxy-Medium-R-bold--14-140-72-72-c-60-ISO10646-1
boxxy/boxxy.bdf|-ark-boxxy-Medium-R-Normal--14-140-72-72-c-60-ISO10646-1
cherry/cherry-10-b.bdf|-t-cherry-Bold-R-Normal--10-100-75-75-C-100-ISO8859-1
cherry/cherry-10-r.bdf|-t-cherry-Medium-R-Normal--10-100-75-75-C-100-ISO8859-1
cherry/cherry-11-b.bdf|-t-cherry-Bold-R-Normal--11-100-75-75-C-100-ISO8859-1
cherry/cherry-11-r.bdf|-t-cherry-Medium-R-Normal--11-100-75-75-C-100-ISO8859-1
cherry/cherry-13-b.bdf|-t-cherry-Bold-R-Normal--13-120-96-96-C-100-ISO8859-1
cherry/cherry-13-r.bdf|-t-cherry-Medium-R-Normal--13-120-96-96-C-100-ISO8859-1
creep/creep.bdf|-gbdfed-creep-Regular-R-Normal--16-120-96-96-M-4-ISO10646-1
ctrld-font/ctrld-fixed-10b.bdf|-ctrld-fixed-bold-r-normal--10-80-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-10r.bdf|-ctrld-fixed-medium-r-normal--10-80-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-13b-i.bdf|-ctrld-fixed-bold-i-normal--13-80-96-96-c-70-ISO10646-1
ctrld-font/ctrld-fixed-13b.bdf|-ctrld-fixed-bold-r-normal--13-80-96-96-c-70-ISO10646-1
ctrld-font/ctrld-fixed-13r-i.bdf|-ctrld-fixed-medium-i-normal--13-80-96-96-c-70-ISO10646-1
ctrld-font/ctrld-fixed-13r.bdf|-ctrld-fixed-medium-r-normal--13-80-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-16b-i.bdf|-ctrld-fixed-bold-i-normal--16-100-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-16b.bdf|-ctrld-fixed-bold-r-normal--16-100-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-16r-i.bdf|-ctrld-fixed-medium-i-normal--16-100-96-96-c-80-ISO10646-1
ctrld-font/ctrld-fixed-16r.bdf|-ctrld-fixed-medium-r-normal--16-100-96-96-c-80-ISO10646-1
dina/Dina_i400-10.bdf|-windows-Dina-medium-i-normal--13-100-96-96-c-80-microsoft-cp1252
dina/Dina_i400-8.bdf|-windows-Dina-medium-i-normal--10-80-96-96-c-70-microsoft-cp1252
dina/Dina_i400-9.bdf|-windows-Dina-medium-i-normal--12-90-96-96-c-70-microsoft-cp1252
dina/Dina_i700-10.bdf|-windows-Dina-bold-i-normal--13-100-96-96-c-80-microsoft-cp1252
dina/Dina_i700-8.bdf|-windows-Dina-bold-i-normal--10-80-96-96-c-70-microsoft-cp1252
dina/Dina_i700-9.bdf|-windows-Dina-bold-i-normal--12-90-96-96-c-70-microsoft-cp1252
dina/Dina_r400-10.bdf|-windows-Dina-medium-r-normal--13-100-96-96-c-80-microsoft-cp1252
dina/Dina_r400-6.bdf|-windows-Dina-medium-r-normal--8-60-96-96-c-60-microsoft-cp1252
dina/Dina_r400-8.bdf|-windows-Dina-medium-r-normal--10-80-96-96-c-70-microsoft-cp1252
dina/Dina_r400-9.bdf|-windows-Dina-medium-r-normal--12-90-96-96-c-70-microsoft-cp1252
dina/Dina_r700-10.bdf|-windows-Dina-bold-r-normal--13-100-96-96-c-80-microsoft-cp1252
dina/Dina_r700-8.bdf|-windows-Dina-bold-r-normal--10-80-96-96-c-70-microsoft-cp1252
dina/Dina_r700-9.bdf|-windows-Dina-bold-r-normal--12-90-96-96-c-70-microsoft-cp1252
dylex/10x20.bdf|-dylex-terminal-Medium-R-Normal--20-200-75-75-C-100-ISO10646-1
dylex/10x20B.bdf|-dylex-terminal-Bold-R-Normal--20-200-75-75-C-100-ISO10646-1
dylex/10x20BO.bdf|-dylex-terminal-Bold-O-Normal--20-200-75-75-C-100-ISO10646-1
dylex/10x20O.bdf|-dylex-terminal-Medium-O-Normal--20-200-75-75-C-100-ISO10646-1
dylex/14x14.bdf|-dylex-crawl-Medium-R-Normal--14-140-75-75-C-140-ISO10646-1
dylex/14x14B.bdf|-dylex-crawl-Bold-R-Normal--14-140-75-75-C-140-ISO10646-1
dylex/14x14BO.bdf|-dylex-crawl-Bold-O-Normal--14-140-75-75-C-140-ISO10646-1
dylex/14x14O.bdf|-dylex-crawl-Medium-O-Normal--14-140-75-75-C-140-ISO10646-1
dylex/6x10.bdf|-dylex-terminal-Medium-R-Normal--10-100-75-75-C-60-ISO10646-1
dylex/6x10B.bdf|-dylex-terminal-Bold-R-Normal--10-100-75-75-C-60-ISO10646-1
dylex/6x10BO.bdf|-dylex-terminal-Bold-O-Normal--10-100-75-75-C-60-ISO10646-1
dylex/6x10O.bdf|-dylex-terminal-Medium-O-Normal--10-100-75-75-C-60-ISO10646-1
dylex/7x13.bdf|-dylex-terminal-Medium-R-Normal--13-120-75-75-C-70-ISO10646-1
dylex/7x13B.bdf|-dylex-terminal-Bold-R-Normal--13-120-75-75-C-70-ISO10646-1
dylex/7x13BO.bdf|-dylex-terminal-Bold-O-Normal--13-120-75-75-C-70-ISO10646-1
dylex/7x13O.bdf|-dylex-terminal-Medium-O-Normal--13-120-75-75-C-70-ISO10646-1
envypn-font/envypn7x13.bdf|-ypn-envypn-Medium-R-Normal--13-130-75-75-C-90-ISO8859-1
envypn-font/envypn7x13e.bdf|-ypn-envypn-Medium-R-Normal--13-130-75-75-C-90-ISO8859-2
envypn-font/envypn7x15.bdf|-ypn-envypn-Medium-R-Normal--15-150-75-75-C-90-ISO8859-1
envypn-font/envypn7x15e.bdf|-ypn-envypn-Medium-R-Normal--15-150-75-75-C-90-ISO8859-2
gomme/Gomme10x20n.bdf|-misc-Gomme-Medium-R-Normal--20-200-100-100-C-100-ISO10646-1
haxor/HaxorMedium-10.bdf|-ucw.cz-Haxor-Medium-R-Normal--12-120-72-72-C-72-iso8859-2
haxor/HaxorMedium-11.bdf|-ucw.cz-Haxor-Medium-R-Normal--12-120-72-72-C-72-iso8859-2
haxor/HaxorMedium-12.bdf|-ucw.cz-Haxor-Medium-R-Normal--12-120-72-72-C-72-iso8859-2
haxor/HaxorMedium-13.bdf|-ucw.cz-Haxor-Medium-R-Normal--13-120-72-72-C-72-iso8859-2
haxor/HaxorNarrow-15.bdf|-ucw.cz-Haxor-Narrow-R-Normal--15-120-72-72-M-72-iso8859-2
haxor/HaxorNarrow-16.bdf|-ucw.cz-Haxor-Narrow-R-Normal--16-120-72-72-M-72-iso8859-2
haxor/HaxorNarrow-17.bdf|-ucw.cz-Haxor-Narrow-R-Normal--18-120-72-72-M-72-iso8859-2
haxor/PsevdoAzbukaMedium-12.bdf|-ucw.cz-PsevdoAzbuka-Medium-R-Normal--12-120-72-72-C-72-iso8859-2
jmk-x11-fonts-3.0/modd-ascii-06x11-bold.bdf|-jmk-Modd-Bold-R-Normal--11-100-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/modd-ascii-06x11.bdf|-jmk-Modd-Medium-R-Normal--11-100-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/modd-ascii-06x13-bold.bdf|-jmk-Modd-Bold-R-SemiCondensed--13-120-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/modd-ascii-06x13.bdf|-jmk-Modd-Medium-R-SemiCondensed--13-120-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/modd-iso8859-1-06x11-bold.bdf|-jmk-Modd-Bold-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/modd-iso8859-1-06x11.bdf|-jmk-Modd-Medium-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/modd-iso8859-1-06x13-bold.bdf|-jmk-Modd-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/modd-iso8859-1-06x13.bdf|-jmk-Modd-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-05x10.bdf|-jmk-Neep Alt-Medium-R-Normal--10-80-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-05x11-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-05x11.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-06x11-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-06x11.bdf|-jmk-Neep Alt-Medium-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-06x13-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-06x13.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-08x15-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--15-140-75-75-C-80-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-08x15.bdf|-jmk-Neep Alt-Medium-R-Normal--15-140-75-75-C-80-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-10x20-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--20-180-75-75-C-100-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-10x20.bdf|-jmk-Neep Alt-Medium-R-Normal--20-180-75-75-C-100-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-12x24-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--24-240-75-75-C-120-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-1-12x24.bdf|-jmk-Neep Alt-Medium-R-Normal--24-240-75-75-C-120-ISO8859-1
jmk-x11-fonts-3.0/neep-alt-iso8859-15-05x10.bdf|-jmk-Neep Alt-Medium-R-Normal--10-80-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-05x11-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-05x11.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-06x11-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--11-100-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-06x11.bdf|-jmk-Neep Alt-Medium-R-Normal--11-100-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-06x13-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-06x13.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-08x15-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--15-140-75-75-C-80-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-08x15.bdf|-jmk-Neep Alt-Medium-R-Normal--15-140-75-75-C-80-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-10x20-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--20-180-75-75-C-100-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-10x20.bdf|-jmk-Neep Alt-Medium-R-Normal--20-180-75-75-C-100-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-12x24-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--24-240-75-75-C-120-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-15-12x24.bdf|-jmk-Neep Alt-Medium-R-Normal--24-240-75-75-C-120-ISO8859-15
jmk-x11-fonts-3.0/neep-alt-iso8859-2-05x10.bdf|-jmk-Neep Alt-Medium-R-Normal--10-80-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-05x11-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-05x11.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-06x11-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--11-100-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-06x11.bdf|-jmk-Neep Alt-Medium-R-Normal--11-100-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-06x13-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-06x13.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-08x15-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--15-140-75-75-C-80-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-08x15.bdf|-jmk-Neep Alt-Medium-R-Normal--15-140-75-75-C-80-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-10x20-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--20-180-75-75-C-100-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-10x20.bdf|-jmk-Neep Alt-Medium-R-Normal--20-180-75-75-C-100-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-12x24-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--24-240-75-75-C-120-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-2-12x24.bdf|-jmk-Neep Alt-Medium-R-Normal--24-240-75-75-C-120-ISO8859-2
jmk-x11-fonts-3.0/neep-alt-iso8859-9-05x10.bdf|-jmk-Neep Alt-Medium-R-Normal--10-80-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-05x11-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-05x11.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-06x11-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--11-100-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-06x11.bdf|-jmk-Neep Alt-Medium-R-Normal--11-100-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-06x13-bold.bdf|-jmk-Neep Alt-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-06x13.bdf|-jmk-Neep Alt-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-08x15-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--15-140-75-75-C-80-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-08x15.bdf|-jmk-Neep Alt-Medium-R-Normal--15-140-75-75-C-80-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-10x20-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--20-180-75-75-C-100-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-10x20.bdf|-jmk-Neep Alt-Medium-R-Normal--20-180-75-75-C-100-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-12x24-bold.bdf|-jmk-Neep Alt-Bold-R-Normal--24-240-75-75-C-120-ISO8859-9
jmk-x11-fonts-3.0/neep-alt-iso8859-9-12x24.bdf|-jmk-Neep Alt-Medium-R-Normal--24-240-75-75-C-120-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-1-05x10.bdf|-jmk-Neep-Medium-R-Normal--10-80-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-05x11-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-05x11.bdf|-jmk-Neep-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-06x11-bold.bdf|-jmk-Neep-Bold-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-06x11.bdf|-jmk-Neep-Medium-R-Normal--11-100-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-06x13-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-06x13.bdf|-jmk-Neep-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-08x15-bold.bdf|-jmk-Neep-Bold-R-Normal--15-140-75-75-C-80-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-08x15.bdf|-jmk-Neep-Medium-R-Normal--15-140-75-75-C-80-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-10x20-bold.bdf|-jmk-Neep-Bold-R-Normal--20-180-75-75-C-100-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-10x20.bdf|-jmk-Neep-Medium-R-Normal--20-180-75-75-C-100-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-12x24-bold.bdf|-jmk-Neep-Bold-R-Normal--24-240-75-75-C-120-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-1-12x24.bdf|-jmk-Neep-Medium-R-Normal--24-240-75-75-C-120-ISO8859-1
jmk-x11-fonts-3.0/neep-iso8859-15-05x10.bdf|-jmk-Neep-Medium-R-Normal--10-80-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-05x11-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-05x11.bdf|-jmk-Neep-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-06x11-bold.bdf|-jmk-Neep-Bold-R-Normal--11-100-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-06x11.bdf|-jmk-Neep-Medium-R-Normal--11-100-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-06x13-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-06x13.bdf|-jmk-Neep-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-08x15-bold.bdf|-jmk-Neep-Bold-R-Normal--15-140-75-75-C-80-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-08x15.bdf|-jmk-Neep-Medium-R-Normal--15-140-75-75-C-80-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-10x20-bold.bdf|-jmk-Neep-Bold-R-Normal--20-180-75-75-C-100-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-10x20.bdf|-jmk-Neep-Medium-R-Normal--20-180-75-75-C-100-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-12x24-bold.bdf|-jmk-Neep-Bold-R-Normal--24-240-75-75-C-120-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-15-12x24.bdf|-jmk-Neep-Medium-R-Normal--24-240-75-75-C-120-ISO8859-15
jmk-x11-fonts-3.0/neep-iso8859-2-05x10.bdf|-jmk-Neep-Medium-R-Normal--10-80-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-05x11-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-05x11.bdf|-jmk-Neep-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-06x11-bold.bdf|-jmk-Neep-Bold-R-Normal--11-100-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-06x11.bdf|-jmk-Neep-Medium-R-Normal--11-100-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-06x13-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-06x13.bdf|-jmk-Neep-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-08x15-bold.bdf|-jmk-Neep-Bold-R-Normal--15-140-75-75-C-80-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-08x15.bdf|-jmk-Neep-Medium-R-Normal--15-140-75-75-C-80-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-10x20-bold.bdf|-jmk-Neep-Bold-R-Normal--20-180-75-75-C-100-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-10x20.bdf|-jmk-Neep-Medium-R-Normal--20-180-75-75-C-100-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-12x24-bold.bdf|-jmk-Neep-Bold-R-Normal--24-240-75-75-C-120-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-2-12x24.bdf|-jmk-Neep-Medium-R-Normal--24-240-75-75-C-120-ISO8859-2
jmk-x11-fonts-3.0/neep-iso8859-9-05x10.bdf|-jmk-Neep-Medium-R-Normal--10-80-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-05x11-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--11-100-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-05x11.bdf|-jmk-Neep-Medium-R-SemiCondensed--11-100-75-75-C-50-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-06x11-bold.bdf|-jmk-Neep-Bold-R-Normal--11-100-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-06x11.bdf|-jmk-Neep-Medium-R-Normal--11-100-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-06x13-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-06x13.bdf|-jmk-Neep-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-08x15-bold.bdf|-jmk-Neep-Bold-R-Normal--15-140-75-75-C-80-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-08x15.bdf|-jmk-Neep-Medium-R-Normal--15-140-75-75-C-80-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-10x20-bold.bdf|-jmk-Neep-Bold-R-Normal--20-180-75-75-C-100-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-10x20.bdf|-jmk-Neep-Medium-R-Normal--20-180-75-75-C-100-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-12x24-bold.bdf|-jmk-Neep-Bold-R-Normal--24-240-75-75-C-120-ISO8859-9
jmk-x11-fonts-3.0/neep-iso8859-9-12x24.bdf|-jmk-Neep-Medium-R-Normal--24-240-75-75-C-120-ISO8859-9
jmk-x11-fonts-3.0/neep-post-ampersand-05x10.bdf|-jmk-Neep-Medium-R-Normal--10-80-75-75-C-50-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-05x11-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--11-100-75-75-C-50-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-05x11.bdf|-jmk-Neep-Medium-R-SemiCondensed--11-100-75-75-C-50-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-06x11-bold.bdf|-jmk-Neep-Bold-R-Normal--11-100-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-06x11.bdf|-jmk-Neep-Medium-R-Normal--11-100-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-06x13-bold.bdf|-jmk-Neep-Bold-R-SemiCondensed--13-120-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-06x13.bdf|-jmk-Neep-Medium-R-SemiCondensed--13-120-75-75-C-60-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-08x15-bold.bdf|-jmk-Neep-Bold-R-Normal--15-140-75-75-C-80-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-08x15.bdf|-jmk-Neep-Medium-R-Normal--15-140-75-75-C-80-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-10x20-bold.bdf|-jmk-Neep-Bold-R-Normal--20-180-75-75-C-100-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-10x20.bdf|-jmk-Neep-Medium-R-Normal--20-180-75-75-C-100-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-12x24-bold.bdf|-jmk-Neep-Bold-R-Normal--24-240-75-75-C-120-US-ASCII
jmk-x11-fonts-3.0/neep-post-ampersand-12x24.bdf|-jmk-Neep-Medium-R-Normal--24-240-75-75-C-120-US-ASCII
kakwa/kakwafont-12-b.bdf|-kakwa-kakwafont-Medium-R-Bold--12-120-72-72-C-60-ISO8859-1
kakwa/kakwafont-12-n.bdf|-kakwa-kakwafont-Medium-R-Normal--12-120-72-72-C-60-ISO8859-1
knxt/knxt.bdf|-k-knxt-Medium-R-Normal--20-200-72-72-C-100-ISO10646-1
kourier/kourier.bdf|-windows-Kourier-medium-r-normal--15-90-96-96-c-70-microsoft-cp1252
kourier/kourierss.bdf|-windows-Kourier SanSerif-medium-r-normal--15-90-96-96-c-70-microsoft-cp1252
leggie/leggie.bdf|-wiktorb-leggie-Medium-R-Normal--12----C--ISO10646-1
mplus/mplus_f10b.bdf|-mplus-fxd-bold-R-normal--10-100-75-75-C-60-iso8859-1
mplus/mplus_f10r.bdf|-mplus-fxd-medium-R-normal--10-100-75-75-C-60-iso8859-1
mplus/mplus_f12b.bdf|-mplus-fxd-bold-R-semicondensed--12-120-75-75-C-60-iso8859-1
mplus/mplus_f12r.bdf|-mplus-fxd-medium-R-semicondensed--12-120-75-75-C-60-iso8859-1
mplus/mplus_h10b.bdf|-mplus-hlv-bold-R-normal--10-100-75-75-P-60-iso8859-1
mplus/mplus_h10r.bdf|-mplus-hlv-medium-R-normal--10-100-75-75-P-50-iso8859-1
mplus/mplus_h12b.bdf|-mplus-hlv-bold-R-normal--12-120-75-75-P-70-iso8859-1
mplus/mplus_h12r.bdf|-mplus-hlv-medium-R-normal--12-120-75-75-P-60-iso8859-1
mplus/mplus_q06r.bdf|-mplus-qub-medium-R-normal--6-60-75-75-P-40-iso8859-1
mplus/mplus_s10b.bdf|-mplus-sys-bold-R-normal--10-100-75-75-P-70-iso8859-1
mplus/mplus_s10r.bdf|-mplus-sys-medium-R-normal--10-100-75-75-P-60-iso8859-1
phallus/lemon.bdf|-benis-lemon-medium-r-normal--10-110-75-75-m-50-ISO8859-1
phallus/uushi.bdf|-benis-uushi-medium-R-Normal--11-90-75-75-P-58-ISO10646-1
progsole/progsole-10.bdf|-FontForge-progsole-Medium-R-Normal--10-100-75-75-C-60-ISO8859-1
scientifica/scientifica-11.bdf|-nerdypepper-scientifica-medium-r-normal--11-80-100-100-C-50-ISO10646-1
scientifica/scientificaBold-11.bdf|-nerdypepper-scientifica-medium-r-normal--11-80-100-100-C-50-ISO10646-1
scientifica/scientificaItalic-11.bdf|-nerdypepper-scientifica-medium-r-normal--11-80-100-100-C-50-ISO10646-1
sq/sq.bdf|-chris2-sq-Medium-R-Normal--15-140-75-75-C-100-ISO8859-1
sq/sqb.bdf|-chris2-sq-Bold-R-Normal--15-140-75-75-C-100-iso8859-1
terminus-font-4.39/ter-u12b.bdf|-xos4-Terminus-Bold-R-Normal--12-120-72-72-C-60-ISO10646-1
terminus-font-4.39/ter-u12n.bdf|-xos4-Terminus-Medium-R-Normal--12-120-72-72-C-60-ISO10646-1
terminus-font-4.39/ter-u14b.bdf|-xos4-Terminus-Bold-R-Normal--14-140-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u14n.bdf|-xos4-Terminus-Medium-R-Normal--14-140-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u14v.bdf|-xos4-Terminus-Bold-R-Normal--14-140-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u16b.bdf|-xos4-Terminus-Bold-R-Normal--16-160-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u16n.bdf|-xos4-Terminus-Medium-R-Normal--16-160-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u16v.bdf|-xos4-Terminus-Bold-R-Normal--16-160-72-72-C-80-ISO10646-1
terminus-font-4.39/ter-u18b.bdf|-xos4-Terminus-Bold-R-Normal--18-180-72-72-C-100-ISO10646-1
terminus-font-4.39/ter-u18n.bdf|-xos4-Terminus-Medium-R-Normal--18-180-72-72-C-100-ISO10646-1
terminus-font-4.39/ter-u20b.bdf|-xos4-Terminus-Bold-R-Normal--20-200-72-72-C-100-ISO10646-1
terminus-font-4.39/ter-u20n.bdf|-xos4-Terminus-Medium-R-Normal--20-200-72-72-C-100-ISO10646-1
terminus-font-4.39/ter-u22b.bdf|-xos4-Terminus-Bold-R-Normal--22-220-72-72-C-110-ISO10646-1
terminus-font-4.39/ter-u22n.bdf|-xos4-Terminus-Medium-R-Normal--22-220-72-72-C-110-ISO10646-1
terminus-font-4.39/ter-u24b.bdf|-xos4-Terminus-Bold-R-Normal--24-240-72-72-C-120-ISO10646-1
terminus-font-4.39/ter-u24n.bdf|-xos4-Terminus-Medium-R-Normal--24-240-72-72-C-120-ISO10646-1
terminus-font-4.39/ter-u28b.bdf|-xos4-Terminus-Bold-R-Normal--28-280-72-72-C-140-ISO10646-1
terminus-font-4.39/ter-u28n.bdf|-xos4-Terminus-Medium-R-Normal--28-280-72-72-C-140-ISO10646-1
terminus-font-4.39/ter-u32b.bdf|-xos4-Terminus-Bold-R-Normal--32-320-72-72-C-160-ISO10646-1
terminus-font-4.39/ter-u32n.bdf|-xos4-Terminus-Medium-R-Normal--32-320-72-72-C-160-ISO10646-1
trisk/TriskwelineBold-12.bdf|-PfaEdit-Triskweline-Bold-R-Normal--13-120-75-75-M-80-ISO8859-1
trisk/TriskwelineNormal-12.bdf|-PfaEdit-Triskweline-Normal-R-Normal--13-120-75-75-M-80-ISO8859-1
uw-ttyp0-1.2/t0-11.bdf|-UW-Ttyp0-Medium-R-Normal--11-100-75-75-C-60-UW-Fontspecific
uw-ttyp0-1.2/t0-11b.bdf|-UW-Ttyp0-Bold-R-Normal--11-100-75-75-C-60-UW-Fontspecific
uw-ttyp0-1.2/t0-12.bdf|-UW-Ttyp0-Medium-R-Normal--12-110-75-75-C-60-UW-Fontspecific
uw-ttyp0-1.2/t0-12b.bdf|-UW-Ttyp0-Bold-R-Normal--12-110-75-75-C-60-UW-Fontspecific
uw-ttyp0-1.2/t0-13.bdf|-UW-Ttyp0-Medium-R-Normal--13-120-75-75-C-70-UW-Fontspecific
uw-ttyp0-1.2/t0-13b.bdf|-UW-Ttyp0-Bold-R-Normal--13-120-75-75-C-70-UW-Fontspecific
uw-ttyp0-1.2/t0-14.bdf|-UW-Ttyp0-Medium-R-Normal--14-130-75-75-C-70-UW-Fontspecific
uw-ttyp0-1.2/t0-14b.bdf|-UW-Ttyp0-Bold-R-Normal--14-130-75-75-C-70-UW-Fontspecific
uw-ttyp0-1.2/t0-15.bdf|-UW-Ttyp0-Medium-R-Normal--15-140-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-15b.bdf|-UW-Ttyp0-Bold-R-Normal--15-140-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-15i.bdf|-UW-Ttyp0-Medium-I-Normal--15-140-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-16.bdf|-UW-Ttyp0-Medium-R-Normal--16-150-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-16b.bdf|-UW-Ttyp0-Bold-R-Normal--16-150-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-16i.bdf|-UW-Ttyp0-Medium-I-Normal--16-150-75-75-C-80-UW-Fontspecific
uw-ttyp0-1.2/t0-17.bdf|-UW-Ttyp0-Medium-R-Normal--17-160-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-17b.bdf|-UW-Ttyp0-Bold-R-Normal--17-160-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-17i.bdf|-UW-Ttyp0-Medium-I-Normal--17-160-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-18.bdf|-UW-Ttyp0-Medium-R-Normal--18-170-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-18b.bdf|-UW-Ttyp0-Bold-R-Normal--18-170-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-18i.bdf|-UW-Ttyp0-Medium-I-Normal--18-170-75-75-C-90-UW-Fontspecific
uw-ttyp0-1.2/t0-22.bdf|-UW-Ttyp0-Medium-R-Normal--22-200-75-75-C-110-UW-Fontspecific
uw-ttyp0-1.2/t0-22b.bdf|-UW-Ttyp0-Bold-R-Normal--22-200-75-75-C-110-UW-Fontspecific
xbmicons/xbmicons.bdf|-Misc-xbmicons-Medium-R-Normal--12-120-72-72-C-60-ISO10646-1
zevv-peep/zevv-peep-iso8859-1-07x14.bdf|-zevv-peep-Medium-R-Normal--14-130-75-75-C-70-ISO8859-1
zevv-peep/zevv-peep-iso8859-1-08x16.bdf|-zevv-peep-Medium-R-Normal--16-140-75-75-C-80-ISO8859-1
zevv-peep/zevv-peep-iso8859-1-10x20.bdf|-zevv-peep-Medium-R-Normal--20-175-75-75-C-100-ISO8859-1
zevv-peep/zevv-peep-iso8859-15-07x14.bdf|-zevv-peep-Medium-R-Normal--14-130-75-75-C-70-ISO8859-15
zevv-peep/zevv-peep-iso8859-15-08x16.bdf|-zevv-peep-Medium-R-Normal--16-140-75-75-C-80-ISO8859-15
zevv-peep/zevv-peep-iso8859-15-10x20.bdf|-zevv-peep-Medium-R-Normal--20-175-75-75-C-100-ISO8859-15`;

41
tools/fontgen/index.html Normal file
View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>8bitworkshop Bitmap Font Generator</title>
<style type="text/css" media="screen">
#previewCanvas {
}
</style>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
if (window.location.host.endsWith('8bitworkshop.com')) {
ga('create', 'UA-54497476-9', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
</head>
<body>
<div id="layout" style="position:absolute;top:0;left:0;bottom:0;right:0">
</div>
<div style="display:none">
<canvas id="previewCanvas" width=640 height=256></canvas>
<textarea id="codeTextarea" cols=80 rows=8>/* output appears here */</textarea>
</div>
<script src="../../jquery/jquery-2.2.3.min.js"></script>
<link rel="stylesheet" href="../../lib/w2ui-1.5.rc1.css">
<script src="../../lib/w2ui-1.5.rc1.js"></script>
<!--
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
-->
<script src="./fontlist.js"></script>
<script src="./uifont.js"></script>
</body>
</html>

332
tools/fontgen/uifont.js Normal file
View File

@ -0,0 +1,332 @@
var font;
var params = {
bpp:1,
wbytes:1,
width:8,
height:8,
lochar:32,
hichar:95,
rotate:false,
xflip:false,
yflip:false,
msbfirst:false,
};
var errors;
var previewCanvas = $("#previewCanvas");
var codeTextarea = $("#codeTextarea");
var paramsForm = $("#paramsForm");
function refreshPreset(item) {
console.log(item);
w2ui.toolbar.set('bpp', {value:'1'});
w2ui.toolbar.set('width', {value:'8'});
w2ui.toolbar.set('height', {value:'8'});
w2ui.toolbar.set('lochar', {value:'32'});
w2ui.toolbar.set('hichar', {value:'95'});
}
function parseBDF(text) {
var chars = {};
var chord;
var ch;
var lines = text.split(/\r?\n/);
var bounds = [0,0,0,0];
for (var i=0; i<lines.length; i++) {
var l = lines[i];
var toks = l.split(/\s+/);
if (toks.length == 0) continue;
switch (toks[0]) {
case 'ENCODING':
chord = parseInt(toks[1]);
ch = {ord:chord};
break;
case 'BITMAP':
ch.bytes = [];
break;
case 'BBX':
if (ch) {
ch.bbx = toks.slice(1).map(function(s) { return parseInt(s); });
bounds[0] = Math.min(bounds[0], ch.bbx[2]);
bounds[1] = Math.min(bounds[1], ch.bbx[3]);
bounds[2] = Math.max(bounds[2], ch.bbx[2]+ch.bbx[0]);
bounds[3] = Math.max(bounds[3], ch.bbx[3]+ch.bbx[1]);
}
break;
case 'ENDCHAR':
chars[chord] = ch;
ch = null;
break;
default:
if (ch && ch.bytes && toks.length == 1) {
var n = parseInt(toks[0], 16);
n <<= (6-toks[0].length) * 4;
ch.bytes.push(n);
}
break;
}
}
return {chars:chars,bounds:bounds,pixbounds:[0,0,0,0]};
}
function loadFont(rec) {
font = {};
var path = 'bitmap-fonts/bitmap/' + rec.path;
$.get(path, function(text) {
font = parseBDF(text);
font.rec = rec;
font.path = path;
console.log(font);
previewFont();
codeTextarea.text(encodeFont());
});
}
function renderGlyph(glyph, putPixel) {
var w = glyph.bbx[0];
var h = glyph.bbx[1];
var dx = glyph.bbx[2];
var dy = glyph.bbx[3];
for (var y=0; y<glyph.bytes.length; y++) {
for (var x=0; x<w; x++) {
if (glyph.bytes[glyph.bytes.length-y-1] & (0x800000 >> x)) {
var xx = x+dx;
var yy = y+dy;
font.pixbounds[0] = Math.min(font.pixbounds[0], xx);
font.pixbounds[1] = Math.min(font.pixbounds[1], yy);
font.pixbounds[2] = Math.max(font.pixbounds[2], xx);
font.pixbounds[3] = Math.max(font.pixbounds[3], yy);
putPixel(xx, yy);
}
}
}
return {w:w+dx,h:h+dy};
}
function drawChar(x0, y0, chord) {
var ctx = previewCanvas[0].getContext('2d');
ctx.fillStyle = "black";
var glyph = font.chars[chord];
if (glyph) {
return renderGlyph(glyph, function(x,y) {
ctx.fillRect( x0+x, y0-y, 1, 1 );
});
} else {
return {w:8,h:8}; // TODO: avgwidth, height
}
}
function drawString(x, y, str) {
for (var i=0; i<str.length; i++) {
x += drawChar(x, y, str.charCodeAt(i)).w+1;
}
}
var TEST_SENTENCES = [
"0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"!@#$%^&*()+ -- == [] {} <>?,./;':\"",
"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG'S BOWL",
"the quick brown fox jumps over the lazy dog's bowl",
//"Pack my box with five dozen liquor jugs.",
];
function previewFont() {
var ctx = previewCanvas[0].getContext('2d');
ctx.fillStyle = "white";
ctx.fillRect( 0, 0, 1024, 1024 );
var x = 8;
var y = 8;
//console.log(font);
TEST_SENTENCES.forEach(function(s) {
y += font.rec.pixelsize + 1;
drawString(x, y, s);
});
}
function encodeGlyph(glyph, bytes) {
var abort = false;
renderGlyph(glyph, function(x,y) {
//x -= font.pixbounds[0];
//y -= font.pixbounds[1];
if (params.rotate) {
var y2 = x; var x2 = y; x = x2; y = y2;
}
if (params.yflip) { y = params.height-1-y; }
if (params.xflip) { x = params.width-1-x; }
var xoutrange = (x < 0 || x >= params.width);
var youtrange = (y < 0 || y >= params.height);
if (xoutrange || youtrange) {
if (!abort) {
errors.push((xoutrange?"X":"Y") + " out of range on character " + String.fromCharCode(glyph.ord) + " " + x + "," + y);
abort = true;
}
}
var bpb = 8 / (params.bpp||1);
var ofs = Math.floor(x/bpb) + (params.height-1-y)*params.wbytes;
var bit = x % bpb;
if (params.msbfirst) { bit = 7-bit; }
bytes[ofs] |= 1<<bit;
});
}
function encodeFont() {
var s = '/* ' + JSON.stringify(params) + JSON.stringify(font.bounds) + JSON.stringify(font.pixbounds) + ' */\n';
s += "#define LOCHAR " + params.lochar + "\n";
s += "#define HICHAR " + params.hichar + "\n";
s += "#define FONT_HEIGHT " + params.height + "\n";
s += "const char FONT[HICHAR-LOCHAR+1][FONT_HEIGHT] = {\n";
errors = [];
for (var chord=params.lochar; chord<=params.hichar; chord++) {
var glyph = font.chars[chord];
var bytes = new Uint8Array(params.wbytes*params.height);
if (glyph) {
encodeGlyph(glyph, bytes);
s += "{ ";
for (var i=0; i<bytes.length; i++) {
s += "0x" + bytes[i].toString(16) + ",";
}
s += " },";
s += "\n";
}
}
s += "};\n";
while (errors.length) {
s = "/* " + errors.pop() + " */\n" + s;
}
return s;
}
/////
var FONTRECS = [];
var li = 0;
for (var line of FONTLIST.split("\n")) {
var ltoks = line.split("|");
var ftoks = ltoks[1].split("-");
var rec = {
recid: ++li,
path: ltoks[0],
foundry: ftoks[1],
family: ftoks[2],
weight: ftoks[3].toLowerCase(),
slant: ftoks[4].toUpperCase(),
setwidth: ftoks[5],
addstyle: ftoks[6],
pixelsize: parseInt(ftoks[7]),
pointsize: parseInt(ftoks[8]),
resx: parseInt(ftoks[9]),
resy: parseInt(ftoks[10]),
spacing: ftoks[11].toUpperCase(),
avgwidth: ftoks[12]/10,
registry: ftoks[13],
encoding: ftoks[14],
};
FONTRECS.push(rec);
}
function toolbarHTMLItem(id, title, maxchars) {
return function(item) {
var html = '<div style="padding: 3px 5px;">' + title + '&nbsp;' +
'<input size=' + maxchars + ' maxlength=' + maxchars +
' onchange="var el = w2ui.toolbar.set(\'' + id + '\', { value: this.value });" '+
' value="'+ (item.value || '') + '"/></div>';
return html;
};
}
$().w2toolbar({
name: 'toolbar',
items: [
{ type: 'menu-radio', id: 'preset', caption: 'Presets', img: 'icon-folder',
text: function(item) { refreshPreset(item); return item.caption; },
items: [
{ text: 'Generic 8x8', id: '8x8' },
{ text: 'Atari 2600', id: 'vcs' },
{ text: 'Midway 8080', id: 'mw8080bw' },
{ text: 'NES', id: 'nes' }
]},
{ type: 'check', id: 'rotate', caption: 'Rotate' },
{ type: 'check', id: 'yflip', caption: 'Flip' },
{ type: 'menu-radio', id: 'bpp', caption: 'BPP', img: 'fas fa-star', items: [
{ text: '1' },
{ text: '2' },
{ text: '4' },
{ text: '8' }
]},
{ type: 'html', id: 'width', html: toolbarHTMLItem('width','Width:',2) },
{ type: 'html', id: 'height', html: toolbarHTMLItem('height','Height:',2) },
{ type: 'break', id: 'break1' },
{ type: 'menu-radio', id: 'charsel', caption: 'Characters', img: 'icon-folder', items: [
//{ text: 'ISO (256 chars)', value:'0-255' },
{ text: 'ASCII (upper+lower)', id:'32-95' },
{ text: 'ASCII (upper only)', id:'32-127' }
]},
{ type: 'html', id: 'lochar', html: toolbarHTMLItem('lochar','First:',3) },
{ type: 'html', id: 'hichar', html: toolbarHTMLItem('hichar','Last:',3) },
/*
{ type: 'spacer' },
{ type: 'check', id: 'item1', caption: 'Check', img: 'icon-page', checked: true },
{ type: 'break', id: 'break0' },
{ type: 'radio', id: 'item3', group: '1', caption: 'Radio 1', icon: 'fa-star', checked: true },
{ type: 'radio', id: 'item4', group: '1', caption: 'Radio 2', icon: 'fa-star-empty' },
{ type: 'button', id: 'item5', caption: 'Item 5', icon: 'fa-home' }
*/
]
});
$().w2grid({
name : 'fontGrid',
show : {
toolbar : true
},
multiSearch: true,
searches: [
{ field: 'weight', caption: 'Weight', type: 'list', options: { items: ['medium','bold','narrow']} },
{ field: 'slant', caption: 'Slant', type: 'list', options: { items: ['R','O']} },
{ field: 'spacing', caption: 'Spacing', type: 'list', options: { items: ['C','M','P']} },
{ field: 'pixelsize', caption: 'Pixel Size', type: 'int' },
{ field: 'avgwidth', caption: 'Avg. Width', type: 'int' },
],
columns: [
{ field: 'foundry', caption: 'Foundry', size: '20%', sortable:true },
{ field: 'family', caption: 'Family', size: '20%', sortable:true },
{ field: 'weight', caption: 'Weight', size: '10%', sortable:true },
{ field: 'slant', caption: 'Slant', size: '10%', sortable:true },
{ field: 'pixelsize', caption: 'Pixel Size', size: '10%', sortable:true },
{ field: 'avgwidth', caption: 'Avg. Width', size: '10%', sortable:true },
{ field: 'spacing', caption: 'Spacing', size: '10%', sortable:true },
],
records: FONTRECS,
onClick: function (event) {
var record = this.get(event.recid);
loadFont(record);
},
});
var pstyle = 'background-color: #F5F6F7; border: 1px solid #dfdfdf; padding: 5px;';
$('#layout').w2layout({
name: 'layout',
panels: [
{ type: 'top', size: 50, resizable: false, style: pstyle, content: 'top' },
{ type: 'left', size: 200, resizable: true, style: pstyle, content: paramsForm },
{ type: 'main', style: pstyle, content: codeTextarea },
{ type: 'preview', size: '50%', resizable: true, style: pstyle, content: previewCanvas },
{ type: 'right', size: 200, resizable: true, style: pstyle, content: 'right' },
{ type: 'bottom', size: 200, resizable: true, style: pstyle, content: 'bottom' }
]
});
w2ui['layout'].content('top', w2ui['toolbar']);
w2ui['layout'].content('bottom', w2ui['fontGrid']);
w2ui.toolbar.set('preset', {selected:'8x8'});
w2ui.toolbar.set('bpp', {value:'1'});
w2ui.toolbar.set('width', {value:'8'});
w2ui.toolbar.set('height', {value:'8'});
w2ui.toolbar.set('lochar', {value:'32'});
w2ui.toolbar.set('hichar', {value:'95'});