FairyGUI.BitmapFont.GetGlyphSize C# (CSharp) Method

GetGlyphSize() public method

public GetGlyphSize ( char ch, float &width, float &height ) : bool
ch char
width float
height float
return bool
        public override bool GetGlyphSize(char ch, out float width, out float height)
        {
            BMGlyph bg;
            if (ch == ' ')
            {
                width = Mathf.CeilToInt(size * scale / 2);
                height = Mathf.CeilToInt(size * scale);
                return true;
            }
            else if (_dict.TryGetValue((int)ch, out bg))
            {
                width = Mathf.CeilToInt(bg.advance * scale);
                height = Mathf.CeilToInt(bg.lineHeight * scale);
                return true;
            }
            else
            {
                width = 0;
                height = 0;
                return false;
            }
        }

Usage Example

 static public int GetGlyphSize(IntPtr l)
 {
     try {
         FairyGUI.BitmapFont self = (FairyGUI.BitmapFont)checkSelf(l);
         System.Char         a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         System.Int32 a3;
         var          ret = self.GetGlyphSize(a1, out a2, out a3);
         pushValue(l, true);
         pushValue(l, ret);
         pushValue(l, a2);
         pushValue(l, a3);
         return(4);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }