Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
paragraph_builder_client_icu.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
9#include "third_party/skia/modules/skparagraph/include/ParagraphBuilder.h"
10#include "third_party/skia/modules/skunicode/include/SkUnicode_client.h"
11
13 return false;
14}
15
20 std::vector<flutter::DlPaint> paints;
21 style->text_style.PopulatePaintIds(paints);
22 style->skia_paragraph_style.setTextStyle(style->text_style.skia_style);
23 return new Skwasm::ParagraphBuilder{
24 skia::textlayout::ParagraphBuilder::make(style->skia_paragraph_style,
25 collection->collection, nullptr),
26 std::move(paints),
27 };
28}
29
31 Skwasm::ParagraphBuilder* builder) {
33 auto [words, grapheme_breaks, line_breaks] =
34 builder->skia_paragraph_builder->getClientICUData();
35 auto text = builder->skia_paragraph_builder->getText();
36 sk_sp<SkUnicode> client_icu =
37 SkUnicodes::Client::Make(text, words, grapheme_breaks, line_breaks);
38 builder->skia_paragraph_builder->SetUnicode(client_icu);
39 return new Skwasm::Paragraph{
40 builder->skia_paragraph_builder->Build(),
41 std::move(builder->paints),
42 };
43}
44
47 std::vector<SkUnicode::Position>* breaks) {
48 builder->skia_paragraph_builder->setGraphemeBreaksUtf16(std::move(*breaks));
49}
50
53 std::vector<SkUnicode::Position>* breaks) {
54 builder->skia_paragraph_builder->setWordsUtf16(std::move(*breaks));
55}
56
59 std::vector<SkUnicode::LineBreakBefore>* breaks) {
60 builder->skia_paragraph_builder->setLineBreaksUtf16(std::move(*breaks));
61}
std::u16string text
uint32_t live_paragraph_builder_count
uint32_t live_paragraph_count
SKWASM_EXPORT void paragraphBuilder_setGraphemeBreaksUtf16(Skwasm::ParagraphBuilder *builder, std::vector< SkUnicode::Position > *breaks)
SKWASM_EXPORT Skwasm::Paragraph * paragraphBuilder_build(Skwasm::ParagraphBuilder *builder)
SKWASM_EXPORT Skwasm::ParagraphBuilder * paragraphBuilder_create(Skwasm::ParagraphStyle *style, Skwasm::FlutterFontCollection *collection)
SKWASM_EXPORT void paragraphBuilder_setWordBreaksUtf16(Skwasm::ParagraphBuilder *builder, std::vector< SkUnicode::Position > *breaks)
SKWASM_EXPORT bool skwasm_isHeavy()
SKWASM_EXPORT void paragraphBuilder_setLineBreaksUtf16(Skwasm::ParagraphBuilder *builder, std::vector< SkUnicode::LineBreakBefore > *breaks)
#define SKWASM_EXPORT
Definition export.h:10
sk_sp< skia::textlayout::FontCollection > collection
Definition wrappers.h:37
std::vector< flutter::DlPaint > paints
Definition text_types.h:45
std::unique_ptr< skia::textlayout::ParagraphBuilder > skia_paragraph_builder
Definition text_types.h:44
skia::textlayout::ParagraphStyle skia_paragraph_style
Definition text_types.h:39
void PopulatePaintIds(std::vector< flutter::DlPaint > &paints)
Definition text_types.h:21
skia::textlayout::TextStyle skia_style
Definition text_types.h:17