Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiaie committed Mar 11, 2019
0 parents commit 7bd52dc
Show file tree
Hide file tree
Showing 197 changed files with 1,328 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
out
20 changes: 20 additions & 0 deletions GNUmakefile
@@ -0,0 +1,20 @@
# TODO: Expand this to handle more font styles and sizes
FONT:=basic
SIZE:=8x8
OUT:=out/$(FONT)-$(SIZE).png
GLYPHS:=$(addprefix $(FONT)/$(SIZE)/glyphs/, 20.pbm 21.pbm 22.pbm 23.pbm 24.pbm 25.pbm 26.pbm 27.pbm 28.pbm 29.pbm 2A.pbm 2B.pbm 2C.pbm 2D.pbm 2E.pbm 2F.pbm 30.pbm 31.pbm 32.pbm 33.pbm 34.pbm 35.pbm 36.pbm 37.pbm 38.pbm 39.pbm 3A.pbm 3B.pbm 3C.pbm 3D.pbm 3E.pbm 3F.pbm 40.pbm 41.pbm 42.pbm 43.pbm 44.pbm 45.pbm 46.pbm 47.pbm 48.pbm 49.pbm 4A.pbm 4B.pbm 4C.pbm 4D.pbm 4E.pbm 4F.pbm 50.pbm 51.pbm 52.pbm 53.pbm 54.pbm 55.pbm 56.pbm 57.pbm 58.pbm 59.pbm 5A.pbm 5B.pbm 5C.pbm 5D.pbm 5E.pbm 5F.pbm 60.pbm 61.pbm 62.pbm 63.pbm 64.pbm 65.pbm 66.pbm 67.pbm 68.pbm 69.pbm 6A.pbm 6B.pbm 6C.pbm 6D.pbm 6E.pbm 6F.pbm 70.pbm 71.pbm 72.pbm 73.pbm 74.pbm 75.pbm 76.pbm 77.pbm 78.pbm 79.pbm 7A.pbm 7B.pbm 7C.pbm 7D.pbm 7E.pbm 7F.pbm)

all: $(OUT)

# FIXME: The -tile option seems to have changed in recent versions of
# ImageMagick; works for now in Devuan Linux
$(OUT): $(GLYPHS)
montage $^ -tile 16x6 -geometry +0+0 $@


clean:
rm -f $(OUT)


.PHONY: all clean

24 changes: 24 additions & 0 deletions LICENSE
@@ -0,0 +1,24 @@
© 2019 Kaia Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Kaia Ltd. nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL KAIA LTD. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

28 changes: 28 additions & 0 deletions README.md
@@ -0,0 +1,28 @@
# Pixel fonts for the Web

## Background

One of the first large programs I ever wrote was a font editor for the ZX
Spectrum computer, some time in the mid 1980s. It spurred an interest in
typography that persists to this day. This project is something of a throwback
to those days, as it's intended to produce pixel fonts for a retro game engine
in JavaScript I'm working on.

