MCPcopy Create free account
hub / github.com/antvis/F2Native / SetFont

Method SetFont

core/android/BitmapCanvasContext.cpp:320–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318float BitmapCanvasContext::GlobalAlpha() { return globalAlpha_; }
319
320void BitmapCanvasContext::SetFont(const std::string &font) {
321 TraceCommand("SetFont: " + font);
322 if(font != fontStyleCache_ && CanvasFontParser::Parse(font, fontStyle_)) {
323 fontStyleCache_ = font;
324 }
325 env_ = GetJniEnvSafe();
326 F2SafeCallVoidMethod(env_, canvasContext_->obj(), setFont_, fontStyle_.fontStyle, fontStyle_.fontVariant,
327 fontStyle_.fontWeight, jni::StringToJavaString(env_, fontStyle_.fontFamily).obj(), fontStyle_.fontSize);
328
329
330}
331
332void BitmapCanvasContext::FillText(const std::string &text, float x, float y, float maxWidth) {
333 TraceCommand("FillText: " + text);

Callers 5

RenderMethod · 0.45
PreDrawFlagContentMethod · 0.45
ResetContextMethod · 0.45
GetTextWidthMethod · 0.45

Calls 3

GetJniEnvSafeFunction · 0.85
StringToJavaStringFunction · 0.85
objMethod · 0.45

Tested by

no test coverage detected