git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6654 c06c8d41-db1a-0410-9941-cceddc491573
PBTLQZHBQK5TAIO7SNSCKSHOQQ65CFFI55OTTETV7FG2FCJOXKHQC
UVO3NT3VC5KVZVJXMAHJLEIL2IRHQO6JVBPFKVENXPU3YMACCQFAC
Q3B3UVMYEVC4YJUPYVSNTR4DJH4E6J4JJDHZNT5LNOCHCPPMEMXAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
DGB7DKTR6OEQEMOOF3MAHDT4PAPKZ54Y33MWYVD7XIOESPFAXHQQC
25CH7HH4LKXFIZ75YNMXS3TSXO6O27DYSOPLOD45K4OCNFWLS4LQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
SH6NU4H5TG4O7CRXRHZ7MDHABZLWWXQ77NJDBHI7KCVHXHQYK46QC
QYDFLJPRJ3GKULPAMHDSTR4JFASE5T45FPQYXJ25PWVN77KFKPGAC
C55G5JGGSVWMU7XVEJL6YZZLDXQZGRN7JQOAALS6WIKFPX3L2U6QC
// TODO enne - make this configurable (and fall back on default if fails)
// TODO enne - use Crawl's dat file loading utilities
const char *font_file = "dat/tiles/VeraMono.ttf";
const int font_size = 14;
if (!load_font(font_file, font_size))
return false;
ASSERT(m_font);
// TODO enne - different font for tooltip and for dungeon tags
m_region_tile = new DungeonRegion(&m_image, m_font, TILE_X, TILE_Y);
int crt_font = load_font(Options.tile_font_crt_file.c_str(),
Options.tile_font_crt_size);
int msg_font = load_font(Options.tile_font_msg_file.c_str(),
Options.tile_font_msg_size);
int stat_font = load_font(Options.tile_font_stat_file.c_str(),
Options.tile_font_stat_size);
m_tip_font = load_font(Options.tile_font_tip_file.c_str(),
Options.tile_font_tip_size);
int lbl_font = load_font(Options.tile_font_lbl_file.c_str(),
Options.tile_font_lbl_size);
if (crt_font == -1 || msg_font == -1 || stat_font == -1
|| m_tip_font == -1 || lbl_font == -1)
{
return false;
}
m_region_tile = new DungeonRegion(&m_image, m_fonts[lbl_font].font,
TILE_X, TILE_Y);
m_region_msg = new MessageRegion(m_font);
m_region_stat = new StatRegion(m_font);
m_region_crt = new CRTRegion(m_font);
m_region_msg = new MessageRegion(m_fonts[msg_font].font);
m_region_stat = new StatRegion(m_fonts[stat_font].font);
m_region_crt = new CRTRegion(m_fonts[crt_font].font);
m_font->render_string(m_mouse.x, m_mouse.y - 2, m_tooltip.c_str(),
min_pos, m_windowsz, WHITE, false, 150,
BLUE, 5);
FTFont *font = m_fonts[m_tip_font].font;
font->render_string(m_mouse.x, m_mouse.y - 2, m_tooltip.c_str(),
min_pos, m_windowsz, WHITE, false, 150,
BLUE, 5);
// font selection
tile_font_crt_file = "VeraMono.ttf";
tile_font_crt_size = 15;
tile_font_stat_file = "VeraMono.ttf";
tile_font_stat_size = 16;
tile_font_msg_file = "VeraMono.ttf";
tile_font_msg_size = 14;
tile_font_tip_file = "VeraMono.ttf";
tile_font_tip_size = 15;
tile_font_lbl_file = "Vera.ttf";
tile_font_lbl_size = 14;
else if (key == "tile_font_crt_file")
{
tile_font_crt_file = field;
}
else INT_OPTION(tile_font_crt_size, 1, INT_MAX);
else if (key == "tile_font_msg_file")
{
tile_font_msg_file = field;
}
else INT_OPTION(tile_font_msg_size, 1, INT_MAX);
else if (key == "tile_font_stat_file")
{
tile_font_stat_file = field;
}
else INT_OPTION(tile_font_stat_size, 1, INT_MAX);
else if (key == "tile_font_tip_file")
{
tile_font_tip_file = field;
}
else INT_OPTION(tile_font_tip_size, 1, INT_MAX);
else if (key == "tile_font_lbl_file")
{
tile_font_lbl_file = field;
}
else INT_OPTION(tile_font_lbl_size, 1, INT_MAX);
std::string tile_font_crt_file;
int tile_font_crt_size;
std::string tile_font_msg_file;
int tile_font_msg_size;
std::string tile_font_stat_file;
int tile_font_stat_size;
std::string tile_font_lbl_file;
int tile_font_lbl_size;
std::string tile_font_tip_file;
int tile_font_tip_size;
# tile_window_col = yellow
# tile_font_crt_file = VeraMono.ttf
# tile_font_crt_size = 15
# tile_font_stat_file = VeraMono.ttf
# tile_font_stat_size = 16
# tile_font_msg_file = VeraMono.ttf
# tile_font_msg_size = 14
# tile_font_tip_file = VeraMono.ttf
# tile_font_tip_size = 15
# tile_font_lbl_file = Vera.ttf
# tile_font_lbl_size = 14