navit
0.5.3-trunk
|
#include <font_freetype.h>
Data Fields | |
void(* | destroy )(void) |
struct font_freetype_font *(* | font_new )(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font, int size, int flags) |
Load a font, preferring one with the given font family. More... | |
void(* | get_text_bbox )(struct graphics_priv *gr, struct font_freetype_font *font, char *text, int dx, int dy, struct point *ret, int estimate) |
struct font_freetype_text *(* | text_new )(char *text, struct font_freetype_font *font, int dx, int dy) |
void(* | text_destroy )(struct font_freetype_text *text) |
int(* | get_shadow )(struct font_freetype_glyph *glyph, unsigned char *data, int stride, struct color *fg, struct color *tr) |
Get glyph "shadow", a glyph bitmap to be used as background. More... | |
int(* | get_glyph )(struct font_freetype_glyph *glyph, unsigned char *data, int stride, struct color *fg, struct color *bg, struct color *tr) |
Get a glyph bitmap. More... | |
Methods provided by this plugin.
void(* font_freetype_methods::destroy) (void) |
Referenced by graphics_destroy(), and graphics_sdl_new().
struct font_freetype_font*(* font_freetype_methods::font_new) (struct graphics_priv *gr, struct graphics_font_methods *meth, char *font, int size, int flags) |
Load a font, preferring one with the given font family.
Try to load a font, trying to match either the given font family, or one from a list of hardcoded families, or let fontconfig pick the best match.
graphics_priv | unused |
graphics_font_methods | used to return font methods |
fontfamily | the preferred font family |
size | requested size of font |
flags | extra flags for the font (bold,etc) |
Referenced by graphics_gd_new(), graphics_gtk_drawing_area_new_helper(), graphics_qt5_new(), graphics_qt_qpainter_new(), graphics_sdl_new(), and overlay_new().
int(* font_freetype_methods::get_glyph) (struct font_freetype_glyph *glyph, unsigned char *data, int stride, struct color *fg, struct color *bg, struct color *tr) |
Get a glyph bitmap.
This method returns a bitmap for rendering the supplied glyph.
g | glyph to render, usually obtained from a struct font_freetype_text created via font_freetype_methods.text_new() |
data | buffer for result image bitmap. Size must be at least (4 * stride * g->h). |
stride | stride (bytes per data row) for result bitmap; must be at least g->w, but may include padding. Special case: If set to 0, 'data' is interpreted as an array of pointers to image data rows (i.e. unsigned char**). |
fg | color for rendering the glyph |
bg | color to alpha blend with fg for semi-transparent glyph pixels |
transparent | color for background pixels |
Referenced by display_text_draw(), and draw_text().
int(* font_freetype_methods::get_shadow) (struct font_freetype_glyph *glyph, unsigned char *data, int stride, struct color *fg, struct color *tr) |
Get glyph "shadow", a glyph bitmap to be used as background.
This method returns a glyph shadow, a bitmap with the glyph, where the glyph has been "fattened" by expanding it by one pixel on each side. In Navit, the shadow is used as the background behind the glyph bitmaps (returned by font_freetype_methods.get_glyph() ), to make the text easier to read.
g | glyph to render, usually created via font_freetype_methods.text_new() |
data | buffer for result image bitmap. Size must be at least (4 * stride * (g->h+2)). |
stride | see font_freetype_methods.get_glyph(). Minimum: g->w+2. |
foreground | color for rendering the "shadow" |
background | color for rest of the bitmap (typically set to transparent) |
Referenced by display_text_draw(), and draw_text().
void(* font_freetype_methods::get_text_bbox) (struct graphics_priv *gr, struct font_freetype_font *font, char *text, int dx, int dy, struct point *ret, int estimate) |
void(* font_freetype_methods::text_destroy) (struct font_freetype_text *text) |
Referenced by draw_text().
struct font_freetype_text*(* font_freetype_methods::text_new) (char *text, struct font_freetype_font *font, int dx, int dy) |
Referenced by draw_text().