Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/dox
Modified Files:
dox.h ttfont.c
Log Message:
Fix/align dox/src imlib2 TT font rendering stuff.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/dox/dox.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- dox.h 22 May 2004 23:08:20 -0000 1.32
+++ dox.h 26 Jun 2004 20:27:30 -0000 1.33
@@ -283,10 +283,10 @@
int *max_ascent_return,
int *max_descent_return,
int *lbearing_return, int *rbearing_return);
-Efont *Efont_load(char *file, int size);
+Efont *Efont_load(const char *file, int size);
void Efont_free(Efont * f);
void EFont_draw_string(Display * disp, Drawable win, GC gc,
- int x, int y, char *text,
+ int x, int y, const char *text,
Efont * font, Visual * vis, Colormap cm);
void TextStateLoadFont(TextState * ts);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/dox/ttfont.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ttfont.c 25 Apr 2004 08:29:36 -0000 1.15
+++ ttfont.c 26 Jun 2004 20:27:30 -0000 1.16
@@ -44,8 +44,9 @@
}
void
-EFont_draw_string(Display * dpy, Drawable win, GC gc, int x, int y, char *text,
- Efont * f, Visual * vis __UNUSED__, Colormap cm)
+EFont_draw_string(Display * dpy, Drawable win, GC gc, int x, int y,
+ const char *text, Efont * f, Visual * vis __UNUSED__,
+ Colormap cm)
{
Imlib_Image im;
int w, h, ascent, descent;
@@ -77,7 +78,7 @@
}
Efont *
-Efont_load(char *file, int size)
+Efont_load(const char *file, int size)
{
char s[4096];
Efont *f;
@@ -100,13 +101,15 @@
int *max_ascent_return, int *max_descent_return,
int *lbearing_return __UNUSED__, int *rbearing_return __UNUSED__)
{
- int height;
+ int w, h;
if (!f)
return;
imlib_context_set_font(f->face);
- imlib_get_text_size(text, width_return, &height);
+ imlib_get_text_advance(text, &w, &h);
+ if (width_return)
+ *width_return = w;
if (font_ascent_return)
*font_ascent_return = imlib_get_font_ascent();
if (font_descent_return)
@@ -370,7 +373,7 @@
}
static TT_Raster_Map *
-calc_size(Efont * f, int *width, int *height, char *text)
+calc_size(Efont * f, int *width, int *height, const char *text)
{
int i, upm, ascent, descent, pw, ph;
TT_Instance_Metrics imetrics;
@@ -413,8 +416,8 @@
}
static void
-render_text(TT_Raster_Map * rmap, TT_Raster_Map * rchr, Efont * f, char *text,
- int *xor, int *yor)
+render_text(TT_Raster_Map * rmap, TT_Raster_Map * rchr, Efont * f,
+ const char *text, int *xor, int *yor)
{
TT_Glyph_Metrics metrics;
TT_Instance_Metrics imetrics;
@@ -739,8 +742,8 @@
}
void
-EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
- Efont * f, Visual * vis, Colormap cm)
+EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y,
+ const char *text, Efont * f, Visual * vis, Colormap cm)
{
XImage *xim;
XShmSegmentInfo shminfo;
@@ -1005,7 +1008,7 @@
}
Efont *
-Efont_load(char *file, int size)
+Efont_load(const char *file, int size)
{
TT_Error error;
TT_Glyph_Metrics metrics;
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs