@@ -24,7 +24,7 @@ public TextOptionsTests()
2424 public void ConstructorTest_FontOnly ( )
2525 {
2626 Font font = FakeFont . CreateFont ( "ABC" ) ;
27- var options = new TextOptions ( font ) ;
27+ TextOptions options = new ( font ) ;
2828
2929 Assert . Equal ( 72 , options . Dpi ) ;
3030 Assert . Empty ( options . FallbackFontFamilies ) ;
@@ -38,7 +38,7 @@ public void ConstructorTest_FontWithSingleDpi()
3838 {
3939 Font font = FakeFont . CreateFont ( "ABC" ) ;
4040 const float dpi = 123 ;
41- var options = new TextOptions ( font ) { Dpi = dpi } ;
41+ TextOptions options = new ( font ) { Dpi = dpi } ;
4242
4343 Assert . Equal ( dpi , options . Dpi ) ;
4444 Assert . Empty ( options . FallbackFontFamilies ) ;
@@ -51,7 +51,7 @@ public void ConstructorTest_FontWithSingleDpi()
5151 public void ConstructorTest_FontWithOrigin ( )
5252 {
5353 Font font = FakeFont . CreateFont ( "ABC" ) ;
54- var origin = new Vector2 ( 123 , 345 ) ;
54+ Vector2 origin = new ( 123 , 345 ) ;
5555 TextOptions options = new ( font ) { Origin = origin } ;
5656
5757 Assert . Equal ( 72 , options . Dpi ) ;
@@ -65,7 +65,7 @@ public void ConstructorTest_FontWithOrigin()
6565 public void ConstructorTest_FontWithSingleDpiWithOrigin ( )
6666 {
6767 Font font = FakeFont . CreateFont ( "ABC" ) ;
68- var origin = new Vector2 ( 123 , 345 ) ;
68+ Vector2 origin = new ( 123 , 345 ) ;
6969 const float dpi = 123 ;
7070 TextOptions options = new ( font ) { Dpi = dpi , Origin = origin } ;
7171
@@ -80,13 +80,13 @@ public void ConstructorTest_FontWithSingleDpiWithOrigin()
8080 public void ConstructorTest_FontOnly_WithFallbackFonts ( )
8181 {
8282 Font font = FakeFont . CreateFont ( "ABC" ) ;
83- FontFamily [ ] fontFamilies = new [ ]
84- {
83+ FontFamily [ ] fontFamilies =
84+ [
8585 FakeFont . CreateFont ( "DEF" ) . Family ,
86- FakeFont . CreateFont ( "GHI" ) . Family
87- } ;
86+ FakeFont . CreateFont ( "GHI" ) . Family ,
87+ ] ;
8888
89- var options = new TextOptions ( font )
89+ TextOptions options = new ( font )
9090 {
9191 FallbackFontFamilies = fontFamilies
9292 } ;
@@ -102,14 +102,14 @@ public void ConstructorTest_FontOnly_WithFallbackFonts()
102102 public void ConstructorTest_FontWithSingleDpi_WithFallbackFonts ( )
103103 {
104104 Font font = FakeFont . CreateFont ( "ABC" ) ;
105- FontFamily [ ] fontFamilies = new [ ]
106- {
105+ FontFamily [ ] fontFamilies =
106+ [
107107 FakeFont . CreateFont ( "DEF" ) . Family ,
108- FakeFont . CreateFont ( "GHI" ) . Family
109- } ;
108+ FakeFont . CreateFont ( "GHI" ) . Family ,
109+ ] ;
110110
111111 const float dpi = 123 ;
112- var options = new TextOptions ( font )
112+ TextOptions options = new ( font )
113113 {
114114 Dpi = dpi ,
115115 FallbackFontFamilies = fontFamilies
@@ -126,13 +126,13 @@ public void ConstructorTest_FontWithSingleDpi_WithFallbackFonts()
126126 public void ConstructorTest_FontWithOrigin_WithFallbackFonts ( )
127127 {
128128 Font font = FakeFont . CreateFont ( "ABC" ) ;
129- FontFamily [ ] fontFamilies = new [ ]
130- {
129+ FontFamily [ ] fontFamilies =
130+ [
131131 FakeFont . CreateFont ( "DEF" ) . Family ,
132- FakeFont . CreateFont ( "GHI" ) . Family
133- } ;
132+ FakeFont . CreateFont ( "GHI" ) . Family ,
133+ ] ;
134134
135- var origin = new Vector2 ( 123 , 345 ) ;
135+ Vector2 origin = new ( 123 , 345 ) ;
136136 TextOptions options = new ( font )
137137 {
138138 FallbackFontFamilies = fontFamilies ,
@@ -150,13 +150,13 @@ public void ConstructorTest_FontWithOrigin_WithFallbackFonts()
150150 public void ConstructorTest_FontWithSingleDpiWithOrigin_WithFallbackFonts ( )
151151 {
152152 Font font = FakeFont . CreateFont ( "ABC" ) ;
153- FontFamily [ ] fontFamilies = new [ ]
154- {
153+ FontFamily [ ] fontFamilies =
154+ [
155155 FakeFont . CreateFont ( "DEF" ) . Family ,
156- FakeFont . CreateFont ( "GHI" ) . Family
157- } ;
156+ FakeFont . CreateFont ( "GHI" ) . Family ,
157+ ] ;
158158
159- var origin = new Vector2 ( 123 , 345 ) ;
159+ Vector2 origin = new ( 123 , 345 ) ;
160160 const float dpi = 123 ;
161161 TextOptions options = new ( font )
162162 {
@@ -176,20 +176,20 @@ public void ConstructorTest_FontWithSingleDpiWithOrigin_WithFallbackFonts()
176176 public void GetMissingGlyphFromMainFont ( )
177177 {
178178 Font font = FakeFont . CreateFontWithInstance ( "ABC" , "ABC" , out Fakes . FakeFontInstance abcFontInstance ) ;
179- FontFamily [ ] fontFamilies = new [ ]
180- {
181- FakeFont . CreateFontWithInstance ( "DEF" , "DEF" , out Fakes . FakeFontInstance defFontInstance ) . Family ,
182- FakeFont . CreateFontWithInstance ( "GHI" , "GHI" , out Fakes . FakeFontInstance ghiFontInstance ) . Family
183- } ;
179+ FontFamily [ ] fontFamilies =
180+ [
181+ FakeFont . CreateFontWithInstance ( "DEF" , "DEF" , out Fakes . FakeFontInstance _ ) . Family ,
182+ FakeFont . CreateFontWithInstance ( "GHI" , "GHI" , out Fakes . FakeFontInstance _ ) . Family ,
183+ ] ;
184184
185- var options = new TextOptions ( font )
185+ TextOptions options = new ( font )
186186 {
187187 FallbackFontFamilies = fontFamilies ,
188188 ColorFontSupport = ColorFontSupport . None
189189 } ;
190190
191191 ReadOnlySpan < char > text = "Z" . AsSpan ( ) ;
192- var renderer = new GlyphRenderer ( ) ;
192+ GlyphRenderer renderer = new ( ) ;
193193 TextRenderer . RenderTextTo ( renderer , text , options ) ;
194194
195195 GlyphRendererParameters glyph = Assert . Single ( renderer . GlyphKeys ) ;
@@ -204,20 +204,20 @@ public void GetMissingGlyphFromMainFont()
204204 public void GetGlyphFromFirstAvailableInstance ( char character , string instance )
205205 {
206206 Font font = FakeFont . CreateFontWithInstance ( "ABC" , "ABC" , out Fakes . FakeFontInstance abcFontInstance ) ;
207- FontFamily [ ] fontFamilies = new [ ]
208- {
207+ FontFamily [ ] fontFamilies =
208+ [
209209 FakeFont . CreateFontWithInstance ( "DEF" , "DEF" , out Fakes . FakeFontInstance defFontInstance ) . Family ,
210- FakeFont . CreateFontWithInstance ( "EFGHI" , "EFGHI" , out Fakes . FakeFontInstance efghiFontInstance ) . Family
211- } ;
210+ FakeFont . CreateFontWithInstance ( "EFGHI" , "EFGHI" , out Fakes . FakeFontInstance efghiFontInstance ) . Family ,
211+ ] ;
212212
213- var options = new TextOptions ( font )
213+ TextOptions options = new ( font )
214214 {
215215 FallbackFontFamilies = fontFamilies ,
216216 ColorFontSupport = ColorFontSupport . None
217217 } ;
218218
219219 ReadOnlySpan < char > text = new [ ] { character } ;
220- var renderer = new GlyphRenderer ( ) ;
220+ GlyphRenderer renderer = new ( ) ;
221221 TextRenderer . RenderTextTo ( renderer , text , options ) ;
222222 GlyphRendererParameters glyph = Assert . Single ( renderer . GlyphKeys ) ;
223223 Assert . Equal ( GlyphType . Standard , glyph . GlyphType ) ;
@@ -233,7 +233,7 @@ public void GetGlyphFromFirstAvailableInstance(char character, string instance)
233233 }
234234
235235 [ Fact ]
236- public void CloneTextOptionsIsNotNull ( ) => Assert . True ( this . clonedTextOptions != null ) ;
236+ public void CloneTextOptionsIsNotNull ( ) => Assert . NotNull ( this . clonedTextOptions ) ;
237237
238238 [ Fact ]
239239 public void DefaultTextOptionsApplyKerning ( )
@@ -312,7 +312,8 @@ public void NonDefaultClone()
312312 VerticalAlignment = VerticalAlignment . Bottom ,
313313 DecorationPositioningMode = DecorationPositioningMode . GlyphFont ,
314314 WrappingLength = 42F ,
315- FeatureTags = new List < Tag > { FeatureTags . OldstyleFigures } ,
315+ Tracking = 66F ,
316+ FeatureTags = new List < Tag > { FeatureTags . OldstyleFigures }
316317 } ;
317318
318319 TextOptions actual = new ( expected ) ;
@@ -326,12 +327,13 @@ public void NonDefaultClone()
326327 Assert . Equal ( expected . WrappingLength , actual . WrappingLength ) ;
327328 Assert . Equal ( expected . DecorationPositioningMode , actual . DecorationPositioningMode ) ;
328329 Assert . Equal ( expected . FeatureTags , actual . FeatureTags ) ;
330+ Assert . Equal ( expected . Tracking , actual . Tracking ) ;
329331 }
330332
331333 [ Fact ]
332334 public void CloneIsDeep ( )
333335 {
334- var expected = new TextOptions ( this . fakeFont ) ;
336+ TextOptions expected = new ( this . fakeFont ) ;
335337 TextOptions actual = new ( expected )
336338 {
337339 KerningMode = KerningMode . None ,
@@ -343,6 +345,8 @@ public void CloneIsDeep()
343345 TextJustification = TextJustification . InterCharacter ,
344346 DecorationPositioningMode = DecorationPositioningMode . GlyphFont ,
345347 WrappingLength = 42F
348+ WrappingLength = 42F ,
349+ Tracking = 66F ,
346350 } ;
347351
348352 Assert . NotEqual ( expected . KerningMode , actual . KerningMode ) ;
@@ -354,6 +358,7 @@ public void CloneIsDeep()
354358 Assert . NotEqual ( expected . WrappingLength , actual . WrappingLength ) ;
355359 Assert . NotEqual ( expected . DecorationPositioningMode , actual . DecorationPositioningMode ) ;
356360 Assert . NotEqual ( expected . TextJustification , actual . TextJustification ) ;
361+ Assert . NotEqual ( expected . Tracking , actual . Tracking ) ;
357362 }
358363
359364 private static void VerifyPropertyDefault ( TextOptions options )
@@ -369,5 +374,6 @@ private static void VerifyPropertyDefault(TextOptions options)
369374 Assert . Equal ( LayoutMode . HorizontalTopBottom , options . LayoutMode ) ;
370375 Assert . Equal ( DecorationPositioningMode . PrimaryFont , options . DecorationPositioningMode ) ;
371376 Assert . Equal ( 1 , options . LineSpacing ) ;
377+ Assert . Equal ( 0 , options . Tracking ) ;
372378 }
373379}
0 commit comments