diff --git a/SConstruct b/SConstruct index 71f04991d..60352732c 100644 --- a/SConstruct +++ b/SConstruct @@ -1068,7 +1068,7 @@ if not preconfigured: # libxml2 should be optional but is currently not # https://github.com/mapnik/mapnik/issues/913 - if conf.parse_config('XML2_CONFIG'): + if conf.parse_config('XML2_CONFIG',checks='--cflags'): env['HAS_LIBXML2'] = True LIBSHEADERS = [ diff --git a/src/build.py b/src/build.py index 211248212..b14b351b4 100644 --- a/src/build.py +++ b/src/build.py @@ -73,6 +73,7 @@ if env['THREADING'] == 'multi': if env['RUNTIME_LINK'] == 'static': if 'icuuc' in env['ICU_LIB_NAME']: lib_env['LIBS'].append('icudata') + lib_env['LIBS'].append('icui18n') else: if env['INTERNAL_LIBAGG']: lib_env['LIBS'].insert(0, 'agg') diff --git a/src/image_util.cpp b/src/image_util.cpp index 5b3b46454..dfc1c54c6 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -45,6 +45,7 @@ extern "C" #ifdef HAVE_CAIRO #include +#include #endif #include @@ -371,17 +372,40 @@ void save_to_cairo_file(mapnik::Map const& map, unsigned width = map.width(); unsigned height = map.height(); if (type == "pdf") + { +#if defined(CAIRO_HAS_PDF_SURFACE) surface = Cairo::PdfSurface::create(filename,width,height); +#else + throw ImageWriterException("PDFSurface not supported in the cairo backend"); +#endif + } +#if defined(CAIRO_HAS_SVG_SURFACE) else if (type == "svg") + { surface = Cairo::SvgSurface::create(filename,width,height); + } +#endif +#if defined(CAIRO_HAS_PS_SURFACE) else if (type == "ps") + { surface = Cairo::PsSurface::create(filename,width,height); + } +#endif +#if defined(CAIRO_HAS_IMAGE_SURFACE) else if (type == "ARGB32") + { surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32,width,height); + } else if (type == "RGB24") + { surface = Cairo::ImageSurface::create(Cairo::FORMAT_RGB24,width,height); + } +#endif else + { throw ImageWriterException("unknown file type: " + type); + } + Cairo::RefPtr context = Cairo::Context::create(surface); // TODO - expose as user option diff --git a/src/load_map.cpp b/src/load_map.cpp index 1ca110d77..d27071c42 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -1069,7 +1069,9 @@ void map_parser::parse_text_symbolizer(rule & rule, xml_node const& sym) } if (strict_ && !placement_finder->defaults.format.fontset.size()) + { ensure_font_face(placement_finder->defaults.format.face_name); + } text_symbolizer text_symbol = text_symbolizer(placement_finder); parse_metawriter_in_symbolizer(text_symbol, sym); @@ -1096,7 +1098,9 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym) placement_finder->defaults.from_xml(sym, fontsets_); if (strict_ && !placement_finder->defaults.format.fontset.size()) + { ensure_font_face(placement_finder->defaults.format.face_name); + } shield_symbolizer shield_symbol = shield_symbolizer(placement_finder); /* Symbolizer specific attributes. */