- change getRenderWidth() default to UTF8

This commit is contained in:
svenhoefer
2014-06-11 11:48:59 +02:00
parent bec2e87412
commit 8b91cda918
35 changed files with 127 additions and 128 deletions

View File

@@ -204,7 +204,7 @@ void CComponentsButton::initCaption()
//handle common position of icon and text inside container required for alignment
int w_required = fr_thickness + append_x_offset;
w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0;
w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt, true) : 0;
w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt) : 0;
w_required += append_x_offset + fr_thickness;
//dynamic width

View File

@@ -117,7 +117,7 @@ void CComponentsFrmClock::initCCLockItems()
string s_time = cl_timestr;
//get minimal required height, width from raw text
int min_text_w = (*getClockFont())->getRenderWidth(s_time, true);;
int min_text_w = (*getClockFont())->getRenderWidth(s_time);
int min_text_h = (*getClockFont())->getHeight();
height = max(height, min_text_h);
width = max(width, min_text_w);
@@ -153,7 +153,7 @@ void CComponentsFrmClock::initCCLockItems()
int minSepWidth = 0;
string sep[] ={" ", ".", ":"};
for (size_t i = 0; i < sizeof(sep)/sizeof(sep[0]); i++)
minSepWidth = max((*getClockFont())->getRenderWidth(sep[i], true), minSepWidth);
minSepWidth = max((*getClockFont())->getRenderWidth(sep[i]), minSepWidth);
//modify available label items with current segment chars
for (size_t i = 0; i < v_cc_items.size(); i++)
@@ -179,7 +179,7 @@ void CComponentsFrmClock::initCCLockItems()
if (isdigit(stmp.at(0)) ) //check for digits, if true, we use digit width
wtmp = (*getClockFont())->getMaxDigitWidth();
else //not digit found, we use render width or minimal width
wtmp = max((*getClockFont())->getRenderWidth(stmp, true), minSepWidth);
wtmp = max((*getClockFont())->getRenderWidth(stmp), minSepWidth);
//set size, text, color of current item
lbl->setDimensionsAll(cl_x, cl_y, wtmp, cl_h);