@@ -158,7 +158,8 @@ protected override void ApplyStylesSelf()
158
158
var bg = computed . backgroundImage ? . Get ( 0 ) ;
159
159
160
160
TargetElement . style . backgroundImage = null ;
161
- bg ? . ResolveImage ( Context , TargetElement . layout . size , tx => {
161
+ bg ? . ResolveImage ( Context , TargetElement . layout . size , tx =>
162
+ {
162
163
if ( bg != ComputedStyle . backgroundImage ? . Get ( 0 ) ) return ;
163
164
TargetElement . style . backgroundImage = tx ? . Texture ;
164
165
} ) ;
@@ -185,15 +186,27 @@ protected override void ApplyStylesSelf()
185
186
186
187
if ( computed . HasValue ( StyleProperties . fontFamily ) )
187
188
{
188
- if ( computed . fontFamily != null ) computed . fontFamily ? . Get ( Context , x => {
189
- if ( x ? . Font != null ) TargetElement . style . unityFont = x ? . Font ;
189
+ if ( computed . fontFamily != null ) computed . fontFamily ? . Get ( Context , x =>
190
+ {
191
+ if ( x ? . Font != null )
192
+ {
193
+ TargetElement . style . unityFont = x . Font ;
190
194
#if REACT_TEXTCORE
191
- else if ( x ? . TextCoreFontAsset != null ) TargetElement . style . unityFontDefinition = FontDefinition . FromSDFFont ( x ? . TextCoreFontAsset ) ;
195
+ TargetElement . style . unityFontDefinition = FontDefinition . FromFont ( x . Font ) ;
192
196
#endif
197
+ }
193
198
#if REACT_TMP
194
- else if ( x ? . TmpFontAsset != null ) TargetElement . style . unityFont = x ? . TmpFontAsset ? . sourceFontFile ;
199
+ else if ( x ? . TmpFontAsset != null ) {
200
+ TargetElement . style . unityFont = x ? . TmpFontAsset ? . sourceFontFile ;
201
+ #if REACT_TEXTCORE
202
+ TargetElement . style . unityFontDefinition = FontDefinition . FromFont ( x ? . TmpFontAsset ? . sourceFontFile ) ;
203
+ #endif
204
+ }
195
205
#endif
196
206
else TargetElement . style. unityFont = ResourcesHelper . DefaultFont ;
207
+ #if REACT_TEXTCORE
208
+ if ( x ? . TextCoreFontAsset != null ) TargetElement . style . unityFontDefinition = FontDefinition . FromSDFFont ( x ? . TextCoreFontAsset ) ;
209
+ #endif
197
210
} ) ;
198
211
}
199
212
else TargetElement . style . unityFont = StyleKeyword . Null ;
0 commit comments