using System; using System.Collections.Generic; using UnityEngine; namespace FairyGUI { /// /// Base class for all kind of fonts. /// public class BaseFont { /// /// The name of this font object. /// public string name; /// /// The texture of this font object. /// public NTexture mainTexture; /// /// Can this font be tinted? Will be true for dynamic font and fonts generated by BMFont. /// public bool canTint; /// /// If true, it will use extra vertices to enhance bold effect /// public bool customBold; /// /// If true, it will use extra vertices to enhance bold effect ONLY when it is in italic style. /// public bool customBoldAndItalic; /// /// If true, it will use extra vertices(4 direction) to enhance outline effect /// public bool customOutline; /// /// The shader for this font object. /// public string shader; /// /// Keep text crisp. /// public bool keepCrisp; /// /// /// public int version; protected internal static bool textRebuildFlag; protected const float SupScale = 0.58f; protected const float SupOffset = 0.33f; virtual public void UpdateGraphics(NGraphics graphics) { } virtual public void SetFormat(TextFormat format, float fontSizeScale) { } virtual public void PrepareCharacters(string text) { } virtual public bool GetGlyph(char ch, out float width, out float height, out float baseline) { width = 0; height = 0; baseline = 0; return false; } virtual public int DrawGlyph(float x, float y, List vertList, List uvList, List uv2List, List colList) { return 0; } virtual public int DrawLine(float x, float y, float width, int fontSize, int type, List vertList, List uvList, List uv2List, List colList) { return 0; } virtual public bool HasCharacter(char ch) { return false; } virtual public int GetLineHeight(int size) { return 0; } virtual public void Dispose() { } } }