diff --git a/CHANGELOG.md b/CHANGELOG.md index 241f3944c..92629c520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ Released ... Summary: TODO +- Added support for web fonts: .woff format (#2113) + - Added missing support for `geometry-transform` in `line-pattern` and `polygon-pattern` symbolizers (#2065) - Dropped support for Sun compiler diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py index f1030b7f9..934bf5a64 100644 --- a/bindings/python/mapnik/__init__.py +++ b/bindings/python/mapnik/__init__.py @@ -1029,7 +1029,7 @@ def register_plugins(path=None): path = inputpluginspath DatasourceCache.register_datasources(path) -def register_fonts(path=None,valid_extensions=['.ttf','.otf','.ttc','.pfa','.pfb','.ttc','.dfont']): +def register_fonts(path=None,valid_extensions=['.ttf','.otf','.ttc','.pfa','.pfb','.ttc','.dfont','.woff']): """Recursively register fonts using path argument as base directory""" if not path: if os.environ.has_key('MAPNIK_FONT_DIRECTORY'): diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index 453a74d80..2b0c5f96e 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -58,7 +58,6 @@ static void shape_text(text_line & line, const std::unique_ptr buffer(hb_buffer_create(),hb_buffer_deleter); hb_buffer_set_unicode_funcs(buffer.get(), hb_icu_get_unicode_funcs()); hb_buffer_pre_allocate(buffer.get(), length); - const char* const shapers[] = { "ot", "fallback", NULL }; for (auto const& text_item : list) { @@ -74,7 +73,7 @@ static void shape_text(text_line & line, hb_buffer_set_script(buffer.get(), hb_icu_script_to_script(text_item.script)); face_ptr const& face = *face_itr; hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); - hb_shape_full(font, buffer.get(), NULL, 0, shapers); + hb_shape(font, buffer.get(), NULL, 0); hb_font_destroy(font); unsigned num_glyphs = hb_buffer_get_length(buffer.get()); diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index f8b97ce69..ee7926cab 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -73,6 +73,7 @@ bool freetype_engine::is_font_file(std::string const& file_name) boost::algorithm::ends_with(fn,std::string(".pfa")) || boost::algorithm::ends_with(fn,std::string(".pfb")) || boost::algorithm::ends_with(fn,std::string(".ttc")) || + boost::algorithm::ends_with(fn,std::string(".woff"))|| // Plus OSX custom ext boost::algorithm::ends_with(fn,std::string(".dfont")); }