pygame is
Simple DirectMedia Layer is
Site Swing

txtlib - 0.2

Francesco Pasa (frapa)



Txtlib is a small library (the download is only 2.5 Kb with a test script included) to render text. It's similar to Glyph and support almost the same features, but it use a different system.

Txtlib is developed to do a css editor.

How txtlib work

Txtlib is a module; you need only to import it and call the class Text. Txtlib does not draw anything on the screen, it only build an image calling the update() method. This allow you to have the maximum control on the screen. You have just to blit the text.area image where you want.

Txtlib doesn't store the format information in the same variable as text. This complicate the control of format, but make txtlib suitable to make a text editor with code highlighting. Anyway, it's available a method to convert HTML-like mark-up code into txtlib text format.


  • Multi line text rendering
  • Basic text format (bold, italic and underline)
  • Different fonts in the same rendering area
  • Different font size
  • Different text colors
  • Automatic font loading (both system and custom fonts)
  • Background color and images
  • HTML-like syntax to define text format


Version 0.2 - Add html style markup
From this version you can define the style with simple html-like tags - see documentation for more informations.
Version 0.1.2 - Bugfixes
  • Txtlib doesn't crash any more if you try to load a font that does not exists. Now it load the default Pygame font.
  • Tab characters are now displayed.

TODO list (what txtlib doesn't support)

  • Lines splitting if the line is too long
  • Text scrolling
  • Line numbers
  • Clickable text
  • Documentation


Please comment for any bug you find. If you find grammar errors in the text please inform me (I'm not very good at English).

Contact: francescopasa at gmail dot com


Home Page:


click to view original size


txtlib - 0.2 - Jul 28, 2010
txtlib - 0.1.2 - Jul 27, 2010
txtlib - 0.1 - Jul 24, 2010 account Comments

If you wish to leave a comment with your account, please sign in first.

August 3, 2010 1:48pm - dvlpr - nickname: (dvlpr) - 4/5
Good Work!
July 26, 2010 2:13pm - Ian Mallett - nickname: (geometrian)
Looks great, actually!
July 25, 2010 2:15pm - Francesco Pasa - nickname: (frapa)
Thank you!!! I'm already working on the new release and on the documentation. Coming soon.
July 25, 2010 5:08am - Rene Dudfield - nickname: (illume)
Very cool! Keep up the good work.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)