freetypy.Outline.to_string

Outline.to_string()

⨎ Convert the outline to a text format string of commands. This function is flexible enough to create path commands for PDF, Postcript and SVG.

Parameters:
  • move_command (bytes) – The character or command to use for “move to” commands.
  • line_command (bytes) – The character or command to use for “line to” commands.
  • cubic_command (bytes) – The character or command to use for “cubic curve” commands.
  • conic_command (bytes, optional) – The character or command to use for “conic curve” commands. If one is not provided, conic curves will be implicitly converted to cubic curves.
  • relative (bool, optional) –
prefix : bool, optional
If True, the command will appear before the points it refers to. Otherwise, the default is for them to appear after.
Returns:string – A text-based string of commands to render the character.
Return type:bytes

Examples

To generate a PDF-compatible path:

outline.to_string(" m ", " l ", " c ")