MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TextLayout

Class TextLayout

snap_drawing/src/snap_drawing/cpp/Text/TextLayout.hpp:83–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82 constexpr TextLayoutLineHeight(Kind kind, Scalar value) : _kind(kind), _value(value) {}
83};
84
85enum TextLayoutDecorationStyle {
86 TextLayoutDecorationStyleSolid,
87 TextLayoutDecorationStyleDashed,
88 TextLayoutDecorationStyleDotted,
89};
90
91struct TextCustomUnderlineStyle {
92 Scalar height = 0;
93 Scalar onWidth = 0;
94 Scalar offWidth = 0;
95 Scalar offset = 0;
96
97 constexpr TextCustomUnderlineStyle() = default;
98 constexpr TextCustomUnderlineStyle(Scalar height, Scalar onWidth, Scalar offWidth, Scalar offset)
99 : height(height), onWidth(onWidth), offWidth(offWidth), offset(offset) {}
100
101 constexpr bool isPatterned() const {
102 return onWidth > 0 && offWidth > 0;
103 }
104
105 constexpr bool operator==(const TextCustomUnderlineStyle& other) const {
106 return height == other.height && onWidth == other.onWidth && offWidth == other.offWidth &&
107 offset == other.offset;
108 }
109
110 constexpr bool operator!=(const TextCustomUnderlineStyle& other) const {
111 return !(*this == other);
112 }
113};
114
115enum TextLayoutVisualEntryKind {
116 TextLayoutVisualEntryKindBackground,
117 TextLayoutVisualEntryKindDecoration,

Callers 1

makeTextLayoutJSONFunction · 0.50

Calls

no outgoing calls

Tested by 1

makeTextLayoutJSONFunction · 0.40