BreakText returns incorrect number of characters if text contains cyrillic characters

ConstantinConstantin RUMember ✭✭

Hello!

Please, see PaintSurface code in attached file.

Thanks.

Posts

  • mattleibowmattleibow ZAXamarin Team Xamurai

    Moving this to the GitHub issue as this is a "bug" with both the docs and the managed perception, but still is functioning as designed: https://github.com/mono/SkiaSharp/issues/381

  • ConstantinConstantin RUMember ✭✭

    Matthew, thank you!
    "The return value is actually the NUMBER OF BYTES in the string, that is why you see the larger numbers."
    This code can work and that's Ok:

        textPaint.TextEncoding = SKTextEncoding.Utf16;
        ...
        var l = textPaint.BreakText(t, maxw, out mw) >> 1;
    
Sign In or Register to comment.