✨
@ -4,6 +4,16 @@ Arial
|
|||||||
Calibri
|
Calibri
|
||||||
Futura
|
Futura
|
||||||
Dax Pro
|
Dax Pro
|
||||||
|
Franklin Gothic
|
||||||
|
Frutiger
|
||||||
|
Helvetica
|
||||||
|
Gill Sans
|
||||||
|
Gotham
|
||||||
|
Myriad Pro
|
||||||
|
News Gothic
|
||||||
|
Roboto
|
||||||
|
Segoe UI
|
||||||
|
Verdana
|
||||||
|
|
||||||
## Serif
|
## Serif
|
||||||
Baskerville
|
Baskerville
|
||||||
@ -12,22 +22,11 @@ Bodoni
|
|||||||
Cambria
|
Cambria
|
||||||
Clarendon
|
Clarendon
|
||||||
Didot
|
Didot
|
||||||
|
|
||||||
Franklin Gothic
|
|
||||||
Frutiger
|
|
||||||
Garamond
|
Garamond
|
||||||
Georgia
|
Georgia
|
||||||
Gill Sans
|
|
||||||
Gotham
|
|
||||||
Helvetica
|
|
||||||
Minion
|
Minion
|
||||||
Mrs Eaves
|
Mrs Eaves
|
||||||
Myriad
|
|
||||||
News Gothic
|
|
||||||
Roboto
|
|
||||||
Roboto Slab
|
Roboto Slab
|
||||||
Rockwell
|
Rockwell
|
||||||
Sabon
|
Sabon
|
||||||
Segoe UI
|
|
||||||
Times New Roman
|
Times New Roman
|
||||||
Verdana
|
|
@ -2,6 +2,7 @@ import string
|
|||||||
import pathlib
|
import pathlib
|
||||||
import time
|
import time
|
||||||
from PIL import ImageFont, Image, ImageDraw
|
from PIL import ImageFont, Image, ImageDraw
|
||||||
|
from numpy import average
|
||||||
|
|
||||||
BASE64_DIGITS = string.digits + string.ascii_letters + "+_"
|
BASE64_DIGITS = string.digits + string.ascii_letters + "+_"
|
||||||
|
|
||||||
@ -92,7 +93,9 @@ def make_fonts():
|
|||||||
|
|
||||||
font_path = f"./fonts/{font_name}.{file_type}"
|
font_path = f"./fonts/{font_name}.{file_type}"
|
||||||
tmp_font = ImageFont.truetype(font_path, FONT_SIZE)
|
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_size = (FONT_SIZE**2)//letter_height
|
||||||
new_font = ImageFont.truetype(font_path, new_size)
|
new_font = ImageFont.truetype(font_path, new_size)
|
||||||
image_fonts[font_name] = new_font
|
image_fonts[font_name] = new_font
|
||||||
|
BIN
fonts/Gill-Sans.OTF
Normal file
BIN
fonts/Gotham.TTF
Normal file
BIN
fonts/Minion.OTF
Normal file
BIN
fonts/Mrs-Eaves.TTF
Normal file
BIN
fonts/Myriad-Pro.OTF
Normal file
BIN
fonts/News-Gothic.OTF
Normal file
BIN
fonts/Rockwell.TTF
Normal file
BIN
fonts/Sabon.TTF
Normal file
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 101 KiB |
BIN
fonts/test_pages/Gill-Sans.png
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
fonts/test_pages/Gotham.png
Normal file
After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 111 KiB |
BIN
fonts/test_pages/Minion.png
Normal file
After Width: | Height: | Size: 125 KiB |
BIN
fonts/test_pages/Mrs-Eaves.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
fonts/test_pages/Myriad-Pro.png
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
fonts/test_pages/News-Gothic.png
Normal file
After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 82 KiB |
BIN
fonts/test_pages/Rockwell.png
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
fonts/test_pages/Sabon.png
Normal file
After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 86 KiB |