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:
parent
23bda2359b
commit
f2e3ec218b
6 changed files with 34 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue