diff options
author | Mike Morris <mikemorris@users.noreply.github.com> | 2016-04-11 17:58:25 -0700 |
---|---|---|
committer | Mike Morris <mikemorris@users.noreply.github.com> | 2016-04-11 17:58:25 -0700 |
commit | 432d9d81288e84c75906da9a976f3151f1ef074c (patch) | |
tree | fb6e96cc1c2012bdcbca0fe9b3f36b33ac636d66 | |
parent | 4d647f9a8623eb06dd4d8b0c4e7c40a459ffb2ad (diff) | |
download | qtlocation-mapboxgl-432d9d81288e84c75906da9a976f3151f1ef074c.tar.gz |
add freetype
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | mbgl.gypi | 2 | ||||
-rw-r--r-- | platform/linux/scripts/configure.sh | 1 | ||||
-rw-r--r-- | platform/osx/scripts/configure.sh | 1 | ||||
-rw-r--r-- | src/mbgl/renderer/symbol_bucket.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/text/font_stack.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/text/font_stack.hpp | 2 |
7 files changed, 11 insertions, 3 deletions
@@ -111,6 +111,7 @@ print_flags pixelmatch static_libs cflags ldflags print_flags webp static_libs cflags ldflags print_flags jni.hpp static_libs cflags ldflags print_flags harfbuzz static_libs cflags ldflags +print_flags freetype static_libs cflags ldflags CONFIG+=" } } @@ -173,6 +173,7 @@ '<@(rapidjson_cflags)', '<@(variant_cflags)', '<@(harfbuzz_cflags)', + '<@(freetype_cflags)', ], 'cflags': [ '<@(opengl_cflags)', @@ -185,6 +186,7 @@ 'libraries': [ '<@(geojsonvt_static_libs)', '<@(harfbuzz_static_libs)', + '<@(freetype_static_libs)', ], }, diff --git a/platform/linux/scripts/configure.sh b/platform/linux/scripts/configure.sh index 37812ba611..0054c23709 100644 --- a/platform/linux/scripts/configure.sh +++ b/platform/linux/scripts/configure.sh @@ -17,6 +17,7 @@ GTEST_VERSION=1.7.0 PIXELMATCH_VERSION=0.9.0 WEBP_VERSION=0.5.0 HARFBUZZ_VERSION=1.2.1 +FREETYPE_VERSION=2.6 function print_opengl_flags { CONFIG+=" 'opengl_cflags%': $(quote_flags $(pkg-config gl x11 --cflags)),"$LN diff --git a/platform/osx/scripts/configure.sh b/platform/osx/scripts/configure.sh index 6e1585ce2e..c5553c84dd 100644 --- a/platform/osx/scripts/configure.sh +++ b/platform/osx/scripts/configure.sh @@ -12,3 +12,4 @@ RAPIDJSON_VERSION=1.0.2 GTEST_VERSION=1.7.0 PIXELMATCH_VERSION=0.9.0 HARFBUZZ_VERSION=1.2.1 +FREETYPE_VERSION=2.6 diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index e189104490..d12ddb8368 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -238,6 +238,7 @@ void SymbolBucket::addFeatures(uintptr_t tileUID, if (feature.label.length()) { shapedText = fontStack->getShaping( /* string */ feature.label, + /* fontstack: string */ layout.text.font, /* maxWidth: ems */ layout.placement != PlacementType::Line ? layout.text.maxWidth * 24 : 0, /* lineHeight: ems */ layout.text.lineHeight * 24, diff --git a/src/mbgl/text/font_stack.cpp b/src/mbgl/text/font_stack.cpp index c45089a933..8b2604973e 100644 --- a/src/mbgl/text/font_stack.cpp +++ b/src/mbgl/text/font_stack.cpp @@ -4,7 +4,7 @@ #include <mbgl/util/math.hpp> #include <harfbuzz/hb.h> -// #include <harfbuzz/hb-ft.h> +#include <harfbuzz/hb-ft.h> #include <iostream> #include <codecvt> @@ -34,7 +34,8 @@ const std::map<uint32_t, SDFGlyph> &FontStack::getSDFs() const { return sdfs; } -const Shaping FontStack::getShaping(const std::u32string &string, const float maxWidth, +const Shaping FontStack::getShaping(const std::u32string &string, + const std::string &font, const float maxWidth, const float lineHeight, const float horizontalAlign, const float verticalAlign, const float justify, const float spacing, const vec2<float> &translate) const { @@ -53,6 +54,7 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float ma std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> cv; std::cout << cv.to_bytes(string) << std::endl; + std::cout << font << std::endl; /* mapnik::value_unicode_string const& text = itemizer.text(); diff --git a/src/mbgl/text/font_stack.hpp b/src/mbgl/text/font_stack.hpp index d81460a534..2ceeceb7c2 100644 --- a/src/mbgl/text/font_stack.hpp +++ b/src/mbgl/text/font_stack.hpp @@ -10,7 +10,7 @@ class FontStack { public: void insert(uint32_t id, const SDFGlyph &glyph); const std::map<uint32_t, SDFGlyph> &getSDFs() const; - const Shaping getShaping(const std::u32string &string, float maxWidth, float lineHeight, + const Shaping getShaping(const std::u32string &string, const std::string &font, float maxWidth, float lineHeight, float horizontalAlign, float verticalAlign, float justify, float spacing, const vec2<float> &translate) const; void lineWrap(Shaping &shaping, float lineHeight, float maxWidth, float horizontalAlign, |