summaryrefslogtreecommitdiffstats
path: root/src/render/Font.h
diff options
context:
space:
mode:
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; }