cull(engine-cleanup): pass-9 cascade round 1 after NGUIText stub
This commit is contained in:
@@ -18,28 +18,8 @@ public class BMGlyph
|
||||
|
||||
public int offsetY;
|
||||
|
||||
public int advance;
|
||||
|
||||
public int channel;
|
||||
|
||||
public List<int> kerning;
|
||||
|
||||
public int GetKerning(int previousChar)
|
||||
{
|
||||
if (kerning != null && previousChar != 0)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = kerning.Count; i < count; i += 2)
|
||||
{
|
||||
if (kerning[i] == previousChar)
|
||||
{
|
||||
return kerning[i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void Trim(int xMin, int yMin, int xMax, int yMax)
|
||||
{
|
||||
int num = x + width;
|
||||
|
||||
@@ -509,10 +509,4 @@ public static class Global
|
||||
string textLanguage = CustomPreference.GetTextLanguage();
|
||||
return AlphabetLanguageNames.Contains(textLanguage);
|
||||
}
|
||||
|
||||
public static bool IsWordBreakLanguage()
|
||||
{
|
||||
string textLanguage = CustomPreference.GetTextLanguage();
|
||||
return WordBreakLanguageNames.Contains(textLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,28 +78,6 @@ public static class NGUIMath
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
[DebuggerStepThrough]
|
||||
public static string DecimalToHex24(int num)
|
||||
{
|
||||
num &= 0xFFFFFF;
|
||||
return num.ToString("X6");
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
[DebuggerStepThrough]
|
||||
public static string DecimalToHex32(int num)
|
||||
{
|
||||
return num.ToString("X8");
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
[DebuggerStepThrough]
|
||||
public static int ColorToInt(Color c)
|
||||
{
|
||||
return 0 | (Mathf.RoundToInt(c.r * 255f) << 24) | (Mathf.RoundToInt(c.g * 255f) << 16) | (Mathf.RoundToInt(c.b * 255f) << 8) | Mathf.RoundToInt(c.a * 255f);
|
||||
}
|
||||
|
||||
public static Rect ConvertToTexCoords(Rect rect, int width, int height)
|
||||
{
|
||||
Rect result = rect;
|
||||
|
||||
@@ -20,14 +20,12 @@ public static class NGUIText
|
||||
public Vector2 u2;
|
||||
public Vector2 u3;
|
||||
public float advance;
|
||||
public bool rotated;
|
||||
public int channel;
|
||||
}
|
||||
|
||||
// Static fields — defaults matching original initializers
|
||||
public static UIFont bitmapFont;
|
||||
public static UnityEngine.Font dynamicFont;
|
||||
public static GlyphInfo glyph = new GlyphInfo();
|
||||
public static int fontSize = 16;
|
||||
public static float fontScale = 1f;
|
||||
public static float pixelDensity = 1f;
|
||||
@@ -50,7 +48,6 @@ public static class NGUIText
|
||||
public static int finalSize = 0;
|
||||
public static float finalSpacingX = 0f;
|
||||
public static float finalLineHeight = 0f;
|
||||
public static float baseline = 0f;
|
||||
public static bool useSymbols = false;
|
||||
|
||||
// Static methods — all no-ops or default returns
|
||||
@@ -58,20 +55,15 @@ public static class NGUIText
|
||||
public static void Update(bool request, UIWidget.Pivot piv) { }
|
||||
public static void Prepare(string text) { }
|
||||
public static BMSymbol GetSymbol(string text, int index, int textLength) => null;
|
||||
public static float GetGlyphWidth(int ch, int prev) => 0f;
|
||||
public static GlyphInfo GetGlyph(int ch, int prev) => null;
|
||||
public static Color ParseColor24(string text, int offset) => Color.white;
|
||||
public static Color ParseColor32(string text, int offset) => Color.white;
|
||||
public static string EncodeColor(Color c) => "";
|
||||
public static string EncodeColor24(Color c) => "";
|
||||
public static string EncodeColor32(Color c) => "";
|
||||
public static bool ParseSymbol(string text, ref int index) => false;
|
||||
public static bool IsHex(char ch) => false;
|
||||
public static string StripSymbols(string text) => text;
|
||||
public static void Align(BetterList<Vector3> verts, int indexOffset, float printedWidth, int elements = 4) { }
|
||||
public static int GetExactCharacterIndex(BetterList<Vector3> verts, BetterList<int> indices, Vector2 pos) => 0;
|
||||
public static int GetApproximateCharacterIndex(BetterList<Vector3> verts, BetterList<int> indices, Vector2 pos) => 0;
|
||||
public static void EndLine(ref StringBuilder s) { }
|
||||
public static Vector2 CalculatePrintedSize(string text) => Vector2.zero;
|
||||
public static int CalculateOffsetToFit(string text) => 0;
|
||||
public static bool WrapText(string text, out string finalText, bool wrapLineColors = false) { finalText = text; return false; }
|
||||
|
||||
@@ -610,37 +610,4 @@ public class UIFont : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BMSymbol MatchSymbol(string text, int offset, int textLength)
|
||||
{
|
||||
int count = mSymbols.Count;
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
textLength -= offset;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
BMSymbol bMSymbol = mSymbols[i];
|
||||
int length = bMSymbol.length;
|
||||
if (length == 0 || textLength < length)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool flag = true;
|
||||
for (int j = 0; j < length; j++)
|
||||
{
|
||||
if (text[offset + j] != bMSymbol.sequence[j])
|
||||
{
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag && bMSymbol.Validate(atlas))
|
||||
{
|
||||
return bMSymbol;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,6 @@ public static class RubyText
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool ParseSymbol(string text, ref int index, BetterList<Color> colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor)
|
||||
{
|
||||
float rubyTotalAdvanceRaw = 0f;
|
||||
float charWithRubyTotalAdvance = 0f;
|
||||
bool isDot = false;
|
||||
return ParseSymbol(text, ref index, colors, premultiply, ref sub, ref bold, ref italic, ref underline, ref strike, ref ignoreColor, ref rubyTotalAdvanceRaw, ref charWithRubyTotalAdvance, isRuby: false, ref isDot);
|
||||
}
|
||||
|
||||
private static bool ParseSymbol(string text, ref int index, BetterList<Color> colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor, ref float rubyTotalAdvanceRaw, ref float charWithRubyTotalAdvance, bool isRuby, ref bool isDot)
|
||||
{
|
||||
int length = text.Length;
|
||||
|
||||
Reference in New Issue
Block a user