public int GetAscent(String text) { int max = 0; char[] chars = text.ToCharArray(); for (int k = 0; k < chars.Length; ++k) { int[] bbox = GetCharBBox(chars[k]); if (bbox != null && bbox[3] > max) max = bbox[3]; } return max; }