Skip to content

Commit 2295367

Browse files
committed
Clean up the new TTF docs a bit
1 parent c211100 commit 2295367

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

sdl2/sdlttf.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,10 +1584,13 @@ def TTF_RenderGlyph32_Blended(font, ch, fg):
15841584

15851585

15861586
def TTF_SetDirection(direction):
1587-
"""Sets the global text direction to use when rendering.
1587+
"""Sets the global text direction to use for rendering.
15881588
1589-
This function passes the direction to the underlying HarfBuzz library,
1590-
meaning that the direction must be one of the following HarfBuzz constants:
1589+
This function lets you manually specify the direction in which SDL_ttf
1590+
should render text, and can be set or changed at any time.
1591+
1592+
The direction value is passed to the underlying HarfBuzz library, meaning
1593+
that the direction must be one of the following HarfBuzz constants:
15911594
15921595
=============== ====================
15931596
Text Direction Constant
@@ -1598,9 +1601,8 @@ def TTF_SetDirection(direction):
15981601
Bottom-to-top ``HB_DIRECTION_BTT``
15991602
=============== ====================
16001603
1601-
If not specified, the TTF library defaults to left-to-right text
1602-
rendering. For convenience, these constants are provided by the
1603-
``sdl2.sdlttf`` module. The direction can be set at any time.
1604+
For convenience, these constants are provided by the ``sdl2.sdlttf`` module.
1605+
If not specified, SDL_ttf defaults to left-to-right text rendering.
16041606
16051607
`Note: Added in SDL_ttf 2.0.18`
16061608
@@ -1615,21 +1617,21 @@ def TTF_SetDirection(direction):
16151617
return _funcs["TTF_SetDirection"](direction)
16161618

16171619
def TTF_SetScript(script):
1618-
"""Sets the global script style (e.g. arabic) to use for rendering text.
1620+
"""Sets the global script (e.g. Arabic) to use for rendering text.
16191621
1620-
Setting the script style gives extra information to the text rendering
1621-
library about how to best shape words and characters. This can produce
1622-
better results when rendering with non-Latin fonts.
1622+
Setting the script gives the text renderer extra information about how
1623+
to best shape words and characters for a given language. This can produce
1624+
better results when rendering with non-Latin languages and fonts.
16231625
1624-
The script is passed to the underlying HarfBuzz library, meaning that the
1625-
it needs to be specified in HarfBuzz ``hb_script_t`` format. To make this
1626+
The script value is passed to the underlying HarfBuzz library, meaning that
1627+
it needs to be specified as a HarfBuzz script constant. To make this
16261628
convenient, the ``sdl2.sdlttf`` module implements HarfBuzz's :func:`HB_TAG`
1627-
macro for converting ISO 15924 character codes to HarfBuzz script::
1629+
macro for converting ISO 15924 character codes to HarfBuzz scripts::
16281630
16291631
arabic_script = HB_TAG('A', 'r', 'a', 'b')
16301632
TTF_SetScript(arabic_script)
16311633
1632-
If no script has been set, the TTF library defaults to unknown ('Zzzz')
1634+
If no script has been set, the TTF library defaults to the unknown ('Zzzz')
16331635
script.
16341636
16351637
`Note: Added in SDL_ttf 2.0.18`

0 commit comments

Comments
 (0)