Skip to content

Commit 53536d7

Browse files
committed
Update README.md
1 parent 573d885 commit 53536d7

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

README.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,23 @@ font = Font("fonts/MyFont.ttf")
7474
- [`to_sliced_variable`](#to_sliced_variable)
7575
- [`to_static`](#to_static)
7676

77-
- #### clone
77+
#### `clone`
7878
```python
7979
"""
8080
Creates a new Font instance reading the same binary file.
8181
"""
8282
font_clone = font.clone()
8383
```
8484

85-
- #### close
85+
#### `close`
8686
```python
8787
"""
8888
Close the wrapped TTFont instance.
8989
"""
9090
font.close()
9191
```
9292

93-
- #### get_characters
93+
#### `get_characters`
9494
```python
9595
"""
9696
Gets the font characters.
@@ -106,7 +106,7 @@ Gets the font characters.
106106
chars = font.get_characters(ignore_blank=False)
107107
```
108108

109-
- #### get_characters_count
109+
#### `get_characters_count`
110110
```python
111111
"""
112112
Gets the font characters count.
@@ -120,7 +120,7 @@ Gets the font characters count.
120120
chars_count = font.get_characters_count(ignore_blank=False)
121121
```
122122

123-
- #### get_features
123+
#### `get_features`
124124
```python
125125
"""
126126
Gets the font opentype features.
@@ -131,7 +131,7 @@ Gets the font opentype features.
131131
features = font.get_features()
132132
```
133133

134-
- #### get_features_tags
134+
#### `get_features_tags`
135135
```python
136136
"""
137137
Gets the font opentype features tags.
@@ -142,7 +142,7 @@ Gets the font opentype features tags.
142142
features_tags = font.get_features_tags()
143143
```
144144

145-
- #### get_fingerprint
145+
#### `get_fingerprint`
146146
```python
147147
"""
148148
Gets the font fingerprint: an hash calculated from an image representation of the font.
@@ -156,7 +156,7 @@ Changing the text option affects the returned fingerprint.
156156
hash = font.get_fingerprint()
157157
```
158158

159-
- #### get_fingerprint_match
159+
#### `get_fingerprint_match`
160160
```python
161161
"""
162162
Gets the fingerprint match between this font and another one.
@@ -174,7 +174,7 @@ by checking if their fingerprints are equal (difference <= tolerance).
174174
match, diff, hash, other_hash = font.get_fingerprint_match(other="other_font.ttf", tolerance=10)
175175
```
176176

177-
- #### get_format
177+
#### `get_format`
178178
```python
179179
"""
180180
Gets the font format: otf, ttf, woff, woff2.
@@ -188,7 +188,7 @@ Gets the font format: otf, ttf, woff, woff2.
188188
format = font.get_format(ignore_flavor=False)
189189
```
190190

191-
- #### get_glyphs
191+
#### `get_glyphs`
192192
```python
193193
"""
194194
Gets the font glyphs and their own composition.
@@ -199,7 +199,7 @@ Gets the font glyphs and their own composition.
199199
glyphs = font.get_glyphs()
200200
```
201201

202-
- #### get_glyphs_count
202+
#### `get_glyphs_count`
203203
```python
204204
"""
205205
Gets the font glyphs count.
@@ -210,7 +210,7 @@ Gets the font glyphs count.
210210
glyphs_count = font.get_glyphs_count()
211211
```
212212

213-
- #### get_image
213+
#### `get_image`
214214
```python
215215
"""
216216
Gets an image representation of the font rendering
@@ -228,7 +228,7 @@ some text using the given options.
228228
img = font.get_image(text="Hello!", size=48, color=(0, 0, 0, 255), background_color=(255, 255, 255, 255))
229229
```
230230

231-
- #### get_italic_angle
231+
#### `get_italic_angle`
232232
```python
233233
"""
234234
Gets the font italic angle.
@@ -239,7 +239,7 @@ Gets the font italic angle.
239239
italic_angle = font.get_italic_angle()
240240
```
241241

242-
- #### get_name
242+
#### `get_name`
243243
```python
244244
"""
245245
Gets the name by its identifier from the font name table.
@@ -255,7 +255,7 @@ Gets the name by its identifier from the font name table.
255255
family_name = font.get_name(key=Font.NAME_FAMILY_NAME)
256256
```
257257

258-
- #### get_names
258+
#### `get_names`
259259
```python
260260
"""
261261
Gets the names records mapped by their property name.
@@ -266,7 +266,7 @@ Gets the names records mapped by their property name.
266266
names = font.get_names()
267267
```
268268

269-
- #### get_style_flag
269+
#### `get_style_flag`
270270
```python
271271
"""
272272
Gets the style flag reading OS/2 and macStyle tables.
@@ -280,7 +280,7 @@ Gets the style flag reading OS/2 and macStyle tables.
280280
flag = font.get_style_flag(Font.STYLE_FLAG_BOLD)
281281
```
282282

283-
- #### get_style_flags
283+
#### `get_style_flags`
284284
```python
285285
"""
286286
Gets the style flags reading OS/2 and macStyle tables.
@@ -291,7 +291,7 @@ Gets the style flags reading OS/2 and macStyle tables.
291291
flags = font.get_style_flags()
292292
```
293293

294-
- #### get_ttfont
294+
#### `get_ttfont`
295295
```python
296296
"""
297297
Gets the wrapped TTFont instance.
@@ -302,7 +302,7 @@ Gets the wrapped TTFont instance.
302302
ttfont = font.get_ttfont()
303303
```
304304

305-
- #### get_unicode_block_by_name
305+
#### `get_unicode_block_by_name`
306306
```python
307307
"""
308308
Gets the unicode block by name (name is case-insensitive and ignores "-").
@@ -316,7 +316,7 @@ Gets the unicode block by name (name is case-insensitive and ignores "-").
316316
block = font.get_unicode_block_by_name(name="Basic Latin")
317317
```
318318

319-
- #### get_unicode_blocks
319+
#### `get_unicode_blocks`
320320
```python
321321
"""
322322
Gets the unicode blocks and their coverage.
@@ -331,7 +331,7 @@ Only blocks with coverage >= coverage_threshold (0.0 <= coverage_threshold <= 1.
331331
blocks = font.get_unicode_blocks(coverage_threshold=0.00001)
332332
```
333333

334-
- #### get_unicode_script_by_name
334+
#### `get_unicode_script_by_name`
335335
```python
336336
"""
337337
Gets the unicode script by name/tag (name/tag is case-insensitive and ignores "-").
@@ -345,7 +345,7 @@ Gets the unicode script by name/tag (name/tag is case-insensitive and ignores "-
345345
script = font.get_unicode_script_by_name(name="Latn")
346346
```
347347

348-
- #### get_unicode_scripts
348+
#### `get_unicode_scripts`
349349
```python
350350
"""
351351
Gets the unicode scripts and their coverage.
@@ -360,7 +360,7 @@ Only scripts with coverage >= coverage_threshold (0.0 <= coverage_threshold <= 1
360360
scripts = font.get_unicode_scripts(coverage_threshold=0.00001)
361361
```
362362

363-
- #### get_variable_axes
363+
#### `get_variable_axes`
364364
```python
365365
"""
366366
Gets the font variable axes.
@@ -371,7 +371,7 @@ Gets the font variable axes.
371371
axes = font.get_variable_axes()
372372
```
373373

374-
- #### get_variable_axes_tags
374+
#### `get_variable_axes_tags`
375375
```python
376376
"""
377377
Gets the variable axes tags.
@@ -382,7 +382,7 @@ Gets the variable axes tags.
382382
axes_tags = font.get_variable_axes_tags()
383383
```
384384

385-
- #### get_variable_axis_by_tag
385+
#### `get_variable_axis_by_tag`
386386
```python
387387
"""
388388
Gets a variable axis by tag.
@@ -396,7 +396,7 @@ Gets a variable axis by tag.
396396
axis = font.get_variable_axis_by_tag(tag="wght")
397397
```
398398

399-
- #### get_variable_instances
399+
#### `get_variable_instances`
400400
```python
401401
"""
402402
Gets the variable instances.
@@ -407,7 +407,7 @@ Gets the variable instances.
407407
instances = font.get_variable_instances()
408408
```
409409

410-
- #### get_variable_instance_closest_to_coordinates
410+
#### `get_variable_instance_closest_to_coordinates`
411411
```python
412412
"""
413413
Gets the variable instance closest to coordinates.
@@ -422,7 +422,7 @@ eg. coordinates = {"wght": 1000, "slnt": 815, "wdth": 775}
422422
instance = font.get_variable_instance_closest_to_coordinates(coordinates={"wght": 1000, "slnt": 815, "wdth": 775})
423423
```
424424

425-
- #### get_version
425+
#### `get_version`
426426
```python
427427
"""
428428
Gets the font version.
@@ -433,7 +433,7 @@ Gets the font version.
433433
version = font.get_version()
434434
```
435435

436-
- #### get_weight
436+
#### `get_weight`
437437
```python
438438
"""
439439
Gets the font weight value and name.
@@ -444,7 +444,7 @@ Gets the font weight value and name.
444444
weight = font.get_weight()
445445
```
446446

447-
- #### get_width
447+
#### `get_width`
448448
```python
449449
"""
450450
Gets the font width value and name.
@@ -455,7 +455,7 @@ Gets the font width value and name.
455455
width = font.get_width()
456456
```
457457

458-
- #### is_static
458+
#### `is_static`
459459
```python
460460
"""
461461
Determines if the font is a static font.
@@ -466,7 +466,7 @@ Determines if the font is a static font.
466466
static = font.is_static()
467467
```
468468

469-
- #### is_variable
469+
#### `is_variable`
470470
```python
471471
"""
472472
Determines if the font is a variable font.
@@ -477,7 +477,7 @@ Determines if the font is a variable font.
477477
variable = font.is_variable()
478478
```
479479

480-
- #### rename
480+
#### `rename`
481481
```python
482482
"""
483483
Renames the font names records (1, 2, 4, 6, 16, 17) according to
@@ -498,7 +498,7 @@ If style_name is not defined it will be auto-detected.
498498
font.rename(family_name="My Font New", style_name="Bold Italic")
499499
```
500500

501-
- #### save
501+
#### `save`
502502
```python
503503
"""
504504
Saves the font at filepath.
@@ -516,7 +516,7 @@ Saves the font at filepath.
516516
saved_font_path = font.save(filepath=None, overwrite=False)
517517
```
518518

519-
- #### save_as_woff
519+
#### `save_as_woff`
520520
```python
521521
"""
522522
Saves font as woff.
@@ -532,7 +532,7 @@ Saves font as woff.
532532
saved_font_path = font.save_as_woff(filepath=None, overwrite=True)
533533
```
534534

535-
- #### save_as_woff2
535+
#### `save_as_woff2`
536536
```python
537537
"""
538538
Saves font as woff2.
@@ -548,7 +548,7 @@ Saves font as woff2.
548548
saved_font_path = font.save_as_woff2(filepath=None, overwrite=True)
549549
```
550550

551-
- #### set_name
551+
#### `set_name`
552552
```python
553553
"""
554554
Sets the name by its identifier in the font name table.
@@ -561,7 +561,7 @@ Sets the name by its identifier in the font name table.
561561
font.set_name(Font.NAME_FAMILY_NAME, "Family Name Renamed")
562562
```
563563

564-
- #### set_names
564+
#### `set_names`
565565
```python
566566
"""
567567
Sets the names by their identifier in the name table.
@@ -575,7 +575,7 @@ font.set_names(names={
575575
})
576576
```
577577

578-
- #### set_style_flag
578+
#### `set_style_flag`
579579
```python
580580
"""
581581
Sets the style flag.
@@ -588,7 +588,7 @@ Sets the style flag.
588588
font.set_style_flag(Font.STYLE_FLAG_BOLD, True)
589589
```
590590

591-
- #### set_style_flags
591+
#### `set_style_flags`
592592
```python
593593
"""
594594
Sets the style flags, flags set to None will be ignored.
@@ -605,7 +605,7 @@ Sets the style flags, flags set to None will be ignored.
605605
font.set_style_flags(regular=None, bold=None, italic=None, outline=None, underline=None)
606606
```
607607

608-
- #### set_style_flags_by_subfamily_name
608+
#### `set_style_flags_by_subfamily_name`
609609
```python
610610
"""
611611
Sets the style flags by the subfamily name value.
@@ -615,7 +615,7 @@ to allow this method to work properly.
615615
font.set_style_flags_by_subfamily_name()
616616
```
617617

618-
- #### subset
618+
#### `subset`
619619
```python
620620
"""
621621
Subsets the font using the given options (unicodes or glyphs or text),
@@ -634,7 +634,7 @@ https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/subset/__init__.p
634634
font.subset(unicodes="", glyphs=[], text="", **options)
635635
```
636636

637-
- #### to_sliced_variable
637+
#### `to_sliced_variable`
638638
```python
639639
"""
640640
Converts the variable font to a partial one slicing the variable axes at the given coordinates.
@@ -657,7 +657,7 @@ If an axis min and max values are equal, the axis will be pinned.
657657
font.to_sliced_variable(coordinates, **options)
658658
```
659659

660-
- #### to_static
660+
#### `to_static`
661661
```python
662662
"""
663663
Converts the variable font to a static one pinning the variable axes at the given coordinates.

0 commit comments

Comments
 (0)