public void DebugWriteLine(ForEach <TGlyph> glyphs, ForEach <PointF> points) { var glyphStrings = glyphs.Select(g => ((int)g).ToString()); var pointStrings = points.Select(pt => $@"{pt.X} {pt.Y}"); for (int i = 0; i < glyphStrings.Count; i++) { Debug.WriteLine($" {glyphStrings[i]} {pointStrings[i]}"); } Debug.WriteLine($"glyphs {glyphStrings} {pointStrings}"); }
public void DrawGlyphsAtPoints(ForEach <TGlyph> glyphs, TFont font, ForEach <PointF> points, Color?color) { DebugWriteLine(glyphs, points); var cgPoints = points.Select(p => (CGPoint)p); var cgArray = new RentedArray <CGPoint>(cgPoints.Count); cgPoints.CopyTo(cgArray.Array); var glyphArray = new RentedArray <TGlyph>(cgPoints.Count); glyphs.CopyTo(glyphArray.Array); var ctFont = font.CtFont; if (color.HasValue) { CgContext.SetFillColor(color.Value.ToCgColor()); } ctFont.DrawGlyphs(CgContext, glyphArray.Array, cgArray.Array); cgArray.Return(); glyphArray.Return(); }