| 209 | } |
| 210 | |
| 211 | pair<int, float> SpaceAtom::getLength(const string& lgth) { |
| 212 | if (lgth.empty()) return pair<int, float>({UNIT_PIXEL, 0.f}); |
| 213 | |
| 214 | size_t i = 0; |
| 215 | for (; i < lgth.size() && !isalpha(lgth[i]); i++) |
| 216 | ; |
| 217 | float f = 0; |
| 218 | valueof(lgth.substr(0, i), f); |
| 219 | |
| 220 | int unit = UNIT_PIXEL; |
| 221 | string x = lgth.substr(i); |
| 222 | tolower(x); |
| 223 | if (i != lgth.size()) unit = getUnit(x); |
| 224 | |
| 225 | return pair<int, float>({unit, f}); |
| 226 | } |
| 227 | |
| 228 | pair<int, float> SpaceAtom::getLength(const wstring& lgth) { |
| 229 | string s; |