commit 33cd053dbef3c8fbcc9175d6f229b72cb687ed9d Author: Niles Rogoff Date: Mon Sep 5 21:06:36 2016 -0400 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d42ab35 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out/* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b042dc6 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +all: + rm -rf out||: + mkdir out + python3 test.py + rm /tmp/*.ttf||: diff --git a/convert_script.sh b/convert_script.sh new file mode 100644 index 0000000..cd285a9 --- /dev/null +++ b/convert_script.sh @@ -0,0 +1,7 @@ +#!/usr/local/bin/fontforge +# Quick and dirty hack: converts a font to truetype (.ttf) +Print("Opening "+$1); +Open($1); +Print("Saving "+"/tmp/" + $2); +Generate("/tmp/" + $2); +Quit(0); diff --git a/example/100-Alternative files-Laura Worthington - Charcuterie Flared.ttf.png b/example/100-Alternative files-Laura Worthington - Charcuterie Flared.ttf.png new file mode 100644 index 0000000..ec2724b Binary files /dev/null and b/example/100-Alternative files-Laura Worthington - Charcuterie Flared.ttf.png differ diff --git a/example/101-Alternative files-Laura Worthington - Charcuterie Sans.ttf.png b/example/101-Alternative files-Laura Worthington - Charcuterie Sans.ttf.png new file mode 100644 index 0000000..cb769cf Binary files /dev/null and b/example/101-Alternative files-Laura Worthington - Charcuterie Sans.ttf.png differ diff --git a/example/102-Alternative files-Laura Worthington - Charcuterie Contrast.ttf.png b/example/102-Alternative files-Laura Worthington - Charcuterie Contrast.ttf.png new file mode 100644 index 0000000..2962584 Binary files /dev/null and b/example/102-Alternative files-Laura Worthington - Charcuterie Contrast.ttf.png differ diff --git a/example/103-Alternative files-Laura Worthington - Charcuterie Sans Inline.ttf.png b/example/103-Alternative files-Laura Worthington - Charcuterie Sans Inline.ttf.png new file mode 100644 index 0000000..ac61c23 Binary files /dev/null and b/example/103-Alternative files-Laura Worthington - Charcuterie Sans Inline.ttf.png differ diff --git a/example/104-Alternative files-Laura Worthington - Charcuterie Cursive.ttf.png b/example/104-Alternative files-Laura Worthington - Charcuterie Cursive.ttf.png new file mode 100644 index 0000000..7591c86 Binary files /dev/null and b/example/104-Alternative files-Laura Worthington - Charcuterie Cursive.ttf.png differ diff --git a/example/105-Alternative files-Laura Worthington - Charcuterie Sans Bold.ttf.png b/example/105-Alternative files-Laura Worthington - Charcuterie Sans Bold.ttf.png new file mode 100644 index 0000000..bfd4aa3 Binary files /dev/null and b/example/105-Alternative files-Laura Worthington - Charcuterie Sans Bold.ttf.png differ diff --git a/example/106-Alternative files-Laura Worthington - Charcuterie Sans Oblique.ttf.png b/example/106-Alternative files-Laura Worthington - Charcuterie Sans Oblique.ttf.png new file mode 100644 index 0000000..24d6c36 Binary files /dev/null and b/example/106-Alternative files-Laura Worthington - Charcuterie Sans Oblique.ttf.png differ diff --git a/example/107-Alternative files-Laura Worthington - Charcuterie Flared Bold.ttf.png b/example/107-Alternative files-Laura Worthington - Charcuterie Flared Bold.ttf.png new file mode 100644 index 0000000..acc2c5a Binary files /dev/null and b/example/107-Alternative files-Laura Worthington - Charcuterie Flared Bold.ttf.png differ diff --git a/example/108-Alternative files-Laura Worthington - Charcuterie Ornaments.ttf.png b/example/108-Alternative files-Laura Worthington - Charcuterie Ornaments.ttf.png new file mode 100644 index 0000000..593abcf Binary files /dev/null and b/example/108-Alternative files-Laura Worthington - Charcuterie Ornaments.ttf.png differ diff --git a/example/109-Alternative files-Laura Worthington - Charcuterie Serif Bold.ttf.png b/example/109-Alternative files-Laura Worthington - Charcuterie Serif Bold.ttf.png new file mode 100644 index 0000000..bf405cc Binary files /dev/null and b/example/109-Alternative files-Laura Worthington - Charcuterie Serif Bold.ttf.png differ diff --git a/example/1092-Accord alternate-AccordAlt_Light.ttf.png b/example/1092-Accord alternate-AccordAlt_Light.ttf.png new file mode 100644 index 0000000..e8657a1 Binary files /dev/null and b/example/1092-Accord alternate-AccordAlt_Light.ttf.png differ diff --git a/example/1093-Accord alternate-AccordAlt_Thin.ttf.png b/example/1093-Accord alternate-AccordAlt_Thin.ttf.png new file mode 100644 index 0000000..9a70d06 Binary files /dev/null and b/example/1093-Accord alternate-AccordAlt_Thin.ttf.png differ diff --git a/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png b/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png new file mode 100644 index 0000000..57913e9 Binary files /dev/null and b/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png differ diff --git a/example/1095-Accord alternate-AccordAlt_Regular.ttf.png b/example/1095-Accord alternate-AccordAlt_Regular.ttf.png new file mode 100644 index 0000000..694a8a5 Binary files /dev/null and b/example/1095-Accord alternate-AccordAlt_Regular.ttf.png differ diff --git a/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png b/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png new file mode 100644 index 0000000..24b33a2 Binary files /dev/null and b/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png differ diff --git a/example/1097-Accord alternate-AccordAlt_Bold.ttf.png b/example/1097-Accord alternate-AccordAlt_Bold.ttf.png new file mode 100644 index 0000000..5b1b2cb Binary files /dev/null and b/example/1097-Accord alternate-AccordAlt_Bold.ttf.png differ diff --git a/example/1098-Accord alternate-AccordAlt_Medium.ttf.png b/example/1098-Accord alternate-AccordAlt_Medium.ttf.png new file mode 100644 index 0000000..066ef53 Binary files /dev/null and b/example/1098-Accord alternate-AccordAlt_Medium.ttf.png differ diff --git a/example/114-fonts-corporate_gothic_nbp.ttf.png b/example/114-fonts-corporate_gothic_nbp.ttf.png new file mode 100644 index 0000000..9c4a564 Binary files /dev/null and b/example/114-fonts-corporate_gothic_nbp.ttf.png differ diff --git a/example/116-fonts-Perfect DOS VGA 437.ttf.png b/example/116-fonts-Perfect DOS VGA 437.ttf.png new file mode 100644 index 0000000..8ea5828 Binary files /dev/null and b/example/116-fonts-Perfect DOS VGA 437.ttf.png differ diff --git a/example/411-Trend Hand Made-Latinotype - TrendHMSansOne-Italic.ttf.png b/example/411-Trend Hand Made-Latinotype - TrendHMSansOne-Italic.ttf.png new file mode 100644 index 0000000..047b01d Binary files /dev/null and b/example/411-Trend Hand Made-Latinotype - TrendHMSansOne-Italic.ttf.png differ diff --git a/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png b/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png new file mode 100644 index 0000000..9848723 Binary files /dev/null and b/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png differ diff --git a/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png b/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png new file mode 100644 index 0000000..a3c7a21 Binary files /dev/null and b/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png differ diff --git a/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png b/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png new file mode 100644 index 0000000..99aba67 Binary files /dev/null and b/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png differ diff --git a/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png b/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png new file mode 100644 index 0000000..571fda2 Binary files /dev/null and b/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png differ diff --git a/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png b/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png new file mode 100644 index 0000000..ef76858 Binary files /dev/null and b/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png differ diff --git a/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png b/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png new file mode 100644 index 0000000..1a51694 Binary files /dev/null and b/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png differ diff --git a/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png b/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png new file mode 100644 index 0000000..5b67235 Binary files /dev/null and b/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png differ diff --git a/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png b/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png new file mode 100644 index 0000000..e5d5963 Binary files /dev/null and b/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png differ diff --git a/example/420-Trend Hand Made-Latinotype - TrendHMSansThree-Italic.ttf.png b/example/420-Trend Hand Made-Latinotype - TrendHMSansThree-Italic.ttf.png new file mode 100644 index 0000000..a106b1b Binary files /dev/null and b/example/420-Trend Hand Made-Latinotype - TrendHMSansThree-Italic.ttf.png differ diff --git a/example/421-Trend Hand Made-Latinotype - TrendHMSansFive-Italic.ttf.png b/example/421-Trend Hand Made-Latinotype - TrendHMSansFive-Italic.ttf.png new file mode 100644 index 0000000..60d3e07 Binary files /dev/null and b/example/421-Trend Hand Made-Latinotype - TrendHMSansFive-Italic.ttf.png differ diff --git a/example/422-Trend Hand Made-Latinotype - TrendHMSlabFive-Italic.ttf.png b/example/422-Trend Hand Made-Latinotype - TrendHMSlabFive-Italic.ttf.png new file mode 100644 index 0000000..deea832 Binary files /dev/null and b/example/422-Trend Hand Made-Latinotype - TrendHMSlabFive-Italic.ttf.png differ diff --git a/example/423-Trend Hand Made-Latinotype - TrendHMSansFour-Italic.ttf.png b/example/423-Trend Hand Made-Latinotype - TrendHMSansFour-Italic.ttf.png new file mode 100644 index 0000000..4c213ec Binary files /dev/null and b/example/423-Trend Hand Made-Latinotype - TrendHMSansFour-Italic.ttf.png differ diff --git a/example/424-Trend Hand Made-Latinotype - TrendHMSansTwo-Italic.ttf.png b/example/424-Trend Hand Made-Latinotype - TrendHMSansTwo-Italic.ttf.png new file mode 100644 index 0000000..bfa96ab Binary files /dev/null and b/example/424-Trend Hand Made-Latinotype - TrendHMSansTwo-Italic.ttf.png differ diff --git a/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png b/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png new file mode 100644 index 0000000..4ba3f5c Binary files /dev/null and b/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png differ diff --git a/example/426-Trend Hand Made-Latinotype - Trend HM Slab Three Italic.ttf.png b/example/426-Trend Hand Made-Latinotype - Trend HM Slab Three Italic.ttf.png new file mode 100644 index 0000000..40401c9 Binary files /dev/null and b/example/426-Trend Hand Made-Latinotype - Trend HM Slab Three Italic.ttf.png differ diff --git a/example/427-Trend Hand Made-Latinotype - TrendHMSlabOne-Italic.ttf.png b/example/427-Trend Hand Made-Latinotype - TrendHMSlabOne-Italic.ttf.png new file mode 100644 index 0000000..bd9781c Binary files /dev/null and b/example/427-Trend Hand Made-Latinotype - TrendHMSlabOne-Italic.ttf.png differ diff --git a/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png b/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png new file mode 100644 index 0000000..a3dfe18 Binary files /dev/null and b/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png differ diff --git a/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png b/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png new file mode 100644 index 0000000..6f5d774 Binary files /dev/null and b/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png differ diff --git a/example/430-Trend Hand Made-Latinotype - TrendHMSlabTwo-Italic.ttf.png b/example/430-Trend Hand Made-Latinotype - TrendHMSlabTwo-Italic.ttf.png new file mode 100644 index 0000000..b21bd8b Binary files /dev/null and b/example/430-Trend Hand Made-Latinotype - TrendHMSlabTwo-Italic.ttf.png differ diff --git a/example/431-Trend Hand Made-Latinotype - TrendHMSlabFour-Italic.ttf.png b/example/431-Trend Hand Made-Latinotype - TrendHMSlabFour-Italic.ttf.png new file mode 100644 index 0000000..6b6719d Binary files /dev/null and b/example/431-Trend Hand Made-Latinotype - TrendHMSlabFour-Italic.ttf.png differ diff --git a/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png b/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png new file mode 100644 index 0000000..9dad9a9 Binary files /dev/null and b/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png differ diff --git a/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png b/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png new file mode 100644 index 0000000..e626227 Binary files /dev/null and b/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png differ diff --git a/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png b/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png new file mode 100644 index 0000000..f142f8a Binary files /dev/null and b/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png differ diff --git a/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png b/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png new file mode 100644 index 0000000..efbced3 Binary files /dev/null and b/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png differ diff --git a/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png b/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png new file mode 100644 index 0000000..335244a Binary files /dev/null and b/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png differ diff --git a/example/86-Alternative files-Fontyou - Kaili FY Light.ttf.png b/example/86-Alternative files-Fontyou - Kaili FY Light.ttf.png new file mode 100644 index 0000000..1f468c6 Binary files /dev/null and b/example/86-Alternative files-Fontyou - Kaili FY Light.ttf.png differ diff --git a/example/87-Alternative files-Fontyou - Kaili FY Regular.ttf.png b/example/87-Alternative files-Fontyou - Kaili FY Regular.ttf.png new file mode 100644 index 0000000..e88cfde Binary files /dev/null and b/example/87-Alternative files-Fontyou - Kaili FY Regular.ttf.png differ diff --git a/example/88-Alternative files-Laura Worthington - Charcuterie Sans Bold Oblique.ttf.png b/example/88-Alternative files-Laura Worthington - Charcuterie Sans Bold Oblique.ttf.png new file mode 100644 index 0000000..5253dce Binary files /dev/null and b/example/88-Alternative files-Laura Worthington - Charcuterie Sans Bold Oblique.ttf.png differ diff --git a/example/89-Alternative files-Laura Worthington - Charcuterie Serif.ttf.png b/example/89-Alternative files-Laura Worthington - Charcuterie Serif.ttf.png new file mode 100644 index 0000000..1363cf5 Binary files /dev/null and b/example/89-Alternative files-Laura Worthington - Charcuterie Serif.ttf.png differ diff --git a/example/90-Alternative files-Laura Worthington - Charcuterie Block Bold Oblique.ttf.png b/example/90-Alternative files-Laura Worthington - Charcuterie Block Bold Oblique.ttf.png new file mode 100644 index 0000000..9a70ac1 Binary files /dev/null and b/example/90-Alternative files-Laura Worthington - Charcuterie Block Bold Oblique.ttf.png differ diff --git a/example/91-Alternative files-Laura Worthington - Charcuterie Engraved.ttf.png b/example/91-Alternative files-Laura Worthington - Charcuterie Engraved.ttf.png new file mode 100644 index 0000000..9f79ce7 Binary files /dev/null and b/example/91-Alternative files-Laura Worthington - Charcuterie Engraved.ttf.png differ diff --git a/example/92-Alternative files-Laura Worthington - Charcuterie Frames.ttf.png b/example/92-Alternative files-Laura Worthington - Charcuterie Frames.ttf.png new file mode 100644 index 0000000..a56892c Binary files /dev/null and b/example/92-Alternative files-Laura Worthington - Charcuterie Frames.ttf.png differ diff --git a/example/93-Alternative files-Laura Worthington - Charcuterie Block Oblique.ttf.png b/example/93-Alternative files-Laura Worthington - Charcuterie Block Oblique.ttf.png new file mode 100644 index 0000000..4b77c5b Binary files /dev/null and b/example/93-Alternative files-Laura Worthington - Charcuterie Block Oblique.ttf.png differ diff --git a/example/94-Alternative files-Laura Worthington - Charcuterie Etched.ttf.png b/example/94-Alternative files-Laura Worthington - Charcuterie Etched.ttf.png new file mode 100644 index 0000000..d9a86c7 Binary files /dev/null and b/example/94-Alternative files-Laura Worthington - Charcuterie Etched.ttf.png differ diff --git a/example/95-Alternative files-Laura Worthington - Charcuterie Deco.ttf.png b/example/95-Alternative files-Laura Worthington - Charcuterie Deco.ttf.png new file mode 100644 index 0000000..5f89541 Binary files /dev/null and b/example/95-Alternative files-Laura Worthington - Charcuterie Deco.ttf.png differ diff --git a/example/96-Alternative files-Laura Worthington - Charcuterie Catchwords.ttf.png b/example/96-Alternative files-Laura Worthington - Charcuterie Catchwords.ttf.png new file mode 100644 index 0000000..cc328c4 Binary files /dev/null and b/example/96-Alternative files-Laura Worthington - Charcuterie Catchwords.ttf.png differ diff --git a/example/97-Alternative files-Laura Worthington - Charcuterie Block Bold.ttf.png b/example/97-Alternative files-Laura Worthington - Charcuterie Block Bold.ttf.png new file mode 100644 index 0000000..bd3b1af Binary files /dev/null and b/example/97-Alternative files-Laura Worthington - Charcuterie Block Bold.ttf.png differ diff --git a/example/98-Alternative files-Laura Worthington - Charcuterie Block.ttf.png b/example/98-Alternative files-Laura Worthington - Charcuterie Block.ttf.png new file mode 100644 index 0000000..6a793bb Binary files /dev/null and b/example/98-Alternative files-Laura Worthington - Charcuterie Block.ttf.png differ diff --git a/example/99-Alternative files-Laura Worthington - Charcuterie Filigree.ttf.png b/example/99-Alternative files-Laura Worthington - Charcuterie Filigree.ttf.png new file mode 100644 index 0000000..6ebef7b Binary files /dev/null and b/example/99-Alternative files-Laura Worthington - Charcuterie Filigree.ttf.png differ diff --git a/test.py b/test.py new file mode 100644 index 0000000..21db283 --- /dev/null +++ b/test.py @@ -0,0 +1,33 @@ +from PIL import Image, ImageDraw, ImageFont +import subprocess +def getFontName(font, extra = False): + result = font.split("/")[-2] + if result == "tmp": + return font.split("/")[-1] + if extra: + result += "-" + font.split("/")[-1] + return result +i=0 +null = open("/dev/null", "w") +fonts = subprocess.check_output(["find", "/home/niles/Downloads/fonts", "-type", "f", "-iname", "*.ttf"]).decode("utf-8").split("\n")[:-1] +for font in subprocess.check_output(["find", "/home/niles/Downloads/fonts", "-type", "f", "-iname", "*.otf"]).decode("utf-8").split("\n")[:-1]: + #prettyname = "-".join(font.split("/")[-2:]).replace(".otf", ".ttf") + prettyname = getFontName(font, True).replace(".otf", ".ttf") + print("Converting " + str(i) + " " + prettyname) + i += 1 + subprocess.call(["fontforge", "-script", "convert_script.sh", font, prettyname], stderr=null, stdout=null) + fonts.append("/tmp/" + prettyname) +i = 0 +for font in fonts: + i+=1 + print("Generating " + str(i) + getFontName(font, True)) + try: + txt = Image.new('RGBA', (2000, 400), (29,204,32, 255)) + fnt = ImageFont.truetype(font, 150) + d = ImageDraw.Draw(txt) + d.text((10,10), getFontName(font, True), font=fnt, fill=(0,0,0,255)) + d.text((10,10 + 150), "The brown fox jumps over the lazy red dog or something", font=fnt, fill=(0,0,0,255)) + out = txt#Image.alpha_composite(base, txt) + out.save("out/" + str(i) + "-" + getFontName(font, True) + ".png") + except: + continue