summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_pbf.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-28 16:29:54 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-29 14:50:15 -0800
commitb41a73e1c1dfea982df4a0326d45a48babc22dd4 (patch)
treefc744d5953ad6ecf8e52d5653c499760b148cb5c /src/mbgl/text/glyph_pbf.cpp
parent849e8b32b4b2febc63ad3df8539b483ccc67ac63 (diff)
downloadqtlocation-mapboxgl-b41a73e1c1dfea982df4a0326d45a48babc22dd4.tar.gz
[core] Rationalize Resource initialization
Diffstat (limited to 'src/mbgl/text/glyph_pbf.cpp')
-rw-r--r--src/mbgl/text/glyph_pbf.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mbgl/text/glyph_pbf.cpp b/src/mbgl/text/glyph_pbf.cpp
index 37b7cfc9fb..0dfed6b430 100644
--- a/src/mbgl/text/glyph_pbf.cpp
+++ b/src/mbgl/text/glyph_pbf.cpp
@@ -67,15 +67,8 @@ GlyphPBF::GlyphPBF(GlyphStore* store,
GlyphStore::Observer* observer_)
: parsed(false),
observer(observer_) {
- // Load the glyph set URL
- std::string url = util::replaceTokens(store->getURL(), [&](const std::string &name) -> std::string {
- if (name == "fontstack") return util::percentEncode(fontStack);
- if (name == "range") return util::toString(glyphRange.first) + "-" + util::toString(glyphRange.second);
- return "";
- });
-
FileSource* fs = util::ThreadContext::getFileSource();
- req = fs->request({ Resource::Kind::Glyphs, url }, [this, store, fontStack, glyphRange](Response res) {
+ req = fs->request(Resource::glyphs(store->getURL(), fontStack, glyphRange), [this, store, fontStack, glyphRange](Response res) {
if (res.error) {
observer->onGlyphsError(fontStack, glyphRange, std::make_exception_ptr(std::runtime_error(res.error->message)));
return;