navit  0.5.3-trunk
font_freetype.c File Reference
#include "config.h"
#include <ft2build.h>
#include <glib.h>
#include "point.h"
#include "graphics.h"
#include "debug.h"
#include "plugin.h"
#include "color.h"
#include "atom.h"
#include "font_freetype.h"

Data Structures

struct  font_freetype_font
 
struct  font_priv
 

Macros

#define USE_CACHING   1
 
#define HAVE_LOOKUP_SCALER   0
 
#define COLOR_BITDEPTH_OUTPUT   8
 
#define COL_SHIFT   (COLOR_BITDEPTH-COLOR_BITDEPTH_OUTPUT)
 

Functions

static void font_freetype_get_text_bbox (struct graphics_priv *gr, struct font_freetype_font *font, char *text, int dx, int dy, struct point *ret, int estimate)
 
static struct font_freetype_textfont_freetype_text_new (char *text, struct font_freetype_font *font, int dx, int dy)
 
static void font_destroy (struct graphics_font_priv *font)
 
static void font_freetype_text_destroy (struct font_freetype_text *text)
 
static FT_Error face_requester (FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface)
 
static struct font_freetype_fontfont_freetype_font_new (struct graphics_priv *gr, struct graphics_font_methods *meth, char *fontfamily, int size, int flags)
 
static int font_freetype_glyph_get_shadow (struct font_freetype_glyph *g, unsigned char *data, int stride, struct color *foreground, struct color *background)
 
static int font_freetype_glyph_get_glyph (struct font_freetype_glyph *g, unsigned char *data, int stride, struct color *fg, struct color *bg, struct color *transparent)
 
static void font_freetype_destroy (void)
 
static struct font_privfont_freetype_new (void *meth)
 
void plugin_init (void)
 

Variables

static struct font_priv dummy
 
static FT_Library library
 
static FTC_Manager manager
 
static FTC_ImageCache image_cache
 
static FTC_CMapCache charmap_cache
 
static FTC_SBitCache sbit_cache
 
static int library_init = 0
 
static int library_deinit = 0
 
static char * fontfamilies []
 
static struct graphics_font_methods font_methods
 
static struct font_freetype_methods methods
 

Macro Definition Documentation

◆ COL_SHIFT

#define COL_SHIFT   (COLOR_BITDEPTH-COLOR_BITDEPTH_OUTPUT)

◆ COLOR_BITDEPTH_OUTPUT

#define COLOR_BITDEPTH_OUTPUT   8

◆ HAVE_LOOKUP_SCALER

#define HAVE_LOOKUP_SCALER   0

◆ USE_CACHING

#define USE_CACHING   1

Navit, a modular navigation system. Copyright (C) 2005-2011 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

◆ face_requester()

static FT_Error face_requester ( FTC_FaceID  face_id,
FT_Library  library,
FT_Pointer  request_data,
FT_Face *  aface 
)
static

References dbg, library, lvl_debug, and lvl_error.

Referenced by font_freetype_font_new().

◆ font_destroy()

static void font_destroy ( struct graphics_font_priv font)
static

◆ font_freetype_destroy()

static void font_freetype_destroy ( void  )
static

References library, library_deinit, and manager.

◆ font_freetype_font_new()

static struct font_freetype_font* font_freetype_font_new ( struct graphics_priv gr,
struct graphics_font_methods meth,
char *  fontfamily,
int  size,
int  flags 
)
static

◆ font_freetype_get_text_bbox()

static void font_freetype_get_text_bbox ( struct graphics_priv gr,
struct font_freetype_font font,
char *  text,
int  dx,
int  dy,
struct point ret,
int  estimate 
)
static

◆ font_freetype_glyph_get_glyph()

static int font_freetype_glyph_get_glyph ( struct font_freetype_glyph g,
unsigned char *  data,
int  stride,
struct color fg,
struct color bg,
struct color transparent 
)
static

◆ font_freetype_glyph_get_shadow()

static int font_freetype_glyph_get_shadow ( struct font_freetype_glyph g,
unsigned char *  data,
int  stride,
struct color foreground,
struct color background 
)
static

◆ font_freetype_new()

◆ font_freetype_text_destroy()

static void font_freetype_text_destroy ( struct font_freetype_text text)
static

◆ font_freetype_text_new()

◆ plugin_init()

void plugin_init ( void  )

References font_freetype_new().

Variable Documentation

◆ charmap_cache

FTC_CMapCache charmap_cache
static

◆ dummy

struct font_priv dummy
static

Referenced by font_freetype_new().

◆ font_methods

struct graphics_font_methods font_methods
static
Initial value:
= {
}
static void font_destroy(struct graphics_font_priv *font)
Definition: font_freetype.c:321

Referenced by font_freetype_font_new().

◆ fontfamilies

char* fontfamilies[]
static
Initial value:
= {
"Liberation Sans",
"Arial",
"NcrBI4nh",
"luximbi",
"FreeSans",
"DejaVu Sans",
NULL,
}

List of font families to use, in order of preference

Referenced by font_freetype_font_new().

◆ image_cache

FTC_ImageCache image_cache
static

◆ library

FT_Library library
static

◆ library_deinit

int library_deinit = 0
static

Referenced by font_freetype_destroy().

◆ library_init

int library_init = 0
static

Referenced by font_freetype_font_new().

◆ manager

◆ methods

struct font_freetype_methods methods
static
Initial value:
= {
}
static struct font_freetype_text * font_freetype_text_new(char *text, struct font_freetype_font *font, int dx, int dy)
Definition: font_freetype.c:191
static void font_freetype_text_destroy(struct font_freetype_text *text)
Definition: font_freetype.c:331
static int font_freetype_glyph_get_shadow(struct font_freetype_glyph *g, unsigned char *data, int stride, struct color *foreground, struct color *background)
Definition: font_freetype.c:512
static int font_freetype_glyph_get_glyph(struct font_freetype_glyph *g, unsigned char *data, int stride, struct color *fg, struct color *bg, struct color *transparent)
Definition: font_freetype.c:565
static struct font_freetype_font * font_freetype_font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *fontfamily, int size, int flags)
Definition: font_freetype.c:370
static void font_freetype_destroy(void)
Definition: font_freetype.c:600
static void font_freetype_get_text_bbox(struct graphics_priv *gr, struct font_freetype_font *font, char *text, int dx, int dy, struct point *ret, int estimate)
Definition: font_freetype.c:89

Referenced by event_sdl_new(), font_freetype_new(), graphics_opengl_egl_new(), graphics_opengl_x11_new(), and graphics_sdl_new().

◆ sbit_cache

FTC_SBitCache sbit_cache
static

Referenced by font_freetype_font_new().