Exemplo n.º 1
0
        public float GetTypographicWidth(TFont font, AttributedGlyphRun <TFont, TGlyph> run)
        {
            var aString = run.ToNsAttributedString();

            using (var ctLine = new CTLine(aString))
                return((float)ctLine.GetTypographicBounds());
        }
Exemplo n.º 2
0
 public void DrawGlyphRunWithOffset(AttributedGlyphRun <TFont, TGlyph> run, PointF offset, Color?color)
 {
     DebugWriteLine($"Text {run} {offset.X} {offset.Y}");
     CgContext.TextPosition = new CGPoint(CgContext.TextPosition.X + offset.X, CgContext.TextPosition.Y + offset.Y);
     if (color.HasValue)
     {
         CgContext.SetFillColor(color.Value.ToCgColor());
     }
     using (var textLine = new CTLine(run.ToNsAttributedString()))
         textLine.Draw(CgContext);
 }
Exemplo n.º 3
0
 public void DrawGlyphRunWithOffset(AttributedGlyphRun <TFont, TGlyph> run, PointF offset, Color?color)
 {
     CgContext.TextPosition = new CGPoint
                                  (CgContext.TextPosition.X + offset.X, CgContext.TextPosition.Y + offset.Y);
     if (color.HasValue)
     {
         CgContext.SetFillColor(color.GetValueOrDefault().ToCGColor());
     }
     using var textLine = new CTLine(run.ToNsAttributedString());
     textLine.Draw(CgContext);
 }