diff --git a/examples/drawtext/main.c b/examples/drawtext/main.c index 13c7c659..fb9ee778 100644 --- a/examples/drawtext/main.c +++ b/examples/drawtext/main.c @@ -62,11 +62,12 @@ static void makeAttributedString(void) static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p) { uiDrawTextLayout *textLayout; - uiFontDescriptor fontdesc; + uiFontDescriptor defaultFont; uiDrawTextLayoutParams params; params.String = attrstr; - uiFontButtonFont(fontButton, &fontdesc); + uiFontButtonFont(fontButton, &defaultFont); + params.DefaultFont = &defaultFont; params.Width = p->AreaWidth - (2 * margins); params.Align = uiDrawTextAlignLeft; textLayout = uiDrawNewTextLayout(¶ms); @@ -153,6 +154,7 @@ int main(void) uiControlShow(uiControl(mainwin)); uiMain(); + uiFreeAttributedString(attrstr); uiUninit(); return 0; }