File: shaping.cpp

package info (click to toggle)
mapnik 3.1.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,548 kB
  • sloc: cpp: 144,430; python: 30,187; sh: 797; makefile: 172; xml: 140; lisp: 13
file content (25 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#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);
}