Flutter Engine
The Flutter Engine
third_party
skia
src
pdf
SkClusterator.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
#ifndef SkClusterator_DEFINED
8
#define SkClusterator_DEFINED
9
10
#include <cstdint>
11
12
namespace
sktext
{
13
class
GlyphRun;
14
}
15
16
/** Given the m-to-n glyph-to-character mapping data (as returned by
17
harfbuzz), iterate over the clusters. */
18
class
SkClusterator
{
19
public
:
20
SkClusterator
(
const
sktext::GlyphRun
&
run
);
21
uint32_t
glyphCount
()
const
{
return
fGlyphCount; }
22
bool
reversedChars
()
const
{
return
fReversedChars; }
23
struct
Cluster
{
24
const
char
*
fUtf8Text
;
25
uint32_t
fTextByteLength
;
26
uint32_t
fGlyphIndex
;
27
uint32_t
fGlyphCount
;
28
explicit
operator
bool()
const
{
return
fGlyphCount
!= 0; }
29
bool
operator==
(
const
SkClusterator::Cluster
& o) {
30
return
fUtf8Text
== o.
fUtf8Text
31
&&
fTextByteLength
== o.
fTextByteLength
32
&&
fGlyphIndex
== o.
fGlyphIndex
33
&&
fGlyphCount
== o.
fGlyphCount
;
34
}
35
};
36
Cluster
next
();
37
38
private
:
39
uint32_t
const
*
const
fClusters;
40
char
const
*
const
fUtf8Text;
41
uint32_t
const
fGlyphCount;
42
uint32_t
const
fTextByteLength;
43
bool
const
fReversedChars;
44
uint32_t fCurrentGlyphIndex = 0;
45
};
46
#endif
// SkClusterator_DEFINED
SkClusterator
Definition:
SkClusterator.h:18
SkClusterator::SkClusterator
SkClusterator(const sktext::GlyphRun &run)
Definition:
SkClusterator.cpp:29
SkClusterator::glyphCount
uint32_t glyphCount() const
Definition:
SkClusterator.h:21
SkClusterator::next
Cluster next()
Definition:
SkClusterator.cpp:43
SkClusterator::reversedChars
bool reversedChars() const
Definition:
SkClusterator.h:22
sktext::GlyphRun
Definition:
GlyphRun.h:36
run
Definition:
run.py:1
sktext
Definition:
SkCanvas.h:45
SkClusterator::Cluster
Definition:
SkClusterator.h:23
SkClusterator::Cluster::fGlyphIndex
uint32_t fGlyphIndex
Definition:
SkClusterator.h:26
SkClusterator::Cluster::fUtf8Text
const char * fUtf8Text
Definition:
SkClusterator.h:24
SkClusterator::Cluster::fGlyphCount
uint32_t fGlyphCount
Definition:
SkClusterator.h:27
SkClusterator::Cluster::fTextByteLength
uint32_t fTextByteLength
Definition:
SkClusterator.h:25
SkClusterator::Cluster::operator==
bool operator==(const SkClusterator::Cluster &o)
Definition:
SkClusterator.h:29
Generated on Sun Jun 23 2024 21:56:30 for Flutter Engine by
1.9.4