[teklib-general] teklib: rawfb target activated; rawfb: added freetype font support,
Franciska Schulze
fschulze at neoscientists.org
Mon Jul 13 10:13:49 CEST 2009
details: http://hg.teklib.org/teklib/rev/58a053596b7a
changeset: 262:58a053596b7a
user: Franciska Schulze <fschulze at neoscientists.org>
date: Mon May 18 12:58:07 2009 +0000
description:
rawfb target activated; rawfb: added freetype font support,
added GetPixel(), struct FontNode -> renamed 'font' to 'face'
added utf8 to unicode converter, improved utf8 support;
visual fonttest now uses rawfb backend; added missing display
argument to OPENFONT and QUERYFONTS requests
diffs (truncated from 926 to 100 lines):
diff -r 8d5ad9ed061b -r 58a053596b7a src/build/tmkmakefile
--- a/src/build/tmkmakefile Sun Feb 22 18:15:13 2009 +0100
+++ b/src/build/tmkmakefile Mon May 18 12:58:07 2009 +0000
@@ -31,10 +31,11 @@
[embed body="meta"]
display_x11
[/embed]
+ [embed body="meta"]
+ display_rawfb
+ [/embed]
[!--
- [embed body="meta"]
- display_rawfb
- [/embed]
+
[embed body="meta"]
display_directfb
[/embed]
diff -r 8d5ad9ed061b -r 58a053596b7a src/display_rawfb/display_fb_api.c
--- a/src/display_rawfb/display_fb_api.c Sun Feb 22 18:15:13 2009 +0100
+++ b/src/display_rawfb/display_fb_api.c Mon May 18 12:58:07 2009 +0000
@@ -77,9 +77,6 @@
/* init default font */
v->curfont = mod->fbd_FontManager.deffont;
mod->fbd_FontManager.defref++;
-
- /* register default font */
- /*TDBPRINTF(TDB_TRACE,("Add window: %p\n", v->window));*/
/* add window on top of window stack: */
TAddHead(&mod->fbd_VisualList, &v->fbv_Node);
@@ -714,30 +711,9 @@
LOCAL void
fb_drawtext(FBDISPLAY *mod, struct TVFBRequest *req)
{
- FBWINDOW *v = req->tvr_Op.Text.Window;
-// TSTRPTR text = req->tvr_Op.Text.Text;
-// TINT len = req->tvr_Op.Text.Length;
-// TUINT x = req->tvr_Op.Text.X;
-// TUINT y = req->tvr_Op.Text.Y;
-// TINT w;
-// TINT h = ((struct FontNode *) v->curfont)->height;
- struct FBPen *fgpen = (struct FBPen *) req->tvr_Op.Text.FgPen;
- struct FBPen *bgpen = (struct FBPen *) req->tvr_Op.Text.BgPen;
-// TINT ascent = ((struct FontNode *) v->curfont)->ascent;
-
- //IDirectFBFont *f = ((struct FontNode *) v->curfont)->font;
- //f->GetStringWidth(f, text, len, &w);
-
- if ((TVPEN) bgpen != TVPEN_UNDEFINED)
- {
- setfgpen(mod, v, (TVPEN) bgpen);
- //v->winsurface->FillRectangle(v->winsurface, x, y, w, h);
- }
-
- setbgpen(mod, v, (TVPEN) bgpen);
- setfgpen(mod, v, (TVPEN) fgpen);
-
- //v->winsurface->DrawString(v->winsurface, text, len, x, y+ascent, DSTF_LEFT);
+ fb_hostdrawtext(mod, req->tvr_Op.Text.Window, req->tvr_Op.Text.Text,
+ req->tvr_Op.Text.Length, req->tvr_Op.Text.X, req->tvr_Op.Text.Y,
+ req->tvr_Op.Text.FgPen);
}
/*****************************************************************************/
@@ -765,7 +741,7 @@
{
req->tvr_Op.TextSize.Width =
fb_hosttextsize(mod, req->tvr_Op.TextSize.Font,
- req->tvr_Op.TextSize.Text);
+ req->tvr_Op.TextSize.Text, strlen(req->tvr_Op.TextSize.Text)); /* FIXME: strlen <-> UTF8 */
}
/*****************************************************************************/
diff -r 8d5ad9ed061b -r 58a053596b7a src/display_rawfb/display_fb_draw.c
--- a/src/display_rawfb/display_fb_draw.c Sun Feb 22 18:15:13 2009 +0100
+++ b/src/display_rawfb/display_fb_draw.c Mon May 18 12:58:07 2009 +0000
@@ -32,7 +32,7 @@
/*****************************************************************************/
-TINLINE static void
+LOCAL void
WritePixel(FBWINDOW *v, TINT x, TINT y, struct FBPen *pen)
{
((TUINT32 *)v->fbv_BufPtr)[y * v->fbv_PixelPerLine + x] = pen->rgb;
@@ -47,6 +47,12 @@
*(TUINT *)(0x0) = 0;
}
#endif
+}
+
+LOCAL TUINT32
+GetPixel(FBWINDOW *v, TINT x, TINT y)
+{
+ return ((TUINT32 *)v->fbv_BufPtr)[y * v->fbv_PixelPerLine + x];
}
/*****************************************************************************/
diff -r 8d5ad9ed061b -r 58a053596b7a src/display_rawfb/display_fb_font.c
More information about the teklib-general
mailing list