MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / create

Method create

src/Android/TextUtil.cpp:80–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80TextUtil *
81TextUtil::create(const FontDescription &d) noexcept
82{
83 jint paramStyle, paramTextSize;
84
85 paramStyle = 0;
86 if (d.IsBold())
87 paramStyle |= 1;
88 if (d.IsItalic())
89 paramStyle |= 2;
90 paramTextSize = d.GetHeight();
91
92 int paint_flags = 0;
93 if (!IsDithered())
94 /* 1 = Paint.ANTI_ALIAS_FLAG */
95 paint_flags |= 1;
96
97 // construct org.xcsoar.TextUtil object
98 auto &e = *env;
99 Java::LocalObject localObject{&e,
100 e.NewObject(cls, midTextUtil,
101 paramStyle, paramTextSize,
102 paint_flags, d.IsMonospace())};
103 Java::RethrowException(&e);
104
105 assert(localObject);
106
107 return new TextUtil(localObject);
108}
109
110PixelSize
111TextUtil::getTextBounds(std::string_view text) const noexcept

Callers 6

playMethod · 0.45
playExternalMethod · 0.45
TextUtilMethod · 0.45
runMethod · 0.45
synchronousOpenMethod · 0.45
CreateMethod · 0.45

Calls 5

IsDitheredFunction · 0.85
IsBoldMethod · 0.80
IsItalicMethod · 0.80
IsMonospaceMethod · 0.80
GetHeightMethod · 0.45

Tested by

no test coverage detected