diff --git a/font-list.txt b/font-list.txt index a82e9e4..5a53fd9 100644 --- a/font-list.txt +++ b/font-list.txt @@ -4,6 +4,16 @@ Arial Calibri Futura Dax Pro +Franklin Gothic +Frutiger +Helvetica +Gill Sans +Gotham +Myriad Pro +News Gothic +Roboto +Segoe UI +Verdana ## Serif Baskerville @@ -12,22 +22,11 @@ Bodoni Cambria Clarendon Didot - -Franklin Gothic -Frutiger Garamond Georgia -Gill Sans -Gotham -Helvetica Minion Mrs Eaves -Myriad -News Gothic -Roboto Roboto Slab Rockwell Sabon -Segoe UI Times New Roman -Verdana \ No newline at end of file diff --git a/font_game/util.py b/font_game/util.py index 0881774..3ace07c 100644 --- a/font_game/util.py +++ b/font_game/util.py @@ -2,6 +2,7 @@ import string import pathlib import time from PIL import ImageFont, Image, ImageDraw +from numpy import average BASE64_DIGITS = string.digits + string.ascii_letters + "+_" @@ -92,7 +93,9 @@ def make_fonts(): font_path = f"./fonts/{font_name}.{file_type}" tmp_font = ImageFont.truetype(font_path, FONT_SIZE) - letter_height = tmp_font.getsize("A")[1] + letter_height = int(average([ + tmp_font.getsize(i)[1] for i in TEST_TEXT + ])) new_size = (FONT_SIZE**2)//letter_height new_font = ImageFont.truetype(font_path, new_size) image_fonts[font_name] = new_font diff --git a/fonts/Gill-Sans.OTF b/fonts/Gill-Sans.OTF new file mode 100644 index 0000000..264a177 Binary files /dev/null and b/fonts/Gill-Sans.OTF differ diff --git a/fonts/Gotham.TTF b/fonts/Gotham.TTF new file mode 100644 index 0000000..793dce5 Binary files /dev/null and b/fonts/Gotham.TTF differ diff --git a/fonts/Minion.OTF b/fonts/Minion.OTF new file mode 100644 index 0000000..c6b3fed Binary files /dev/null and b/fonts/Minion.OTF differ diff --git a/fonts/Mrs-Eaves.TTF b/fonts/Mrs-Eaves.TTF new file mode 100644 index 0000000..8496583 Binary files /dev/null and b/fonts/Mrs-Eaves.TTF differ diff --git a/fonts/Myriad-Pro.OTF b/fonts/Myriad-Pro.OTF new file mode 100644 index 0000000..e7b7f26 Binary files /dev/null and b/fonts/Myriad-Pro.OTF differ diff --git a/fonts/News-Gothic.OTF b/fonts/News-Gothic.OTF new file mode 100644 index 0000000..c9df8d1 Binary files /dev/null and b/fonts/News-Gothic.OTF differ diff --git a/fonts/Rockwell.TTF b/fonts/Rockwell.TTF new file mode 100644 index 0000000..f4cd355 Binary files /dev/null and b/fonts/Rockwell.TTF differ diff --git a/fonts/Sabon.TTF b/fonts/Sabon.TTF new file mode 100644 index 0000000..f5b4d72 Binary files /dev/null and b/fonts/Sabon.TTF differ diff --git a/fonts/test_pages/Akzidenz-Grotesk.png b/fonts/test_pages/Akzidenz-Grotesk.png index 85a6b10..954f58f 100644 Binary files a/fonts/test_pages/Akzidenz-Grotesk.png and b/fonts/test_pages/Akzidenz-Grotesk.png differ diff --git a/fonts/test_pages/Arial.png b/fonts/test_pages/Arial.png index 82019d3..9facba8 100644 Binary files a/fonts/test_pages/Arial.png and b/fonts/test_pages/Arial.png differ diff --git a/fonts/test_pages/Baskerville.png b/fonts/test_pages/Baskerville.png index 53bc6a6..11b3963 100644 Binary files a/fonts/test_pages/Baskerville.png and b/fonts/test_pages/Baskerville.png differ diff --git a/fonts/test_pages/Bembo.png b/fonts/test_pages/Bembo.png index 233b1ef..4c69739 100644 Binary files a/fonts/test_pages/Bembo.png and b/fonts/test_pages/Bembo.png differ diff --git a/fonts/test_pages/Bodoni.png b/fonts/test_pages/Bodoni.png index 32f234d..2c1527f 100644 Binary files a/fonts/test_pages/Bodoni.png and b/fonts/test_pages/Bodoni.png differ diff --git a/fonts/test_pages/Calibri.png b/fonts/test_pages/Calibri.png index 86b136f..4c9ec18 100644 Binary files a/fonts/test_pages/Calibri.png and b/fonts/test_pages/Calibri.png differ diff --git a/fonts/test_pages/Cambria.png b/fonts/test_pages/Cambria.png index cf47d59..40fcf1c 100644 Binary files a/fonts/test_pages/Cambria.png and b/fonts/test_pages/Cambria.png differ diff --git a/fonts/test_pages/Clarendon.png b/fonts/test_pages/Clarendon.png index 96421da..4a7a13a 100644 Binary files a/fonts/test_pages/Clarendon.png and b/fonts/test_pages/Clarendon.png differ diff --git a/fonts/test_pages/Dax-Pro.png b/fonts/test_pages/Dax-Pro.png index bac240c..353bf86 100644 Binary files a/fonts/test_pages/Dax-Pro.png and b/fonts/test_pages/Dax-Pro.png differ diff --git a/fonts/test_pages/Didot.png b/fonts/test_pages/Didot.png index c00e6dc..b8c3196 100644 Binary files a/fonts/test_pages/Didot.png and b/fonts/test_pages/Didot.png differ diff --git a/fonts/test_pages/Franklin-Gothic.png b/fonts/test_pages/Franklin-Gothic.png index 8609e66..059058f 100644 Binary files a/fonts/test_pages/Franklin-Gothic.png and b/fonts/test_pages/Franklin-Gothic.png differ diff --git a/fonts/test_pages/Frutiger.png b/fonts/test_pages/Frutiger.png index bb3ff83..5a32e04 100644 Binary files a/fonts/test_pages/Frutiger.png and b/fonts/test_pages/Frutiger.png differ diff --git a/fonts/test_pages/Futura.png b/fonts/test_pages/Futura.png index 00f1a04..6e54609 100644 Binary files a/fonts/test_pages/Futura.png and b/fonts/test_pages/Futura.png differ diff --git a/fonts/test_pages/Garamond.png b/fonts/test_pages/Garamond.png index 3eb05a1..4a44e1d 100644 Binary files a/fonts/test_pages/Garamond.png and b/fonts/test_pages/Garamond.png differ diff --git a/fonts/test_pages/Georgia.png b/fonts/test_pages/Georgia.png index 9b6b521..abe4840 100644 Binary files a/fonts/test_pages/Georgia.png and b/fonts/test_pages/Georgia.png differ diff --git a/fonts/test_pages/Gill-Sans.png b/fonts/test_pages/Gill-Sans.png new file mode 100644 index 0000000..cadcd31 Binary files /dev/null and b/fonts/test_pages/Gill-Sans.png differ diff --git a/fonts/test_pages/Gotham.png b/fonts/test_pages/Gotham.png new file mode 100644 index 0000000..4913492 Binary files /dev/null and b/fonts/test_pages/Gotham.png differ diff --git a/fonts/test_pages/Helvetica.png b/fonts/test_pages/Helvetica.png index 83bcc65..4dbefd0 100644 Binary files a/fonts/test_pages/Helvetica.png and b/fonts/test_pages/Helvetica.png differ diff --git a/fonts/test_pages/Minion.png b/fonts/test_pages/Minion.png new file mode 100644 index 0000000..c033028 Binary files /dev/null and b/fonts/test_pages/Minion.png differ diff --git a/fonts/test_pages/Mrs-Eaves.png b/fonts/test_pages/Mrs-Eaves.png new file mode 100644 index 0000000..cc26f40 Binary files /dev/null and b/fonts/test_pages/Mrs-Eaves.png differ diff --git a/fonts/test_pages/Myriad-Pro.png b/fonts/test_pages/Myriad-Pro.png new file mode 100644 index 0000000..3a4a822 Binary files /dev/null and b/fonts/test_pages/Myriad-Pro.png differ diff --git a/fonts/test_pages/News-Gothic.png b/fonts/test_pages/News-Gothic.png new file mode 100644 index 0000000..ae4304f Binary files /dev/null and b/fonts/test_pages/News-Gothic.png differ diff --git a/fonts/test_pages/Roboto-Slab.png b/fonts/test_pages/Roboto-Slab.png index 51ecf1a..5dfb4da 100644 Binary files a/fonts/test_pages/Roboto-Slab.png and b/fonts/test_pages/Roboto-Slab.png differ diff --git a/fonts/test_pages/Roboto.png b/fonts/test_pages/Roboto.png index 02818a8..713e8ae 100644 Binary files a/fonts/test_pages/Roboto.png and b/fonts/test_pages/Roboto.png differ diff --git a/fonts/test_pages/Rockwell.png b/fonts/test_pages/Rockwell.png new file mode 100644 index 0000000..0963685 Binary files /dev/null and b/fonts/test_pages/Rockwell.png differ diff --git a/fonts/test_pages/Sabon.png b/fonts/test_pages/Sabon.png new file mode 100644 index 0000000..dab7727 Binary files /dev/null and b/fonts/test_pages/Sabon.png differ diff --git a/fonts/test_pages/Segoe-UI.png b/fonts/test_pages/Segoe-UI.png index 92c42fd..8480c9a 100644 Binary files a/fonts/test_pages/Segoe-UI.png and b/fonts/test_pages/Segoe-UI.png differ diff --git a/fonts/test_pages/Times-New-Roman.png b/fonts/test_pages/Times-New-Roman.png index f216d01..b38ef2a 100644 Binary files a/fonts/test_pages/Times-New-Roman.png and b/fonts/test_pages/Times-New-Roman.png differ diff --git a/fonts/test_pages/Verdana.png b/fonts/test_pages/Verdana.png index 333c947..7c189f5 100644 Binary files a/fonts/test_pages/Verdana.png and b/fonts/test_pages/Verdana.png differ