First time actually trekking through an assets code has paid off.
If you have this issue go into NGUIText.cs (Btw this is an older version of NGUI) and modify this function
static public void Print (Font font, string text, BetterList<Vector3> verts, BetterList<Vector2> uvs, BetterList<Color32> cols)
{
if (font == null || string.IsNullOrEmpty(text)) return;
int size = current.finalSize;
int indexOffset = verts.size;
float lineHeight = size + current.finalSpacingY;
// We need to know the baseline first
font.RequestCharactersInTexture("j", size, current.style);
font.GetCharacterInfo('j', out mTempChar, size, current.style);
// This is pretty much a hack, in case you're wondering. Unity doesn't expose a way to retrieve the baseline in a clean fashion.
float baseline = mTempChar.vert.yMin + (Mathf.RoundToInt(size - Mathf.Abs(mTempChar.vert.height)) >> 1);
// Ensure that the text we're about to print exists in the font's texture
font.RequestCharactersInTexture(text, size, current.style);
// Start with the white tint
mColors.Add(Color.white);
float x = 0f;
float y = 0f;
float maxX = 0f;
float spacingX = current.finalSpacingX;
float pixelSize = 1f / current.pixelDensity;
float sizeF = size;
Vector3 v0 = Vector3.zero, v1 = Vector3.zero;
Vector2 u0 = Vector2.zero, u1 = Vector2.zero;
Color gb = current.tint * current.gradientBottom;
Color gt = current.tint * current.gradientTop;
Color32 uc = current.tint;
int textLength = text.Length;
for (int i = 0; i < textLength; ++i)
{
char c = text[i];
if (c == '\n')
{
if (x > maxX) maxX = x;
if (current.alignment != TextAlignment.Left)
{
Align(verts, indexOffset, x - spacingX);
indexOffset = verts.size;
}
x = 0;
//Modified by Andrew Blakely 2013 or HeIIoKitty at Github.com
//After running through this code, looking everywhere for the issue,
//I found that while in printing, for this version of NGUI, it placed a new line above the the old line causing the text
//to usually give an undesired effect
//OLD CODE: y += lineHeight;
y -= lineHeight;
continue;
}
if (c < ' ') continue;
// Color changing symbol
if (current.encoding ParseSymbol(text, ref i, mColors, current.premultiply))
{
Color fc = current.tint * mColors[mColors.size - 1];
uc = fc;
if (current.gradient)
{
gb = current.gradientBottom * fc;
gt = current.gradientTop * fc;
}
--i;
continue;
}
if (!font.GetCharacterInfo(c, out mTempChar, size, current.style))
continue;
v0.x = x + mTempChar.vert.xMin;
v0.y = y + mTempChar.vert.yMax - baseline;
v1.x = v0.x + mTempChar.vert.width;
v1.y = v0.y - mTempChar.vert.height;
if (pixelSize != 1f)
{
v0 *= pixelSize;
v1 *= pixelSize;
}
u0.x = mTempChar.uv.xMin;
u0.y = mTempChar.uv.yMin;
u1.x = mTempChar.uv.xMax;
u1.y = mTempChar.uv.yMax;
x += (mTempChar.width + spacingX);
verts.Add(new Vector3(v1.x, v0.y));
verts.Add(new Vector3(v0.x, v0.y));
verts.Add(new Vector3(v0.x, v1.y));
verts.Add(new Vector3(v1.x, v1.y));
if (mTempChar.flipped)
{
uvs.Add(new Vector2(u0.x, u1.y));
uvs.Add(new Vector2(u0.x, u0.y));
uvs.Add(new Vector2(u1.x, u0.y));
uvs.Add(new Vector2(u1.x, u1.y));
}
else
{
uvs.Add(new Vector2(u1.x, u0.y));
uvs.Add(new Vector2(u0.x, u0.y));
uvs.Add(new Vector2(u0.x, u1.y));
uvs.Add(new Vector2(u1.x, u1.y));
}
if (current.gradient)
{
float min = sizeF - (-mTempChar.vert.yMax + baseline);
float max = min - (mTempChar.vert.height);
min /= sizeF;
max /= sizeF;
s_c0 = Color.Lerp(gb, gt, min);
s_c1 = Color.Lerp(gb, gt, max);
cols.Add(s_c0);
cols.Add(s_c0);
cols.Add(s_c1);
cols.Add(s_c1);
}
else for (int b = 0; b < 4; ++b) cols.Add(uc);
}
if (current.alignment != TextAlignment.Left indexOffset < verts.size)
{
Align(verts, indexOffset, x - spacingX);
indexOffset = verts.size;
}
mColors.Clear();
}
… and make the modifications that are commented around line 50.