Author: dmeyer
Date: Sat Jun 17 15:29:45 2006
New Revision: 1545

Modified:
   trunk/imlib2/src/font.py

Log:
support Font init to get fontdesc as list

Modified: trunk/imlib2/src/font.py
==============================================================================
--- trunk/imlib2/src/font.py    (original)
+++ trunk/imlib2/src/font.py    Sat Jun 17 15:29:45 2006
@@ -38,7 +38,8 @@
         Create a new Font object.
 
         Arguments:
-          fontdesc: the description of the font, in the form 'Fontname/Size'.
+          fontdesc: the description of the font, in the form 'Fontname/Size'
+                    or as a list/tuple in the form ('Fontname', size).
                     Only TrueType fonts are supported, and the .ttf file must
                     exist in a registered font path.  Font paths can be
                     registered by calling Imlib2.add_font_path().
@@ -48,7 +49,8 @@
                     is 255.  If color is not specified, the default is fully
                     opaque white.
         """
-
+        if isinstance(fontdesc, (list, tuple)):
+            fontdesc = fontdesc[0] + '/' + str(fontdesc[1])
         self._font = _Imlib2.load_font(fontdesc)
         sep = fontdesc.index("/")
         self.fontname = fontdesc[:sep]


_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to