Merge pull request #777 from sa-kib/rawfb_xft_demo_fixes

x11_rawfb and x11_xft demos fixes
This commit is contained in:
dumblob 2019-05-28 10:32:58 +02:00 committed by GitHub
commit b76f2f28c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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
/* ----------------------------------------- */

View File

@ -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;