Skip to content

Can to draw text at an angle using flutter? #15710

@micrcx

Description

@micrcx

For text drawing on canvas, a fairly simple construction can be used:

  void drawName(Canvas context, String name, double x, double y)
  {
    TextSpan span = new TextSpan(
        style: new TextStyle(color: Colors.blue[800], fontSize: 24.0,
        fontFamily: 'Roboto'), text: name);
    TextPainter tp = new TextPainter(
        text: span, textAlign: TextAlign.left, textDirection: TextDirection.ltr);
    tp.layout();
    tp.paint(context, new Offset(x, y));
  }

Is it possible to draw text at an angle, for example 45 degrees, or 90 degrees (vertically from the bottom up)?

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