Skip to content

Commit

Permalink
Adds support for font-directory
Browse files Browse the repository at this point in the history
Usage:

    Map {
      font-directory: url("fonts/");
    }

Fixes mapnik#9
  • Loading branch information
mojodna committed May 24, 2014
1 parent 82f6685 commit b4e1385
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cascadenik/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def is_applicable_selector(selector, filter):
def get_map_attributes(declarations):
"""
"""
property_map = {'map-bgcolor': 'background'}
property_map = {'map-bgcolor': 'background', 'font-directory': 'font-directory'}

return dict([(property_map[dec.property.name], dec.value.value)
for dec in declarations
Expand Down
1 change: 1 addition & 0 deletions cascadenik/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __eq__(self, other):

#
'map-bgcolor': color_transparent,
'font-directory': uri,

#--------------- polygon symbolizer

Expand Down
3 changes: 3 additions & 0 deletions cascadenik/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def testValue14(self):

def testValue15(self):
self.assertEqual(14, postprocess_value(Property('shield-line-spacing'), [('NUMBER', '14')], False, 0, 0).value)

def testValue16(self):
self.assertEqual('fonts/', str(postprocess_value(Property('font-directory'), [('URI', 'url("fonts/")')], False, 0, 0)))

class CascadeTests(unittest.TestCase):

Expand Down

0 comments on commit b4e1385

Please sign in to comment.