textSize

core/typography.py

tags:

Set the font size used when rendering text.

syntax

textSize(size)

parameters

size font size

examples

setting the font size

def init():
   textFont('data/fonts/DroidSans.ttf')

def display():
   size = 12

   textSize(size)
   text('font-size={}'.format(size), 0, 0, 5)
   size += 2
   
   textSize(size)
   text('font-size={}'.format(size), 0, 0, 3)
   size += 2
   
   textSize(size)
   text('font-size={}'.format(size), 0, 0, 0)
   size += 2
   
   textSize(size)
   text('font-size={}'.format(size), 0, 0, -3)
   size += 2
   
   textSize(size)
   text('font-size={}'.format(size), 0, 0, -5)
   size += 2