FL.objects.TTH.TTH

class FL.objects.TTH.TTH(g: Glyph | None = None, f: Font | None = None)

Bases: object

TTH - class to represent a TrueType program

__init__(g: Glyph | None = None, f: Font | None = None) None
TTH()

generic constructor, creates an empty TTH

TTH(Glyph g)

creates TTH, assigns ‘g’ as glyph and ‘parent’ of ‘g’ as font

TTH(Glyph g, Font f)

creates TTH, assigns ‘g’ as glyph and ‘f’ as font

Parameters:
  • g (Glyph | None, optional) – _description_. Defaults to None.

  • f (Font | None, optional) – _description_. Defaults to None.

Methods

BuildFromLinks([g])

Init(g_or_f[, f])

Initoutline()

LoadFromTextFile(filename)

Load TTH from a text file.

LoadProgram([g])

ResetAllDeltas([direction])

ResetFinalDeltas([direction])

ResetProgram([direction])

RunCommand(tthcommand)

RunProgram([i, j])

SaveProgram([g])

SaveToTextFile(filename)

Save the TTH to a text file at path filename.

SetPPM(ppm)

SortProgram()

TestProgram()

__init__([g, f])

TTH()

Attributes

base_bottom_zones

base_hstems

base_outline

base_top_zones

base_vstems

bottom_zones

commands

font

glyph

hstems

outline

ppm

problems

top_zones

upm

vstems

zero_point

LoadFromTextFile(filename: str) int

Load TTH from a text file.

Parameters:

filename (str) – The path and filename of the text file.

Returns:

0 on success, -1 on error.

Return type:

int

SaveToTextFile(filename: str) None

Save the TTH to a text file at path filename.

Parameters:

filename (str) – The path and filename of the text file.

Example file:

34 POINTS
439 412 17
421 419 2
382 427 2
363 427 1
318 427 2
255 384 2
220 322 2
205 254 2
205 225 1
205 181 2
248 135 2
296 135 1
320 135 2
364 144 2
388 152 1
385 11 1
354 2 2
282 -7 2
250 -7 1
185 -7 2
97 30 2
51 90 2
33 158 2
33 194 1
33 259 2
73 390 2
154 500 2
287 569 2
374 569 1
405 569 2
459 562 2
482 554 1
0 -17 17
441 -17 17

5 BOTTOMZONES
344 10
0 15
-83 15
-171 15
-233 15

10 TOPZONES
815 8
792 10
730 15
705 15
675 15
650 15
600 15
520 15
497 15
470 15

19 HSTEMS
140
152
158
171
220
116
85
97
109
123
130
164
145
180
200
22222
44444
100
44

25 VSTEMS
182
195
220
152
208
91
128
139
66
100
110
117
127
135
144
148
169
179
189
200
215
225
22222
55555
54

0 PROGRAM