summaryrefslogtreecommitdiff
path: root/plugingui/font.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-12-19 19:57:17 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-12-19 19:57:17 +0100
commitfde590274c9d99e2cabc5b5f9971f2051659f1aa (patch)
tree109ab6ece65d7fd3d24c75329b05389b34b86dce /plugingui/font.h
parent180361cda94f612d3ebfd2c460c24b457fae64d3 (diff)
Add spacing control method for fonts and modernize loops.
Diffstat (limited to 'plugingui/font.h')
-rw-r--r--plugingui/font.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugingui/font.h b/plugingui/font.h
index d350481..e29528d 100644
--- a/plugingui/font.h
+++ b/plugingui/font.h
@@ -41,19 +41,24 @@ public:
size_t textWidth(const std::string& text) const;
size_t textHeight(const std::string& text = "") const;
+ void setLetterSpacing(int letterSpacing);
+ int letterSpacing() const;
+
PixelBufferAlpha *render(const std::string& text) const;
private:
Image img_font;
- struct Character {
- int offset = 0;
- size_t width = 0;
- int pre_bias = 0;
- int post_bias = 0;
+ class Character {
+ public:
+ int offset{0};
+ size_t width{0};
+ int pre_bias{0};
+ int post_bias{0};
};
std::array<Character, 255> characters;
+ int spacing{1};
};
} // GUI::