fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

utf8Wrap.c File Reference

#include "../../FL/Xutf8.h"
#include <X11/Xlib.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "ucs2fontmap.c"
Include dependency graph for utf8Wrap.c:

Go to the source code of this file.

Defines

#define Fl_XChar2b   XChar2b

Functions

XFontStruct * find_best_font (Display *dpy, char **name)
XUtf8FontStructXCreateUtf8FontStruct (Display *dpy, const char *base_font_name_list)
void XUtf8DrawRtlString (Display *display, Drawable d, XUtf8FontStruct *font_set, GC gc, int x, int y, const char *string, int num_bytes)
void XUtf8DrawString (Display *display, Drawable d, XUtf8FontStruct *font_set, GC gc, int x, int y, const char *string, int num_bytes)
int XUtf8TextWidth (XUtf8FontStruct *font_set, const char *string, int num_bytes)
int XGetUtf8FontAndGlyph (XUtf8FontStruct *font_set, unsigned int ucs, XFontStruct **fnt, unsigned short *id)
int XUtf8UcsWidth (XUtf8FontStruct *font_set, unsigned int ucs)
void XUtf8DrawImageString (Display *display, Drawable d, XUtf8FontStruct *font_set, GC gc, int x, int y, const char *string, int num_bytes)
void XFreeUtf8FontStruct (Display *dpy, XUtf8FontStruct *font_set)

Define Documentation

#define Fl_XChar2b   XChar2b

Definition at line 59 of file utf8Wrap.c.


Function Documentation

XFontStruct* find_best_font ( Display *  dpy,
char **  name 
)

find the first font which matches the name and load it.

Definition at line 216 of file utf8Wrap.c.

References NULL.

XUtf8FontStruct* XCreateUtf8FontStruct ( Display *  dpy,
const char *  base_font_name_list 
)

Creates an array of XFontStruct acording to the comma separated list of fonts. XLoad all fonts.

Definition at line 308 of file utf8Wrap.c.

References XUtf8FontStruct::font_name_list, XUtf8FontStruct::nb_font, and NULL.

Referenced by main().

void XFreeUtf8FontStruct ( Display *  dpy,
XUtf8FontStruct font_set 
)

free the XFontSet and others things created by XCreateUtf8FontSet

Definition at line 881 of file utf8Wrap.c.

References XUtf8FontStruct::encodings, XUtf8FontStruct::font_name_list, XUtf8FontStruct::fonts, i, and XUtf8FontStruct::ranges.

Referenced by main().

int XGetUtf8FontAndGlyph ( XUtf8FontStruct font_set,
unsigned int  ucs,
XFontStruct **  fnt,
unsigned short *  id 
)

get the X font and glyph ID of a UCS char

Definition at line 682 of file utf8Wrap.c.

References XUtf8FontStruct::encodings, encodings, XUtf8FontStruct::fonts, i, XUtf8FontStruct::nb_font, XUtf8FontStruct::ranges, ucs2fontmap(), and x.

void XUtf8DrawImageString ( Display *  display,
Drawable  d,
XUtf8FontStruct font_set,
GC  gc,
int  x,
int  y,
const char *  string,
int  num_bytes 
)

draw an UTF-8 string and clear the background.

Definition at line 828 of file utf8Wrap.c.

References XUtf8FontStruct::ascent, background, XUtf8FontStruct::descent, w, XUtf8DrawString(), and XUtf8TextWidth().

Referenced by main().

void XUtf8DrawRtlString ( Display *  display,
Drawable  d,
XUtf8FontStruct font_set,
GC  gc,
int  x,
int  y,
const char *  string,
int  num_bytes 
)

draw a Right To Left UTF-8 string using multiple fonts as needed.

Definition at line 337 of file utf8Wrap.c.

References buf, XUtf8FontStruct::encodings, encodings, XUtf8FontStruct::fonts, i, XUtf8FontStruct::nb_font, ptr, XUtf8FontStruct::ranges, ucs2fontmap(), XFastConvertUtf8ToUcs(), and XUtf8IsNonSpacing().

Referenced by main(), and Fl_Xlib_Graphics_Driver::rtl_draw().

void XUtf8DrawString ( Display *  display,
Drawable  d,
XUtf8FontStruct font_set,
GC  gc,
int  x,
int  y,
const char *  string,
int  num_bytes 
)
int XUtf8TextWidth ( XUtf8FontStruct font_set,
const char *  string,
int  num_bytes 
)
int XUtf8UcsWidth ( XUtf8FontStruct font_set,
unsigned int  ucs 
)

returns the pixel width of a UCS char

Definition at line 753 of file utf8Wrap.c.

References buf, XUtf8FontStruct::encodings, encodings, XUtf8FontStruct::fonts, i, XUtf8FontStruct::nb_font, XUtf8FontStruct::ranges, ucs2fontmap(), x, and XUtf8IsNonSpacing().

Referenced by fl_width().