summaryrefslogtreecommitdiff
path: root/src/render/Font.h
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-06-25 02:34:29 +0200
committer_AG <gennariarmando@outlook.com>2019-06-25 02:36:26 +0200
commite765dfe90a5519dc221580acf6d78fdd9c74ceab (patch)
treea7c8c8d910cfd8d6b9b90c2d49dedff3454fa495 /src/render/Font.h
parentf07f411629b686338df10fdce217b2d258f38c92 (diff)
Initial commit for Frontend.
Bug fixes: fix #40, fix #39, fix #38, fix #37, fix #21. Code organization and cleanup...
Diffstat (limited to 'src/render/Font.h')
-rw-r--r--src/render/Font.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/render/Font.h b/src/render/Font.h
index 2e698533..11c0f8ec 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -33,6 +33,12 @@ enum {
FONT_HEADING,
};
+enum {
+ ALIGN_LEFT,
+ ALIGN_CENTER,
+ ALIGN_RIGHT,
+};
+
class CFont
{
static CFontDetails &Details;
@@ -56,6 +62,7 @@ public:
static void DrawFonts(void);
static uint16 character_code(uint8 c);
+ static CFontDetails GetDetails() { return Details; }
static void SetScale(float x, float y) { Details.scaleX = x; Details.scaleY = y; }
static void SetSlantRefPoint(float x, float y) { Details.slantRefX = x; Details.slantRefY = y; }
static void SetSlant(float s) { Details.slant = s; }
@@ -86,6 +93,23 @@ public:
static void SetCentreOff(void) {
Details.centre = false;
}
+ static void SetAlignment(uint8 alignment) {
+ if (alignment == ALIGN_LEFT) {
+ CFont::Details.justify = true;
+ CFont::Details.centre = false;
+ CFont::Details.rightJustify = false;
+ }
+ else if (alignment == ALIGN_CENTER) {
+ CFont::Details.justify = false;
+ CFont::Details.centre = true;
+ CFont::Details.rightJustify = false;
+ }
+ else if (alignment == ALIGN_RIGHT) {
+ CFont::Details.justify = false;
+ CFont::Details.centre = false;
+ CFont::Details.rightJustify = true;
+ }
+ }
static void SetWrapx(float x) { Details.wrapX = x; }
static void SetCentreSize(float s) { Details.centreSize = s; }
static void SetBackgroundOn(void) { Details.background = true; }