ChevalierJoseph commited on
Commit
d7059e6
·
verified ·
1 Parent(s): f936f26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
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.newTable('head')
66
- font['hhea'] = TTFont.newTable('hhea')
67
- font['maxp'] = TTFont.newTable('maxp')
68
- font['name'] = TTFont.newTable('name')
69
- font['OS/2'] = TTFont.newTable('OS/2')
70
- font['post'] = TTFont.newTable('post')
71
- font['hmtx'] = TTFont.newTable('hmtx')
72
- font['cmap'] = TTFont.newTable('cmap')
73
- font['glyf'] = TTFont.newTable('glyf')
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