add test to ensure icu/harfbuzz shapers can be compiled

This commit is contained in:
Dane Springmeyer 2015-07-08 23:28:38 -07:00
parent a6a4f1eb2e
commit 153051d020
5 changed files with 35 additions and 4 deletions

View file

@ -44,7 +44,7 @@ extern "C"
namespace mapnik
{
class font_face : util::noncopyable
class MAPNIK_DECL font_face : util::noncopyable
{
public:
font_face(FT_Face face);

View file

@ -28,7 +28,9 @@
#include <mapnik/text/text_line.hpp>
#include <mapnik/text/face.hpp>
#include <mapnik/text/font_feature_settings.hpp>
#include <mapnik/text/itemizer.hpp>
#include <mapnik/safe_cast.hpp>
#include <mapnik/font_engine_freetype.hpp>
// stl
#include <list>
@ -38,6 +40,9 @@
#include <harfbuzz/hb.h>
#include <harfbuzz/hb-ft.h>
// icu
#include <unicode/uscript.h>
namespace mapnik
{

View file

@ -27,6 +27,7 @@
#include <mapnik/text/evaluated_format_properties_ptr.hpp>
#include <mapnik/value_types.hpp>
#include <mapnik/util/noncopyable.hpp>
#include <mapnik/config.hpp>
// stl
#include <string>
@ -41,7 +42,7 @@
namespace mapnik
{
struct text_item : util::noncopyable
struct MAPNIK_DECL text_item : util::noncopyable
{
text_item(unsigned s,
unsigned e,
@ -71,7 +72,7 @@ struct text_item : util::noncopyable
// - format
// - script (http://en.wikipedia.org/wiki/Scripts_in_Unicode)
class text_itemizer
class MAPNIK_DECL text_itemizer
{
public:
text_itemizer();

View file

@ -25,6 +25,7 @@
//stl
#include <vector>
#include <mapnik/util/noncopyable.hpp>
#include <mapnik/config.hpp>
namespace mapnik
{
@ -35,7 +36,7 @@ struct glyph_info;
// It can be used for rendering but no text processing (like line breaking)
// should be done!
class text_line : util::noncopyable
class MAPNIK_DECL text_line : util::noncopyable
{
public:
using glyph_vector = std::vector<glyph_info>;

View file

@ -0,0 +1,24 @@
#include "catch.hpp"
#include <mapnik/text/icu_shaper.hpp>
#include <mapnik/text/harfbuzz_shaper.hpp>
#include <mapnik/text/font_library.hpp>
TEST_CASE("shapers compile") {
mapnik::text_line line(0,0);
mapnik::text_itemizer itemizer;
std::map<unsigned,double> width_map;
double scale_factor = 1;
mapnik::font_library fl;
mapnik::freetype_engine::font_file_mapping_type font_file_mapping;
mapnik::freetype_engine::font_memory_cache_type font_memory_cache;
mapnik::face_manager fm(fl,font_file_mapping,font_memory_cache);
mapnik::harfbuzz_shaper::shape_text(line,itemizer,
width_map,
fm,
scale_factor);
mapnik::icu_shaper::shape_text(line,itemizer,
width_map,
fm,
scale_factor);
}