libgpac
Documentation of the core library of GPAC
ft_font.c File Reference
#include <gpac/modules/font.h>
#include <gpac/list.h>
#include <gpac/utf.h>
#include <gpac/tools.h>
#include <ft2build.h>
+ Include dependency graph for ft_font.c:

Data Structures

struct  FTBuilder
 
struct  ft_outliner
 

Macros

#define FTCST   const
 

Functions

static Bool isBestFontFor (const char *listOfFonts[], const char *currentBestFont, const char *fontName)
 
void setBestFont (const char *listOfFonts[], char **currentBestFont, const char *fontName)
 
static Bool ft_enum_fonts (void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
 
static Bool ft_enum_fonts_dir (void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
 
static void ft_rescan_fonts (GF_FontReader *dr)
 
static GF_Err ft_init_font_engine (GF_FontReader *dr)
 
static GF_Err ft_shutdown_font_engine (GF_FontReader *dr)
 
static Bool ft_check_face (FT_Face font, const char *fontName, u32 styles)
 
static FT_Face ft_font_in_cache (FTBuilder *ft, const char *fontName, u32 styles)
 
static GF_Err ft_set_font (GF_FontReader *dr, const char *OrigFontName, u32 styles)
 
static GF_Err ft_get_font_info (GF_FontReader *dr, char **font_name, u32 *em_size, s32 *ascent, s32 *descent, s32 *underline, s32 *line_spacing, s32 *max_advance_h, s32 *max_advance_v)
 
static GF_Err ft_get_glyphs (GF_FontReader *dr, const char *utf_string, u32 *glyph_buffer, u32 *io_glyph_buffer_size, const char *xml_lang, Bool *is_rtl)
 
static int ft_move_to (FTCST FT_Vector *to, void *user)
 
static int ft_line_to (FTCST FT_Vector *to, void *user)
 
static int ft_conic_to (FTCST FT_Vector *control, FTCST FT_Vector *to, void *user)
 
static int ft_cubic_to (FTCST FT_Vector *c1, FTCST FT_Vector *c2, FTCST FT_Vector *to, void *user)
 
static GF_Glyphft_load_glyph (GF_FontReader *dr, u32 glyph_name)
 
static GF_FontReaderft_load ()
 
static void ft_delete (GF_BaseInterface *ifce)
 
GPAC_MODULE_EXPORT const u32QueryInterfaces ()
 
GPAC_MODULE_EXPORT GF_BaseInterfaceLoadInterface (u32 InterfaceType)
 
GPAC_MODULE_EXPORT void ShutdownInterface (GF_BaseInterface *ifce)
 

Variables

static const char * BEST_FIXED_FONTS []
 
static const char * BEST_SERIF_FONTS []
 
static const char * BEST_SANS_FONTS []
 

Data Structure Documentation

◆ FTBuilder

struct FTBuilder
Data Fields
FT_Library library
FT_Face active_face
GF_List * font_dirs
GF_List * loaded_fonts
char * font_serif
char * font_sans
char * font_fixed
char * font_default
Bool cache_checked

◆ ft_outliner

struct ft_outliner
+ Collaboration diagram for ft_outliner:
Data Fields
FTBuilder * ftpriv
GF_Path * path
s32 last_x
s32 last_y

Macro Definition Documentation

◆ FTCST

#define FTCST   const

Function Documentation

◆ isBestFontFor()

static Bool isBestFontFor ( const char *  listOfFonts[],
const char *  currentBestFont,
const char *  fontName 
)
static

Choose the best font in the list of fonts

+ Here is the caller graph for this function:

◆ setBestFont()

void setBestFont ( const char *  listOfFonts[],
char **  currentBestFont,
const char *  fontName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_enum_fonts()

static Bool ft_enum_fonts ( void *  cbck,
char *  file_name,
char *  file_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_enum_fonts_dir()

static Bool ft_enum_fonts_dir ( void *  cbck,
char *  file_name,
char *  file_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_rescan_fonts()

static void ft_rescan_fonts ( GF_FontReader dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_init_font_engine()

static GF_Err ft_init_font_engine ( GF_FontReader dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_shutdown_font_engine()

static GF_Err ft_shutdown_font_engine ( GF_FontReader dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_check_face()

static Bool ft_check_face ( FT_Face  font,
const char *  fontName,
u32  styles 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_font_in_cache()

static FT_Face ft_font_in_cache ( FTBuilder ft,
const char *  fontName,
u32  styles 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_set_font()

static GF_Err ft_set_font ( GF_FontReader dr,
const char *  OrigFontName,
u32  styles 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_get_font_info()

static GF_Err ft_get_font_info ( GF_FontReader dr,
char **  font_name,
u32 em_size,
s32 ascent,
s32 descent,
s32 underline,
s32 line_spacing,
s32 max_advance_h,
s32 max_advance_v 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_get_glyphs()

static GF_Err ft_get_glyphs ( GF_FontReader dr,
const char *  utf_string,
u32 glyph_buffer,
u32 io_glyph_buffer_size,
const char *  xml_lang,
Bool is_rtl 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_move_to()

static int ft_move_to ( FTCST FT_Vector *  to,
void *  user 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_line_to()

static int ft_line_to ( FTCST FT_Vector *  to,
void *  user 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_conic_to()

static int ft_conic_to ( FTCST FT_Vector *  control,
FTCST FT_Vector *  to,
void *  user 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_cubic_to()

static int ft_cubic_to ( FTCST FT_Vector *  c1,
FTCST FT_Vector *  c2,
FTCST FT_Vector *  to,
void *  user 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_load_glyph()

static GF_Glyph* ft_load_glyph ( GF_FontReader dr,
u32  glyph_name 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_load()

static GF_FontReader* ft_load ( )
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ft_delete()

static void ft_delete ( GF_BaseInterface ifce)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QueryInterfaces()

GPAC_MODULE_EXPORT const u32* QueryInterfaces ( )

◆ LoadInterface()

GPAC_MODULE_EXPORT GF_BaseInterface* LoadInterface ( u32  InterfaceType)
+ Here is the call graph for this function:

◆ ShutdownInterface()

GPAC_MODULE_EXPORT void ShutdownInterface ( GF_BaseInterface ifce)
+ Here is the call graph for this function:

Variable Documentation

◆ BEST_FIXED_FONTS

const char* BEST_FIXED_FONTS[]
static
Initial value:
= {
"Courier New",
"Courier",
"Monaco",
"Bitstream Vera Monospace",
"Droid Sans Mono",
NULL
}

◆ BEST_SERIF_FONTS

const char* BEST_SERIF_FONTS[]
static
Initial value:
= {
"Times New Roman",
"Bitstream Vera",
"Times",
"Droid Serif",
NULL
}

◆ BEST_SANS_FONTS

const char* BEST_SANS_FONTS[]
static
Initial value:
= {
"Arial",
"Tahoma",
"Verdana",
"Helvetica",
"Bitstream Vera Sans",
"Frutiger",
"Droid Sans",
NULL
}