I download and install Graphics_SDK_4_05_00_03 on my beagleboard.
Build it with xorg support.
And I see that almost every application that uses GTK+/X11 or Qt/X11 show garbage instead of letters.
So I dig into this, and write simple application that uses xlib and xft (see attachment).
It draws "Hello, World!" with different font sizes.
It takes one argument - font size. And I ran it with paramter:
100 - good
50 - "," - broken other letters ok
30 - almost all letters are broken.
I run Xorg that I build myself on this board, and with all parameters (100, 50, 30...) it show
"Hello, World!" without any damage.
So question, is it bug? If not, can you provide image of linux system for beagle board, where my example works as expected?
Here are screenshots:
./xft_example2 30
./xft_example2 50
and screenshost with my Xorg + omapfb
./xft_example2 30
./xft_example2 50 (my Xorg + omapfb):
sh gfx_check.sh
WSEGL settings
[default]
WindowSystem=libpvrPVR2D_DRIWSEGL.so
#WindowSystem=libpvrPVR2D_FLIPWSEGL.so
#WindowSystem=libpvrPVR2D_FRONTWSEGL.so
#DisableHWTQMipGen=1
ParamBufferSize=25165824
------
ARM CPU information
Processor : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 717.37
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part : 0xc08
CPU revision : 3
Hardware : OMAP3 Beagle Board
Revision : 0020
Serial : 0000000000000000
------
SGX driver information
Version 1.6.16.4117 (release) /home/evgeniy/projects/compas/planetable/civil/beagleboard/Graphics_SDK_4_05_00_03/GFX_Linux_KM
System Version String: SGX revision = 1.2.1
------
Framebuffer settings
------
Rotation settings
0
------
Kernel Module information
Module Size Used by
pvrsrvkm 123288 2
drm 124580 3 pvrsrvkm
omapfb 23408 1
cfbcopyarea 2608 1 omapfb
cfbimgblt 1688 1 omapfb
cfbfillrect 2632 1 omapfb
panel_generic_dpi 1728 1
omapdss 114072 2 omapfb,panel_generic_dpi
max7359_keypad 2624 0
spidev 3924 0
autofs4 19628 0
------
Boot settings
console=ttyO2,115200n8 mpurate=720 buddy=unknown camera=lbcm3m1 vram=12M omapfb.mode=dvi:800x480MR-16@60 omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
------
Linux Kernel version
Linux beagleboard 3.0.12+ #46 PREEMPT Thu Mar 22 02:18:34 GMT-4 2012 armv7l GNU/Linux
root@beagleboard:~#
There are some problems with attachments, so here is test code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
int main(int argc, char *argv[])
{
Display *dpy;
Window win;
Colormap cmap;
XEvent e;
XftFont *xfthuge;
XftColor color, black;
XftDraw *draw;
XRenderColor kindofblue = { 0x4c00, 0x7800, 0x9900, 0xffff};
double font_height = 100.;
assert(argc > 1);
sscanf(argv[1], "%lf", &font_height);
const char *msg = "Hello, World!";
int scr;
/* open connection with the server */
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
fprintf(stderr, "Cannot open display\n");
exit(1);
}
scr = DefaultScreen(dpy);
cmap = DefaultColormap(dpy, scr);
/* create window */
win = XCreateSimpleWindow(dpy, RootWindow(dpy, scr), 100, 100, 700,
300, 1, BlackPixel(dpy, scr), WhitePixel(dpy, scr));
/* select kind of events we are interested in */
XSelectInput(dpy, win, ExposureMask | KeyPressMask);
/* map (show) the window */
XMapWindow(dpy, win);
xfthuge = XftFontOpen(dpy, scr,
XFT_FAMILY, XftTypeString, "dejavuserifcondensed",
XFT_SIZE, XftTypeDouble, font_height,
NULL);
XftColorAllocValue(dpy, DefaultVisual(dpy, scr), cmap,
&kindofblue, &color);
XftColorAllocName(dpy,
DefaultVisual(dpy, scr),
DefaultColormap(dpy, scr),
"black",
&black);
draw = XftDrawCreate(dpy, win, DefaultVisual(dpy, scr), cmap);
/* event loop */
while (1) {
XNextEvent(dpy, &e);
/* draw or redraw the window */
if (e.type == Expose) {
#if 0
XftDrawStringUtf8(draw, &color, xfthuge, 10, 100,
(FcChar8*)msg, strlen(msg));
#else
for (int x = 10, y = 100; *msg != '\0'; ++msg, x += xfthuge->max_advance_width) {
XGlyphInfo extent;
FT_UInt glyph;
if (!XftCharExists(dpy, xfthuge, *msg)) {
printf("missed character %c\n", *msg);
continue;
}
// Get the glyph and its extents.
glyph = XftCharIndex(dpy, xfthuge, *msg);
XftGlyphExtents(dpy, xfthuge, &glyph, 1, &extent);
// Clear the bounding box and draw the glyph
XftDrawRect(draw, &black, x, y, xfthuge->max_advance_width, xfthuge->height);
XftDrawGlyphs(draw, &color, xfthuge, x, y + xfthuge->ascent, &glyph, 1);
}
#endif
}
/* exit on key press */
if (e.type == KeyPress)
break;
}
XftDrawDestroy(draw);
/* close connection to server */
XCloseDisplay(dpy);
return 0;
}