Skip to content

Why TextSize != Bounds.Height? #1753

@Aleksey1555

Description

@Aleksey1555

Hello!
my code is:

string str="Good Morning 1";
SKPaint textPaint = new SKPaint
{
      Color = SKColors.Black,
      TextSize=textsize // parameter, for example 10
 };
SKRect textBounds = new SKRect();
textPaint.MeasureText(str, ref textBounds);
// And here , i expected to textBounds.Height==textSize But it does not
// textBounds={Left=-1,Top=-9,Width=72.14746,Height=13};

So, textSize=10 and Height=13 !!
The documentation say's that TextSize - is a height ot text!. But this example show's another results. (((

i need revers method or algorithm which take specified width, and will return TextSize.
Help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions