Seperate matcher from font manager.
This commit is contained in:
@@ -11,17 +11,17 @@ namespace Cryville.Common.Unity.UI {
|
||||
[RequireComponent(typeof(TextMeshProUGUI))]
|
||||
public class TMPAutoFont : MonoBehaviour {
|
||||
public static Shader DefaultShader;
|
||||
public static FontManager FontManager;
|
||||
public static FontMatcher FontMatcher;
|
||||
static FontAsset _font;
|
||||
TextMeshProUGUI _text;
|
||||
|
||||
[SerializeField]
|
||||
Shader m_shader;
|
||||
void Awake() {
|
||||
if (FontManager == null) return;
|
||||
if (FontMatcher == null) return;
|
||||
_text = GetComponent<TextMeshProUGUI>();
|
||||
if (_font == null) {
|
||||
foreach (var typeface in FontManager.MatchScript()) {
|
||||
foreach (var typeface in FontMatcher.MatchScript(null, true)) {
|
||||
try {
|
||||
var _ifont = new IFont(typeface.File.FullName);
|
||||
_font = (FontAsset)typeof(FontAsset).GetMethod("CreateFontAsset", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(IFont), typeof(int), typeof(int), typeof(int), typeof(GlyphRenderMode), typeof(int), typeof(int), typeof(AtlasPopulationMode), typeof(bool) },
|
||||
|
Reference in New Issue
Block a user