|
Krita Source Code Documentation
|
#include <KoSvgTextProperties.h>
Inheritance diagram for KoSvgTextProperties:Classes | |
| struct | Private |
Public Member Functions | |
| KoSvgText::FontMetrics | applyLineHeight (KoSvgText::FontMetrics metrics) const |
| applyLineHeight Calculate the linegap for the current linegap property. | |
| QSharedPointer< KoShapeBackground > | background () const |
| QMap< QString, QString > | convertParagraphProperties () const |
| convertParagraphProperties some properties only apply to the root shape, so we write those separately. | |
| QMap< QString, QString > | convertToSvgTextAttributes () const |
| KoCSSFontInfo | cssFontInfo () const |
| cssFontInfo | |
| QStringList | fontFeaturesForText (int start, int length) const |
| fontFeaturesForText Returns a harfbuzz friendly list of opentype font-feature settings using the various font-variant and font-feature-settings values. | |
| KoSvgText::CssLengthPercentage | fontSize () const |
| QFont | generateFont () const |
| bool | hasNonInheritableProperties () const |
| Test whether it has non-inheritable properties set. | |
| bool | hasProperty (PropertyId id) const |
| void | inheritFrom (const KoSvgTextProperties &parentProperties, bool resolve=false) |
| bool | inheritsProperty (PropertyId id, const KoSvgTextProperties &parentProperties) const |
| bool | isEmpty () const |
| KoSvgTextProperties () | |
| KoSvgTextProperties (const KoSvgTextProperties &rhs) | |
| KoSvgText::FontMetrics | metrics (const bool withResolvedLineHeight=true) const |
| metrics Return the metrics of the first available font. | |
| KoSvgTextProperties & | operator= (const KoSvgTextProperties &rhs) |
| bool | operator== (const KoSvgTextProperties &rhs) const |
| KoSvgTextProperties | ownProperties (const KoSvgTextProperties &parentProperties, bool keepFontSize=false) const |
| void | parseSvgTextAttribute (const SvgLoadingContext &context, const QString &command, const QString &value) |
| parseSvgTextAttribute add a property according to an XML attribute value. | |
| QList< PropertyId > | properties () const |
| QVariant | property (PropertyId id, const QVariant &defaultValue=QVariant()) const |
| bool | propertyIsInheritable (KoSvgTextProperties::PropertyId id) const |
| QVariant | propertyOrDefault (PropertyId id) const |
| void | removeProperty (PropertyId id) |
| void | resetNonInheritableToDefault () |
| void | resolveRelativeValues (const KoSvgText::FontMetrics metrics=KoSvgText::FontMetrics(12.0, true), const qreal fontSize=12.0) |
| resolveRelativeValues resolve the font-relative values. | |
| void | scaleAbsoluteValues (const double scaleInline=1.0, const double scaleBlock=1.0) |
| scaleAbsoluteValues This scales all absolute values stored in these text properties. Relative values don't need to be scaled. This can be used to scale styles in setSize as well as scale the text properties for Style Presets. | |
| void | setAllButNonInheritableProperties (const KoSvgTextProperties &properties) |
| Used to merge child properties into parent properties. | |
| void | setFontSize (const KoSvgText::CssLengthPercentage length) |
| void | setProperty (PropertyId id, const QVariant &value) |
| KoShapeStrokeModelSP | stroke () const |
| qreal | xHeight () const |
| ~KoSvgTextProperties () | |
Static Public Member Functions | |
| static const KoSvgTextProperties & | defaultProperties () |
| static bool | propertyIsBlockOnly (KoSvgTextProperties::PropertyId id) |
| static QStringList | supportedXmlAttributes () |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
KoSvgTextProperties represents the text attributes defined in SVG DOM tree
There is a limitation in flake: it doesn't support the inheritance of shape properties: every shape stores all the properties that were defined at the loading/creation stage. KoSvgTextProperties allows the user to compare the properties of the two shapes and distinguish, which properties were inherited by text shape, and which are its own. It is needed to generate a correct and clean SVG/markup code that can be edited by the user easily. Otherwise, every <tspan> block will contain the full list of 20+ attributes, which are not interesting for the user, since they are inherited or default.
To achieve the goal, KoSvgTextProperties wraps all the SVG attributes into a map of QVariants. When the user need to find a set of unique properties of the shape, it iterates through the map and compares values with standard QVariant-based comparison operator. If the property value in a child and a parent is not the same, then it is not inherited.
Definition at line 43 of file KoSvgTextProperties.h.
Defines a set of supported properties. See SVG 1.1 for details.
| Enumerator | |
|---|---|
| WritingModeId | |
| DirectionId | |
| UnicodeBidiId | |
| TextAnchorId | |
| DominantBaselineId | |
| AlignmentBaselineId | |
| BaselineShiftModeId | |
| BaselineShiftValueId | Double. |
| KerningId | |
| TextOrientationId | |
| LetterSpacingId | |
| WordSpacingId | |
| FontFamiliesId | QStringList. |
| FontStyleId | KoSvgText::CssSlantData. |
| FontStretchId | Int. |
| FontWeightId | Int. |
| FontSizeId | Double. |
| FontSizeAdjustId | |
| FontVariantLigatureId | KoSvgText::FontVariantFeature. |
| FontVariantPositionId | |
| FontVariantCapsId | |
| FontVariantNumericId | |
| FontVariantEastAsianId | |
| FontFeatureSettingsId | QStringList. |
| FontOpticalSizingId | Bool. |
| FontVariationSettingsId | QStringList. |
| TextDecorationLineId | Flags, KoSvgText::TextDecorations. |
| TextDecorationStyleId | |
| TextDecorationColorId | QColor. |
| TextDecorationPositionId | |
| FillId | |
| StrokeId | |
| Opacity | Double, SVG shape opacity. |
| PaintOrder | |
| Visiblity | Bool, CSS visibility. |
| TextLanguage | a language string. |
| TextCollapseId | |
| TextWrapId | |
| TextTrimId | Flags, KoSvgText::TextSpaceTrims. |
| LineBreakId | |
| WordBreakId | |
| TextAlignAllId | |
| TextAlignLastId | |
| TextTransformId | KoSvgText::TextTransformInfo Struct. |
| TextOverFlowId | |
| OverflowWrapId | |
| InlineSizeId | |
| LineHeightId | |
| TextIndentId | KoSvgText::TextIndentInfo Struct. |
| HangingPunctuationId | Flags, KoSvgText::HangingPunctuations. |
| TabSizeId | Int. |
| ShapePaddingId | Double. |
| ShapeMarginId | Double. |
| FontSynthesisBoldId | Bool. |
| FontSynthesisItalicId | Bool. |
| FontSynthesisSmallCapsId | Bool. |
| FontSynthesisSuperSubId | Bool. |
| TextRenderingId | Enum. |
| KraTextVersionId | Int, used for handling incorrectly saved files. |
| KraTextStyleType | string, used to identify the style preset type (character or paragraph). |
| KraTextStyleResolution | Int, used to scale style presets to be pixel-relative. |
Definition at line 49 of file KoSvgTextProperties.h.
| KoSvgTextProperties::KoSvgTextProperties | ( | ) |
Definition at line 32 of file KoSvgTextProperties.cpp.
| KoSvgTextProperties::~KoSvgTextProperties | ( | ) |
Definition at line 37 of file KoSvgTextProperties.cpp.
| KoSvgTextProperties::KoSvgTextProperties | ( | const KoSvgTextProperties & | rhs | ) |
| KoSvgText::FontMetrics KoSvgTextProperties::applyLineHeight | ( | KoSvgText::FontMetrics | metrics | ) | const |
applyLineHeight Calculate the linegap for the current linegap property.
| metrics | the metrics to apply this to. |
Definition at line 1102 of file KoSvgTextProperties.cpp.
References KoSvgText::FontMetrics::ascender, KoSvgText::FontMetrics::descender, KoSvgText::FontMetrics::fontSize, fontSize(), KoSvgText::LineHeightInfo::isNormal, KoSvgText::LineHeightInfo::isNumber, KoSvgText::LineHeightInfo::length, KoSvgText::FontMetrics::lineGap, LineHeightId, metrics(), propertyOrDefault(), KoSvgText::CssLengthPercentage::value, and KoSvgText::LineHeightInfo::value.
| QSharedPointer< KoShapeBackground > KoSvgTextProperties::background | ( | ) | const |
Definition at line 1183 of file KoSvgTextProperties.cpp.
References FillId, and property().
| QMap< QString, QString > KoSvgTextProperties::convertParagraphProperties | ( | ) | const |
convertParagraphProperties some properties only apply to the root shape, so we write those separately.
Definition at line 993 of file KoSvgTextProperties.cpp.
References hasProperty(), InlineSizeId, property(), propertyOrDefault(), ShapeMarginId, ShapePaddingId, TextAlignAllId, TextAlignLastId, and TextIndentId.
| QMap< QString, QString > KoSvgTextProperties::convertToSvgTextAttributes | ( | ) | const |
Convert all the properties of the set into a map of XML attribute/value pairs.
Definition at line 638 of file KoSvgTextProperties.cpp.
References AlignmentBaselineId, BaselineShiftModeId, BaselineShiftValueId, KoSvgText::AutoValue::customValue, Direction, DirectionId, DominantBaselineId, FontFamiliesId, FontFeatureSettingsId, FontOpticalSizingId, fontSize(), FontSizeAdjustId, FontSizeId, FontStretchId, KoSvgText::fontStretchNames, FontStyleId, FontSynthesisBoldId, FontSynthesisItalicId, FontSynthesisSmallCapsId, FontSynthesisSuperSubId, FontVariantCapsId, FontVariantEastAsianId, FontVariantLigatureId, FontVariantNumericId, FontVariantPositionId, FontVariationSettingsId, FontWeightId, HangingPunctuationId, hasProperty(), KoSvgText::TextUnderlinePosition::horizontalPosition, KoSvgText::AutoValue::isAuto, KerningId, KIS_ASSERT, LetterSpacingId, LineBreakId, LineHeightId, OverflowWrapId, KoSvgText::PreserveSpaces, property(), propertyOrDefault(), TabSizeId, TextAnchorId, TextCollapseId, TextDecorationColorId, TextDecorationLineId, TextDecorationPositionId, TextDecorationStyleId, TextLanguage, TextOrientationId, TextOverFlowId, TextRenderingId, TextTransformId, TextTrimId, TextWrapId, KisDomUtils::toString(), UnicodeBidiId, value(), KoSvgText::TextUnderlinePosition::verticalPosition, WordBreakId, WordSpacingId, KoSvgText::writeFontStyle(), KoSvgText::writeLineHeight(), KoSvgText::writeTextRendering(), and WritingModeId.
| KoCSSFontInfo KoSvgTextProperties::cssFontInfo | ( | ) | const |
cssFontInfo
Definition at line 1157 of file KoSvgTextProperties.cpp.
References KoCSSFontInfo::automaticOpticalSizing, KoCSSFontInfo::autoSlant, KoCSSFontInfo::axisSettings, KoSvgText::AutoValue::customValue, KoCSSFontInfo::families, FontFamiliesId, FontOpticalSizingId, KoCSSFontInfo::fontSizeAdjust, FontSizeAdjustId, FontSizeId, FontStretchId, FontStyleId, FontVariationSettingsId, FontWeightId, KoSvgText::AutoValue::isAuto, KraTextVersionId, property(), propertyOrDefault(), KoCSSFontInfo::size, KoCSSFontInfo::slantMode, KoCSSFontInfo::slantValue, KoSvgText::CssFontStyleData::slantValue, KoSvgText::CssFontStyleData::style, value(), KoCSSFontInfo::weight, and KoCSSFontInfo::width.
|
static |
Return a static object that defines default values for all the supported properties according to SVG
Definition at line 1228 of file KoSvgTextProperties.cpp.
References AlignmentBaselineId, BaselineShiftModeId, BaselineShiftValueId, Collapse, DirectionId, DominantBaselineId, FontFamiliesId, FontOpticalSizingId, FontSizeAdjustId, FontSizeId, FontStretchId, FontStyleId, FontSynthesisBoldId, FontSynthesisItalicId, FontSynthesisSmallCapsId, FontSynthesisSuperSubId, FontWeightId, HangingPunctuationId, KerningId, LetterSpacingId, LineBreakId, LineHeightId, TabSizeId, TextAlignAllId, TextAlignLastId, TextAnchorId, TextCollapseId, TextDecorationColorId, TextDecorationLineId, TextDecorationPositionId, TextDecorationStyleId, TextOrientationId, TextRenderingId, TextTransformId, TextTrimId, TextWrapId, UnicodeBidiId, WordBreakId, WordSpacingId, and WritingModeId.
| QStringList KoSvgTextProperties::fontFeaturesForText | ( | int | start, |
| int | length ) const |
fontFeaturesForText Returns a harfbuzz friendly list of opentype font-feature settings using the various font-variant and font-feature-settings values.
| start | the start pos of the text. |
| length | the length of the text. |
Definition at line 1118 of file KoSvgTextProperties.cpp.
References KoSvgText::FontFeatureLigatures::fontFeatures(), KoSvgText::FontFeatureNumeric::fontFeatures(), KoSvgText::FontFeatureEastAsian::fontFeatures(), KoSvgText::fontFeaturesCaps(), FontFeatureSettingsId, KoSvgText::fontFeaturesPosition(), FontVariantCapsId, FontVariantEastAsianId, FontVariantLigatureId, FontVariantNumericId, FontVariantPositionId, hasProperty(), KerningId, length(), and property().
| KoSvgText::CssLengthPercentage KoSvgTextProperties::fontSize | ( | ) | const |
Definition at line 1193 of file KoSvgTextProperties.cpp.
References FontSizeId, and propertyOrDefault().
| QFont KoSvgTextProperties::generateFont | ( | ) | const |
The constructor of QFont cannot accept fractional font size, so we pass a rounded one to it and set the correct one later on
Definition at line 1020 of file KoSvgTextProperties.cpp.
References FontFamiliesId, fontSize(), FontStretchId, FontStyleId, FontWeightId, propertyOrDefault(), TextDecorationLineId, and KoSvgText::CssLengthPercentage::value.
| bool KoSvgTextProperties::hasNonInheritableProperties | ( | ) | const |
Test whether it has non-inheritable properties set.
Definition at line 186 of file KoSvgTextProperties.cpp.
References m_d.
| bool KoSvgTextProperties::hasProperty | ( | KoSvgTextProperties::PropertyId | id | ) | const |
Check if property id is present in this properties set
Definition at line 64 of file KoSvgTextProperties.cpp.
References m_d.
| void KoSvgTextProperties::inheritFrom | ( | const KoSvgTextProperties & | parentProperties, |
| bool | resolve = false ) |
Apply properties from the parent shape. The property is set iff the property is inheritable according to SVG and this set does not define it.
Definition at line 114 of file KoSvgTextProperties.cpp.
References fontSize(), hasProperty(), m_d, metrics(), resolveRelativeValues(), setProperty(), and KoSvgText::CssLengthPercentage::value.
| bool KoSvgTextProperties::inheritsProperty | ( | KoSvgTextProperties::PropertyId | id, |
| const KoSvgTextProperties & | parentProperties ) const |
Return true if the property id is inherited from parentProperties. The property is considered "inherited" **iff* it is inheritable according to SVG and the parent defined the same property with the same value.
Definition at line 181 of file KoSvgTextProperties.cpp.
References hasProperty(), and property().
| bool KoSvgTextProperties::isEmpty | ( | ) | const |
Return true if the set contains no properties
Definition at line 93 of file KoSvgTextProperties.cpp.
References m_d.
| KoSvgText::FontMetrics KoSvgTextProperties::metrics | ( | const bool | withResolvedLineHeight = true | ) | const |
metrics Return the metrics of the first available font.
| withResolvedLineHeight | – apply the lineheight into the linegap property. |
Definition at line 1091 of file KoSvgTextProperties.cpp.
References applyLineHeight(), cssFontInfo(), KoFontRegistry::fontMetricsForCSSValues(), KoSvgText::HorizontalTB, KoFontRegistry::instance(), metrics(), propertyOrDefault(), TextRenderingId, and WritingModeId.
| KoSvgTextProperties & KoSvgTextProperties::operator= | ( | const KoSvgTextProperties & | rhs | ) |
Definition at line 47 of file KoSvgTextProperties.cpp.
References m_d, and properties().
| bool KoSvgTextProperties::operator== | ( | const KoSvgTextProperties & | rhs | ) | const |
Definition at line 55 of file KoSvgTextProperties.cpp.
References m_d.
| KoSvgTextProperties KoSvgTextProperties::ownProperties | ( | const KoSvgTextProperties & | parentProperties, |
| bool | keepFontSize = false ) const |
Return a set of properties that ar not inherited from parentProperties. The property is considered "inherited" **iff* it is inheritable according to SVG and the parent defined the same property with the same value.
| keepFontSize | whether to keep the font size, use for root nodes so that it won't be omitted and inheriting from the "default", which may not be deterministic. |
Definition at line 246 of file KoSvgTextProperties.cpp.
References FontSizeId, hasProperty(), m_d, properties(), property(), and setProperty().
| void KoSvgTextProperties::parseSvgTextAttribute | ( | const SvgLoadingContext & | context, |
| const QString & | command, | ||
| const QString & | value ) |
parseSvgTextAttribute add a property according to an XML attribute value.
| context | shared loading context |
| command | XML attribute name |
| value | attribute value |
Definition at line 321 of file KoSvgTextProperties.cpp.
References AlignmentBaselineId, BaselineShiftModeId, BaselineShiftValueId, SvgGraphicsContext::currentBoundingBox, SvgLoadingContext::currentGC(), KoSvgText::AutoValue::customValue, KoSvgText::DecorationNone, DirectionId, DominantBaselineId, FontFamiliesId, FontFeatureSettingsId, FontOpticalSizingId, FontSizeAdjustId, FontSizeId, FontStretchId, FontStyleId, FontSynthesisBoldId, FontSynthesisItalicId, FontSynthesisSmallCapsId, FontSynthesisSuperSubId, FontVariantCapsId, FontVariantEastAsianId, FontVariantLigatureId, FontVariantNumericId, FontVariantPositionId, FontVariationSettingsId, FontWeightId, KoSvgText::fromAutoValue(), KoSvgText::HangEnd, KoSvgText::HangFirst, KoSvgText::HangForce, HangingPunctuationId, KoSvgText::HangLast, KoSvgText::TextUnderlinePosition::horizontalPosition, InlineSizeId, KoSvgText::AutoValue::isAuto, KerningId, kisRadiansToDegrees(), LetterSpacingId, LineBreakId, LineHeightId, KoSvgText::OverFlowClip, KoSvgText::OverFlowEllipse, KoSvgText::OverFlowVisible, KoSvgText::OverflowWrapAnywhere, KoSvgText::OverflowWrapBreakWord, OverflowWrapId, KoSvgText::OverflowWrapNormal, KoSvgText::parseAutoLengthPercentageXY(), KoSvgText::parseAutoValueAngular(), KoSvgText::parseAutoValueXY(), KoSvgText::parseAutoValueY(), KoSvgText::parseBaseline(), KoSvgText::parseBaselineShiftMode(), KoSvgText::parseCSSFontStretch(), KoSvgText::parseCSSFontWeight(), KoSvgText::parseDirection(), parseFeatureSettingsStringList(), KoSvgText::parseFontFeatureCaps(), KoSvgText::parseFontFeatureEastAsian(), KoSvgText::parseFontFeatureLigatures(), KoSvgText::parseFontFeatureNumeric(), KoSvgText::parseFontFeaturePosition(), KoSvgText::parseFontStyle(), KoSvgText::parseLineBreak(), KoSvgText::parseLineHeight(), parseSvgTextAttribute(), KoSvgText::parseTabSize(), KoSvgText::parseTextAlign(), KoSvgText::parseTextAnchor(), KoSvgText::parseTextIndent(), KoSvgText::parseTextOrientation(), KoSvgText::parseTextOrientationFromGlyphOrientation(), KoSvgText::parseTextRendering(), KoSvgText::parseTextTransform(), SvgUtil::parseTextUnitStruct(), KoSvgText::parseUnicodeBidi(), SvgUtil::parseUnitXY(), parseVariantStringList(), KoSvgText::parseWordBreak(), KoSvgText::parseWritingMode(), property(), propertyOrDefault(), SvgLoadingContext::resolvedProperties(), roundToStraightAngle(), setProperty(), ShapeMarginId, ShapePaddingId, KoSvgText::ShiftLengthPercentage, TabSizeId, TextAlignAllId, TextAlignLastId, TextAnchorId, TextCollapseId, TextDecorationColorId, TextDecorationLineId, TextDecorationPositionId, TextDecorationStyleId, TextIndentId, TextLanguage, TextOrientationId, TextOverFlowId, TextRenderingId, TextTransformId, TextTrimId, TextWrapId, UnicodeBidiId, KoSvgText::CssLengthPercentage::value, value(), KoSvgText::TextUnderlinePosition::verticalPosition, KoSvgText::whiteSpaceValueToLongHands(), WordBreakId, WordSpacingId, WritingModeId, and KoSvgText::xmlSpaceToLongHands().
| QList< KoSvgTextProperties::PropertyId > KoSvgTextProperties::properties | ( | ) | const |
Return a list of properties contained in this set
Definition at line 88 of file KoSvgTextProperties.cpp.
References m_d.
| QVariant KoSvgTextProperties::property | ( | KoSvgTextProperties::PropertyId | id, |
| const QVariant & | defaultValue = QVariant() ) const |
Return the value of property id. If the property doesn't exist in the shape, return defaultValue instead.
Definition at line 69 of file KoSvgTextProperties.cpp.
References m_d.
|
static |
Returns whether the property only applies to paragraphs (what CSS calls blocks). Within SVG, all paragraphs are blocks and all text inside is inline. There are some potential caveats to this (text-combine-upright, ruby), but those are also unique in other ways.
Definition at line 1287 of file KoSvgTextProperties.cpp.
References HangingPunctuationId, TextAlignAllId, TextAlignLastId, TextIndentId, TextRenderingId, and WritingModeId.
| bool KoSvgTextProperties::propertyIsInheritable | ( | KoSvgTextProperties::PropertyId | id | ) | const |
returns whether a property can be inherited.
Definition at line 1297 of file KoSvgTextProperties.cpp.
References m_d.
| QVariant KoSvgTextProperties::propertyOrDefault | ( | KoSvgTextProperties::PropertyId | id | ) | const |
Return the value of property id. If the property doesn't exist in the shape, return the default value define in SVG 1.1.
Definition at line 79 of file KoSvgTextProperties.cpp.
References defaultProperties(), m_d, property(), and value().
| void KoSvgTextProperties::removeProperty | ( | KoSvgTextProperties::PropertyId | id | ) |
Remove property id from the set
Definition at line 74 of file KoSvgTextProperties.cpp.
References m_d.
| void KoSvgTextProperties::resetNonInheritableToDefault | ( | ) |
Reset all non-inheritable properties to default values. The set of non-inheritable properties is define by SVG 1.1. Used by the loading code for resetting state automata's properties on entering a <tspan>.
Definition at line 104 of file KoSvgTextProperties.cpp.
References defaultProperties(), m_d, and property().
| void KoSvgTextProperties::resolveRelativeValues | ( | const KoSvgText::FontMetrics | metrics = KoSvgText::FontMetrics(12.0, true), |
| const qreal | fontSize = 12.0 ) |
resolveRelativeValues resolve the font-relative values.
| fontSize | – fontsize to resolve 'em' to. |
| xHeight | – xHeight to resolve 'ex' to. |
Definition at line 128 of file KoSvgTextProperties.cpp.
References BaselineShiftValueId, KoSvgText::CssLengthPercentage::convertToAbsolute(), KoSvgText::CssLengthPercentage::Em, fontSize(), FontSizeId, KoSvgText::AutoLengthPercentage::isAuto, KoSvgText::LineHeightInfo::isNormal, KoSvgText::TabSizeInfo::isNumber, KoSvgText::LineHeightInfo::isNumber, KoSvgText::AutoLengthPercentage::length, KoSvgText::TextIndentInfo::length, KoSvgText::TabSizeInfo::length, KoSvgText::LineHeightInfo::length, length(), KoSvgText::CssLengthPercentage::Lh, LineHeightId, m_d, metrics(), KoSvgText::CssLengthPercentage::Percentage, propertyOrDefault(), setFontSize(), setProperty(), TabSizeId, TextIndentId, KoSvgText::CssLengthPercentage::unit, KoSvgText::CssLengthPercentage::value, and KoSvgText::TabSizeInfo::value.
| void KoSvgTextProperties::scaleAbsoluteValues | ( | const double | scaleInline = 1.0, |
| const double | scaleBlock = 1.0 ) |
scaleAbsoluteValues This scales all absolute values stored in these text properties. Relative values don't need to be scaled. This can be used to scale styles in setSize as well as scale the text properties for Style Presets.
| scaleInline | – affects inline-direction values, like letter-spacing, inline-size, tab-size, text-indent, etc. |
| scaleBlock | – affects block-direction values, like font-size, line-height, and baseline-shift. |
Definition at line 206 of file KoSvgTextProperties.cpp.
References KoSvgText::CssLengthPercentage::Absolute, BaselineShiftValueId, KoSvgText::AutoValue::customValue, FontSizeId, InlineSizeId, KoSvgText::AutoValue::isAuto, KoSvgText::TextIndentInfo::length, KoSvgText::TabSizeInfo::length, KoSvgText::LineHeightInfo::length, length(), m_d, KoSvgText::CssLengthPercentage::unit, KoSvgText::CssLengthPercentage::value, KoSvgText::TabSizeInfo::value, and KoSvgText::LineHeightInfo::value.
| void KoSvgTextProperties::setAllButNonInheritableProperties | ( | const KoSvgTextProperties & | properties | ) |
Used to merge child properties into parent properties.
Definition at line 196 of file KoSvgTextProperties.cpp.
References m_d, properties(), and setProperty().
| void KoSvgTextProperties::setFontSize | ( | const KoSvgText::CssLengthPercentage | length | ) |
Definition at line 1198 of file KoSvgTextProperties.cpp.
References FontSizeId, length(), and setProperty().
| void KoSvgTextProperties::setProperty | ( | KoSvgTextProperties::PropertyId | id, |
| const QVariant & | value ) |
| KoShapeStrokeModelSP KoSvgTextProperties::stroke | ( | ) | const |
Definition at line 1188 of file KoSvgTextProperties.cpp.
References property(), and StrokeId.
|
static |
Return a list of supported XML attribute names (defined in SVG)
Definition at line 1203 of file KoSvgTextProperties.cpp.
| qreal KoSvgTextProperties::xHeight | ( | ) | const |
Definition at line 1080 of file KoSvgTextProperties.cpp.
References KoSvgText::FontMetrics::fontSize, fontSize(), metrics(), KoSvgText::CssLengthPercentage::value, and KoSvgText::FontMetrics::xHeight.
|
private |
Definition at line 321 of file KoSvgTextProperties.h.