in binding/SkiaSharp/SKPaint.cs [515:690]
public int CountGlyphs (string text) =>
GetFont ().CountGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.CountGlyphs)}() instead.")]
public int CountGlyphs (ReadOnlySpan<char> text) =>
GetFont ().CountGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.CountGlyphs)}() instead.")]
public int CountGlyphs (byte[] text) =>
GetFont ().CountGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.CountGlyphs)}() instead.")]
public int CountGlyphs (ReadOnlySpan<byte> text) =>
GetFont ().CountGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.CountGlyphs)}() instead.")]
public int CountGlyphs (IntPtr text, int length) =>
GetFont ().CountGlyphs (text, length, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.CountGlyphs)}() instead.")]
public int CountGlyphs (IntPtr text, IntPtr length) =>
GetFont ().CountGlyphs (text, (int)length, TextEncoding);
// GetGlyphs
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (string text) =>
GetFont ().GetGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (ReadOnlySpan<char> text) =>
GetFont ().GetGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (byte[] text) =>
GetFont ().GetGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (ReadOnlySpan<byte> text) =>
GetFont ().GetGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (IntPtr text, int length) =>
GetFont ().GetGlyphs (text, length, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphs)}() instead.")]
public ushort[] GetGlyphs (IntPtr text, IntPtr length) =>
GetFont ().GetGlyphs (text, (int)length, TextEncoding);
// ContainsGlyphs
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (string text) =>
GetFont ().ContainsGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (ReadOnlySpan<char> text) =>
GetFont ().ContainsGlyphs (text);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (byte[] text) =>
GetFont ().ContainsGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (ReadOnlySpan<byte> text) =>
GetFont ().ContainsGlyphs (text, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (IntPtr text, int length) =>
GetFont ().ContainsGlyphs (text, length, TextEncoding);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.ContainsGlyphs)}() instead.")]
public bool ContainsGlyphs (IntPtr text, IntPtr length) =>
GetFont ().ContainsGlyphs (text, (int)length, TextEncoding);
// GetGlyphPositions
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphPositions)}() instead.")]
public SKPoint[] GetGlyphPositions (string text, SKPoint origin = default) =>
GetFont ().GetGlyphPositions (text, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphPositions)}() instead.")]
public SKPoint[] GetGlyphPositions (ReadOnlySpan<char> text, SKPoint origin = default) =>
GetFont ().GetGlyphPositions (text, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphPositions)}() instead.")]
public SKPoint[] GetGlyphPositions (ReadOnlySpan<byte> text, SKPoint origin = default) =>
GetFont ().GetGlyphPositions (text, TextEncoding, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphPositions)}() instead.")]
public SKPoint[] GetGlyphPositions (IntPtr text, int length, SKPoint origin = default) =>
GetFont ().GetGlyphPositions (text, length, TextEncoding, origin);
// GetGlyphOffsets
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphOffsets)}() instead.")]
public float[] GetGlyphOffsets (string text, float origin = 0f) =>
GetFont ().GetGlyphOffsets (text, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphOffsets)}() instead.")]
public float[] GetGlyphOffsets (ReadOnlySpan<char> text, float origin = 0f) =>
GetFont ().GetGlyphOffsets (text, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphOffsets)}() instead.")]
public float[] GetGlyphOffsets (ReadOnlySpan<byte> text, float origin = 0f) =>
GetFont ().GetGlyphOffsets (text, TextEncoding, origin);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphOffsets)}() instead.")]
public float[] GetGlyphOffsets (IntPtr text, int length, float origin = 0f) =>
GetFont ().GetGlyphOffsets (text, length, TextEncoding, origin);
// GetGlyphWidths
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (string text) =>
GetFont ().GetGlyphWidths (text, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (ReadOnlySpan<char> text) =>
GetFont ().GetGlyphWidths (text, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (byte[] text) =>
GetFont ().GetGlyphWidths (text, TextEncoding, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (ReadOnlySpan<byte> text) =>
GetFont ().GetGlyphWidths (text, TextEncoding, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (IntPtr text, int length) =>
GetFont ().GetGlyphWidths (text, length, TextEncoding, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (IntPtr text, IntPtr length) =>
GetFont ().GetGlyphWidths (text, (int)length, TextEncoding, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (string text, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, out bounds, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (ReadOnlySpan<char> text, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, out bounds, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (byte[] text, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, TextEncoding, out bounds, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (ReadOnlySpan<byte> text, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, TextEncoding, out bounds, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (IntPtr text, int length, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, length, TextEncoding, out bounds, this);
[Obsolete ($"Use {nameof (SKFont)}.{nameof (SKFont.GetGlyphWidths)}() instead.")]
public float[] GetGlyphWidths (IntPtr text, IntPtr length, out SKRect[] bounds) =>
GetFont ().GetGlyphWidths (text, (int)length, TextEncoding, out bounds, this);
// GetTextIntercepts
[Obsolete ($"Use {nameof (SKTextBlob)}.{nameof (SKTextBlob.GetIntercepts)}() instead.")]
public float[] GetTextIntercepts (string text, float x, float y, float upperBounds, float lowerBounds) =>
GetTextIntercepts (text.AsSpan (), x, y, upperBounds, lowerBounds);
[Obsolete ($"Use {nameof (SKTextBlob)}.{nameof (SKTextBlob.GetIntercepts)}() instead.")]
public float[] GetTextIntercepts (ReadOnlySpan<char> text, float x, float y, float upperBounds, float lowerBounds)
{
if (text == null)
throw new ArgumentNullException (nameof (text));
using var blob = SKTextBlob.Create (text, GetFont (), new SKPoint (x, y));
return blob.GetIntercepts (upperBounds, lowerBounds, this);
}