8000 Update README.md · fabiocaccamo/python-fontbro@f9600d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9600d0

Browse files
committed
Update README.md
1 parent 4a5dfe9 commit f9600d0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ with open("fonts/MyFont.ttf") as fh:
5656
- [`get_style_flag`](#get_style_flag)
5757
- [`get_style_flags`](#get_style_flags)
5858
- [`get_style_name`](#get_style_name)
59+
- [`get_svg`](#get_svg)
5960
- [`get_ttfont`](#get_ttfont)
6061
- [`get_unicode_block_by_name`](#get_unicode_block_by_name)
6162
- [`get_unicode_blocks`](#get_unicode_blocks)
@@ -388,6 +389,23 @@ Gets the style name reading the name records with priority order (17, 22, 2).
388389
style_name = font.get_style_name()
389390
```
390391

392+
#### `get_svg`
393+
```python
394+
"""
395+
Gets an SVG representation of the font rendering
396+
some text using the given options.
397+
398+
:param text: The text to be rendered as SVG paths.
399+
:type text: str
400+
:param size: The size of the font to be used for rendering the text, in points.
401+
:type size: int
402+
403+
:returns: An SVG string that represents the rendered text.
404+
:rtype: str
405+
"""
406+
svg_str = font.get_svg(text="Hello!", size=48)
407+
```
408+
391409
#### `get_ttfont`
392410
```python
393411
"""

0 commit comments

Comments
 (0)
0