Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions
fontregen.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFont.h"
#include "include/core/SkFontMgr.h"
#include "include/core/SkFontStyle.h"
#include "include/core/SkFontTypes.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTextBlob.h"
#include "include/core/SkTypeface.h"
#include "include/core/SkTypes.h"
#include "include/gpu/GrContextOptions.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/GrRecordingContext.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  FontRegenGM
 
class  BadAppleGM
 

Typedefs

using MaskFormat = skgpu::MaskFormat
 

Functions

static sk_sp< SkTextBlobmake_blob (const SkString &text, const SkFont &font)
 

Typedef Documentation

◆ MaskFormat

Definition at line 45 of file fontregen.cpp.

Function Documentation

◆ make_blob()

static sk_sp< SkTextBlob > make_blob ( const SkString text,
const SkFont font 
)
static

Definition at line 47 of file fontregen.cpp.

47 {
48 size_t len = text.size();
51
52 font.textToGlyphs(text.c_str(), len, SkTextEncoding::kUTF8, glyphs.get(), len);
53 font.getXPos(glyphs.get(), len, pos.get());
54 return SkTextBlob::MakeFromPosTextH(text.c_str(), len, pos.get(), 0, font);
55}
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46
SkPoint pos
@ kUTF8
uses bytes to represent UTF-8 or ASCII
static sk_sp< SkTextBlob > MakeFromPosTextH(const void *text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
Definition: SkTextBlob.cpp:817
std::u16string text
font
Font Metadata and Metrics.