Flutter Engine
The Flutter Engine
Functions
strut_style.cpp File Reference
#include "../export.h"
#include "third_party/skia/modules/skparagraph/include/Paragraph.h"

Go to the source code of this file.

Functions

SKWASM_EXPORT StrutStylestrutStyle_create ()
 
SKWASM_EXPORT void strutStyle_dispose (StrutStyle *style)
 
SKWASM_EXPORT void strutStyle_setFontFamilies (StrutStyle *style, SkString **fontFamilies, int count)
 
SKWASM_EXPORT void strutStyle_setFontSize (StrutStyle *style, SkScalar fontSize)
 
SKWASM_EXPORT void strutStyle_setHeight (StrutStyle *style, SkScalar height)
 
SKWASM_EXPORT void strutStyle_setHalfLeading (StrutStyle *style, bool halfLeading)
 
SKWASM_EXPORT void strutStyle_setLeading (StrutStyle *style, SkScalar leading)
 
SKWASM_EXPORT void strutStyle_setFontStyle (StrutStyle *style, int weight, SkFontStyle::Slant slant)
 
SKWASM_EXPORT void strutStyle_setForceStrutHeight (StrutStyle *style, bool forceStrutHeight)
 

Function Documentation

◆ strutStyle_create()

SKWASM_EXPORT StrutStyle * strutStyle_create ( )

Definition at line 10 of file strut_style.cpp.

10 {
11 auto style = new StrutStyle();
12 style->setStrutEnabled(true);
13 return style;
14}

◆ strutStyle_dispose()

SKWASM_EXPORT void strutStyle_dispose ( StrutStyle style)

Definition at line 16 of file strut_style.cpp.

16 {
17 delete style;
18}

◆ strutStyle_setFontFamilies()

SKWASM_EXPORT void strutStyle_setFontFamilies ( StrutStyle style,
SkString **  fontFamilies,
int  count 
)

Definition at line 20 of file strut_style.cpp.

22 {
23 std::vector<SkString> families;
24 families.reserve(count);
25 for (int i = 0; i < count; i++) {
26 families.push_back(*fontFamilies[i]);
27 }
28 style->setFontFamilies(std::move(families));
29}
int count
Definition: FontMgrTest.cpp:50
void setFontFamilies(std::vector< SkString > families)

◆ strutStyle_setFontSize()

SKWASM_EXPORT void strutStyle_setFontSize ( StrutStyle style,
SkScalar  fontSize 
)

Definition at line 31 of file strut_style.cpp.

32 {
33 style->setFontSize(fontSize);
34}
void setFontSize(SkScalar size)

◆ strutStyle_setFontStyle()

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

Definition at line 50 of file strut_style.cpp.

52 {
54}
void setFontStyle(SkFontStyle fontStyle)

◆ strutStyle_setForceStrutHeight()

SKWASM_EXPORT void strutStyle_setForceStrutHeight ( StrutStyle style,
bool  forceStrutHeight 
)

Definition at line 56 of file strut_style.cpp.

57 {
58 style->setForceStrutHeight(forceStrutHeight);
59}

◆ strutStyle_setHalfLeading()

SKWASM_EXPORT void strutStyle_setHalfLeading ( StrutStyle style,
bool  halfLeading 
)

Definition at line 41 of file strut_style.cpp.

42 {
43 style->setHalfLeading(halfLeading);
44}
void setHalfLeading(bool halfLeading)

◆ strutStyle_setHeight()

SKWASM_EXPORT void strutStyle_setHeight ( StrutStyle style,
SkScalar  height 
)

Definition at line 36 of file strut_style.cpp.

36 {
37 style->setHeight(height);
38 style->setHeightOverride(true);
39}
int32_t height
void setHeight(SkScalar height)

◆ strutStyle_setLeading()

SKWASM_EXPORT void strutStyle_setLeading ( StrutStyle style,
SkScalar  leading 
)

Definition at line 46 of file strut_style.cpp.

46 {
47 style->setLeading(leading);
48}
void setLeading(SkScalar Leading)