@@ -1584,10 +1584,13 @@ def TTF_RenderGlyph32_Blended(font, ch, fg):
1584
1584
1585
1585
1586
1586
def TTF_SetDirection (direction ):
1587
- """Sets the global text direction to use when rendering.
1587
+ """Sets the global text direction to use for rendering.
1588
1588
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:
1591
1594
1592
1595
=============== ====================
1593
1596
Text Direction Constant
@@ -1598,9 +1601,8 @@ def TTF_SetDirection(direction):
1598
1601
Bottom-to-top ``HB_DIRECTION_BTT``
1599
1602
=============== ====================
1600
1603
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.
1604
1606
1605
1607
`Note: Added in SDL_ttf 2.0.18`
1606
1608
@@ -1615,21 +1617,21 @@ def TTF_SetDirection(direction):
1615
1617
return _funcs ["TTF_SetDirection" ](direction )
1616
1618
1617
1619
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.
1619
1621
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.
1623
1625
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
1626
1628
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 ::
1628
1630
1629
1631
arabic_script = HB_TAG('A', 'r', 'a', 'b')
1630
1632
TTF_SetScript(arabic_script)
1631
1633
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')
1633
1635
script.
1634
1636
1635
1637
`Note: Added in SDL_ttf 2.0.18`
0 commit comments