The fonts comprise single files in [Netpbm bitmap
format](https://en.wikipedia.org/wiki/Netpbm_format). This format was chosen
because it is human-readable and easy to edit in a regular text editor. A
makefile uses the `montage` tool that comes with the
[ImageMagick](http://www.imagemagick.org/script/montage.php) utilities to
convert the font into a single image (similar to a CSS sprite). Only fixed-width
fonts are supported for now, and only characters in the Basic Latin (i.e., 7-bit
ASCII) range are handled. An HTML/ JavaScript test script is included to test
the created font.

## Prerequisites

- GNU Make (the Makefile uses the `addprefix` function that not all variants of
`make` support
- ImageMagick (note: this project was created on Devuan Linux which uses a
somewhat old version of ImageMagick, dated 2009. Perusal of the ImageMagick
Web site suggests some of the command-line arguments may have changed on newer
releases. Your mileage may vary.)
1 change: 1 addition & 0 deletions basic/8x8/by-name/20-Space.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/21-Exclamation_mark.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/22-Quotation_mark.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/23-Number_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/24-Dollar_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/25-Percent_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/26-Ampersand.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/27-Apostrophe.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/28-Left_parenthesis.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/29-Right_parenthesis.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2A-Asterisk.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2B-Plus_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2C-Comma.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2D-Hyphen.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2E-Full_stop.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/2F-Slash.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/30-Digit_Zero.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/31-Digit_One.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/32-Digit_Two.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/33-Digit_Three.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/34-Digit_Four.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/35-Digit_Five.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/36-Digit_Six.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/37-Digit_Seven.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/38-Digit_Eight.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/39-Digit_Nine.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3A-Colon.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3B-Semicolon.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3C-Less-than_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3D-Equal_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3E-Greater-than_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/3F-Question_mark.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/40-At_sign.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/41-Latin_Capital_letter_A.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/42-Latin_Capital_letter_B.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/43-Latin_Capital_letter_C.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/44-Latin_Capital_letter_D.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/45-Latin_Capital_letter_E.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/46-Latin_Capital_letter_F.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/47-Latin_Capital_letter_G.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/48-Latin_Capital_letter_H.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/49-Latin_Capital_letter_I.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4A-Latin_Capital_letter_J.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4B-Latin_Capital_letter_K.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4C-Latin_Capital_letter_L.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4D-Latin_Capital_letter_M.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4E-Latin_Capital_letter_N.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/4F-Latin_Capital_letter_O.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/50-Latin_Capital_letter_P.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/51-Latin_Capital_letter_Q.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/52-Latin_Capital_letter_R.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/53-Latin_Capital_letter_S.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/54-Latin_Capital_letter_T.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/55-Latin_Capital_letter_U.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/56-Latin_Capital_letter_V.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/57-Latin_Capital_letter_W.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/58-Latin_Capital_letter_X.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/59-Latin_Capital_letter_Y.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5A-Latin_Capital_letter_Z.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5B-Left_Square_Bracket.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5C-Backslash.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5D-Right_Square_Bracket.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5E-Circumflex_accent.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/5F-Low_line.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/60-Grave_accent.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/61-Latin_Small_Letter_A.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/62-Latin_Small_Letter_B.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/63-Latin_Small_Letter_C.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/64-Latin_Small_Letter_D.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/65-Latin_Small_Letter_E.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/66-Latin_Small_Letter_F.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/67-Latin_Small_Letter_G.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/68-Latin_Small_Letter_H.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/69-Latin_Small_Letter_I.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6A-Latin_Small_Letter_J.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6B-Latin_Small_Letter_K.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6C-Latin_Small_Letter_L.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6D-Latin_Small_Letter_M.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6E-Latin_Small_Letter_N.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/6F-Latin_Small_Letter_O.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/70-Latin_Small_Letter_P.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/71-Latin_Small_Letter_Q.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/72-Latin_Small_Letter_R.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/73-Latin_Small_Letter_S.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/74-Latin_Small_Letter_T.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/75-Latin_Small_Letter_U.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/76-Latin_Small_Letter_V.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/77-Latin_Small_Letter_W.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/78-Latin_Small_Letter_X.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/79-Latin_Small_Letter_Y.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7A-Latin_Small_Letter_Z.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7B-Left_Curly_Bracket.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7C-Vertical_bar.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7D-Right_Curly_Bracket.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7E-Tilde.pbm
1 change: 1 addition & 0 deletions basic/8x8/by-name/7F-DELETE.pbm
11 changes: 11 additions & 0 deletions basic/8x8/glyphs/20.pbm
@@ -0,0 +1,11 @@
P1
8 8
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

11 changes: 11 additions & 0 deletions basic/8x8/glyphs/21.pbm
@@ -0,0 +1,11 @@
P1
8 8
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0

0 comments on commit 7bd52dc

Please sign in to comment.