Flutter Engine
The Flutter Engine
line_metrics.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 double ascent,
12 double descent,
13 double unscaledAscent,
14 double height,
15 double width,
16 double left,
17 double baseline,
18 size_t lineNumber) {
19 auto metrics = new LineMetrics();
20 metrics->fHardBreak = hardBreak;
21 metrics->fAscent = ascent;
22 metrics->fDescent = descent;
23 metrics->fUnscaledAscent = unscaledAscent;
24 metrics->fHeight = height;
25 metrics->fWidth = width;
26 metrics->fLeft = left;
27 metrics->fBaseline = baseline;
28 metrics->fLineNumber = lineNumber;
29 return metrics;
30}
31
33 delete metrics;
34}
35
37 return metrics->fHardBreak;
38}
39
41 return metrics->fAscent;
42}
43
45 return metrics->fDescent;
46}
47
49 return metrics->fUnscaledAscent;
50}
51
53 return metrics->fHeight;
54}
55
57 return metrics->fWidth;
58}
59
61 return metrics->fLeft;
62}
63
65 return metrics->fBaseline;
66}
67
69 return metrics->fLineNumber;
70}
71
73 return metrics->fStartIndex;
74}
75
77 return metrics->fEndIndex;
78}
static bool left(const SkPoint &p0, const SkPoint &p1)
float SkScalar
Definition: extension.cpp:12
SKWASM_EXPORT SkScalar lineMetrics_getHeight(LineMetrics *metrics)
SKWASM_EXPORT size_t lineMetrics_getStartIndex(LineMetrics *metrics)
SKWASM_EXPORT size_t lineMetrics_getEndIndex(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getUnscaledAscent(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getAscent(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getDescent(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getLeft(LineMetrics *metrics)
SKWASM_EXPORT LineMetrics * lineMetrics_create(bool hardBreak, double ascent, double descent, double unscaledAscent, double height, double width, double left, double baseline, size_t lineNumber)
SKWASM_EXPORT void lineMetrics_dispose(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getBaseline(LineMetrics *metrics)
SKWASM_EXPORT bool lineMetrics_getHardBreak(LineMetrics *metrics)
SKWASM_EXPORT SkScalar lineMetrics_getWidth(LineMetrics *metrics)
SKWASM_EXPORT int lineMetrics_getLineNumber(LineMetrics *metrics)
int32_t height
int32_t width
#define SKWASM_EXPORT
Definition: export.h:10