From e39482d5570719654e7206d74a2c7bee1aa96dae Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 13 Apr 2016 18:42:49 -0700 Subject: wire in some freetype nonsense --- src/mbgl/text/font_stack.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 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 4c27a3dc5f..05274be315 100644 --- a/src/mbgl/text/font_stack.cpp +++ b/src/mbgl/text/font_stack.cpp @@ -35,31 +35,9 @@ 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); - - // 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"); - 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; - } - } - */ + Font font("/Users/mikemorris/Desktop/Open_Sans/OpenSans-Regular.ttf"); + Shaping shaping = font.shape(string, spacing, translate, sdfs); if (shaping.positionedGlyphs.empty()) return shaping; -- cgit v1.2.1