EmojiFont, EmojiCheck: OTL_FeatureTag lives in UnityEngine.TextCore; kerning read from the serialized m_enableKerning

Compiles (Unity 6000.3.24f1 batchmode). Fixes the previous commit, which did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 04:36:52 +02:00
commit 6d2d52c529
2 changed files with 4 additions and 3 deletions

View file

@ -99,7 +99,7 @@ public static class EmojiCheck
var runtime = new GameObject("Runtime", typeof(RectTransform));
runtime.transform.SetParent(canvas.transform, false);
runtimeLiga = runtime.AddComponent<TextMeshProUGUI>().fontFeatures
.Contains(UnityEngine.TextCore.LowLevel.OTL_FeatureTag.liga) ? 1 : 0;
.Contains(UnityEngine.TextCore.OTL_FeatureTag.liga) ? 1 : 0;
if (runtimeLiga == 0) failures.Add("a TextMeshProUGUI added at runtime does not have liga: TMP Settings' features are not inherited");
// Sequences: space-separated groups, each of which must end as one visible character.
@ -155,7 +155,7 @@ public static class EmojiCheck
EmojiFont.VisitSerializedTexts(component =>
{
texts++;
if (!component.fontFeatures.Contains(UnityEngine.TextCore.LowLevel.OTL_FeatureTag.liga))
if (!component.fontFeatures.Contains(UnityEngine.TextCore.OTL_FeatureTag.liga))
{
withoutLiga++;
failures.Add($"TMP text {component.name} has no liga: {GetPath(component)}");

View file

@ -5,6 +5,7 @@ using TMPro;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.TextCore;
using UnityEngine.TextCore.LowLevel;
// The one writer of the emoji font asset and of TMP Settings' emoji routing. The font file is the
@ -94,7 +95,7 @@ public static class EmojiFont
var (files, components) = VisitSerializedTexts(text =>
{
var features = text.fontFeatures.ToList();
if (!Enable(features, text.enableKerning)) return false;
if (!Enable(features, new SerializedObject(text).FindProperty("m_enableKerning").boolValue)) return false;
text.fontFeatures = features;
EditorUtility.SetDirty(text);
return true;