kq-fork
kq-fork copied to clipboard
Fonts: Colors and dimensions
We should have a class/struct for fonts and either blend or remove one/both of the eFont
/eFontColor
enums. If we have a std::map
or std::vector
of fonts, the enum values could still be used to indicate which font we're after.
enum eFont
{
FONT_WHITE = 0,
FONT_RED = 1,
FONT_YELLOW = 2,
FONT_GREEN = 3,
FONT_PURPLE = 4,
FONT_DECIDE = 5,
NUM_FONTS // always last
};
enum eFontColor
{
FNORMAL = 0,
FRED = 1,
FYELLOW = 2,
FGREEN = 3,
FDARK = 4,
FGOLD = 5,
FBIG = 6,
NUM_FONT_COLORS // always last
};
The struct should include the font dimensions (height, width) since these are monospaced fonts, and possibly color (or at least an index value within pal[]
if we're wanting to recolor them).
KDraw::print_font()
typically multiplies the font width by some offset, and I'd like to replace those Magic Number multiplications (* 8
) with * font.width()
or something similar.
This should also make it easier to extend the fonts in the future, in support of localization in case the current fonts.png
doesn't contain all the necessary characters.