@@ -4,28 +4,28 @@ import { getFontSetting, tokenizeString, isSpace, isZeroWidthSpace, wrapText, me
4
4
describe ( 'TextTextureRendererUtils' , ( ) => {
5
5
describe ( 'getFontSetting' , ( ) => {
6
6
it ( 'should form a valid CSS font string' , ( ) => {
7
- expect ( getFontSetting ( 'Arial' , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px " Arial" ' ) ;
7
+ expect ( getFontSetting ( 'Arial' , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px Arial' ) ;
8
8
expect ( getFontSetting ( 'Times New Roman' , 'bold' , 30 , 1 , 'Default' ) ) . toBe ( 'bold 30px "Times New Roman"' ) ;
9
9
} ) ;
10
10
it ( 'should adjust font size for precision' , ( ) => {
11
- expect ( getFontSetting ( 'Arial' , 'normal' , 12 , 2 , 'Default' ) ) . toBe ( 'normal 24px " Arial" ' ) ;
11
+ expect ( getFontSetting ( 'Arial' , 'normal' , 12 , 2 , 'Default' ) ) . toBe ( 'normal 24px Arial' ) ;
12
12
} ) ;
13
13
it ( 'should support "serif" and "sans-serif" specially' , ( ) => {
14
14
expect ( getFontSetting ( 'serif' , 'italic' , 12 , 1 , 'Default' ) ) . toBe ( 'italic 12px serif' ) ;
15
15
expect ( getFontSetting ( 'sans-serif' , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px sans-serif' ) ;
16
16
} ) ;
17
17
it ( 'should default to the defaultFontFace if fontFace is null' , ( ) => {
18
- expect ( getFontSetting ( null , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px " Default" ' ) ;
19
- expect ( getFontSetting ( [ null ] , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px " Default" ' ) ;
18
+ expect ( getFontSetting ( null , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px Default' ) ;
19
+ expect ( getFontSetting ( [ null ] , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px Default' ) ;
20
20
} ) ;
21
21
it ( 'should defaultFontFace should also handle "serif" and "sans-serif" specially' , ( ) => {
22
22
expect ( getFontSetting ( null , 'normal' , 12 , 1 , 'serif' ) ) . toBe ( 'normal 12px serif' ) ;
23
23
expect ( getFontSetting ( [ null ] , 'normal' , 12 , 1 , 'sans-serif' ) ) . toBe ( 'normal 12px sans-serif' ) ;
24
24
} ) ;
25
25
it ( 'should support an array of fonts' , ( ) => {
26
- expect ( getFontSetting ( [ 'Arial' ] , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px " Arial" ' ) ;
27
- expect ( getFontSetting ( [ 'serif' , 'Arial' ] , 'italic' , 12 , 1 , 'Default' ) ) . toBe ( 'italic 12px serif," Arial" ' ) ;
28
- expect ( getFontSetting ( [ 'serif' , 'Arial' , null ] , 'bold' , 12 , 1 , 'Default' ) ) . toBe ( 'bold 12px serif," Arial"," Default" ' ) ;
26
+ expect ( getFontSetting ( [ 'Arial' ] , 'normal' , 12 , 1 , 'Default' ) ) . toBe ( 'normal 12px Arial' ) ;
27
+ expect ( getFontSetting ( [ 'serif' , 'Arial' ] , 'italic' , 12 , 1 , 'Default' ) ) . toBe ( 'italic 12px serif,Arial' ) ;
28
+ expect ( getFontSetting ( [ 'serif' , 'Arial' , null ] , 'bold' , 12 , 1 , 'Default' ) ) . toBe ( 'bold 12px serif,Arial, Default' ) ;
29
29
} ) ;
30
30
} ) ;
31
31
0 commit comments