auto paint = SkPaint{}; paint.setTextAlign(SkPaint::kLeft_Align); canvas->drawText("Hello, World!", 10, 20, paint);
auto paint = SkPaint{}; paint.setTextAlign(SkPaint::kRight_Align); canvas->drawText("Hello, World!", 10, 20, paint);
auto paint = SkPaint{}; paint.setTextAlign(SkPaint::kCenter_Align); canvas->drawText("Hello, World!", 10, 20, paint);This code will draw "Hello, World!" on a canvas starting from position (10, 20). Since the alignment is set to center, the center of the text will be at position (10, 20), with the rest of the text extending equally towards the left and the right. Package Library: The SkPaint library is part of Skia Graphics Library.