Initial commit for Frontend.
Bug fixes: fix #40, fix #39, fix #38, fix #37, fix #21. Code organization and cleanup...
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user