5
5
6
6
mod styleset;
7
7
8
- use alloc:: borrow:: Cow ;
9
8
pub use styled_text:: {
10
9
Brush , FontFamily , FontSettings , FontStack , GenericFamily , Stretch as FontStretch ,
11
- Style as FontStyle , StyleProperty , Weight as FontWeight ,
10
+ Style as FontStyle , StyleProperty , TextStyle , Weight as FontWeight ,
12
11
} ;
13
12
14
13
pub use styleset:: StyleSet ;
@@ -24,75 +23,3 @@ pub enum WhiteSpaceCollapse {
24
23
Collapse ,
25
24
Preserve ,
26
25
}
27
-
28
- /// Unresolved styles.
29
- #[ derive( Clone , PartialEq , Debug ) ]
30
- pub struct TextStyle < ' a , B : Brush > {
31
- /// Font family stack.
32
- pub font_stack : FontStack < ' a > ,
33
- /// Font size.
34
- pub font_size : f32 ,
35
- /// Font stretch.
36
- pub font_stretch : FontStretch ,
37
- /// Font style.
38
- pub font_style : FontStyle ,
39
- /// Font weight.
40
- pub font_weight : FontWeight ,
41
- /// Font variation settings.
42
- pub font_variations : FontSettings < ' a , styled_text:: FontVariation > ,
43
- /// Font feature settings.
44
- pub font_features : FontSettings < ' a , styled_text:: FontFeature > ,
45
- /// Locale.
46
- pub locale : Option < & ' a str > ,
47
- /// Brush for rendering text.
48
- pub brush : B ,
49
- /// Underline decoration.
50
- pub has_underline : bool ,
51
- /// Offset of the underline decoration.
52
- pub underline_offset : Option < f32 > ,
53
- /// Size of the underline decoration.
54
- pub underline_size : Option < f32 > ,
55
- /// Brush for rendering the underline decoration.
56
- pub underline_brush : Option < B > ,
57
- /// Strikethrough decoration.
58
- pub has_strikethrough : bool ,
59
- /// Offset of the strikethrough decoration.
60
- pub strikethrough_offset : Option < f32 > ,
61
- /// Size of the strikethrough decoration.
62
- pub strikethrough_size : Option < f32 > ,
63
- /// Brush for rendering the strikethrough decoration.
64
- pub strikethrough_brush : Option < B > ,
65
- /// Line height multiplier.
66
- pub line_height : f32 ,
67
- /// Extra spacing between words.
68
- pub word_spacing : f32 ,
69
- /// Extra spacing between letters.
70
- pub letter_spacing : f32 ,
71
- }
72
-
73
- impl < B : Brush > Default for TextStyle < ' _ , B > {
74
- fn default ( ) -> Self {
75
- TextStyle {
76
- font_stack : FontStack :: Source ( Cow :: Borrowed ( "sans-serif" ) ) ,
77
- font_size : 16.0 ,
78
- font_stretch : Default :: default ( ) ,
79
- font_style : Default :: default ( ) ,
80
- font_weight : Default :: default ( ) ,
81
- font_variations : FontSettings :: List ( Cow :: Borrowed ( & [ ] ) ) ,
82
- font_features : FontSettings :: List ( Cow :: Borrowed ( & [ ] ) ) ,
83
- locale : Default :: default ( ) ,
84
- brush : Default :: default ( ) ,
85
- has_underline : Default :: default ( ) ,
86
- underline_offset : Default :: default ( ) ,
87
- underline_size : Default :: default ( ) ,
88
- underline_brush : Default :: default ( ) ,
89
- has_strikethrough : Default :: default ( ) ,
90
- strikethrough_offset : Default :: default ( ) ,
91
- strikethrough_size : Default :: default ( ) ,
92
- strikethrough_brush : Default :: default ( ) ,
93
- line_height : 1.2 ,
94
- word_spacing : Default :: default ( ) ,
95
- letter_spacing : Default :: default ( ) ,
96
- }
97
- }
98
- }
0 commit comments