diff --git a/Makefile b/Makefile index b042dc6..6833f05 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,3 @@ all: rm -rf out||: mkdir out python3 test.py - rm /tmp/*.ttf||: diff --git a/convert_script.sh b/convert_script.sh deleted file mode 100644 index cd285a9..0000000 --- a/convert_script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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 deleted file mode 100644 index ec2724b..0000000 Binary files a/example/100-Alternative files-Laura Worthington - Charcuterie Flared.ttf.png and /dev/null 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 deleted file mode 100644 index cb769cf..0000000 Binary files a/example/101-Alternative files-Laura Worthington - Charcuterie Sans.ttf.png and /dev/null 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 deleted file mode 100644 index 2962584..0000000 Binary files a/example/102-Alternative files-Laura Worthington - Charcuterie Contrast.ttf.png and /dev/null 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 deleted file mode 100644 index ac61c23..0000000 Binary files a/example/103-Alternative files-Laura Worthington - Charcuterie Sans Inline.ttf.png and /dev/null 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 deleted file mode 100644 index 7591c86..0000000 Binary files a/example/104-Alternative files-Laura Worthington - Charcuterie Cursive.ttf.png and /dev/null 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 deleted file mode 100644 index bfd4aa3..0000000 Binary files a/example/105-Alternative files-Laura Worthington - Charcuterie Sans Bold.ttf.png and /dev/null 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 deleted file mode 100644 index 24d6c36..0000000 Binary files a/example/106-Alternative files-Laura Worthington - Charcuterie Sans Oblique.ttf.png and /dev/null 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 deleted file mode 100644 index acc2c5a..0000000 Binary files a/example/107-Alternative files-Laura Worthington - Charcuterie Flared Bold.ttf.png and /dev/null 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 deleted file mode 100644 index 593abcf..0000000 Binary files a/example/108-Alternative files-Laura Worthington - Charcuterie Ornaments.ttf.png and /dev/null 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 deleted file mode 100644 index bf405cc..0000000 Binary files a/example/109-Alternative files-Laura Worthington - Charcuterie Serif Bold.ttf.png and /dev/null differ diff --git a/example/1092-Accord alternate-AccordAlt_Light.ttf.png b/example/1092-Accord alternate-AccordAlt_Light.ttf.png deleted file mode 100644 index e8657a1..0000000 Binary files a/example/1092-Accord alternate-AccordAlt_Light.ttf.png and /dev/null differ diff --git a/example/1093-Accord alternate-AccordAlt_Thin.ttf.png b/example/1093-Accord alternate-AccordAlt_Thin.ttf.png deleted file mode 100644 index 9a70d06..0000000 Binary files a/example/1093-Accord alternate-AccordAlt_Thin.ttf.png and /dev/null differ diff --git a/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png b/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png deleted file mode 100644 index 57913e9..0000000 Binary files a/example/1094-Accord alternate-AccordAlt_ExtraLight.ttf.png and /dev/null differ diff --git a/example/1095-Accord alternate-AccordAlt_Regular.ttf.png b/example/1095-Accord alternate-AccordAlt_Regular.ttf.png deleted file mode 100644 index 694a8a5..0000000 Binary files a/example/1095-Accord alternate-AccordAlt_Regular.ttf.png and /dev/null differ diff --git a/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png b/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png deleted file mode 100644 index 24b33a2..0000000 Binary files a/example/1096-Accord alternate-AccordAlt_ExtraBold.ttf.png and /dev/null differ diff --git a/example/1097-Accord alternate-AccordAlt_Bold.ttf.png b/example/1097-Accord alternate-AccordAlt_Bold.ttf.png deleted file mode 100644 index 5b1b2cb..0000000 Binary files a/example/1097-Accord alternate-AccordAlt_Bold.ttf.png and /dev/null differ diff --git a/example/1098-Accord alternate-AccordAlt_Medium.ttf.png b/example/1098-Accord alternate-AccordAlt_Medium.ttf.png deleted file mode 100644 index 066ef53..0000000 Binary files a/example/1098-Accord alternate-AccordAlt_Medium.ttf.png and /dev/null differ diff --git a/example/114-fonts-corporate_gothic_nbp.ttf.png b/example/114-fonts-corporate_gothic_nbp.ttf.png deleted file mode 100644 index 9c4a564..0000000 Binary files a/example/114-fonts-corporate_gothic_nbp.ttf.png and /dev/null differ diff --git a/example/116-fonts-Perfect DOS VGA 437.ttf.png b/example/116-fonts-Perfect DOS VGA 437.ttf.png deleted file mode 100644 index 8ea5828..0000000 Binary files a/example/116-fonts-Perfect DOS VGA 437.ttf.png and /dev/null differ diff --git a/example/152-Portrait-Portrait-MediumItalic.ttf.png b/example/152-Portrait-Portrait-MediumItalic.ttf.png deleted file mode 100644 index 997dc36..0000000 Binary files a/example/152-Portrait-Portrait-MediumItalic.ttf.png and /dev/null differ diff --git a/example/161-Portrait-Portrait-Medium.ttf.png b/example/161-Portrait-Portrait-Medium.ttf.png deleted file mode 100644 index 2c818c6..0000000 Binary files a/example/161-Portrait-Portrait-Medium.ttf.png and /dev/null 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 deleted file mode 100644 index 047b01d..0000000 Binary files a/example/411-Trend Hand Made-Latinotype - TrendHMSansOne-Italic.ttf.png and /dev/null differ diff --git a/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png b/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png deleted file mode 100644 index 9848723..0000000 Binary files a/example/412-Trend Hand Made-Latinotype - TrendHMSansThree.ttf.png and /dev/null differ diff --git a/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png b/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png deleted file mode 100644 index a3c7a21..0000000 Binary files a/example/413-Trend Hand Made-Latinotype - TrendHMSansTwo.ttf.png and /dev/null differ diff --git a/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png b/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png deleted file mode 100644 index 99aba67..0000000 Binary files a/example/414-Trend Hand Made-Latinotype - TrendHMSlabTwo.ttf.png and /dev/null differ diff --git a/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png b/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png deleted file mode 100644 index 571fda2..0000000 Binary files a/example/415-Trend Hand Made-Latinotype - TrendHMSlabFive.ttf.png and /dev/null differ diff --git a/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png b/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png deleted file mode 100644 index ef76858..0000000 Binary files a/example/416-Trend Hand Made-Latinotype - TrendHMSansOne.ttf.png and /dev/null differ diff --git a/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png b/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png deleted file mode 100644 index 1a51694..0000000 Binary files a/example/417-Trend Hand Made-Latinotype - TrendHMSlabThree.ttf.png and /dev/null differ diff --git a/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png b/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png deleted file mode 100644 index 5b67235..0000000 Binary files a/example/418-Trend Hand Made-Latinotype - TrendHMSlabFour.ttf.png and /dev/null differ diff --git a/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png b/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png deleted file mode 100644 index e5d5963..0000000 Binary files a/example/419-Trend Hand Made-Latinotype - TrendHMOrnaments.ttf.png and /dev/null 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 deleted file mode 100644 index a106b1b..0000000 Binary files a/example/420-Trend Hand Made-Latinotype - TrendHMSansThree-Italic.ttf.png and /dev/null 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 deleted file mode 100644 index 60d3e07..0000000 Binary files a/example/421-Trend Hand Made-Latinotype - TrendHMSansFive-Italic.ttf.png and /dev/null 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 deleted file mode 100644 index deea832..0000000 Binary files a/example/422-Trend Hand Made-Latinotype - TrendHMSlabFive-Italic.ttf.png and /dev/null 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 deleted file mode 100644 index 4c213ec..0000000 Binary files a/example/423-Trend Hand Made-Latinotype - TrendHMSansFour-Italic.ttf.png and /dev/null 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 deleted file mode 100644 index bfa96ab..0000000 Binary files a/example/424-Trend Hand Made-Latinotype - TrendHMSansTwo-Italic.ttf.png and /dev/null differ diff --git a/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png b/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png deleted file mode 100644 index 4ba3f5c..0000000 Binary files a/example/425-Trend Hand Made-Latinotype - TrendHMSansFive.ttf.png and /dev/null 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 deleted file mode 100644 index 40401c9..0000000 Binary files a/example/426-Trend Hand Made-Latinotype - Trend HM Slab Three Italic.ttf.png and /dev/null 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 deleted file mode 100644 index bd9781c..0000000 Binary files a/example/427-Trend Hand Made-Latinotype - TrendHMSlabOne-Italic.ttf.png and /dev/null differ diff --git a/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png b/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png deleted file mode 100644 index a3dfe18..0000000 Binary files a/example/428-Trend Hand Made-Latinotype - TrendHMSlabOne.ttf.png and /dev/null differ diff --git a/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png b/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png deleted file mode 100644 index 6f5d774..0000000 Binary files a/example/429-Trend Hand Made-Latinotype - TrendHMSansFour.ttf.png and /dev/null 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 deleted file mode 100644 index b21bd8b..0000000 Binary files a/example/430-Trend Hand Made-Latinotype - TrendHMSlabTwo-Italic.ttf.png and /dev/null 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 deleted file mode 100644 index 6b6719d..0000000 Binary files a/example/431-Trend Hand Made-Latinotype - TrendHMSlabFour-Italic.ttf.png and /dev/null differ diff --git a/example/6-fonts-SNNeoNoire-Regular.ttf.png b/example/6-fonts-SNNeoNoire-Regular.ttf.png deleted file mode 100644 index 688cb91..0000000 Binary files a/example/6-fonts-SNNeoNoire-Regular.ttf.png and /dev/null differ diff --git a/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png b/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png deleted file mode 100644 index 9dad9a9..0000000 Binary files a/example/694-Camcorder-Camcorder-Monospaced-UDon'tKnow.ttf.png and /dev/null differ diff --git a/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png b/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png deleted file mode 100644 index e626227..0000000 Binary files a/example/695-Camcorder-Camcorder-Monospaced-Outline1.ttf.png and /dev/null differ diff --git a/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png b/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png deleted file mode 100644 index f142f8a..0000000 Binary files a/example/696-Camcorder-Camcorder-Monospaced-Regular.ttf.png and /dev/null differ diff --git a/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png b/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png deleted file mode 100644 index efbced3..0000000 Binary files a/example/697-Camcorder-Camcorder-Monospaced-Outline2.ttf.png and /dev/null differ diff --git a/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png b/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png deleted file mode 100644 index 335244a..0000000 Binary files a/example/698-Camcorder-Camcorder-Monospaced-Inverse.ttf.png and /dev/null 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 deleted file mode 100644 index 1f468c6..0000000 Binary files a/example/86-Alternative files-Fontyou - Kaili FY Light.ttf.png and /dev/null 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 deleted file mode 100644 index e88cfde..0000000 Binary files a/example/87-Alternative files-Fontyou - Kaili FY Regular.ttf.png and /dev/null 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 deleted file mode 100644 index 5253dce..0000000 Binary files a/example/88-Alternative files-Laura Worthington - Charcuterie Sans Bold Oblique.ttf.png and /dev/null 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 deleted file mode 100644 index 1363cf5..0000000 Binary files a/example/89-Alternative files-Laura Worthington - Charcuterie Serif.ttf.png and /dev/null 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 deleted file mode 100644 index 9a70ac1..0000000 Binary files a/example/90-Alternative files-Laura Worthington - Charcuterie Block Bold Oblique.ttf.png and /dev/null 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 deleted file mode 100644 index 9f79ce7..0000000 Binary files a/example/91-Alternative files-Laura Worthington - Charcuterie Engraved.ttf.png and /dev/null 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 deleted file mode 100644 index a56892c..0000000 Binary files a/example/92-Alternative files-Laura Worthington - Charcuterie Frames.ttf.png and /dev/null 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 deleted file mode 100644 index 4b77c5b..0000000 Binary files a/example/93-Alternative files-Laura Worthington - Charcuterie Block Oblique.ttf.png and /dev/null 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 deleted file mode 100644 index d9a86c7..0000000 Binary files a/example/94-Alternative files-Laura Worthington - Charcuterie Etched.ttf.png and /dev/null 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 deleted file mode 100644 index 5f89541..0000000 Binary files a/example/95-Alternative files-Laura Worthington - Charcuterie Deco.ttf.png and /dev/null 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 deleted file mode 100644 index cc328c4..0000000 Binary files a/example/96-Alternative files-Laura Worthington - Charcuterie Catchwords.ttf.png and /dev/null 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 deleted file mode 100644 index bd3b1af..0000000 Binary files a/example/97-Alternative files-Laura Worthington - Charcuterie Block Bold.ttf.png and /dev/null 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 deleted file mode 100644 index 6a793bb..0000000 Binary files a/example/98-Alternative files-Laura Worthington - Charcuterie Block.ttf.png and /dev/null 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 deleted file mode 100644 index 6ebef7b..0000000 Binary files a/example/99-Alternative files-Laura Worthington - Charcuterie Filigree.ttf.png and /dev/null differ diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..d70b361 --- /dev/null +++ b/generate.py @@ -0,0 +1,42 @@ +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") +print(" ".join(["find", "/home/niles/Documents/fonts", "-type", "f", "-iregex", ".*\\.ttf|.*\\.otf"])) +fonts = subprocess.check_output(["find", "/home/niles/Documents/fonts", "-type", "f", "-iregex", ".*\\.\(ttf\|otf\)"]).decode("utf-8").split("\n")[:-1] +i = 0 +for font in fonts: + i+=1 + print("Generating " + str(i) + getFontName(font, True)) + try: + txt = Image.new('RGBA', (2000, 2400), (211,141,95, 255)) + #txt.putpixel((x, y), (255, 127, 42, 255)) + d = ImageDraw.Draw(txt) + d.rectangle([(0, 1600), (2000, 2400)], (255, 127, 42, 255)) + fnt = ImageFont.truetype(font, 200) + d.text((100,110), getFontName(font, True), font=fnt, fill=(0,0,0,255)) + fnt = ImageFont.truetype(font, 300) + d.text((50,450), "Aa Ee Rr", font=fnt, fill=(0,0,0,255)) + fnt = ImageFont.truetype(font, 300) + d.text((50,750), "Aa Ee Rr", font=fnt, fill=(0,0,0,255)) + fnt = ImageFont.truetype(font, 800) + d.text((1500,300), "a", font=fnt, fill=(255,255,255,255)) + fnt = ImageFont.truetype(font, 200) + d.text((100,1200), "The brown fox jumps over the lazy red dog or something", font=fnt, fill=(0,0,0,255)) + fnt = ImageFont.truetype(font, 180) + d.text((100,1700), "abcdefghijklm", font=fnt, fill=(0,0,0,255)) + d.text((100,1900), "nopqrstuvwxyz", font=fnt, fill=(0,0,0,255)) + fnt = ImageFont.truetype(font, 250) + d.text((450,2100), "0123456789", font=fnt, fill=(255,255,255,255)) + out = txt#Image.alpha_composite(base, txt) + out.save("out/" + str(i) + "-" + getFontName(font, True) + ".png") + except: + import traceback + print(traceback.format_exc()) diff --git a/test.py b/test.py deleted file mode 100644 index 21db283..0000000 --- a/test.py +++ /dev/null @@ -1,33 +0,0 @@ -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