Skip to content

Commit

Permalink
TMP字体渲染修正,使用字体资源获取字库纹理的尺寸,避免通过程序创建的资源取到字体纹理尺寸为0导致阴影效果渲染有误的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Jul 11, 2024
1 parent 2379325 commit d77021f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/Extensions/TextMeshPro/TMPFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void Init()

void OnCreateNewMaterial(Material mat)
{
mat.SetFloat(ShaderUtilities.ID_TextureWidth, mainTexture.width);
mat.SetFloat(ShaderUtilities.ID_TextureHeight, mainTexture.height);
mat.SetFloat(ShaderUtilities.ID_TextureWidth, fontAsset.atlasWidth);
mat.SetFloat(ShaderUtilities.ID_TextureHeight, fontAsset.atlasHeight);
mat.SetFloat(ShaderUtilities.ID_GradientScale, _gradientScale);
mat.SetFloat(ShaderUtilities.ID_WeightNormal, fontAsset.normalStyle);
mat.SetFloat(ShaderUtilities.ID_WeightBold, fontAsset.boldStyle);
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Utils/Html/HtmlPageContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace FairyGUI.Utils
Expand Down

0 comments on commit d77021f

Please sign in to comment.