Flutter Engine
The Flutter Engine
strut_style.cpp
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "../export.h"
7
8using namespace skia::textlayout;
9
11 auto style = new StrutStyle();
12 style->setStrutEnabled(true);
13 return style;
14}
15
17 delete style;
18}
19
21 SkString** fontFamilies,
22 int count) {
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}
30
32 SkScalar fontSize) {
33 style->setFontSize(fontSize);
34}
35
37 style->setHeight(height);
38 style->setHeightOverride(true);
39}
40
42 bool halfLeading) {
43 style->setHalfLeading(halfLeading);
44}
45
47 style->setLeading(leading);
48}
49
51 int weight,
52 SkFontStyle::Slant slant) {
54}
55
57 bool forceStrutHeight) {
58 style->setForceStrutHeight(forceStrutHeight);
59}
int count
Definition: FontMgrTest.cpp:50
float SkScalar
Definition: extension.cpp:12
int32_t height
void setHalfLeading(bool halfLeading)
void setFontFamilies(std::vector< SkString > families)
void setFontStyle(SkFontStyle fontStyle)
void setHeight(SkScalar height)
void setLeading(SkScalar Leading)
void setFontSize(SkScalar size)
SKWASM_EXPORT StrutStyle * strutStyle_create()
Definition: strut_style.cpp:10
SKWASM_EXPORT void strutStyle_setHeight(StrutStyle *style, SkScalar height)
Definition: strut_style.cpp:36
SKWASM_EXPORT void strutStyle_setFontSize(StrutStyle *style, SkScalar fontSize)
Definition: strut_style.cpp:31
SKWASM_EXPORT void strutStyle_setLeading(StrutStyle *style, SkScalar leading)
Definition: strut_style.cpp:46
SKWASM_EXPORT void strutStyle_setFontStyle(StrutStyle *style, int weight, SkFontStyle::Slant slant)
Definition: strut_style.cpp:50
SKWASM_EXPORT void strutStyle_setFontFamilies(StrutStyle *style, SkString **fontFamilies, int count)
Definition: strut_style.cpp:20
SKWASM_EXPORT void strutStyle_setForceStrutHeight(StrutStyle *style, bool forceStrutHeight)
Definition: strut_style.cpp:56
SKWASM_EXPORT void strutStyle_setHalfLeading(StrutStyle *style, bool halfLeading)
Definition: strut_style.cpp:41
SKWASM_EXPORT void strutStyle_dispose(StrutStyle *style)
Definition: strut_style.cpp:16
#define SKWASM_EXPORT
Definition: export.h:10