@@ -158,7 +158,8 @@ protected override void ApplyStylesSelf()
158158 var bg = computed . backgroundImage ? . Get ( 0 ) ;
159159
160160 TargetElement . style . backgroundImage = null ;
161- bg ? . ResolveImage ( Context , TargetElement . layout . size , tx => {
161+ bg ? . ResolveImage ( Context , TargetElement . layout . size , tx =>
162+ {
162163 if ( bg != ComputedStyle . backgroundImage ? . Get ( 0 ) ) return ;
163164 TargetElement . style . backgroundImage = tx ? . Texture ;
164165 } ) ;
@@ -185,15 +186,27 @@ protected override void ApplyStylesSelf()
185186
186187 if ( computed . HasValue ( StyleProperties . fontFamily ) )
187188 {
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 ;
190194#if REACT_TEXTCORE
191- else if ( x ? . TextCoreFontAsset != null ) TargetElement . style . unityFontDefinition = FontDefinition . FromSDFFont ( x ? . TextCoreFontAsset ) ;
195+ TargetElement . style . unityFontDefinition = FontDefinition . FromFont ( x . Font ) ;
192196#endif
197+ }
193198#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+ }
195205#endif
196206 else TargetElement . style. unityFont = ResourcesHelper . DefaultFont ;
207+ #if REACT_TEXTCORE
208+ if ( x ? . TextCoreFontAsset != null ) TargetElement . style . unityFontDefinition = FontDefinition . FromSDFFont ( x ? . TextCoreFontAsset ) ;
209+ #endif
197210 } ) ;
198211 }
199212 else TargetElement . style . unityFont = StyleKeyword . Null ;
0 commit comments