FairyGUI.DynamicFont.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)
        {
            if (_font.GetCharacterInfo(ch, out sTempChar, _size, _style))
            {
            #if UNITY_5
                width = sTempChar.advance;
            #else
                width = Mathf.CeilToInt(sTempChar.width);
            #endif
                height = sTempChar.size;
                if (customBold)
                    width++;

                if (keepCrisp)
                {
                    width /= UIContentScaler.scaleFactor;
                    height /= UIContentScaler.scaleFactor;
                }

                return true;
            }
            else
            {
                width = 0;
                height = 0;
                return false;
            }
        }

Usage Example

 static public int GetGlyphSize(IntPtr l)
 {
     try {
         FairyGUI.DynamicFont self = (FairyGUI.DynamicFont)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));
     }
 }