Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
scaledemoji.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/SkFontMetrics.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 "src/base/SkUTF.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"
#include <string.h>
#include <initializer_list>

Go to the source code of this file.

Classes

class  skiagm::ScaledEmojiGM
 
class  skiagm::ScaledEmojiPosGM
 
class  skiagm::ScaledEmojiPerspectiveGM
 

Namespaces

namespace  skiagm
 

Functions

static sk_sp< SkTextBlobmake_hpos_test_blob_utf8 (const char *text, const SkFont &font)
 

Function Documentation

◆ make_hpos_test_blob_utf8()

static sk_sp< SkTextBlob > make_hpos_test_blob_utf8 ( const char *  text,
const SkFont font 
)
static

Definition at line 28 of file scaledemoji.cpp.

28 {
31 size_t len = strlen(text);
32 int glyphCount = font.countText(text, len, enc);
33 const auto& buffer = builder.allocRunPosH(font, glyphCount, 0);
34 (void)font.textToGlyphs(text, len, enc, buffer.glyphs, glyphCount);
35 font.getXPos(buffer.glyphs, glyphCount, buffer.pos);
36 return builder.make();
37}
SkTextEncoding
Definition SkFontTypes.h:11
@ kUTF8
uses bytes to represent UTF-8 or ASCII
static const uint8_t buffer[]
std::u16string text
font
Font Metadata and Metrics.