This commit is contained in:
NikolajDanger
2022-06-02 16:41:35 +02:00
parent 41b5adf9f5
commit 95e70c76a4
39 changed files with 14 additions and 12 deletions

View File

@ -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

View File

@ -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

BIN
fonts/Gill-Sans.OTF Normal file

Binary file not shown.

BIN
fonts/Gotham.TTF Normal file

Binary file not shown.

BIN
fonts/Minion.OTF Normal file

Binary file not shown.

BIN
fonts/Mrs-Eaves.TTF Normal file

Binary file not shown.

BIN
fonts/Myriad-Pro.OTF Normal file

Binary file not shown.

BIN
fonts/News-Gothic.OTF Normal file

Binary file not shown.

BIN
fonts/Rockwell.TTF Normal file

Binary file not shown.

BIN
fonts/Sabon.TTF Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
fonts/test_pages/Gotham.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
fonts/test_pages/Minion.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
fonts/test_pages/Sabon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 86 KiB