Merge pull request #777 from sa-kib/rawfb_xft_demo_fixes
x11_rawfb and x11_xft demos fixes
This commit is contained in:
commit
b76f2f28c4
@ -228,13 +228,13 @@ main(void)
|
||||
|
||||
/* -------------- EXAMPLES ---------------- */
|
||||
#ifdef INCLUDE_CALCULATOR
|
||||
calculator(ctx);
|
||||
calculator(&rawfb->ctx);
|
||||
#endif
|
||||
#ifdef INCLUDE_OVERVIEW
|
||||
overview(ctx);
|
||||
overview(&rawfb->ctx);
|
||||
#endif
|
||||
#ifdef INCLUDE_NODE_EDITOR
|
||||
node_editor(ctx);
|
||||
node_editor(&rawfb->ctx);
|
||||
#endif
|
||||
/* ----------------------------------------- */
|
||||
|
||||
|
@ -430,7 +430,7 @@ nk_xsurf_draw_text(XSurface *surf, short x, short y, unsigned short w, unsigned
|
||||
xrc.blue = cfg.b * 257;
|
||||
xrc.alpha = cfg.a * 257;
|
||||
XftColorAllocValue(surf->dpy, xlib.vis, xlib.cmap, &xrc, &color);
|
||||
XftDrawString8(surf->ftdraw, &color, font->ft, tx, ty, (FcChar8*)text, len);
|
||||
XftDrawStringUtf8(surf->ftdraw, &color, font->ft, tx, ty, (FcChar8*)text, len);
|
||||
}
|
||||
#else
|
||||
XSetForeground(surf->dpy, surf->gc, fg);
|
||||
@ -632,7 +632,7 @@ nk_xfont_get_text_width(nk_handle handle, float height, const char *text, int le
|
||||
XGlyphInfo g;
|
||||
if(!font || !text)
|
||||
return 0;
|
||||
XftTextExtents8(xlib.dpy, font->ft, (FcChar8*)text, len, &g);
|
||||
XftTextExtentsUtf8(xlib.dpy, font->ft, (FcChar8*)text, len, &g);
|
||||
return g.width;
|
||||
#else
|
||||
XRectangle r;
|
||||
|
Loading…
Reference in New Issue
Block a user