Flutter Engine
 
Loading...
Searching...
No Matches
impeller::interop::ParagraphStyle Class Referencefinal

#include <paragraph_style.h>

Inheritance diagram for impeller::interop::ParagraphStyle:
impeller::interop::Object< ParagraphStyle, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)> impeller::interop::ObjectBase

Public Member Functions

 ParagraphStyle ()
 
 ~ParagraphStyle () override
 
 ParagraphStyle (const ParagraphStyle &)=delete
 
ParagraphStyleoperator= (const ParagraphStyle &)=delete
 
void SetForeground (ScopedObject< Paint > paint)
 
void SetBackground (ScopedObject< Paint > paint)
 
void SetFontWeight (int weight)
 
void SetFontStyle (txt::FontStyle style)
 
void SetFontFamily (std::string family)
 
void SetFontSize (double size)
 
void SetHeight (double height)
 
void SetTextAlignment (txt::TextAlign alignment)
 
void SetTextDirection (txt::TextDirection direction)
 
void SetTextDecoration (const ImpellerTextDecoration &decoration)
 
void SetMaxLines (size_t max_lines)
 
void SetLocale (std::string locale)
 
void SetEllipsis (const std::string &string)
 
txt::TextStyle CreateTextStyle () const
 
const txt::ParagraphStyleGetParagraphStyle () const
 
- Public Member Functions inherited from impeller::interop::ObjectBase
 ObjectBase ()=default
 
virtual ~ObjectBase ()=default
 
 ObjectBase (const ObjectBase &)=delete
 
 ObjectBase (ObjectBase &&)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
ObjectBaseoperator= (ObjectBase &&)=delete
 
void Retain ()
 
void Release ()
 
uint64_t GetRefCountForTests () const
 

Additional Inherited Members

- Public Types inherited from impeller::interop::Object< ParagraphStyle, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)>
using InteropClass = ParagraphStyle
 
using InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)
 
- Static Public Member Functions inherited from impeller::interop::ObjectBase
static void SafeRetain (void *ptr)
 
static void SafeRelease (void *ptr)
 

Detailed Description

Definition at line 15 of file paragraph_style.h.

Constructor & Destructor Documentation

◆ ParagraphStyle() [1/2]

impeller::interop::ParagraphStyle::ParagraphStyle ( )
explicitdefault

◆ ~ParagraphStyle()

impeller::interop::ParagraphStyle::~ParagraphStyle ( )
overridedefault

◆ ParagraphStyle() [2/2]

impeller::interop::ParagraphStyle::ParagraphStyle ( const ParagraphStyle )
delete

Member Function Documentation

◆ CreateTextStyle()

txt::TextStyle impeller::interop::ParagraphStyle::CreateTextStyle ( ) const

Definition at line 60 of file paragraph_style.cc.

60 {
61 auto style = style_.GetTextStyle();
62
63 if (foreground_) {
64 style.foreground = foreground_->GetPaint();
65 }
66 if (background_) {
67 style.background = background_->GetPaint();
68 }
69 if (decoration_.has_value()) {
70 const auto& decoration = decoration_.value();
71 style.decoration = decoration.types;
72 style.decoration_color = ToSkiaType(decoration.color);
73 style.decoration_style = ToTxtType(decoration.style);
74 style.decoration_thickness_multiplier = decoration.thickness_multiplier;
75 }
76
77 return style;
78}
TextStyle GetTextStyle() const
std::optional< flutter::DlPaint > foreground
Definition text_style.h:48
constexpr txt::TextDecorationStyle ToTxtType(ImpellerTextDecorationStyle style)
Definition formats.h:442
constexpr std::optional< SkRect > ToSkiaType(const ImpellerRect *rect)
Definition formats.h:30

References txt::TextStyle::foreground, txt::ParagraphStyle::GetTextStyle(), impeller::interop::ToSkiaType(), and impeller::interop::ToTxtType().

Referenced by impeller::interop::ParagraphBuilder::PushStyle().

◆ GetParagraphStyle()

const txt::ParagraphStyle & impeller::interop::ParagraphStyle::GetParagraphStyle ( ) const

