diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-22 10:38:42 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-22 15:53:18 -0700 |
commit | 5939dd5b412fcc1ef857711a137589aa865bd442 (patch) | |
tree | 4bd4e021ea564ee262cff56ab7b6f76e98b29471 /include | |
parent | d77e35b6866e461c3cb05de2112d548be4ef7780 (diff) | |
download | qtlocation-mapboxgl-5939dd5b412fcc1ef857711a137589aa865bd442.tar.gz |
[core] Use the proper type for font stacks
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/resource.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/style/types.hpp | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/mbgl/storage/resource.hpp b/include/mbgl/storage/resource.hpp index edd9f58c72..296dff7f3d 100644 --- a/include/mbgl/storage/resource.hpp +++ b/include/mbgl/storage/resource.hpp @@ -3,6 +3,7 @@ #include <mbgl/storage/response.hpp> #include <mbgl/util/optional.hpp> +#include <mbgl/style/types.hpp> #include <string> @@ -42,7 +43,7 @@ public: int32_t y, int8_t z); static Resource glyphs(const std::string& urlTemplate, - const std::string& fontStack, + const FontStack& fontStack, const std::pair<uint16_t, uint16_t>& glyphRange); static Resource spriteImage(const std::string& base, float pixelRatio); static Resource spriteJSON(const std::string& base, float pixelRatio); diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp index 999b8d8b79..ca56d39991 100644 --- a/include/mbgl/style/types.hpp +++ b/include/mbgl/style/types.hpp @@ -5,12 +5,21 @@ #include <string> #include <array> +#include <vector> namespace mbgl { // Stores a premultiplied color, with all four channels ranging from 0..1 -typedef std::array<float, 4> Color; +using Color = std::array<float, 4>; +// An array of font names +using FontStack = std::vector<std::string>; + +std::string fontStackToString(const FontStack&); + +struct FontStackHash { + std::size_t operator()(const FontStack&) const; +}; template <typename T> struct Faded { |