32 #include "libmb/mbconfig.h"
34 #include "mbdotdesktop.h"
37 #include <X11/Xft/Xft.h>
43 #include <pango/pango.h>
44 #include <pango/pangoxft.h>
78 #if defined (USE_XFT) || defined (USE_PANGO)
104 PangoContext *pgo_context;
105 PangoFontMap *pgo_fontmap;
106 PangoFontDescription *fontdes;
108 PangoFontMetrics *metrics;
109 #elif defined (USE_XFT)
116 Bool _have_fresh_font_object;
172 MB_FONT_RENDER_OPTS_NONE = 0,
173 MB_FONT_RENDER_OPTS_CLIP_TRAIL = (1<<1),
174 MB_FONT_RENDER_ALIGN_CENTER = (1<<2),
175 MB_FONT_RENDER_ALIGN_RIGHT = (1<<3),
176 MB_FONT_RENDER_EFFECT_SHADOW = (1<<4),
177 MB_FONT_RENDER_VALIGN_MIDDLE = (1<<5)
194 #if defined (USE_XFT) || defined (USE_PANGO)
220 Bool _have_autocalc_size;
268 unsigned char alpha);
283 unsigned char *green,
285 unsigned char *alpha);
288 #define mb_col_red(col) (col)->r
289 #define mb_col_green(col) (col)->g
290 #define mb_col_blue(col) (col)->b
291 #define mb_col_alpha(col) (col)->a
292 #define mb_col_xpixel(col) (col)->xcol.pixel
376 mb_font_get (
MBFont *font);
459 mb_font_get_txt_width (
MBFont *font,
542 mb_layout_new (
void);
553 mb_layout_set_geometry(
MBLayout *layout,
554 int width,
int height);
557 mb_layout_get_geometry(
MBLayout *layout,
558 int *width,
int *height);
562 mb_layout_set_text(
MBLayout *layout,
567 mb_layout_destroy (
MBLayout *layout);
570 mb_layout_set_multiline (
MBLayout *layout, Bool want_multiline);
573 mb_layout_set_align (
MBLayout *layout,
int horizontal,
int vertical);
576 mb_layout_set_clip_style (
MBLayout *layout,
int clip_stype);
585 #define mb_layout_width(l) (l)->width
586 #define mb_layout_height(l) (l)->height
629 #define mb_drawable_pixmap(drw) (drw)->xpixmap
633 mb_util_next_utf8_char (
unsigned char **
string);
MBFont * mb_font_set_from_string(MBFont *font, char *spec)
Sets the font propertys from a textual description.
MBFontRenderOpts
Option flags for text rendering.
MBColor * mb_col_new_from_spec(MBPixbuf *pb, char *spec)
Constructs a new MBColor from a string specification.
void mb_font_ref(MBFont *font)
Refs a created MBFont object.
void mb_font_set_family(MBFont *font, const char *family)
Sets the fonts family.
MBFontWeight mb_font_get_weight(MBFont *font)
Gets the fonts weight.
char * mb_font_get_family(MBFont *font)
Gets the fonts family.
void mb_drawable_unref(MBDrawable *drw)
Unrefs ( frees ) a drawable.
void mb_font_set_slant(MBFont *font, MBFontSlant slant)
Sets the fonts slant.
int mb_font_get_descent(MBFont *font)
Gets the fonts descent in pixels.
int mb_font_render_simple(MBFont *font, MBDrawable *drw, int x, int y, int width, unsigned char *text, int encoding, MBFontRenderOpts opts)
Renders a line of text onto a MBDrawable.
void mb_font_set_color(MBFont *font, MBColor *col)
Sets the fonts color.
Bool mb_col_set(MBColor *col, char *spec)
Sets an existing MBColor from a string specification.
int mb_font_get_height(MBFont *font)
Gets the fonts height in pixels.
struct MBColor MBColor
Its not recommended you touch structure internals directly.
int mb_font_get_ascent(MBFont *font)
Gets the fonts ascent in pixels.
void mb_font_unref(MBFont *font)
Unrefs ( frees ) a created MBColor object.
void mb_font_set_weight(MBFont *font, MBFontWeight weight)
Sets the fonts weight.
MBDrawable * mb_drawable_new_from_pixmap(MBPixbuf *pixbuf, Pixmap pxm)
Creates a new MBDrawable instance from a pre-existing pixmap.
struct MBDrawable MBDrawable
Type for representing an mbdrawable.
int mb_font_set_size_to_pixels(MBFont *font, int max_pixels, int *points_to_try)
Attempts to fit the point size to a pixel size.
void mb_font_set_point_size(MBFont *font, int points)
Sets the fonts size.
MBFontSlant
enumerated types for font slant styles
MBFontWeight
enumerated types for font weights.
MBDrawable * mb_drawable_new(MBPixbuf *pixbuf, int width, int height)
Creates a new MBDrawable instance.
struct MBFont MBFont
Its not recommended you touch structure internals directly.
int mb_font_get_point_size(MBFont *font)
Gets the fonts point size.
void mb_col_unref(MBColor *col)
Unrefs ( frees ) a created MBColor object.
MBFont * mb_font_new_from_string(Display *dpy, char *spec)
Constructs a new MBFont instance.
struct MBPixbuf MBPixbuf
Opaque structure used for all operations.
MBFont * mb_font_new(Display *dpy, char *family)
Constructs a new MBFont instance.
MBColor * mb_font_get_color(MBFont *font)
Gets the fonts point size.
struct MBLayout MBLayout
Experimental and therefore not as yet documented.
void mb_col_set_rgba(MBColor *col, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
Sets an existing MBColor from r,g,b,a values.
int mb_font_render_simple_get_width(MBFont *font, int width, unsigned char *text, int encoding, MBFontRenderOpts opts)
Returns the width in pixels of any text rendered with mb_font_render_simple, taking into account any ...
void mb_col_get_rgba(MBColor *col, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha)
Gets an r,g,b,a values from an existing MBColor.
MBEncoding
enumerated types for text encodings