summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Morris <mikemorris@users.noreply.github.com>2016-04-11 17:58:25 -0700
committerMike Morris <mikemorris@users.noreply.github.com>2016-04-11 17:58:25 -0700
commit432d9d81288e84c75906da9a976f3151f1ef074c (patch)
treefb6e96cc1c2012bdcbca0fe9b3f36b33ac636d66
parent4d647f9a8623eb06dd4d8b0c4e7c40a459ffb2ad (diff)
downloadqtlocation-mapboxgl-432d9d81288e84c75906da9a976f3151f1ef074c.tar.gz
add freetype
-rwxr-xr-xconfigure1
-rw-r--r--mbgl.gypi2
-rw-r--r--platform/linux/scripts/configure.sh1
-rw-r--r--platform/osx/scripts/configure.sh1
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp1
-rw-r--r--src/mbgl/text/font_stack.cpp6
-rw-r--r--src/mbgl/text/font_stack.hpp2
7 files changed, 11 insertions, 3 deletions
diff --git a/configure b/configure
index 6f820774fc..c0e7dcf9f0 100755
--- a/configure
+++ b/configure
@@ -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+=" }
}
diff --git a/mbgl.gypi b/mbgl.gypi
index 72d1f318b5..f50a27ab75 100644
--- a/mbgl.gypi
+++ b/mbgl.gypi
@@ -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,