xref: /aosp_15_r20/external/skia/modules/skplaintexteditor/src/shape.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 
4 #include "include/core/SkFont.h"
5 #include "include/core/SkTextBlob.h"
6 
7 #include <cstddef>
8 #include <vector>
9 
10 namespace SkPlainTextEditor {
11 
12 struct ShapeResult {
13     sk_sp<SkTextBlob> blob;
14     std::vector<std::size_t> lineBreakOffsets;
15     std::vector<SkRect> glyphBounds;
16     std::vector<bool> wordBreaks;
17     int verticalAdvance;
18 };
19 
20 ShapeResult Shape(const char* ut8text,
21                   size_t textByteLen,
22                   const SkFont& font,
23                   sk_sp<SkFontMgr> fontMgr,
24                   const char* locale,
25                   float width);
26 
27 }  // namespace SkPlainTextEditor
28