public IEnumerable <RectangleF> GetBoundingRectsForGlyphs(TFont font, IEnumerable <TGlyph> glyphs, int nVariants) { using var glyphArray = new Structures.RentedArray <TGlyph>(glyphs, nVariants); var rects = new CGRect[nVariants]; font.CtFont.GetBoundingRects(CTFontOrientation.Horizontal, glyphArray.Result.Array, rects, nVariants); return(rects.Select(rect => (RectangleF)rect)); }
public RectangleF[] GetBoundingRectsForGlyphs(TFont font, TGlyph[] glyphs) { CTFont ctFont = font.CtFont; int nVariants = glyphs.Length; CGRect[] rects = new CGRect[nVariants]; ctFont.GetBoundingRects(CTFontOrientation.Horizontal, glyphs, rects, nVariants); RectangleF[] r = rects.Select(rect => (RectangleF)rect).ToArray(); return(r); }
public IEnumerable <RectangleF> GetBoundingRectsForGlyphs(TFont font, ForEach <TGlyph> glyphs, int nVariants) { var glyphArray = new TGlyph[nVariants]; glyphs.CopyTo(glyphArray); var rects = new CGRect[nVariants]; font.CtFont.GetBoundingRects(CTFontOrientation.Horizontal, glyphArray, rects, nVariants); return(rects.Select(rect => (RectangleF)rect)); }