Turtle Text (TT)

About

Turtle Text is a Turtle Graphics (TG) library add-on which like TG is implemented in pure JavaScript and any examples use p5js because it provides a simple framework.

Introduction

TT can only draw the printable characters in the ASCII set as shown in this table -

Although TT only has a single font-face and proportional-width characters it does allow great control over how the text is displayed -

  • Font height:
  • Font weight: the pensize.
  • Scale: the charater width depends on the pensize and is independant of the font height. The scale enables greater control of the charecter aspect ratio.
  • Kerning: the horizontal spacing between adjacent characters in the text.
  • Leading: the vertical space between lines of text. The vertical distance between two lines of text is the font height + leading.
  • Line width: if specified it is the maximum horizontal space for displaying the text. Text that does not fit will automatically be split into multiple lines.
  • Align: if a line width has been specified then the text can be left aligned, right aligned, centred or justified.