zenilib: zenilib/jni/external/freetype2/src/tools/ftrandom/ftrandom.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
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().

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 554 of file ftrandom.c.

References calloc, check_outlines, default_dir_list, default_ext_list, do_test(), error_count, error_fraction, ExecuteTest(), FindFonts(), font_size, forever, i, nohints, NULL, rasterize, and results_dir.

static void TestFace | ( | FT_Face | face | ) |

static

Definition at line 148 of file ftrandom.c.

References check_outlines, font_size, FT_Done_Face(), FT_IS_SCALABLE, FT_LOAD_DEFAULT, FT_Load_Glyph(), FT_LOAD_NO_BITMAP, FT_LOAD_NO_HINTING, FT_Outline_Decompose(), FT_Render_Glyph(), ft_render_mode_normal, FT_Set_Char_Size(), FT_FaceRec_::glyph, nohints, NULL, FT_FaceRec_::num_glyphs, FT_GlyphSlotRec_::outline, and rasterize.

Referenced by ExecuteTest().

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:
=
{
GOOD_FONTS_DIR,
NULL
}
GOOD_FONTS_DIR
#define GOOD_FONTS_DIR
Definition: ftrandom.c:59
NULL
#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",
NULL
}
NULL
#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:
=
{
FT_MoveTo,
FT_LineTo,
FT_ConicTo,
FT_CubicTo,
0, 0
}
FT_CubicTo
static int FT_CubicTo(const FT_Vector *cp1, const FT_Vector *cp2, const FT_Vector *to, void *user)
Definition: ftrandom.c:128
FT_MoveTo
static int FT_MoveTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:103
FT_LineTo
static int FT_LineTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:111
FT_ConicTo
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().