Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
strut_style.cc File Reference
#include <vector>
#include "flutter/skwasm/export.h"
#include "flutter/skwasm/live_objects.h"
#include "third_party/skia/include/core/SkString.h"
#include "third_party/skia/modules/skparagraph/include/Paragraph.h"

Go to the source code of this file.

Functions

SKWASM_EXPORT skia::textlayout::StrutStyle * strutStyle_create ()
 
SKWASM_EXPORT void strutStyle_dispose (skia::textlayout::StrutStyle *style)
 
SKWASM_EXPORT void strutStyle_setFontFamilies (skia::textlayout::StrutStyle *style, SkString **font_families, int count)
 
SKWASM_EXPORT void strutStyle_setFontSize (skia::textlayout::StrutStyle *style, SkScalar font_size)
 
SKWASM_EXPORT void strutStyle_setHeight (skia::textlayout::StrutStyle *style, SkScalar height)
 
SKWASM_EXPORT void strutStyle_setHalfLeading (skia::textlayout::StrutStyle *style, bool half_leading)
 
SKWASM_EXPORT void strutStyle_setLeading (skia::textlayout::StrutStyle *style, SkScalar leading)
 
SKWASM_EXPORT void strutStyle_setFontStyle (skia::textlayout::StrutStyle *style, int weight, SkFontStyle::Slant slant)
 
SKWASM_EXPORT void strutStyle_setForceStrutHeight (skia::textlayout::StrutStyle *style, bool force_strut_height)
 

Function Documentation

◆ strutStyle_create()

SKWASM_EXPORT skia::textlayout::StrutStyle * strutStyle_create ( )

Definition at line 12 of file strut_style.cc.

12 {
14 auto style = new skia::textlayout::StrutStyle();
15 style->setStrutEnabled(true);
16 return style;
17}
uint32_t live_strut_style_count

References Skwasm::live_strut_style_count.

◆ strutStyle_dispose()

SKWASM_EXPORT void strutStyle_dispose ( skia::textlayout::StrutStyle *  style)

Definition at line 19 of file strut_style.cc.

19 {
21 delete style;
22}

References Skwasm::live_strut_style_count.

◆ strutStyle_setFontFamilies()

SKWASM_EXPORT void strutStyle_setFontFamilies ( skia::textlayout::StrutStyle *  style,
SkString **  font_families,
int  count 
)

Definition at line 24 of file strut_style.cc.

27 {
28 std::vector<SkString> families;
29 families.reserve(count);
30 for (int i = 0; i < count; i++) {
31 families.push_back(*font_families[i]);
32 }
33 style->setFontFamilies(std::move(families));
34}

References i.

◆ strutStyle_setFontSize()

SKWASM_EXPORT void strutStyle_setFontSize ( skia::textlayout::StrutStyle *  style,
SkScalar  font_size 
)

Definition at line 36 of file strut_style.cc.

37 {
38 style->setFontSize(font_size);
39}
Scalar font_size

References font_size.

◆ strutStyle_setFontStyle()

SKWASM_EXPORT void strutStyle_setFontStyle ( skia::textlayout::StrutStyle *  style,
int  weight,
SkFontStyle::Slant  slant 
)

Definition at line 58 of file strut_style.cc.

60 {
61 style->setFontStyle(SkFontStyle(weight, SkFontStyle::kNormal_Width, slant));
62}

◆ strutStyle_setForceStrutHeight()

SKWASM_EXPORT void strutStyle_setForceStrutHeight ( skia::textlayout::StrutStyle *  style,
bool  force_strut_height 
)

Definition at line 64 of file strut_style.cc.

66 {
67 style->setForceStrutHeight(force_strut_height);
68}

◆ strutStyle_setHalfLeading()

SKWASM_EXPORT void strutStyle_setHalfLeading ( skia::textlayout::StrutStyle *  style,
bool  half_leading 
)

Definition at line 47 of file strut_style.cc.

49 {
50 style->setHalfLeading(half_leading);
51}

◆ strutStyle_setHeight()

SKWASM_EXPORT void strutStyle_setHeight ( skia::textlayout::StrutStyle *  style,
SkScalar  height 
)

Definition at line 41 of file strut_style.cc.

42 {
43 style->setHeight(height);
44 style->setHeightOverride(true);
45}
int32_t height

References height.

◆ strutStyle_setLeading()

SKWASM_EXPORT void strutStyle_setLeading ( skia::textlayout::StrutStyle *  style,
SkScalar  leading 
)

Definition at line 53 of file strut_style.cc.

54 {
55 style->setLeading(leading);
56}