10auto getValue = lager::lenses::getset (
15 if (data.length.unit == KoSvgText::CssLengthPercentage::Percentage) {
16 return data.length.value * 100;
18 return data.length.value;
34auto getUnit = lager::lenses::getset (
37 return LineHeightModel::Lines;
39 switch(data.length.unit) {
40 case KoSvgText::CssLengthPercentage::Absolute:
41 return LineHeightModel::LineHeightType::Absolute;
42 case KoSvgText::CssLengthPercentage::Em:
43 return LineHeightModel::LineHeightType::Em;
44 case KoSvgText::CssLengthPercentage::Ex:
45 return LineHeightModel::LineHeightType::Ex;
46 case KoSvgText::CssLengthPercentage::Cap:
47 return LineHeightModel::LineHeightType::Cap;
48 case KoSvgText::CssLengthPercentage::Ch:
49 return LineHeightModel::LineHeightType::Ch;
50 case KoSvgText::CssLengthPercentage::Ic:
51 return LineHeightModel::LineHeightType::Ic;
52 case KoSvgText::CssLengthPercentage::Lh:
53 return LineHeightModel::LineHeightType::Lh;
54 case KoSvgText::CssLengthPercentage::Percentage:
55 return LineHeightModel::LineHeightType::Percentage;
float value(const T *src, size_t ch)
LineHeightModel(lager::cursor< KoSvgText::LineHeightInfo > _data=lager::make_state(KoSvgText::LineHeightInfo(), lager::automatic_tag{}))
lager::cursor< KoSvgText::LineHeightInfo > data
@ Cap
multiply by font-x-height.
@ Ch
multiply by font cap height
@ Absolute
Pt, everything needs to be converted to pt for this to work.
@ Lh
multiply by width of "U+6C34", represents average full width script advance.
@ Ex
multiply by Font-size
@ Ic
multiply by width of "0", represents average proportional script advance.
bool isNumber
Length or number.
CssLengthPercentage length
bool isNormal
It's a number indicating the lineHeight;.