diff --git a/src/map/tile_parser.cpp b/src/map/tile_parser.cpp index f097913cc..673600ecc 100644 --- a/src/map/tile_parser.cpp +++ b/src/map/tile_parser.cpp @@ -13,8 +13,6 @@ #include -#include - using namespace llmr; @@ -173,9 +171,6 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer& laye tile.textVertexBuffer, tile.triangleElementsBuffer, bucket_desc, placement); - std::wstring_convert, char32_t> ucs4conv; - - // Determine and load glyph ranges { std::set ranges; @@ -194,7 +189,7 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer& laye continue; } - const std::u32string string = ucs4conv.from_bytes(toString(it_prop->second)); + const std::string string = toString(it_prop->second); // Loop through all characters of this text and collect unique codepoints. for (uint32_t chr : string) { @@ -206,7 +201,7 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer& laye } // Create a copy! - const FontStack fontStack = glyphStore.getFontStack(bucket_desc.geometry.font); + const FontStack &fontStack = glyphStore.getFontStack(bucket_desc.geometry.font); // Shape and place all labels. { @@ -224,7 +219,7 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer& laye continue; } - const std::u32string string = ucs4conv.from_bytes(toString(it_prop->second)); + const std::string string = toString(it_prop->second); // TODO: Shape label // TODO: Place label diff --git a/src/text/glyph_store.cpp b/src/text/glyph_store.cpp index a355b28f2..bafd6ce82 100644 --- a/src/text/glyph_store.cpp +++ b/src/text/glyph_store.cpp @@ -27,7 +27,7 @@ GlyphPBF::GlyphPBF(const std::string &fontStack, GlyphRange glyphRange) std::string url = util::sprintf<255>("http://mapbox.s3.amazonaws.com/gl-glyphs/%s/%d-%d.pbf", fontStack.c_str(), glyphRange.first, glyphRange.second); // TODO: Find more reliable URL normalization function - std::replace(url.begin(), url.end(), ' ', '+'); + // std::replace(url.begin(), url.end(), ' ', '+'); platform::request_http(url, [&](platform::Response *res) { if (res->code != 200) { @@ -91,7 +91,7 @@ void GlyphPBF::parse(FontStack &stack) { } } - stack.insert(id, glyph); + stack.insert(id, glyph.metrics, glyph.bitmap); } else { fontstack_pbf.skip(); }