Files
luban-lite-t3e-pro/packages/third-party/awtk-ui/awtk/3rd/nanovg/demos/draw_text.inc
刘可亮 3b4064f334 v1.0.2
2023-11-30 19:48:02 +08:00

19 lines
429 B
C++

#include "nanovg.h"
static void do_draw_text(NVGcontext* vg, int32_t w, int32_t h) {
const char* text = "Hello AWTK";
nvgBeginFrame(vg, w, h, 1);
nvgFillColor(vg, nvgRGBA(255, 0, 0, 255));
nvgSave(vg);
nvgFontSize(vg, 20);
nvgTextAlign(vg, NVG_ALIGN_LEFT|NVG_ALIGN_TOP);
//nvgFontBlur(vg,2);
nvgFillColor(vg, nvgRGBA(0, 255, 0, 255));
nvgText(vg, 20, 20, text, NULL);
nvgRestore(vg);
nvgEndFrame(vg);
}