Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgText.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KOSVGTEXT_H
8#define KOSVGTEXT_H
9
10#include <QFont>
11#include <QPainterPath>
12#include <QTextCharFormat>
13#include <QVariant>
14#include <QLocale>
15#include <array>
16#include <boost/operators.hpp>
17#include <boost/optional.hpp>
18
19#include <QSharedPointer>
20#include <KoShapeBackground.h>
21#include <KoShapeStrokeModel.h>
22
23#include <QDomDocument>
24
25#include <kritaflake_export.h>
26
28class QDebug;
29
30#include <KoShape.h>
31class KoSvgTextChunkShape;
32
33namespace KoSvgText
34{
35 Q_NAMESPACE_EXPORT(KRITAFLAKE_EXPORT)
36
45Q_ENUM_NS(WritingMode)
46
47
52Q_ENUM_NS(Direction)
53
54
67Q_ENUM_NS(UnicodeBidi)
68
69
76Q_ENUM_NS(TextOrientation)
77
78
84Q_ENUM_NS(TextAnchor)
85
86/*
87 * CSS-Text-3 defines the white space property, and SVG 2 adopts this, except,
88 * CSS-Text-3 doesn't have a concept of 'xml:space="preserve"'. CSS-Text-4
89 * *does*, however, that works by splitting the white-space property into the
90 * the following three enums. Officially the SVG2 spec says to use 'white-space'
91 * of CSS-Text-4 because of this.
92 */
93
94
106Q_ENUM_NS(TextSpaceCollapse)
107
108
110 Wrap,
113 Balance,
115 Stable,
117 Pretty
120Q_ENUM_NS(TextWrap)
121
122
129Q_ENUM_NS(TextSpaceTrim)
130
131
137Q_ENUM_NS(WordBreak)
138
139
148Q_ENUM_NS(LineBreak)
149
150
158
179Q_ENUM_NS(TextAlign)
180
181
190Q_ENUM_NS(TextTransform)
191
192
200
211
237Q_ENUM_NS(Baseline)
238
239
248Q_ENUM_NS(BaselineShiftMode)
249
254Q_ENUM_NS(LengthAdjust)
255
256
263
272Q_ENUM_NS(TextDecorationStyle)
273
274
284
285
291
298
304
305Q_DECLARE_FLAGS(TextDecorations, TextDecoration)
306Q_DECLARE_OPERATORS_FOR_FLAGS(TextDecorations)
307
308Q_DECLARE_FLAGS(TextSpaceTrims, TextSpaceTrim)
309Q_DECLARE_OPERATORS_FOR_FLAGS(TextSpaceTrims)
310
311Q_DECLARE_FLAGS(HangingPunctuations, HangingPunctuation)
312Q_DECLARE_OPERATORS_FOR_FLAGS(HangingPunctuations)
313
320Q_ENUM_NS(TextRendering)
321
322
327struct FontMetrics : public boost::equality_comparable<FontMetrics> {
328 bool isVertical = false;
329 qint32 fontSize;
330 qint32 zeroAdvance;
333
334 qint32 xHeight;
335 qint32 capHeight;
336 QPair<qint32, qint32> subScriptOffset;
337 QPair<qint32, qint32> superScriptOffset;
338
339 qint32 ascender;
340 qint32 descender;
341 qint32 lineGap;
342
345
350
353
355
360
362 qint32 caretRun;
363 qint32 caretRise;
365
367
368 }
369
370 // Generate fallback font metrics from a fontSize.
371 FontMetrics (qreal fontSizeInPt, bool isHorizontal);
372
373 bool operator==(const FontMetrics & other) const;
374
375 int valueForBaselineValue(Baseline baseline) const;
376
377 void setBaselineValueByTag(const QString &tag, int32_t value);
378
379 void setMetricsValueByTag(const QLatin1String &tag, int32_t value);
380
381 void scaleBaselines(const qreal multiplier);
382
383 void offsetMetricsToNewOrigin(const Baseline baseline);
384};
385QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontMetrics &metrics);
386
406struct CssLengthPercentage : public boost::equality_comparable<CssLengthPercentage> {
417
420
421 qreal value = 0.0;
423
424 void convertToAbsolute(const KoSvgText::FontMetrics metrics, const qreal fontSize, const UnitType percentageUnit = Em);
425
426 bool operator==(const CssLengthPercentage & other) const {
427 return qFuzzyCompare(value, other.value) && unit == other.unit;
428 }
429};
430
431QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::CssLengthPercentage &value);
432
433// Not all properties support percentage, so this ensures % is saved as em as a fallback.
434QString writeLengthPercentage(const CssLengthPercentage &length, bool percentageAsEm = false);
435
444struct AutoValue : public boost::equality_comparable<AutoValue>
445{
447 AutoValue(qreal _customValue) : isAuto(false), customValue(_customValue) {}
448
449 bool isAuto = true;
450 qreal customValue = 0.0;
451
452 bool operator==(const AutoValue & other) const {
453 return isAuto == other.isAuto && (isAuto || qFuzzyCompare(customValue, other.customValue));
454 }
455};
456
457struct AutoLengthPercentage : public boost::equality_comparable<AutoLengthPercentage>
458{
461 : isAuto(false), length(_length) {}
463 : isAuto(false), length(_customValue, unit) {}
464
465 bool isAuto = true;
467
468 bool operator==(const AutoLengthPercentage & other) const {
469 return isAuto == other.isAuto && (isAuto || length == other.length);
470 }
471};
472
474struct CssFontStyleData : public boost::equality_comparable<CssFontStyleData>
475{
477 CssFontStyleData(QFont::Style _style): style(_style){}
478 QFont::Style style = QFont::StyleNormal;
480
481 bool operator==(const CssFontStyleData & other) const {
482 return style == other.style
483 && (style != QFont::StyleOblique || slantValue == other.slantValue);
484 }
485};
486
487
488
489QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::AutoValue &value);
490QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::AutoLengthPercentage &value);
491QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::CssFontStyleData &value);
492
493inline QVariant fromAutoValue(const KoSvgText::AutoValue &value) {
494 return QVariant::fromValue(value);
495}
496
497AutoValue parseAutoValueX(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword = "auto");
498AutoValue parseAutoValueY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword = "auto");
499AutoValue parseAutoValueXY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword = "auto");
500AutoValue parseAutoValueAngular(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword = "auto");
501
502AutoLengthPercentage parseAutoLengthPercentageXY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword = "auto", QRectF bbox = QRectF(), bool percentageIsViewPort = true);
503
504WritingMode parseWritingMode(const QString &value);
505Direction parseDirection(const QString &value);
506UnicodeBidi parseUnicodeBidi(const QString &value);
509TextAnchor parseTextAnchor(const QString &value);
510
512
524bool whiteSpaceValueToLongHands(const QString &value, TextSpaceCollapse &collapseMethod, TextWrap &wrapMethod, TextSpaceTrims &trimMethod);
530bool xmlSpaceToLongHands(const QString &value, TextSpaceCollapse &collapseMethod);
531
532WordBreak parseWordBreak(const QString &value);
533LineBreak parseLineBreak(const QString &value);
534TextAlign parseTextAlign(const QString &value);
535
536CssFontStyleData parseFontStyle(const QString &value);
537
538Baseline parseBaseline(const QString &value);
540
541LengthAdjust parseLengthAdjust(const QString &value);
542
543static const std::array<const char *, 9> fontStretchNames = {"ultra-condensed",
544 "extra-condensed",
545 "condensed",
546 "semi-condensed",
547 "normal",
548 "semi-expanded",
549 "expanded",
550 "extra-expanded",
551 "ultra-expanded"};
552static const std::array<const char *, 7> fontSizeNames =
553 {"xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"};
560int parseCSSFontStretch(const QString &value, int currentStretch);
561
562int parseCSSFontWeight(const QString &value, int currentWeight);
563
566TextPathSide parseTextPathSide(const QString &value);
567
568QString writeAutoValue(const AutoValue &value, const QString &autoKeyword = "auto");
569
570// Not all properties support percentages, so in that case, save percentage as em.
571QString writeAutoLengthPercentage(const AutoLengthPercentage &value, const QString &autoKeyword = "auto", bool percentageToEm = false);
572
573QString writeWritingMode(WritingMode value, bool svg1_1 = false);
576QString writeTextOrientation(TextOrientation orientation);
580QString writeBaselineShiftMode(BaselineShiftMode value, CssLengthPercentage shift);
582
586
590
591QString writeFontStyle(CssFontStyleData value);
592
594
600QString writeWhiteSpaceValue(TextSpaceCollapse collapseMethod, TextWrap wrapMethod, KoSvgText::TextSpaceTrims trimMethod);
601QString writeXmlSpace(TextSpaceCollapse collapseMethod);
602
603struct CharTransformation : public boost::equality_comparable<CharTransformation>
604{
605 boost::optional<qreal> xPos;
606 boost::optional<qreal> yPos;
607 boost::optional<qreal> dxPos;
608 boost::optional<qreal> dyPos;
609 boost::optional<qreal> rotate;
610
612 bool isNull() const;
613 bool startsNewChunk() const;
614 bool hasRelativeOffset() const;
615
616 QPointF absolutePos() const;
617 QPointF relativeOffset() const;
618
619 bool operator==(const CharTransformation & other) const;
620};
621QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::CharTransformation &t);
622
630
635struct TextTransformInfo : public boost::equality_comparable<TextTransformInfo> {
636 TextTransformInfo() = default;
638 bool fullWidth = false;
640 bool fullSizeKana = false;
642 bool operator==(const TextTransformInfo &rhs) const
643 {
644 return (capitals == rhs.capitals) && (fullWidth == rhs.fullWidth) && (fullSizeKana == rhs.fullSizeKana);
645 }
646};
647QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::TextTransformInfo &t);
648TextTransformInfo parseTextTransform(const QString &value);
649QString writeTextTransform(TextTransformInfo textTransform);
650
655struct TextIndentInfo : public boost::equality_comparable<TextIndentInfo> {
656 TextIndentInfo() = default;
657
659 bool hanging = false;
660 bool eachLine = false;
661 bool operator==(const TextIndentInfo &rhs) const
662 {
663 return (length == rhs.length) && (hanging == rhs.hanging) && (eachLine == rhs.eachLine);
664 }
665};
666
667TextIndentInfo parseTextIndent(const QString &value, const SvgLoadingContext &context);
668QString writeTextIndent(TextIndentInfo textIndent);
669
670QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::TextIndentInfo &value);
671
674struct TabSizeInfo : public boost::equality_comparable<TabSizeInfo> {
675 qreal value = 8;
676 bool isNumber = true;
679 qreal extraSpacing = 0.0;
681 bool operator==(const TabSizeInfo &rhs) const
682 {
683 bool val = isNumber? qFuzzyCompare(value, rhs.value): length == rhs.length;
684 return (val) && (isNumber == rhs.isNumber);
685 }
686};
687TabSizeInfo parseTabSize(const QString &value, const SvgLoadingContext &context);
688QString writeTabSize(TabSizeInfo tabSize);
689QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::TabSizeInfo &value);
690
691
692struct LineHeightInfo : public boost::equality_comparable<LineHeightInfo> {
694 qreal value = 1.0;
695 bool isNumber = false;
696 bool isNormal = true;
697
698 bool operator==(const LineHeightInfo &rhs) const
699 {
700 bool toggles = (isNumber == rhs.isNumber && isNormal == rhs.isNormal);
701 bool val = isNumber? qFuzzyCompare(value, rhs.value): length == rhs.length;
702 return (toggles && val);
703 }
704};
705
706LineHeightInfo parseLineHeight(const QString &value, const SvgLoadingContext &context);
707QString writeLineHeight(LineHeightInfo lineHeight);
708QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::LineHeightInfo &value);
709
713struct BackgroundProperty : public boost::equality_comparable<BackgroundProperty>
714{
717
718 bool operator==(const BackgroundProperty &rhs) const {
719 return (!property && !rhs.property) ||
720 (property && rhs.property &&
721 property->compareTo(rhs.property.data()));
722 }
723
725};
726
727QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::BackgroundProperty &prop);
728
732struct StrokeProperty : public boost::equality_comparable<StrokeProperty>
733{
736
737 bool operator==(const StrokeProperty &rhs) const {
738 return (!property && !rhs.property) ||
739 (property && rhs.property &&
740 property->compareFillTo(rhs.property.data()) && property->compareStyleTo(rhs.property.data()));
741 }
742
744};
745
746QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::StrokeProperty &prop);
747
748struct FontFamilyAxis : public boost::equality_comparable<FontFamilyAxis> {
749
751 FontFamilyAxis (QString _tag, qreal _value)
752 : tag(_tag), value(_value) {}
753
754 static FontFamilyAxis weightAxis(qreal val) {
755 FontFamilyAxis axis("wght", val);
756 axis.min = val;
757 axis.max = val;
758 axis.defaultValue = 400;
759 return axis;
760 }
761 static FontFamilyAxis widthAxis(qreal val) {
762 FontFamilyAxis axis("wdth", val);
763 axis.min = val;
764 axis.max = val;
765 axis.defaultValue = 100;
766 return axis;
767 }
768 static FontFamilyAxis slantAxis(qreal val) {
769 FontFamilyAxis axis("slnt", val);
770 axis.min = val;
771 axis.max = val;
772 axis.defaultValue = 0;
773 return axis;
774 }
775
776 QString tag;
777 QHash<QLocale, QString> localizedLabels;
778 qreal min = -1;
779 qreal max = -1;
780 qreal value = 0;
781 qreal defaultValue = 0;
782 bool variableAxis = false;
783 bool axisHidden = false;
784
785 QString debugInfo() const {
786 QString label;
787 if (!localizedLabels.isEmpty()) {
788 label = localizedLabels.value(QLocale(QLocale::English), localizedLabels.values().first());
789 }
790 return QString("Axis: %1 (%2), min: %3, default:%4, max: %5").arg(tag).arg(label).arg(min).arg(value).arg(max);
791 }
792
793 bool operator==(const FontFamilyAxis & other) const {
794 return (other.tag != tag)
795 && (!qFuzzyCompare(other.min, min))
796 && (!qFuzzyCompare(other.max, max))
798 && (!qFuzzyCompare(other.value, value));
799 }
800};
801
802QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontFamilyAxis &axis);
803QDataStream KRITAFLAKE_EXPORT &operator<<(QDataStream &out, const KoSvgText::FontFamilyAxis &axis);
804QDataStream KRITAFLAKE_EXPORT &operator>>(QDataStream &in, KoSvgText::FontFamilyAxis &axis);
805
812Q_ENUM_NS(FontFormatType)
813
814struct FontFamilyStyleInfo : public boost::equality_comparable<FontFamilyStyleInfo> {
815 QHash<QLocale, QString> localizedLabels;
816 QHash<QString, float> instanceCoords;
817
818 bool isItalic = false;
819 bool isOblique = false;
820
821 QString debugInfo() const {
822 QString label;
823 if (!localizedLabels.isEmpty()) {
824 label = localizedLabels.value(QLocale(QLocale::English), localizedLabels.values().first());
825 }
826 QStringList coords;
827 for (int i = 0; i < instanceCoords.size(); i++) {
828 QString key = instanceCoords.keys().at(i);
829 coords.append(key+"="+QString::number(instanceCoords.value(key)));
830 }
831 return QString("Instance: %1, coords: [ %2 ]").arg(label).arg(coords.join(" "));
832 }
833
834 bool operator==(const FontFamilyStyleInfo & other) const {
835 return (other.instanceCoords != instanceCoords)
836 && (other.isItalic != isItalic)
837 && (other.isOblique != isOblique);
838 }
839};
840
841QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontFamilyStyleInfo &style);
842
847struct FontFeatureLigatures : public boost::equality_comparable<FontFeatureLigatures> {
848 bool commonLigatures = true;
850 bool historicalLigatures = false;
852
859
860 QStringList fontFeatures(const int start, const int end) {
861 QStringList list;
862 const QString length = QString("[%1:%2]").arg(start).arg(end);
863 if (!commonLigatures) {
864 list << "clig" + length + "=0";
865 list << "liga" + length + "=0";
866 }
868 list << "dlig" + length + "=1";
869 }
871 list << "hlig" + length + "=1";
872 }
874 list << "calt" + length + "=0";
875 }
876 return list;
877 }
878};
879FontFeatureLigatures parseFontFeatureLigatures(const QString &value, FontFeatureLigatures features);
880QString writeFontFeatureLigatures(const FontFeatureLigatures &feature);
881QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontFeatureLigatures &feature);
893QStringList fontFeaturesPosition(const FontFeaturePosition &feature, const int start, const int end);
894
895Q_ENUM_NS(FontFeaturePosition)
908QStringList fontFeaturesCaps(const FontFeatureCaps &feature, const int start, const int end);
909
910Q_ENUM_NS(FontFeatureCaps)
911
917Q_ENUM_NS(NumericFigureStyle)
918
924Q_ENUM_NS(NumericFigureSpacing)
930Q_ENUM_NS(NumericFractions)
935struct FontFeatureNumeric : public boost::equality_comparable<FontFeatureNumeric> {
936
937
941 bool ordinals = false;
942 bool slashedZero = false;
943 bool operator==(const FontFeatureNumeric & other) const {
944 return (other.style == style
945 && other.spacing == spacing
946 && other.fractions == fractions
947 && other.ordinals == ordinals
948 && other.slashedZero == slashedZero);
949 }
950
951 QStringList fontFeatures(const int start, const int end) {
952 QStringList list;
953 const QString length = QString("[%1:%2]").arg(start).arg(end);
954 switch (style) {
956 list << "lnum" + length + "=1";
957 break;
959 list << "onum" + length + "=1";
960 break;
961 default:
962 break;
963 }
964 switch (spacing) {
966 list << "pnum" + length + "=1";
967 break;
969 list << "tnum" + length + "=1";
970 break;
971 default:
972 break;
973 }
974 switch (fractions) {
976 list << "frac" + length + "=1";
977 break;
979 list << "afrc" + length + "=1";
980 break;
981 default:
982 break;
983 }
984 if (ordinals) {
985 list << "ordn" + length + "=1";
986 }
987 if (slashedZero) {
988 list << "zero" + length + "=1";
989 }
990 return list;
991 }
992};
993
994FontFeatureNumeric parseFontFeatureNumeric(const QString &value, FontFeatureNumeric features);
995QString writeFontFeatureNumeric(const FontFeatureNumeric &feature);
996QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontFeatureNumeric &feature);
1006Q_ENUM_NS(EastAsianVariant)
1012Q_ENUM_NS(EastAsianWidth)
1013struct FontFeatureEastAsian : public boost::equality_comparable<FontFeatureEastAsian> {
1016 bool ruby = false;
1017 bool operator==(const FontFeatureEastAsian & other) const {
1018 return (other.variant == variant
1019 && other.width == width
1020 && other.ruby == ruby);
1021 }
1022
1023 QStringList fontFeatures(const int start, const int end) {
1024 QStringList list;
1025 const QString length = QString("[%1:%2]").arg(start).arg(end);
1026 switch (variant) {
1027 case EastAsianJis78:
1028 list << "jp78" + length + "=1";
1029 break;
1030 case EastAsianJis83:
1031 list << "jp83" + length + "=1";
1032 break;
1033 case EastAsianJis90:
1034 list << "jp90" + length + "=1";
1035 break;
1036 case EastAsianJis04:
1037 list << "jp04" + length + "=1";
1038 break;
1040 list << "smpl" + length + "=1";
1041 break;
1043 list << "trad" + length + "=1";
1044 break;
1045 default:
1046 break;
1047 }
1048 switch (width) {
1049 case EastAsianFullWidth:
1050 list << "fwid" + length + "=1";
1051 break;
1053 list << "pwid" + length + "=1";
1054 break;
1055 default:
1056 break;
1057 }
1058 if (ruby) {
1059 list << "ruby" + length + "=1";
1060 }
1061 return list;
1062 }
1063};
1064FontFeatureEastAsian parseFontFeatureEastAsian(const QString &value, FontFeatureEastAsian features);
1065QString writeFontFeatureEastAsian(const FontFeatureEastAsian &feature);
1066QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::FontFeatureEastAsian &feature);
1067
1068struct TextUnderlinePosition : public boost::equality_comparable<TextUnderlinePosition> {
1071
1072 bool operator==(const TextUnderlinePosition & other) const {
1073 return (other.horizontalPosition == horizontalPosition
1075 }
1076
1077};
1078
1085
1086 ResolutionHandler(qreal _xRes = 72.0, qreal _yRes = 72.0, bool _roundToPixelHorizontal = false, bool _roundToPixelVertical = false)
1087 : xRes(_xRes), yRes(_yRes), roundToPixelHorizontal(_roundToPixelHorizontal), roundToPixelVertical(_roundToPixelVertical) {}
1088
1089
1090 qreal xRes = 72.0;
1091 qreal yRes = 72.0;
1094
1095 const qreal freeTypePixel = 64.0; // 64 ints to a pixel for freetype, also called "26.6 fp" in the docs.
1096 const qreal pointInInch = 72.0; // PostScript points, Krita's vector unit.
1097
1098 qreal freeTypePixelToPointFactor(const bool x = true) const;
1099
1100 QTransform freeTypeToPixelTransform() const;
1101 QTransform freeTypeToPointTransform() const;
1102
1103 qreal pointToPixelFactor(const bool x = true) const;
1104 QTransform pointToPixel() const;
1105
1106 qreal pixelToPointFactor(const bool x = true) const;
1107 QTransform pixelToPoint() const;
1108
1110 QPointF adjust(const QPointF point) const;
1111
1113 QPointF adjustFloor(const QPointF point) const;
1115 QPointF adjustCeil(const QPointF point) const;
1116
1119 QPointF adjustWithOffset(const QPointF point, const QPointF offset) const;
1120
1122 QRectF adjust(const QRectF rect) const;
1123};
1124
1125QDebug KRITAFLAKE_EXPORT operator<<(QDebug dbg, const KoSvgText::TextUnderlinePosition &position);
1126
1127} // namespace KoSvgText
1128
1132Q_DECLARE_METATYPE(KoSvgText::TextDecorations)
1133Q_DECLARE_METATYPE(KoSvgText::HangingPunctuations)
1134Q_DECLARE_METATYPE(KoSvgText::TextSpaceTrims)
1142
1145
1150
1152
1153#endif // KOSVGTEXT_H
qreal length(const QPointF &vec)
Definition Ellipse.cc:82
float value(const T *src, size_t ch)
const Params2D p
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)
Contains data used for loading svg.
static bool qFuzzyCompare(half p1, half p2)
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)
Q_DECLARE_METATYPE(KisPaintopLodLimitations)
@ AlignCenter
Center text in line.
Definition KoSvgText.h:173
@ AlignLastAuto
Definition KoSvgText.h:163
@ AlignMatchParent
Definition KoSvgText.h:176
QString writeTextPathSide(TextPathSide value)
BaselineShiftMode parseBaselineShiftMode(const QString &value)
BaselineShiftMode
Mode of the baseline shift.
Definition KoSvgText.h:240
@ ShiftLineBottom
this handles css-inline-3 vertical-align:bottom. Not exposed to ui
Definition KoSvgText.h:246
@ ShiftSuper
Use parent font metric for 'superscript'.
Definition KoSvgText.h:243
@ ShiftLineTop
this handles css-inline-3 vertical-align:top. Not exposed to ui
Definition KoSvgText.h:245
@ ShiftLengthPercentage
Css Length Percentage, percentage is lh.
Definition KoSvgText.h:244
@ ShiftNone
No shift.
Definition KoSvgText.h:241
@ ShiftSub
Use parent font metric for 'subscript'.
Definition KoSvgText.h:242
@ EastAsianJis78
Definition KoSvgText.h:999
@ EastAsianSimplified
Definition KoSvgText.h:1003
@ EastAsianVariantNormal
Definition KoSvgText.h:998
@ EastAsianTraditional
Definition KoSvgText.h:1004
@ TextPathExact
Definition KoSvgText.h:296
FontFeatureCaps
Represents font-feature-caps.
Definition KoSvgText.h:897
@ CapsAllPetite
Definition KoSvgText.h:902
bool xmlSpaceToLongHands(const QString &value, TextSpaceCollapse &collapseMethod)
xmlSpaceToLongHands This takes xml:space values and converts them to CSS-Text-4 properties.
AutoValue parseAutoValueY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword)
@ LineBreakStrict
Use strict method, language specific.
Definition KoSvgText.h:145
@ LineBreakLoose
Use loose method, language specific.
Definition KoSvgText.h:143
@ LineBreakAnywhere
Break between any typographic clusters.
Definition KoSvgText.h:146
@ LineBreakAuto
Use preferred method.
Definition KoSvgText.h:142
@ LineBreakNormal
Use normal method, language specific.
Definition KoSvgText.h:144
TextAnchor
Where the text is anchored for SVG 1.1 text and 'inline-size'.
Definition KoSvgText.h:79
@ AnchorEnd
Anchor right for LTR, left for RTL.
Definition KoSvgText.h:82
@ AnchorStart
Anchor left for LTR, right for RTL.
Definition KoSvgText.h:80
@ AnchorMiddle
Anchor to the middle.
Definition KoSvgText.h:81
QString writeWordBreak(WordBreak value)
FontFeaturePosition
The FontFeatureLigatures class This enum represents css font-variant-position.
Definition KoSvgText.h:886
@ PositionSuper
Definition KoSvgText.h:888
@ PositionNormal
Definition KoSvgText.h:887
TabSizeInfo parseTabSize(const QString &value, const SvgLoadingContext &context)
TextPathSide parseTextPathSide(const QString &value)
QDebug operator<<(QDebug dbg, const KoSvgText::AutoValue &value)
Baseline parseBaseline(const QString &value)
TextDecorationStyle
Style of the text-decoration.
Definition KoSvgText.h:265
@ Solid
Draw a solid line.Ex: --—.
Definition KoSvgText.h:266
@ Dashed
Draw a dashed line. Ex: - - - - -.
Definition KoSvgText.h:269
@ Double
Draw two lines. Ex: =====.
Definition KoSvgText.h:267
@ Wavy
Draw a wavy line. We currently make a zigzag, ex: ^^^^^.
Definition KoSvgText.h:270
@ Dotted
Draw a dotted line. Ex: .....
Definition KoSvgText.h:268
NumericFigureSpacing
Definition KoSvgText.h:919
@ NumericFigureSpacingProportional
Definition KoSvgText.h:921
@ NumericFigureSpacingTabular
Definition KoSvgText.h:922
@ NumericFigureSpacingNormal
Definition KoSvgText.h:920
FontFeatureEastAsian parseFontFeatureEastAsian(const QString &value, FontFeatureEastAsian features)
TextAnchor parseTextAnchor(const QString &value)
OverflowWrap
What to do with words that cannot be broken, but still overflow.
Definition KoSvgText.h:151
@ OverflowWrapBreakWord
Definition KoSvgText.h:155
@ OverflowWrapNormal
Definition KoSvgText.h:152
@ OverflowWrapAnywhere
Break anywhere as soon as overflow happens.
Definition KoSvgText.h:154
TextOrientation parseTextOrientation(const QString &value)
TextDecorationUnderlinePosition
Which location to choose for the underline.
Definition KoSvgText.h:275
@ UnderlineLeft
Definition KoSvgText.h:278
@ UnderlineRight
Definition KoSvgText.h:280
@ UnderlineUnder
Use the bottom of the text decoration bounding box.
Definition KoSvgText.h:277
@ UnderlineAuto
Use Font metrics.
Definition KoSvgText.h:276
TextPathSpacing parseTextPathSpacing(const QString &value)
WordBreak
Whether to break words.
Definition KoSvgText.h:132
@ WordBreakNormal
Set according to script. Also "break-word".
Definition KoSvgText.h:133
@ WordBreakBreakAll
Always break inside words.
Definition KoSvgText.h:135
@ WordBreakKeepAll
Never break inside words.
Definition KoSvgText.h:134
QString writeBaselineShiftMode(BaselineShiftMode value, CssLengthPercentage shift)
UnicodeBidi parseUnicodeBidi(const QString &value)
@ LengthAdjustSpacing
Only stretch the spaces.
Definition KoSvgText.h:251
@ LengthAdjustSpacingAndGlyphs
Stretches the glyphs as well.
Definition KoSvgText.h:252
WritingMode parseWritingMode(const QString &value)
QString writeTabSize(const TabSizeInfo tabSize)
LengthAdjust parseLengthAdjust(const QString &value)
TextWrap
Part of "white-space", in practice we only support wrap and nowrap.
Definition KoSvgText.h:109
@ NoWrap
Do not do any text wrapping.
Definition KoSvgText.h:112
AutoValue parseAutoValueX(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword)
QString writeLineHeight(LineHeightInfo lineHeight)
TextDecoration
Flags for text-decoration, for underline, overline and strikethrough.
Definition KoSvgText.h:257
@ DecorationOverline
Definition KoSvgText.h:260
@ DecorationLineThrough
Definition KoSvgText.h:261
@ DecorationNone
Definition KoSvgText.h:258
@ DecorationUnderline
Definition KoSvgText.h:259
bool whiteSpaceValueToLongHands(const QString &value, TextSpaceCollapse &collapseMethod, TextWrap &wrapMethod, TextSpaceTrims &trimMethod)
whiteSpaceValueToLongHands CSS-Text-4 takes CSS-Text-3 whitespace values and treats them as a shortha...
CssFontStyleData parseFontStyle(const QString &value)
Direction
Base direction used by Bidi algorithm.
Definition KoSvgText.h:48
@ DirectionLeftToRight
Definition KoSvgText.h:49
@ DirectionRightToLeft
Definition KoSvgText.h:50
TextRendering parseTextRendering(const QString &value)
Baseline
Baseline values used by dominant-baseline and baseline-align.
Definition KoSvgText.h:213
@ BaselineAlphabetic
Use 'romn' or the baseline for LCG scripts.
Definition KoSvgText.h:225
@ BaselineDominant
Definition KoSvgText.h:218
@ BaselineHanging
Definition KoSvgText.h:226
@ BaselineMiddle
Definition KoSvgText.h:232
@ BaselineUseScript
Definition KoSvgText.h:216
@ BaselineTextBottom
Bottom side of the inline line-box.
Definition KoSvgText.h:234
@ BaselineResetSize
Definition KoSvgText.h:221
@ BaselineNoChange
Use parent baseline table.
Definition KoSvgText.h:220
@ BaselineIdeographic
Definition KoSvgText.h:223
@ BaselineMathematical
Definition KoSvgText.h:228
@ BaselineTextTop
Top side of the inline line-box.
Definition KoSvgText.h:235
@ BaselineCentral
Use the center between the ideographic over and under.
Definition KoSvgText.h:231
QString writeFontFeatureLigatures(const FontFeatureLigatures &feature)
QString writeUnicodeBidi(UnicodeBidi value)
@ EastAsianProportionalWidth
Definition KoSvgText.h:1010
@ EastAsiantNormalWidth
Definition KoSvgText.h:1008
@ EastAsianFullWidth
Definition KoSvgText.h:1009
AutoValue parseAutoValueAngular(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword)
TextOverflow
How to handle overflow.
Definition KoSvgText.h:193
@ OverFlowVisible
Definition KoSvgText.h:194
@ OverFlowEllipse
Replace the last characters with "U+2026".
Definition KoSvgText.h:198
@ OverFlowClip
Clip the rendered content.
Definition KoSvgText.h:197
TextIndentInfo parseTextIndent(const QString &value, const SvgLoadingContext &context)
QString writeTextRendering(TextRendering value)
TextAlign parseTextAlign(const QString &value)
QString writeTextPathMethod(TextPathMethod value)
TextPathSide
Whether to reverse the path before laying out text.
Definition KoSvgText.h:300
@ TextPathSideRight
Definition KoSvgText.h:301
@ TextPathSideLeft
Definition KoSvgText.h:302
Direction parseDirection(const QString &value)
LineHeightInfo parseLineHeight(const QString &value, const SvgLoadingContext &context)
QString writeLineBreak(LineBreak value)
QString writeLengthPercentage(const CssLengthPercentage &length, bool percentageAsEm)
@ HorizontalTB
Definition KoSvgText.h:38
QVariant fromAutoValue(const KoSvgText::AutoValue &value)
Definition KoSvgText.h:493
@ NumericFractionsNormal
Definition KoSvgText.h:926
@ NumericFractionsDiagonal
Definition KoSvgText.h:927
@ NumericFractionsStacked
Definition KoSvgText.h:928
QString writeAutoLengthPercentage(const AutoLengthPercentage &value, const QString &autoKeyword, bool percentageToEm)
AutoValue parseAutoValueXY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword)
@ BidiNormal
No new bidi-level is started.
Definition KoSvgText.h:57
@ BidiPlainText
Definition KoSvgText.h:64
@ BidiIsolate
Content is ordered as if in a separate paragraph.
Definition KoSvgText.h:61
@ BidiOverride
Definition KoSvgText.h:59
@ BidiEmbed
Opens an additional Bidi-reordering level.
Definition KoSvgText.h:58
@ BidiIsolateOverride
Definition KoSvgText.h:62
QString writeFontFeatureCaps(const FontFeatureCaps &value)
QDataStream & operator>>(QDataStream &in, KoSvgText::FontFamilyAxis &axis)
FontFeaturePosition parseFontFeaturePosition(const QString &value, FontFeaturePosition feature)
QString writeFontFeatureEastAsian(const FontFeatureEastAsian &feature)
QString writeFontStyle(CssFontStyleData value)
QString writeTextAlign(TextAlign value)
LineBreak parseLineBreak(const QString &value)
QStringList fontFeaturesPosition(const FontFeaturePosition &feature, const int start, const int end)
QString writeFontFeatureNumeric(const FontFeatureNumeric &feature)
QString writeLengthAdjust(LengthAdjust value)
QString writeAlignmentBaseline(Baseline value)
TextSpaceTrim
Part of "white-space".
Definition KoSvgText.h:123
@ TrimInner
Discard white space at the beginning and end of element.
Definition KoSvgText.h:125
@ DiscardAfter
Trim white space after the end of the element.
Definition KoSvgText.h:127
@ TrimNone
No trimming.
Definition KoSvgText.h:124
@ DiscardBefore
Trim white space before the start of the element.
Definition KoSvgText.h:126
@ RenderingGeometricPrecision
Definition KoSvgText.h:318
@ RenderingAuto
Definition KoSvgText.h:315
@ RenderingOptimizeLegibility
Definition KoSvgText.h:317
@ RenderingOptimizeSpeed
Definition KoSvgText.h:316
int parseCSSFontWeight(const QString &value, int currentWeight)
TextOrientation parseTextOrientationFromGlyphOrientation(AutoValue value)
QString writeFontFeaturePosition(const FontFeaturePosition &value)
static const std::array< const char *, 9 > fontStretchNames
Definition KoSvgText.h:543
AutoLengthPercentage parseAutoLengthPercentageXY(const QString &value, const SvgLoadingContext &context, const QString &autoKeyword, QRectF bbox, bool percentageIsViewPort)
FontFeatureCaps parseFontFeatureCaps(const QString &value, FontFeatureCaps feature)
QString writeTextOrientation(TextOrientation orientation)
FontFeatureLigatures parseFontFeatureLigatures(const QString &value, FontFeatureLigatures features)
QString writeXmlSpace(TextSpaceCollapse collapseMethod)
QString writeTextPathSpacing(TextPathSpacing value)
TextPathMethod parseTextPathMethod(const QString &value)
int parseCSSFontStretch(const QString &value, int currentStretch)
parseCSSFontStretch For CSS3, the font-stretches were only given as keywords. In Css 4 and above,...
TextOrientation
Orientation of the glyphs, used for vertical writing modes.
Definition KoSvgText.h:70
@ OrientationUpright
Set all characters upright.
Definition KoSvgText.h:73
@ OrientationMixed
Definition KoSvgText.h:71
@ OrientationSideWays
Set all characters sideways.
Definition KoSvgText.h:74
@ TextTransformCapitalize
Definition KoSvgText.h:185
@ TextTransformUppercase
Convert all bicarmel text to upper-case, locale dependant.
Definition KoSvgText.h:187
@ TextTransformLowercase
Convert all bicarmel text to lower-case, locale dependant.
Definition KoSvgText.h:188
@ TextTransformNone
No transforms.
Definition KoSvgText.h:184
QString writeTextAnchor(TextAnchor value)
QString writeWritingMode(WritingMode value, bool svg1_1)
TextTransformInfo parseTextTransform(const QString &value)
@ HangForce
Whether to force hanging stops or commas.
Definition KoSvgText.h:209
@ HangLast
Hang closing brackets and quotes.
Definition KoSvgText.h:207
@ HangFirst
Hang opening brackets and quotes.
Definition KoSvgText.h:206
@ HangNone
Hang nothing.
Definition KoSvgText.h:205
@ HangEnd
Hang stops and commas. Force/Allow is a separate boolean.
Definition KoSvgText.h:208
QString writeAutoValue(const AutoValue &value, const QString &autoKeyword)
QString writeDominantBaseline(Baseline value)
@ NumericFigureStyleOld
Definition KoSvgText.h:915
@ NumericFigureStyleLining
Definition KoSvgText.h:914
@ NumericFigureStyleNormal
Definition KoSvgText.h:913
@ OpenTypeFontType
Definition KoSvgText.h:810
@ Type1FontType
Definition KoSvgText.h:809
@ UnknownFontType
Definition KoSvgText.h:807
TextSpaceCollapse
Definition KoSvgText.h:96
@ Preserve
Do not collapse any space.
Definition KoSvgText.h:99
@ BreakSpaces
Same as preserve, except each white space and wordseperate is breakable.
Definition KoSvgText.h:104
@ Collapse
Collapse white space sequences into a single character.
Definition KoSvgText.h:97
@ PreserveBreaks
Definition KoSvgText.h:100
@ Discard
Discard all Spaces.
Definition KoSvgText.h:98
@ PreserveSpaces
required for 'xml:space="preserve"' emulation.
Definition KoSvgText.h:102
QString writeTextTransform(const TextTransformInfo textTransform)
static const std::array< const char *, 7 > fontSizeNames
Definition KoSvgText.h:552
WordBreak parseWordBreak(const QString &value)
FontFeatureNumeric parseFontFeatureNumeric(const QString &value, FontFeatureNumeric features)
QString writeDirection(Direction value)
TextPathMethod
Whether to stretch the glyphs along a path.
Definition KoSvgText.h:286
@ TextPathAlign
Only align position and rotation of glyphs to the path.
Definition KoSvgText.h:287
@ TextPathStretch
Definition KoSvgText.h:288
QString writeWhiteSpaceValue(TextSpaceCollapse collapseMethod, TextWrap wrapMethod, TextSpaceTrims trimMethod)
QStringList fontFeaturesCaps(const FontFeatureCaps &feature, const int start, const int end)
QString writeTextIndent(const TextIndentInfo textIndent)
CssLengthPercentage length
Definition KoSvgText.h:466
bool operator==(const AutoLengthPercentage &other) const
Definition KoSvgText.h:468
AutoLengthPercentage(qreal _customValue, CssLengthPercentage::UnitType unit=CssLengthPercentage::Absolute)
Definition KoSvgText.h:462
AutoLengthPercentage(CssLengthPercentage _length)
Definition KoSvgText.h:460
bool operator==(const AutoValue &other) const
Definition KoSvgText.h:452
AutoValue(qreal _customValue)
Definition KoSvgText.h:447
BackgroundProperty is a special wrapper around KoShapeBackground for managing it in KoSvgTextProperti...
Definition KoSvgText.h:714
QSharedPointer< KoShapeBackground > property
Definition KoSvgText.h:724
BackgroundProperty(QSharedPointer< KoShapeBackground > p)
Definition KoSvgText.h:716
bool operator==(const BackgroundProperty &rhs) const
Definition KoSvgText.h:718
boost::optional< qreal > yPos
Definition KoSvgText.h:606
bool operator==(const CharTransformation &other) const
boost::optional< qreal > dxPos
Definition KoSvgText.h:607
boost::optional< qreal > dyPos
Definition KoSvgText.h:608
boost::optional< qreal > rotate
Definition KoSvgText.h:609
void mergeInParentTransformation(const CharTransformation &t)
boost::optional< qreal > xPos
Definition KoSvgText.h:605
When style is oblique, a custom slant value can be specified for variable fonts.
Definition KoSvgText.h:475
bool operator==(const CssFontStyleData &other) const
Definition KoSvgText.h:481
KoSvgText::AutoValue slantValue
Definition KoSvgText.h:479
CssFontStyleData(QFont::Style _style)
Definition KoSvgText.h:477
CssLengthPercentage(qreal value, UnitType unit=Absolute)
Definition KoSvgText.h:419
bool operator==(const CssLengthPercentage &other) const
Definition KoSvgText.h:426
@ Cap
multiply by font-x-height.
Definition KoSvgText.h:412
@ Ch
multiply by font cap height
Definition KoSvgText.h:413
@ Absolute
Pt, everything needs to be converted to pt for this to work.
Definition KoSvgText.h:408
@ Lh
multiply by width of "U+6C34", represents average full width script advance.
Definition KoSvgText.h:415
@ Ex
multiply by Font-size
Definition KoSvgText.h:411
@ Ic
multiply by width of "0", represents average proportional script advance.
Definition KoSvgText.h:414
void convertToAbsolute(const KoSvgText::FontMetrics metrics, const qreal fontSize, const UnitType percentageUnit=Em)
static FontFamilyAxis weightAxis(qreal val)
Definition KoSvgText.h:754
QString debugInfo() const
Some variable fonts have axes that are not really supposed to be shown to the user.
Definition KoSvgText.h:785
static FontFamilyAxis slantAxis(qreal val)
Definition KoSvgText.h:768
FontFamilyAxis(QString _tag, qreal _value)
Definition KoSvgText.h:751
bool operator==(const FontFamilyAxis &other) const
Definition KoSvgText.h:793
QHash< QLocale, QString > localizedLabels
Definition KoSvgText.h:777
static FontFamilyAxis widthAxis(qreal val)
Definition KoSvgText.h:761
QHash< QString, float > instanceCoords
Definition KoSvgText.h:816
QHash< QLocale, QString > localizedLabels
Definition KoSvgText.h:815
bool operator==(const FontFamilyStyleInfo &other) const
Definition KoSvgText.h:834
bool operator==(const FontFeatureEastAsian &other) const
Definition KoSvgText.h:1017
QStringList fontFeatures(const int start, const int end)
Definition KoSvgText.h:1023
The FontFeatureLigatures class This struct represents css font-variant-ligatures.
Definition KoSvgText.h:847
QStringList fontFeatures(const int start, const int end)
Definition KoSvgText.h:860
bool commonLigatures
'clig' and 'liga'
Definition KoSvgText.h:848
bool operator==(const FontFeatureLigatures &other) const
Definition KoSvgText.h:853
The FontFeatureLigatures class This struct represents css font-variant-numeric.
Definition KoSvgText.h:935
QStringList fontFeatures(const int start, const int end)
Definition KoSvgText.h:951
NumericFractions fractions
Definition KoSvgText.h:940
NumericFigureStyle style
Definition KoSvgText.h:938
NumericFigureSpacing spacing
Definition KoSvgText.h:939
bool operator==(const FontFeatureNumeric &other) const
Definition KoSvgText.h:943
The FontMetrics class A class to keep track of a variety of font metrics. Note that values are in Fre...
Definition KoSvgText.h:327
qint32 ideographicCenterBaseline
default baseline for vertical, centered between over and under.
Definition KoSvgText.h:347
qint32 ideographicUnderBaseline
location of ideographic under baseline from origin, may fall back to descender.
Definition KoSvgText.h:346
QPair< qint32, qint32 > subScriptOffset
subscript baseline height, defaults to 1/5th em below alphabetic.
Definition KoSvgText.h:336
qint32 xHeight
height of X, defaults to 0.5 fontsize.
Definition KoSvgText.h:334
qint32 lineThroughThickness
strikethrough thickness, from font.
Definition KoSvgText.h:359
qint32 underlineThickness
underline thickness from font.
Definition KoSvgText.h:357
qint32 lineThroughOffset
offset of strike-through from alphabetic baseline.
Definition KoSvgText.h:358
qint32 lineGap
additional linegap between consecutive lines.
Definition KoSvgText.h:341
qint32 zeroAdvance
Advance of the character '0', CSS Unit 'ch', defaults to 0.5 em in horizontal and 1....
Definition KoSvgText.h:330
qint32 underlineOffset
underline offset from alphabetic, positive.
Definition KoSvgText.h:356
qint32 ideographicAdvance
Advance of the character '水' (U+6C34), CSS Unit ic, defaults to 1 em.
Definition KoSvgText.h:332
qint32 ideographicFaceOverBaseline
location of ideographic face over baseline, that is, the top of the glyphs.
Definition KoSvgText.h:352
qint32 ideographicOverBaseline
location of ideographic over baseline from origin.
Definition KoSvgText.h:349
qint32 fontSize
Currently set size, CSS unit 'em'.
Definition KoSvgText.h:329
qint32 ideographicFaceUnderBaseline
location of ideographic face under baseline, that is, the bottom of the glyphs.
Definition KoSvgText.h:351
qint32 caretRun
These are only used to determine the caret slant proportion.
Definition KoSvgText.h:362
qint32 alphabeticBaseline
location of alphabetic baseline from origin.
Definition KoSvgText.h:343
qint32 descender
distance for origin to bottom.
Definition KoSvgText.h:340
qint32 ascender
distance from origin to top.
Definition KoSvgText.h:339
qint32 mathematicalBaseline
location of mathematical baseline from origin.
Definition KoSvgText.h:344
qint32 capHeight
Height of capital letters, defaults to ascender.
Definition KoSvgText.h:335
qint32 hangingBaseline
location of the hanging baseline used in north brahmic scripts.
Definition KoSvgText.h:354
qint32 spaceAdvance
Advance of the character ' ', used by tabs.
Definition KoSvgText.h:331
QPair< qint32, qint32 > superScriptOffset
superscript baseline height, defaults to 2/3rd above alphabetic.
Definition KoSvgText.h:337
bool isNumber
Length or number.
Definition KoSvgText.h:695
bool operator==(const LineHeightInfo &rhs) const
The 'auto' value.
Definition KoSvgText.h:698
CssLengthPercentage length
Definition KoSvgText.h:693
bool isNormal
It's a number indicating the lineHeight;.
Definition KoSvgText.h:696
The ResolutionHandler class.
Definition KoSvgText.h:1084
qreal freeTypePixelToPointFactor(const bool x=true) const
qreal pointToPixelFactor(const bool x=true) const
qreal pixelToPointFactor(const bool x=true) const
QTransform pixelToPoint() const
ResolutionHandler(qreal _xRes=72.0, qreal _yRes=72.0, bool _roundToPixelHorizontal=false, bool _roundToPixelVertical=false)
Definition KoSvgText.h:1086
QTransform pointToPixel() const
QPointF adjustCeil(const QPointF point) const
Adjusts the point to ceiled pixel values.
QTransform freeTypeToPixelTransform() const
QTransform freeTypeToPointTransform() const
QPointF adjustWithOffset(const QPointF point, const QPointF offset) const
QPointF adjustFloor(const QPointF point) const
Adjusts the point to floored pixel values.
QPointF adjust(const QPointF point) const
Adjusts the point to rounded pixel values, based on whether roundToPixelHorizontal or roundToPixelVer...
StrokeProperty is a special wrapper around KoShapeStrokeModel for managing it in KoSvgTextProperties.
Definition KoSvgText.h:733
QSharedPointer< KoShapeStrokeModel > property
Definition KoSvgText.h:743
bool operator==(const StrokeProperty &rhs) const
Definition KoSvgText.h:737
StrokeProperty(QSharedPointer< KoShapeStrokeModel > p)
Definition KoSvgText.h:735
bool operator==(const TabSizeInfo &rhs) const
Definition KoSvgText.h:681
qreal value
A length or a number. Length is currently marked 'at-risk'.
Definition KoSvgText.h:675
CssLengthPercentage length
Definition KoSvgText.h:678
bool hanging
Flip the lines to which text-indent is applied.
Definition KoSvgText.h:659
bool eachLine
Apply the text-indent to each line following a hardbreak.
Definition KoSvgText.h:660
CssLengthPercentage length
Definition KoSvgText.h:658
bool operator==(const TextIndentInfo &rhs) const
Definition KoSvgText.h:661
TextPathMethod method
Definition KoSvgText.h:626
TextPathSpacing spacing
Definition KoSvgText.h:627
bool operator==(const TextTransformInfo &rhs) const
Definition KoSvgText.h:642
TextTransform capitals
Text transform upper/lower/capitalize.
Definition KoSvgText.h:637
TextDecorationUnderlinePosition verticalPosition
Definition KoSvgText.h:1070
TextDecorationUnderlinePosition horizontalPosition
Definition KoSvgText.h:1069
bool operator==(const TextUnderlinePosition &other) const
Definition KoSvgText.h:1072