Skip to content

Commit 23bfcb8

Browse files
committed
fix another obsolescence warning
* by commenting out code * warning CS0618: 'SKPaint.TextEncoding' is obsolete: 'Use SKTextEncoding method overloads instead.' * note: SKPaint.TextEncoding is not set anywhere, i.e. it always stays at the default value (which per documentation is Utf8)
1 parent bb77acb commit 23bfcb8

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

Source/OxyPlot.Maui.Skia/SkiaRenderContext.cs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -912,20 +912,21 @@ private float MeasureText(string text, SKShaper shaper, SKFont font)
912912
// we have to get a bit creative here as SKShaper does not offer a direct overload for this.
913913
// see also https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.HarfBuzz/SkiaSharp.HarfBuzz.Shared/SKShaper.cs
914914
using var buffer = new HarfBuzzSharp.Buffer();
915-
switch (paint.TextEncoding)
916-
{
917-
case SKTextEncoding.Utf8:
918-
buffer.AddUtf8(text);
919-
break;
920-
case SKTextEncoding.Utf16:
921-
buffer.AddUtf16(text);
922-
break;
923-
case SKTextEncoding.Utf32:
924-
buffer.AddUtf32(text);
925-
break;
926-
default:
927-
throw new NotSupportedException("TextEncoding is not supported.");
928-
}
915+
916+
// switch (paint.TextEncoding)
917+
// {
918+
// case SKTextEncoding.Utf8:
919+
buffer.AddUtf8(text);
920+
// break;
921+
// case SKTextEncoding.Utf16:
922+
// buffer.AddUtf16(text);
923+
// break;
924+
// case SKTextEncoding.Utf32:
925+
// buffer.AddUtf32(text);
926+
// break;
927+
// default:
928+
// throw new NotSupportedException("TextEncoding is not supported.");
929+
// }
929930

930931
buffer.GuessSegmentProperties();
931932
shaper.Shape(buffer, font);

0 commit comments

Comments
 (0)