From fea3aa573ad49003068f94374d766300fc35247f Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 12 Apr 2016 18:33:39 -0700 Subject: everything is wrong but harfbuzz output is being consumed --- src/mbgl/text/font_stack.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mbgl/text/font_stack.cpp') diff --git a/src/mbgl/text/font_stack.cpp b/src/mbgl/text/font_stack.cpp index d49e128f51..4c27a3dc5f 100644 --- a/src/mbgl/text/font_stack.cpp +++ b/src/mbgl/text/font_stack.cpp @@ -35,26 +35,31 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float ma const float lineHeight, const float horizontalAlign, const float verticalAlign, const float justify, const float spacing, const vec2 &translate) const { + /* Shaping shaping(translate.x * 24, translate.y * 24, string); - // the y offset *should* be part of the font metadata + // TODO: the y offset *should* be part of the font metadata const int32_t yOffset = -17; float x = 0; const float y = yOffset; + */ // Create new Harfbuzz font object Font font("/Library/Fonts/Arial Unicode.ttf"); - font.shape(string); + Shaping shaping = font.shape(string, spacing, translate); + /* // Loop through all characters of this label and shape. for (uint32_t chr : string) { auto it = sdfs.find(chr); if (it != sdfs.end()) { + // TODO: change this instead of assuming they stay in order shaping.positionedGlyphs.emplace_back(chr, x, y); x += it->second.metrics.advance + spacing; } } + */ if (shaping.positionedGlyphs.empty()) return shaping; -- cgit v1.2.1