class_docstr:   This is an interactive example of how to display text on app.Canvas.
    The text rendering will respond to standard C escape sequences.
  
    - Scroll for changing text font size
    - Press left and right arrows for changing text anchor positions
    - Press up and down arrows for changing text content
  
    Standard C escape sequences:
        -     ->  alert (beep, bell)
        -     ->  Backspace
        -     ->  Formfeed
        -   
  ->  Newline
        -   
    ->  Carriage Return
        -         ->  Horizontal Tab
        -     ->  Vertical Tab
        -   \  ->  Backslash
        -   '  ->  Single quotation mark
        -   "  ->  Double quotation mark
    
code: def __init__(self):
      app.Canvas.__init__(self, title="Glyphs", keys="interactive")
  
      self.font_size = 9.0
  
      # Create a cross eye for easy see if text anchor positions are good
      l_pos = np.array(
          [
              [-1.0, 0.0],
              [1.0, 0.0],
              [0.0, 0.0],
              [0.0, 1.0],
              [0.0, -1.0],
          ]
      )
      self.cross_eye_line = visuals.LineVisual(
          pos=l_pos, color=(1.0, 0.0, 0.0, 1), method="gl"
      )
  
      big_test_string = "This is the big test string!\n"
      big_test_string += (
          "It includes all of the escape sequences known\n"
      )
      big_test_string += "to man:\n\n"
      big_test_string += "\t-\t\\n\n"
      big_test_string += "\t-\t\\v\n"
      big_test_string += "\t-\t\\t\n"
      big_test_string += "\t-\tetc..\v"
      big_test_string += (
          "So \bif \fthis \rlooks correct, somebody did a \n"
      )
      big_test_string += "decent job and deserves a beer "
      big_test_string += "and a digital salute\a! ;)"
      big_test_string += "\vThe end!"
      self.string_alternatives = [
          "",
          "Hello (scroll/arrows to change text properties)|\a|how are u",
          "Hello (scroll/arrows to change text properties)|\b|how are u",
          "Hello (scroll/arrows to change text properties)|\f|how are u",
          "Hello (scroll/arrows to change text properties)|\n|how are u",
          "Hello (scroll/arrows to change text properties)|\r|how are u",
          "Hello (scroll/arrows to change text properties)|\t|how are u",
          "Hello (scroll/arrows to change text properties)|\v|how are u",
          "Hello (scroll/arrows to change text properties)|\\|how are u",
          "Hello (scroll/arrows to change text properties)|'|how are u",
          'Hello (scroll/arrows to change text properties)|"|how are u',
          "Hello (scroll/arrows to change text properties)|?|how are u",
          big_test_string,
      ]
      self.str_ind = 0
  
      # anchor_x , anchor_y
      self.anchor_variants = [
          ["top", "left"],
          ["center", "left"],
          ["bottom", "left"],
          ["top", "center"],
          ["center", "center"],
          ["bottom", "center"],
          ["top", "right"],
          ["center", "right"],
          ["bottom", "right"],
      ]
      self.anchor_ind = 0
  
      self.text = visuals.TextVisual("", bold=True, pos=(0.0, 0.0))
      self.update_text()
  
file_path: vispy/examples/basics/visuals/text_visual.py
imports: from vispy import app, gloo, visuals
  import numpy
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()