Flutter Engine
The Flutter Engine
Classes | Functions
bigtext.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkData.h"
#include "include/core/SkFont.h"
#include "include/core/SkFontTypes.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypeface.h"
#include "tools/Resources.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  BigTextGM
 

Functions

 DEF_SIMPLE_GM (bigtext_crbug_1370488, canvas, 512, 512)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( bigtext_crbug_1370488  ,
canvas  ,
512  ,
512   
)

Definition at line 66 of file bigtext.cpp.

66 {
67 auto typeface = ToolUtils::CreateTypefaceFromResource("fonts/SpiderSymbol.ttf");
68 const char* text = "\xEF\x80\xA1";
69 if (!typeface) {
71 text = "H";
72 }
73
74 SkFont font(typeface, 12.f);
75 canvas->translate(-1800.f, 1800.f);
76 canvas->scale(437.5f, 437.5f);
78 paint.setAntiAlias(true);
79 canvas->drawString(text, 0.f, 0.f, font, paint);
80}
Definition: SkFont.h:35
const Paint & paint
Definition: color_source.cc:38
std::u16string text
sk_sp< SkTypeface > DefaultPortableTypeface()
sk_sp< SkTypeface > CreateTypefaceFromResource(const char *resource, int ttcIndex)
font
Font Metadata and Metrics.