ChevalierJoseph commited on
Commit
45d360c
·
verified ·
1 Parent(s): 99a9027

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -83,14 +83,16 @@ def build_ufo_from_glyphs(glyphs):
83
  glyph = Glyph()
84
  glyph.name = letter
85
  glyph.unicode = ord(letter)
86
- pen = SVGPathPen(glyph)
87
  try:
88
- if not path_data.strip():
89
- print(f"Empty path data for glyph {letter}")
90
- continue
91
- pen.path(path_data) # copier exactement le path SVG dans le glyphe
92
- glyph.width = 600 # largeur du glyphe
93
- print(f"Glyph {letter} created with path: {path_data[:50]}...") # Log pour débogage
 
 
94
  except Exception as e:
95
  print(f"Error injecting SVG for {letter}: {e}")
96
  font.insertGlyph(glyph)
 
83
  glyph = Glyph()
84
  glyph.name = letter
85
  glyph.unicode = ord(letter)
86
+ pen = glyph.getPen()
87
  try:
88
+ # Dessiner un rectangle pour chaque glyphe
89
+ pen.moveTo((50, 0))
90
+ pen.lineTo((500, 0))
91
+ pen.lineTo((500, 500))
92
+ pen.lineTo((50, 500))
93
+ pen.closePath()
94
+ glyph.width = 600
95
+ print(f"Glyph {letter} created with rectangle contour.")
96
  except Exception as e:
97
  print(f"Error injecting SVG for {letter}: {e}")
98
  font.insertGlyph(glyph)