pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
txtlib

txtlib - 0.2

Francesco Pasa (frapa)

Tags:

Description

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.

Features

  • 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

changelog

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

Info

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

Links

Home Page: http://www.utopico.tk
Source: http://www.famigliapasa.it/francesco/download/txtlib-0.2.zip

Screenshot


click to view original size

Releases

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

Pygame.org account Comments

If you wish to leave a comment with your pygame.org 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.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014

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