32#include <libmb/mbconfig.h>
33#include <libmb/mbpixbuf.h>
34#include <libmb/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)
189typedef struct MBDrawable
194#if defined (USE_XFT) || defined (USE_PANGO)
208typedef struct MBLayout
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
376mb_font_get (MBFont *font);
459mb_font_get_txt_width (MBFont *font,
545mb_layout_unref (MBLayout *layout);
548mb_layout_set_font(MBLayout *layout, MBFont *font);
553mb_layout_set_geometry(MBLayout *layout,
554 int width,
int height);
557mb_layout_get_geometry(MBLayout *layout,
558 int *width,
int *height);
562mb_layout_set_text(MBLayout *layout,
567mb_layout_destroy (MBLayout *layout);
570mb_layout_set_multiline (MBLayout *layout, Bool want_multiline);
573mb_layout_set_align (MBLayout *layout,
int horizontal,
int vertical);
576mb_layout_set_clip_style (MBLayout *layout,
int clip_stype);
579mb_layout_render (MBLayout *layout,
585#define mb_layout_width(l) (l)->width
586#define mb_layout_height(l) (l)->height
629#define mb_drawable_pixmap(drw) (drw)->xpixmap
633mb_util_next_utf8_char (
unsigned char **
string);
int mb_font_get_descent(MBFont *font)
Gets the fonts descent in pixels.
MBColor * mb_col_new_from_spec(MBPixbuf *pb, char *spec)
Constructs a new MBColor from a string specification.
MBFont * mb_font_new(Display *dpy, char *family)
Constructs a new MBFont instance.
char * mb_font_get_family(MBFont *font)
Gets the fonts family.
MBFontWeight
enumerated types for font weights.
struct MBLayout MBLayout
Experimental and therefore not as yet documented.
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 ...
MBFont * mb_font_set_from_string(MBFont *font, char *spec)
Sets the font propertys from a textual description.
void mb_font_set_color(MBFont *font, MBColor *col)
Sets the fonts color.
void mb_font_set_slant(MBFont *font, MBFontSlant slant)
Sets the fonts slant.
void mb_font_unref(MBFont *font)
Unrefs ( frees ) a created MBColor object.
MBFontSlant
enumerated types for font slant styles
struct MBDrawable MBDrawable
Type for representing an mbdrawable.
void mb_col_unref(MBColor *col)
Unrefs ( frees ) a created MBColor object.
int mb_font_get_ascent(MBFont *font)
Gets the fonts ascent in pixels.
MBFontRenderOpts
Option flags for text rendering.
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.
MBFont * mb_font_new_from_string(Display *dpy, char *spec)
Constructs a new MBFont instance.
int mb_font_get_height(MBFont *font)
Gets the fonts height in pixels.
void mb_font_set_family(MBFont *font, const char *family)
Sets the fonts family.
void mb_font_set_weight(MBFont *font, MBFontWeight weight)
Sets the fonts weight.
MBEncoding
enumerated types for text encodings
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.
int mb_font_get_point_size(MBFont *font)
Gets the fonts point size.
struct MBColor MBColor
Its not recommended you touch structure internals directly.
MBDrawable * mb_drawable_new_from_pixmap(MBPixbuf *pixbuf, Pixmap pxm)
Creates a new MBDrawable instance from a pre-existing pixmap.
struct MBFont MBFont
Its not recommended you touch structure internals directly.
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.
MBFontWeight mb_font_get_weight(MBFont *font)
Gets the fonts weight.
void mb_font_set_point_size(MBFont *font, int points)
Sets the fonts size.
void mb_drawable_unref(MBDrawable *drw)
Unrefs ( frees ) a drawable.
MBColor * mb_font_get_color(MBFont *font)
Gets the fonts point size.
MBDrawable * mb_drawable_new(MBPixbuf *pixbuf, int width, int height)
Creates a new MBDrawable instance.
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.
Bool mb_col_set(MBColor *col, char *spec)
Sets an existing MBColor from a string specification.
void mb_font_ref(MBFont *font)
Refs a created MBFont object.