@@ -37,11 +37,11 @@ public void LoadFontMetadataWoff()
37
37
[ Fact ]
38
38
public void LoadFont_WithTtfFormat ( )
39
39
{
40
- FontMetrics font = StreamFontMetrics . LoadFont ( TestFonts . OpenSansFile ) ;
40
+ Font font = new FontCollection ( ) . Add ( TestFonts . OpenSansFile ) . CreateFont ( 12 ) ;
41
41
42
- GlyphMetrics glyph = font . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
42
+ GlyphMetrics glyph = font . FontMetrics . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
43
43
var r = new GlyphRenderer ( ) ;
44
- glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( ( Font ) null ) ) ;
44
+ glyph . RenderTo ( r , font . Size , System . Numerics . Vector2 . Zero , new TextOptions ( font ) ) ;
45
45
46
46
Assert . Equal ( 37 , r . ControlPoints . Count ) ;
47
47
Assert . Single ( r . GlyphKeys ) ;
@@ -51,11 +51,11 @@ public void LoadFont_WithTtfFormat()
51
51
[ Fact ]
52
52
public void LoadFont_WithWoff1Format ( )
53
53
{
54
- FontMetrics font = StreamFontMetrics . LoadFont ( TestFonts . OpenSansFileWoff1 ) ;
54
+ Font font = new FontCollection ( ) . Add ( TestFonts . OpenSansFileWoff1 ) . CreateFont ( 12 ) ;
55
55
56
- GlyphMetrics glyph = font . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
56
+ GlyphMetrics glyph = font . FontMetrics . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
57
57
var r = new GlyphRenderer ( ) ;
58
- glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( ( Font ) null ) ) ;
58
+ glyph . RenderTo ( r , font . Size , System . Numerics . Vector2 . Zero , new TextOptions ( font ) ) ;
59
59
60
60
Assert . Equal ( 37 , r . ControlPoints . Count ) ;
61
61
Assert . Single ( r . GlyphKeys ) ;
@@ -84,11 +84,11 @@ public void LoadFontMetadata_WithWoff2Format()
84
84
[ Fact ]
85
85
public void LoadFont_WithWoff2Format ( )
86
86
{
87
- FontMetrics font = StreamFontMetrics . LoadFont ( TestFonts . OpensSansWoff2Data ( ) ) ;
87
+ Font font = new FontCollection ( ) . Add ( TestFonts . OpensSansWoff2Data ( ) ) . CreateFont ( 12 ) ;
88
88
89
- GlyphMetrics glyph = font . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
89
+ GlyphMetrics glyph = font . FontMetrics . GetGlyphMetrics ( new CodePoint ( 'A' ) , ColorFontSupport . None ) . First ( ) ;
90
90
var r = new GlyphRenderer ( ) ;
91
- glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( ( Font ) null ) ) ;
91
+ glyph . RenderTo ( r , font . Size , System . Numerics . Vector2 . Zero , new TextOptions ( font ) ) ;
92
92
93
93
Assert . Equal ( 37 , r . ControlPoints . Count ) ;
94
94
Assert . Single ( r . GlyphKeys ) ;
@@ -99,14 +99,14 @@ public void LoadFont_WithWoff2Format()
99
99
[ Fact ]
100
100
public void LoadFont ( )
101
101
{
102
- FontMetrics font = StreamFontMetrics . LoadFont ( TestFonts . SimpleFontFileData ( ) ) ;
102
+ Font font = new FontCollection ( ) . Add ( TestFonts . SimpleFontFileData ( ) ) . CreateFont ( 12 ) ;
103
103
104
- Assert . Equal ( "SixLaborsSampleAB regular" , font . Description . FontNameInvariantCulture ) ;
105
- Assert . Equal ( "Regular" , font . Description . FontSubFamilyNameInvariantCulture ) ;
104
+ Assert . Equal ( "SixLaborsSampleAB regular" , font . FontMetrics . Description . FontNameInvariantCulture ) ;
105
+ Assert . Equal ( "Regular" , font . FontMetrics . Description . FontSubFamilyNameInvariantCulture ) ;
106
106
107
- GlyphMetrics glyph = font . GetGlyphMetrics ( new CodePoint ( 'a' ) , ColorFontSupport . None ) . First ( ) ;
107
+ GlyphMetrics glyph = font . FontMetrics . GetGlyphMetrics ( new CodePoint ( 'a' ) , ColorFontSupport . None ) . First ( ) ;
108
108
var r = new GlyphRenderer ( ) ;
109
- glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( ( Font ) null ) ) ;
109
+ glyph . RenderTo ( r , font . Size , System . Numerics . Vector2 . Zero , new TextOptions ( font ) ) ;
110
110
111
111
// the test font only has characters .notdef, 'a' & 'b' defined
112
112
Assert . Equal ( 6 , r . ControlPoints . Distinct ( ) . Count ( ) ) ;
@@ -115,14 +115,14 @@ public void LoadFont()
115
115
[ Fact ]
116
116
public void LoadFontWoff ( )
117
117
{
118
- FontMetrics font = StreamFontMetrics . LoadFont ( TestFonts . SimpleFontFileWoffData ( ) ) ;
118
+ Font font = new FontCollection ( ) . Add ( TestFonts . SimpleFontFileWoffData ( ) ) . CreateFont ( 12 ) ;
119
119
120
- Assert . Equal ( "SixLaborsSampleAB regular" , font . Description . FontNameInvariantCulture ) ;
121
- Assert . Equal ( "Regular" , font . Description . FontSubFamilyNameInvariantCulture ) ;
120
+ Assert . Equal ( "SixLaborsSampleAB regular" , font . FontMetrics . Description . FontNameInvariantCulture ) ;
121
+ Assert . Equal ( "Regular" , font . FontMetrics . Description . FontSubFamilyNameInvariantCulture ) ;
122
122
123
- GlyphMetrics glyph = font . GetGlyphMetrics ( new CodePoint ( 'a' ) , ColorFontSupport . None ) . First ( ) ;
123
+ GlyphMetrics glyph = font . FontMetrics . GetGlyphMetrics ( new CodePoint ( 'a' ) , ColorFontSupport . None ) . First ( ) ;
124
124
var r = new GlyphRenderer ( ) ;
125
- glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( ( Font ) null ) ) ;
125
+ glyph . RenderTo ( r , 12 , System . Numerics . Vector2 . Zero , new TextOptions ( font ) ) ;
126
126
127
127
// the test font only has characters .notdef, 'a' & 'b' defined
128
128
Assert . Equal ( 6 , r . ControlPoints . Distinct ( ) . Count ( ) ) ;
0 commit comments