Changeset 4710 for libcaca


Ignore:
Timestamp:
Nov 11, 2010, 9:46:17 AM (8 years ago)
Author:
Alex Foulon
Message:
  • Bind figfont functions
  • Add example figfont
Location:
libcaca/trunk/python
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/python/caca/canvas.py

    r4410 r4710  
    952952        return ctypes.string_at(ret, p.value)
    953953
     954    def set_figfont(self, filename):
     955        """     Load a figfont and attach it to a canvas.
     956
     957            filename    -- the figfont file to load.
     958        """
     959        _lib.caca_canvas_set_figfont.argtypes = [_Canvas, ctypes.c_char_p]
     960        _lib.caca_canvas_set_figfont.restype  = ctypes.c_int
     961
     962        return _lib.caca_canvas_set_figfont(self, filename)
     963
     964    def put_figchar(self, ch):
     965        """ Paste a character using the current figfont.
     966
     967            ch  -- the character to paste
     968        """
     969        _lib.caca_put_figchar.argtypes = [_Canvas, ctypes.c_uint32]
     970        _lib.caca_put_figchar.restype  = ctypes.c_int
     971
     972        return _lib.caca_put_figchar(self, ord(ch))
     973
     974    def flush_figlet(self):
     975        """ Flush the figlet context
     976        """
     977        _lib.caca_flush_figlet.argtypes = [_Canvas]
     978        _lib.caca_flush_figlet.restype  = ctypes.c_int
     979
     980        return _lib.caca_flush_figlet(self)
     981
    954982class NullCanvas(_Canvas):
    955983    """ Represent a NULL canvas_t, eg to use as canvas mask for blit operations.
Note: See TracChangeset for help on using the changeset viewer.