| Flutter Impeller |

glyph_info.cc
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 "impeller/toolkit/interop/glyph_info.h"
6
7 namespace impeller::interop {
8
9 GlyphInfo::~GlyphInfo() = default;
10
11 size_t GlyphInfo::GetGraphemeClusterCodeUnitRangeBegin() const {
12 return info_.fGraphemeClusterTextRange.start;
13 }
14
15 size_t GlyphInfo::GetGraphemeClusterCodeUnitRangeEnd() const {
16 return info_.fGraphemeClusterTextRange.end;
17 }
18
19 ImpellerRect GlyphInfo::GetGraphemeClusterBounds() const {
20 return ImpellerRect{
21 info_.fGraphemeLayoutBounds.y(),
22 info_.fGraphemeLayoutBounds.x(),
23 info_.fGraphemeLayoutBounds.width(),
24 info_.fGraphemeLayoutBounds.height(),
25 };
26 }
27
28 bool GlyphInfo::IsEllipsis() const {
29 return info_.fIsEllipsis;
30 }
31
32 ImpellerTextDirection GlyphInfo::GetTextDirection() const {
33 switch (info_.fDirection) {
34 case skia::textlayout::TextDirection::kRtl:
35 return kImpellerTextDirectionRTL;
36 case skia::textlayout::TextDirection::kLtr:
37 return kImpellerTextDirectionLTR;
38 }
39 return kImpellerTextDirectionLTR;
40 }
41
42 } // namespace impeller::interop
impeller::interop::GlyphInfo::~GlyphInfo
~GlyphInfo()
impeller::interop::GlyphInfo::GetTextDirection
ImpellerTextDirection GetTextDirection() const
Definition: glyph_info.cc:32
impeller::interop::GlyphInfo::IsEllipsis
bool IsEllipsis() const
Definition: glyph_info.cc:28
impeller::interop::GlyphInfo::GetGraphemeClusterCodeUnitRangeBegin
size_t GetGraphemeClusterCodeUnitRangeBegin() const
Definition: glyph_info.cc:11
impeller::interop::GlyphInfo::GetGraphemeClusterBounds
ImpellerRect GetGraphemeClusterBounds() const
Definition: glyph_info.cc:19
impeller::interop::GlyphInfo::GetGraphemeClusterCodeUnitRangeEnd
size_t GetGraphemeClusterCodeUnitRangeEnd() const
Definition: glyph_info.cc:15
glyph_info.h
ImpellerTextDirection
ImpellerTextDirection
Definition: impeller.h:470
kImpellerTextDirectionLTR
@ kImpellerTextDirectionLTR
Definition: impeller.h:472
kImpellerTextDirectionRTL
@ kImpellerTextDirectionRTL
Definition: impeller.h:471
impeller::interop
Definition: context_gles.cc:12
ImpellerRect
Definition: impeller.h:478