File tree 1 file changed +31
-2
lines changed
1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,37 @@ public static object FromString(Type type, string value)
134
134
}
135
135
if ( type == typeof ( Font ) )
136
136
{
137
- Font font = new TypeConverters . FontConverter ( ) . ConvertFromInvariantString ( value ) as Font ;
138
- return Config . PrivateFontCollection . CheckFamily ( font ) ;
137
+ Font font ;
138
+
139
+ #if FRCORE || COREWIN
140
+ // This patch made for "Wix Madefor Text" font
141
+ // We manually parse font description and create font
142
+
143
+ String [ ] fontNameFields = value . Split ( ',' ) ;
144
+ if ( Config . PrivateFontCollection . HasFont ( fontNameFields [ 0 ] ) )
145
+ {
146
+ FontFamily fontFamily = new FontFamily ( fontNameFields [ 0 ] , Config . PrivateFontCollection . Collection ) ;
147
+ fontNameFields [ 1 ] = fontNameFields [ 1 ] . Replace ( "pt" , "" ) ;
148
+ float size = float . Parse ( fontNameFields [ 1 ] ) ;
149
+ if ( fontNameFields . Length == 3 )
150
+ {
151
+ fontNameFields [ 2 ] = fontNameFields [ 2 ] . Replace ( "style=" , "" ) ;
152
+ FontStyle style = ( ( FontStyle ) Enum . Parse ( typeof ( FontStyle ) , fontNameFields [ 2 ] ) ) ;
153
+ font = new Font ( fontFamily , size , style ) ;
154
+ }
155
+ else
156
+ {
157
+ font = new Font ( fontFamily , size ) ;
158
+ }
159
+ }
160
+ else
161
+ #endif
162
+ {
163
+ font = new TypeConverters . FontConverter ( ) . ConvertFromInvariantString ( value ) as Font ;
164
+ font = Config . PrivateFontCollection . CheckFamily ( font ) ;
165
+ }
166
+
167
+ return font ;
139
168
}
140
169
141
170
if ( type == typeof ( Color ) )
You can’t perform that action at this time.
0 commit comments