1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

fixed px/pt font size processing

This commit is contained in:
Nikolay Pultsin 2012-05-15 11:49:13 +01:00
parent 23bda2359b
commit f2e3ec218b
6 changed files with 34 additions and 9 deletions

View file

@ -67,10 +67,14 @@ static bool parseLength(const std::string &toParse, short &size, ZLTextStyleEntr
unit = ZLTextStyleEntry::SIZE_UNIT_EX_100;
size = (short)(100 * ZLStringUtil::stringToDouble(toParse, 0));
return true;
} else {
} else if (ZLStringUtil::stringEndsWith(toParse, "px")) {
unit = ZLTextStyleEntry::SIZE_UNIT_PIXEL;
size = atoi(toParse.c_str());
return true;
} else if (ZLStringUtil::stringEndsWith(toParse, "pt")) {
unit = ZLTextStyleEntry::SIZE_UNIT_POINT;
size = atoi(toParse.c_str());
return true;
}
return false;
}