MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuViewDrawStringSubPixel

Function PiuViewDrawStringSubPixel

modules/piu/PC/lin/piuView.c:620–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620void PiuViewDrawStringSubPixel(PiuView* self, xsSlot* slot, xsIntegerValue offset, xsIntegerValue length, PiuFont* font, double x, double y, PiuDimension w, PiuDimension sw)
621{
622 xsMachine* the = (*self)->the;
623 cairo_t* cr = (*self)->cairo;
624 xsStringValue string = PiuToString(slot);
625 if (length < 0)
626 length = c_strlen(string + offset);
627 char* text = malloc(length + 1);
628 memcpy(text, string + offset, length);
629 text[length] = 0;
630 cairo_set_font_face(cr, (*font)->face);
631 cairo_set_font_size(cr, (*font)->size);
632 cairo_move_to(cr, x, y + (*font)->ascent);
633 cairo_show_text(cr, text);
634 free(text);
635}
636
637void PiuViewDrawTexture(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
638{

Callers 2

PiuViewDrawStringFunction · 0.70
PiuCodeDrawFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected