From 33af4e4ba5cec3f0fe757ca9889b23b2ba0f3b76 Mon Sep 17 00:00:00 2001 From: Ian MacArthur Date: Mon, 7 Feb 2011 22:22:16 +0000 Subject: Attempt to fix STR #2550 to make fl_text_extents work in Xlib-only (i.e. non-XFT) X11 builds. This appears to be working now, though I can not test it fully, so we need more feedback. In particular the setting of the dx param is certainly wrong, but works fine in general cases. I think. Also, I suspect it may behave badly in the face of RtoL text rendering but I think we have other problems in that area anyway... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8399 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Xutf8.h | 59 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 23 deletions(-) (limited to 'FL') diff --git a/FL/Xutf8.h b/FL/Xutf8.h index 459db02b8..609a7cff7 100644 --- a/FL/Xutf8.h +++ b/FL/Xutf8.h @@ -48,8 +48,8 @@ typedef struct { XUtf8FontStruct * XCreateUtf8FontStruct ( - Display *dpy, - const char *base_font_name_list); + Display *dpy, + const char *base_font_name_list); void XUtf8DrawString( @@ -62,6 +62,19 @@ XUtf8DrawString( const char *string, int num_bytes); +void +XUtf8_measure_extents( + Display *display, + Drawable d, + XUtf8FontStruct *font_set, + GC gc, + int *xx, + int *yy, + int *ww, + int *hh, + const char *string, + int num_bytes); + void XUtf8DrawRtlString( Display *display, @@ -89,7 +102,7 @@ XUtf8TextWidth( XUtf8FontStruct *font_set, const char *string, int num_bytes); -int +int XUtf8UcsWidth( XUtf8FontStruct *font_set, unsigned int ucs); @@ -100,41 +113,41 @@ XGetUtf8FontAndGlyph( unsigned int ucs, XFontStruct **fnt, unsigned short *id); - + void XFreeUtf8FontStruct( Display *dpy, XUtf8FontStruct *font_set); -int -XConvertUtf8ToUcs( - const unsigned char *buf, - int len, +int +XConvertUtf8ToUcs( + const unsigned char *buf, + int len, unsigned int *ucs); -int +int XConvertUcsToUtf8( - unsigned int ucs, + unsigned int ucs, char *buf); -int +int XUtf8CharByteLen( - const unsigned char *buf, + const unsigned char *buf, int len); -int +int XCountUtf8Char( - const unsigned char *buf, + const unsigned char *buf, int len); -int -XFastConvertUtf8ToUcs( - const unsigned char *buf, - int len, +int +XFastConvertUtf8ToUcs( + const unsigned char *buf, + int len, unsigned int *ucs); -long +long XKeysymToUcs( KeySym keysym); @@ -147,7 +160,7 @@ XUtf8LookupString( KeySym* keysym, Status* status_return); -unsigned short +unsigned short XUtf8IsNonSpacing( unsigned int ucs); @@ -156,11 +169,11 @@ XUtf8IsRightToLeft( unsigned int ucs); -int +int XUtf8Tolower( int ucs); -int +int XUtf8Toupper( int ucs); @@ -173,4 +186,4 @@ XUtf8Toupper( /* * End of "$Id$". - */ + */ -- cgit v1.2.3