From 0e9c542d11f1d69e67d391a48c6262e59544b65d Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 8 Nov 2007 11:06:05 +0000 Subject: [PATCH] 1.Added 'face_names' method which returns list of face names: >>> from mapnik import * >>> for name in FontEngine.instance().face_names(): ... print name ... DejaVu Sans Bold DejaVu Sans Bold Oblique .... 2. std::vector is reflected as mapnik_.Names object TODO: test if there are more then one face in the file --- bindings/python/mapnik_font_engine.cpp | 10 ++++++---- bindings/python/mapnik_layer.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bindings/python/mapnik_font_engine.cpp b/bindings/python/mapnik_font_engine.cpp index d48decae2..5b25d9189 100644 --- a/bindings/python/mapnik_font_engine.cpp +++ b/bindings/python/mapnik_font_engine.cpp @@ -36,9 +36,11 @@ void export_font_engine() .staticmethod("instance") ; - class_ >, - boost::noncopyable>("FontEngine",no_init) - .def("register_font",&freetype_engine::register_font) - .staticmethod("register_font") + class_ >, + boost::noncopyable>("FontEngine",no_init) + .def("register_font",&freetype_engine::register_font) + .def("face_names",&freetype_engine::face_names) + .staticmethod("register_font") + .staticmethod("face_names") ; } diff --git a/bindings/python/mapnik_layer.cpp b/bindings/python/mapnik_layer.cpp index a8097a9d4..95a7de1dc 100644 --- a/bindings/python/mapnik_layer.cpp +++ b/bindings/python/mapnik_layer.cpp @@ -35,7 +35,7 @@ std::vector & (mapnik::Layer::*_styles_)() = &mapnik::Layer::styles void export_layer() { using namespace boost::python; - class_ >("Styles") + class_ >("Names") .def(vector_indexing_suite,true >()) ;