src/reportlab/lib/utils.py
changeset 3631 faec46a34c20
parent 3617 ae5744e97c42
child 3634 30efff664458
--- a/src/reportlab/lib/utils.py	Thu Dec 06 16:12:38 2012 +0000
+++ b/src/reportlab/lib/utils.py	Tue Dec 11 13:52:45 2012 +0000
@@ -1174,3 +1174,14 @@
         self = str.__new__(cls,value)
         self.__inc = inc
         return self
+
+class RLFontName(str):
+    '''allows specification of the properties of a font using a dictionary of extra attributes
+    eg fontName = RLFontName('proxima-nova-bold',
+                    svgAttrs=dict(family='"proxima-nova"',weight='bold'))
+    '''
+    def __new__(cls,v,**kwds):
+        self = str.__new__(cls,v)
+        for k,v in kwds.iteritems():
+            setattr(self,k,v)
+        return self