zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftrandom.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <dirent.h>
#include <math.h>
#include <signal.h>
#include <time.h>
#include <ft2build.h>
#include <FT_FREETYPE_H>
#include <FT_OUTLINE_H>

Go to the source code of this file.

Macros

#define false   0
 
#define forever   for (;;)
 
#define GOOD_FONTS_DIR   "/home/wl/freetype-testfonts"
 
#define true   1
 

Functions

static void abort_test (int sig)
 
static int copyfont (struct fontlist *item, char *newfont)
 
static void do_test (void)
 
static void ExecuteTest (char *testfont)
 
static int extmatch (char *filename, char **extensions)
 
static void figurefiletype (struct fontlist *item)
 
static void FindFonts (char **fontdirs, char **extensions)
 
static int FT_ConicTo (const FT_Vector *_cp, const FT_Vector *to, void *user)
 
static int FT_CubicTo (const FT_Vector *cp1, const FT_Vector *cp2, const FT_Vector *to, void *user)
 
static int FT_LineTo (const FT_Vector *to, void *user)
 
static int FT_MoveTo (const FT_Vector *to, void *user)
 
static int getErrorCnt (struct fontlist *item)
 
static int getRandom (int low, int high)
 
int main (int argc, char **argv)
 
static void TestFace (FT_Face face)
 
static void usage (FILE *out, char *name)
 

Variables

static int check_outlines = false
 
static int child_pid
 
static char * default_dir_list []
 
static char * default_ext_list []
 
static int error_count = 1
 
static int error_fraction = 0
 
static int fcnt
 
static FT_F26Dot6 font_size = 12 * 64
 
static struct fontlist * fontlist
 
static int nohints = false
 
static FT_Outline_Funcs outlinefuncs
 
static int rasterize = false
 
static char * results_dir = "results"
 

Macro Definition Documentation

#define false   0

Definition at line 50 of file ftrandom.c.

Referenced by TiXmlPrinter::VisitEnter().

#define forever   for (;;)

Definition at line 51 of file ftrandom.c.

Referenced by main().

#define GOOD_FONTS_DIR   "/home/wl/freetype-testfonts"

Definition at line 59 of file ftrandom.c.

#define true   1

Definition at line 49 of file ftrandom.c.

Function Documentation

static void abort_test ( int  sig)
static

Definition at line 482 of file ftrandom.c.

References child_pid.

Referenced by do_test().

static int copyfont ( struct fontlist item,
char *  newfont 
)
static

Definition at line 414 of file ftrandom.c.

References getErrorCnt(), getRandom(), i, NULL, and SEEK_SET.

Referenced by do_test().

static void do_test ( void  )
static

Definition at line 491 of file ftrandom.c.

References abort_test(), child_pid, copyfont(), ExecuteTest(), fcnt, fontlist, getRandom(), i, and results_dir.

Referenced by main().

static void ExecuteTest ( char *  testfont)
static

Definition at line 183 of file ftrandom.c.

References context, FT_Done_Face(), FT_Init_FreeType(), FT_New_Face(), i, FT_FaceRec_::num_faces, and TestFace().

Referenced by do_test(), and main().

static int extmatch ( char *  filename,
char **  extensions 
)
static

Definition at line 221 of file ftrandom.c.

References i, and NULL.

Referenced by FindFonts().

static void figurefiletype ( struct fontlist item)
static

Definition at line 247 of file ftrandom.c.

References NULL.

Referenced by FindFonts().

static void FindFonts ( char **  fontdirs,
char **  extensions 
)
static

Definition at line 327 of file ftrandom.c.

References extmatch(), fcnt, figurefiletype(), fontlist, i, max, NULL, realloc, and strdup().

Referenced by main().

static int FT_ConicTo ( const FT_Vector _cp,
const FT_Vector to,
void user 
)
static

Definition at line 119 of file ftrandom.c.

static int FT_CubicTo ( const FT_Vector cp1,
const FT_Vector cp2,
const FT_Vector to,
void user 
)
static

Definition at line 128 of file ftrandom.c.

static int FT_LineTo ( const FT_Vector to,
void user 
)
static

Definition at line 111 of file ftrandom.c.

static int FT_MoveTo ( const FT_Vector to,
void user 
)
static

Definition at line 103 of file ftrandom.c.

static int getErrorCnt ( struct fontlist item)
static

Definition at line 393 of file ftrandom.c.

References error_count, and error_fraction.

Referenced by copyfont().

static int getRandom ( int  low,
int  high 
)
static

Definition at line 403 of file ftrandom.c.

References low.

Referenced by copyfont(), and do_test().

static void usage ( FILE *  out,
char *  name 
)
static

Definition at line 531 of file ftrandom.c.

Variable Documentation

int check_outlines = false
static

Definition at line 54 of file ftrandom.c.

Referenced by main(), and TestFace().

int child_pid
static

Definition at line 479 of file ftrandom.c.

Referenced by abort_test(), and do_test().

char* default_dir_list[]
static
Initial value:
=
{
}
#define GOOD_FONTS_DIR
Definition: ftrandom.c:59
#define NULL
Definition: ftobjs.h:61

Definition at line 61 of file ftrandom.c.

Referenced by main().

char* default_ext_list[]
static
Initial value:
=
{
"ttf",
"otf",
"ttc",
"cid",
"pfb",
"pfa",
"bdf",
"pcf",
"pfr",
"fon",
"otb",
"cff",
}
#define NULL
Definition: ftobjs.h:61

Definition at line 67 of file ftrandom.c.

Referenced by main().

int error_count = 1
static

Definition at line 84 of file ftrandom.c.

Referenced by getErrorCnt(), and main().

int error_fraction = 0
static

Definition at line 85 of file ftrandom.c.

Referenced by getErrorCnt(), and main().

int fcnt
static

Definition at line 99 of file ftrandom.c.

Referenced by do_test(), and FindFonts().

FT_F26Dot6 font_size = 12 * 64
static

Definition at line 87 of file ftrandom.c.

Referenced by main(), and TestFace().

struct fontlist * fontlist
static

Referenced by do_test(), and FindFonts().

int nohints = false
static

Definition at line 55 of file ftrandom.c.

Referenced by main(), and TestFace().

FT_Outline_Funcs outlinefuncs
static
Initial value:
=
{
0, 0
}
static int FT_CubicTo(const FT_Vector *cp1, const FT_Vector *cp2, const FT_Vector *to, void *user)
Definition: ftrandom.c:128
static int FT_MoveTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:103
static int FT_LineTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:111
static int FT_ConicTo(const FT_Vector *_cp, const FT_Vector *to, void *user)
Definition: ftrandom.c:119

Definition at line 137 of file ftrandom.c.

int rasterize = false
static

Definition at line 56 of file ftrandom.c.

Referenced by main(), and TestFace().

char* results_dir = "results"
static

Definition at line 57 of file ftrandom.c.

Referenced by do_test(), and main().