Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,8 @@ import os
|
|
| 11 |
from fontTools.ttLib import TTFont
|
| 12 |
from fontTools.ttLib.tables import ttProgram
|
| 13 |
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def load_model():
|
| 16 |
tokenizer = AutoTokenizer.from_pretrained("ChevalierJoseph/typtop")
|
|
@@ -62,15 +64,15 @@ def create_otf_font(glyphs, output_path="font.otf"):
|
|
| 62 |
font = TTFont()
|
| 63 |
|
| 64 |
# Ajouter les tables nécessaires
|
| 65 |
-
font['head'] = TTFont.
|
| 66 |
-
font['hhea'] = TTFont.
|
| 67 |
-
font['maxp'] = TTFont.
|
| 68 |
-
font['name'] = TTFont.
|
| 69 |
-
font['OS/2'] = TTFont.
|
| 70 |
-
font['post'] = TTFont.
|
| 71 |
-
font['hmtx'] = TTFont.
|
| 72 |
-
font['cmap'] = TTFont.
|
| 73 |
-
font['glyf'] = TTFont.
|
| 74 |
|
| 75 |
# Configurer les champs obligatoires pour chaque table
|
| 76 |
font['head'].fontRevision = 1.0
|
|
|
|
| 11 |
from fontTools.ttLib import TTFont
|
| 12 |
from fontTools.ttLib.tables import ttProgram
|
| 13 |
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable
|
| 14 |
+
from fontTools.ttLib.tables._g_l_y_f import GlyphCoordinates
|
| 15 |
+
from fontTools.pens.ttGlyphPen import TTGlyphPen
|
| 16 |
|
| 17 |
def load_model():
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained("ChevalierJoseph/typtop")
|
|
|
|
| 64 |
font = TTFont()
|
| 65 |
|
| 66 |
# Ajouter les tables nécessaires
|
| 67 |
+
font['head'] = TTFont.Table('head')
|
| 68 |
+
font['hhea'] = TTFont.Table('hhea')
|
| 69 |
+
font['maxp'] = TTFont.Table('maxp')
|
| 70 |
+
font['name'] = TTFont.Table('name')
|
| 71 |
+
font['OS/2'] = TTFont.Table('OS/2')
|
| 72 |
+
font['post'] = TTFont.Table('post')
|
| 73 |
+
font['hmtx'] = TTFont.Table('hmtx')
|
| 74 |
+
font['cmap'] = TTFont.Table('cmap')
|
| 75 |
+
font['glyf'] = TTFont.Table('glyf')
|
| 76 |
|
| 77 |
# Configurer les champs obligatoires pour chaque table
|
| 78 |
font['head'].fontRevision = 1.0
|