diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llmr/style/bucket_description.hpp | 7 | ||||
-rw-r--r-- | include/llmr/text/glyph_store.hpp | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/llmr/style/bucket_description.hpp b/include/llmr/style/bucket_description.hpp index 004932aa49..b708ef6866 100644 --- a/include/llmr/style/bucket_description.hpp +++ b/include/llmr/style/bucket_description.hpp @@ -74,6 +74,12 @@ inline float alignmentType(const std::string& alignment) { else return 0.5; }; +inline float verticalAlignmentType(const std::string& alignment) { + if (alignment == "bottom") return 1.0f; + else if (alignment == "top") return 0.0f; + else return 0.5; +}; + class BucketGeometryDescription { public: CapType cap = CapType::None; @@ -86,6 +92,7 @@ public: float round_limit = 1.0f; TextPathType path = TextPathType::Horizontal; float alignment = 0.5; + float vertical_alignment = 0.5; float line_height = 1.2 * 24; float max_width = 15.0f * 24; float padding = 2.0f; diff --git a/include/llmr/text/glyph_store.hpp b/include/llmr/text/glyph_store.hpp index 74472194b0..f8b14683d7 100644 --- a/include/llmr/text/glyph_store.hpp +++ b/include/llmr/text/glyph_store.hpp @@ -33,11 +33,13 @@ public: const Shaping getShaping(const std::u32string &string, const float &maxWidth, const float &lineHeight, - const float &alignment) const; + const float &alignment, + const float &verticalAlignment) const; Shaping lineWrap(Shaping shaped, const float &lineHeight, const float &maxWidth, - const float &alignment) const; + const float &alignment, + const float &verticalAlignment) const; private: std::map<uint32_t, std::string> bitmaps; |