Definition at line 80 of file paragraph_style.cc.

80 {
81 return style_;
82}

Referenced by impeller::interop::ParagraphBuilder::PushStyle().

◆ operator=()

ParagraphStyle & impeller::interop::ParagraphStyle::operator= ( const ParagraphStyle )
delete

◆ SetBackground()

void impeller::interop::ParagraphStyle::SetBackground ( ScopedObject< Paint paint)

Definition at line 56 of file paragraph_style.cc.

56 {
57 background_ = std::move(paint);
58}

◆ SetEllipsis()

void impeller::interop::ParagraphStyle::SetEllipsis ( const std::string &  string)

Definition at line 89 of file paragraph_style.cc.

89 {
90 if (string.empty()) {
91 style_.ellipsis = {};
92 return;
93 }
94 style_.ellipsis = fml::Utf8ToUtf16(string);
95}
std::u16string ellipsis
std::u16string Utf8ToUtf16(const std::string_view string)

References txt::ParagraphStyle::ellipsis, and fml::Utf8ToUtf16().

◆ SetFontFamily()

void impeller::interop::ParagraphStyle::SetFontFamily ( std::string  family)

Definition at line 23 of file paragraph_style.cc.

23 {
24 style_.font_family = std::move(family);
25}

References txt::ParagraphStyle::font_family.

◆ SetFontSize()

void impeller::interop::ParagraphStyle::SetFontSize ( double  size)

Definition at line 27 of file paragraph_style.cc.

27 {
28 style_.font_size = size;
29}
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size

References txt::ParagraphStyle::font_size.

◆ SetFontStyle()

void impeller::interop::ParagraphStyle::SetFontStyle ( txt::FontStyle  style)

Definition at line 19 of file paragraph_style.cc.

19 {
20 style_.font_style = style;
21}

References txt::ParagraphStyle::font_style.

◆ SetFontWeight()

void impeller::interop::ParagraphStyle::SetFontWeight ( int  weight)

Definition at line 15 of file paragraph_style.cc.

15 {
16 style_.font_weight = weight;
17}

References txt::ParagraphStyle::font_weight.

◆ SetForeground()

void impeller::interop::ParagraphStyle::SetForeground ( ScopedObject< Paint paint)

Definition at line 52 of file paragraph_style.cc.

52 {
53 foreground_ = std::move(paint);
54}

◆ SetHeight()

void impeller::interop::ParagraphStyle::SetHeight ( double  height)

Definition at line 31 of file paragraph_style.cc.

31 {
32 style_.height = height;
33 style_.has_height_override = (height != 0.0);
34}
int32_t height

References txt::ParagraphStyle::has_height_override, height, and txt::ParagraphStyle::height.

◆ SetLocale()

void impeller::interop::ParagraphStyle::SetLocale ( std::string  locale)

Definition at line 48 of file paragraph_style.cc.

48 {
49 style_.locale = std::move(locale);
50}

References txt::ParagraphStyle::locale.

◆ SetMaxLines()

void impeller::interop::ParagraphStyle::SetMaxLines ( size_t  max_lines)

Definition at line 44 of file paragraph_style.cc.

44 {
45 style_.max_lines = max_lines;
46}

References txt::ParagraphStyle::max_lines.

◆ SetTextAlignment()

void impeller::interop::ParagraphStyle::SetTextAlignment ( txt::TextAlign  alignment)

Definition at line 36 of file paragraph_style.cc.

36 {
37 style_.text_align = alignment;
38}

References txt::ParagraphStyle::text_align.

◆ SetTextDecoration()

void impeller::interop::ParagraphStyle::SetTextDecoration ( const ImpellerTextDecoration decoration)

Definition at line 84 of file paragraph_style.cc.

85 {
86 decoration_ = decoration;
87}

◆ SetTextDirection()

void impeller::interop::ParagraphStyle::SetTextDirection ( txt::TextDirection  direction)

Definition at line 40 of file paragraph_style.cc.

40 {
41 style_.text_direction = direction;
42}
TextDirection text_direction

References txt::ParagraphStyle::text_direction.


The documentation for this class was generated from the following files: