@@ -35,7 +35,7 @@ class FontconfigPatternParser:
3535 See here for a rough specification of these patterns:
3636 http://www.fontconfig.org/fontconfig-user.html
3737 """
38-
38+
3939
4040 _constants = {
4141 'thin' : ('weight' , 'light' ),
@@ -63,12 +63,12 @@ class FontconfigPatternParser:
6363 'extraexpanded' : ('width' , 'extra-expanded' ),
6464 'ultraexpanded' : ('width' , 'ultra-expanded' )
6565 }
66-
66+
6767 def __init__ (self ):
6868 family = Regex (r'([^%s]|(\\[%s]))*' %
6969 (family_punc , family_punc )) \
7070 .setParseAction (self ._family )
71- size = Regex (r' [0-9.]+' ) \
71+ size = Regex (r"( [0-9]+\.?[0-9]*|\.[0-9]+)" ) \
7272 .setParseAction (self ._size )
7373 name = Regex (r'[a-z]+' ) \
7474 .setParseAction (self ._name )
@@ -79,7 +79,7 @@ def __init__(self):
7979 families = (family
8080 + ZeroOrMore (
8181 Literal (',' )
82- + family )
82+ + family )
8383 ).setParseAction (self ._families )
8484
8585 point_sizes = (size
@@ -118,10 +118,10 @@ def parse(self, pattern):
118118 self ._parser .parseString (pattern )
119119 except self .ParseException , e :
120120 raise ValueError ("Could not parse font string: '%s'\n %s" % (pattern , e ))
121-
121+
122122 self ._properties = None
123123 return props
124-
124+
125125 def _family (self , s , loc , tokens ):
126126 return [family_unescape (r'\1' , tokens [0 ])]
127127
@@ -141,7 +141,7 @@ def _families(self, s, loc, tokens):
141141 def _point_sizes (self , s , loc , tokens ):
142142 self ._properties ['size' ] = tokens
143143 return []
144-
144+
145145 def _property (self , s , loc , tokens ):
146146 if len (tokens ) == 1 :
147147 if tokens [0 ] in self ._constants :
0 commit comments