Flutter Engine
The Flutter Engine
Functions
text_scale_skew.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/utils/SkTextUtils.h"
#include "tools/fonts/FontToolUtils.h"
#include <initializer_list>

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (text_scale_skew, canvas, 256, 128)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( text_scale_skew  ,
canvas  ,
256  ,
128   
)

Definition at line 19 of file text_scale_skew.cpp.

19 {
20 SkPaint p;
21 p.setAntiAlias(true);
23 font.setSize(18.0f);
24 float y = 10.0f;
25 for (float scale : { 0.5f, 0.71f, 1.0f, 1.41f, 2.0f }) {
26 font.setScaleX(scale);
27 y += font.getSpacing();
28 float x = 50.0f;
29 for (float skew : { -0.5f, 0.0f, 0.5f }) {
30 font.setSkewX(skew);
32 x += 78.0f;
33 }
34 }
35}
Definition: SkFont.h:35
static void DrawString(SkCanvas *canvas, const char text[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint, Align align=kLeft_Align)
Definition: SkTextUtils.h:34
double y
double x
SkFont DefaultPortableFont()
font
Font Metadata and Metrics.
const Scalar scale