w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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 <signal.h>
#include <time.h>
#include <ft2build.h>
#include <freetype/freetype.h>
#include <freetype/ftoutln.h>
Include dependency graph for ftrandom.c:

Go to the source code of this file.

Classes

struct  fontlist
 

Macros

#define _XOPEN_SOURCE   500 /* for `kill', `strdup', `random', and `srandom' */
 
#define true   1
 
#define false   0
 
#define forever   for (;;)
 
#define GOOD_FONTS_DIR   "/usr/local/share/fonts"
 

Functions

static int FT_MoveTo (const FT_Vector *to, void *user)
 
static int FT_LineTo (const FT_Vector *to, void *user)
 
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 void TestFace (FT_Face face)
 
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 unsigned int getErrorCnt (struct fontlist *item)
 
static int getRandom (int low, int high)
 
static int copyfont (struct fontlist *item, char *newfont)
 
static void abort_test (int sig)
 
static void do_test (void)
 
static void usage (FILE *out, char *name)
 
int main (int argc, char **argv)
 

Variables

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

Macro Definition Documentation

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   500 /* for `kill', `strdup', `random', and `srandom' */

Definition at line 32 of file ftrandom.c.

◆ false

#define false   0

Definition at line 52 of file ftrandom.c.

◆ forever

#define forever   for (;;)

Definition at line 53 of file ftrandom.c.

◆ GOOD_FONTS_DIR

#define GOOD_FONTS_DIR   "/usr/local/share/fonts"

Definition at line 61 of file ftrandom.c.

◆ true

#define true   1

Definition at line 51 of file ftrandom.c.

Function Documentation

◆ abort_test()

static void abort_test ( int  sig)
static

Definition at line 505 of file ftrandom.c.

References child_pid, FT_UNUSED, and write.

Referenced by do_test().

◆ copyfont()

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

Definition at line 437 of file ftrandom.c.

References exit(), fclose, ferror, FILE, fopen, fprintf, fread, fseek, fwrite(), getErrorCnt(), getRandom(), hex, i, item, len, newfont, putc, SEEK_SET, and unlink.

Referenced by do_test().

◆ do_test()

static void do_test ( void  )
static

◆ ExecuteTest()

static void ExecuteTest ( char *  testfont)
static

◆ extmatch()

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

Definition at line 242 of file ftrandom.c.

References extensions, filename, i, NULL, pt, strcasecmp, and strrchr.

Referenced by FindFonts().

◆ figurefiletype()

static void figurefiletype ( struct fontlist item)
static

Definition at line 268 of file ftrandom.c.

References ch2, ch3, ch4, fclose, FILE, fopen, fprintf, getc, item, and strstr().

Referenced by FindFonts().

◆ FindFonts()

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

◆ FT_ConicTo()

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

Definition at line 127 of file ftrandom.c.

References FT_UNUSED, and to.

◆ FT_CubicTo()

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

Definition at line 140 of file ftrandom.c.

References FT_UNUSED, and to.

◆ FT_LineTo()

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

Definition at line 116 of file ftrandom.c.

References FT_UNUSED, and to.

◆ FT_MoveTo()

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

Definition at line 105 of file ftrandom.c.

References FT_UNUSED, and to.

◆ getErrorCnt()

static unsigned int getErrorCnt ( struct fontlist item)
static

Definition at line 416 of file ftrandom.c.

References error_count, error_fraction, int(), and item.

Referenced by copyfont().

◆ getRandom()

static int getRandom ( int  low,
int  high 
)
static

Definition at line 426 of file ftrandom.c.

References high, and low.

Referenced by copyfont(), and do_test().

◆ main()

◆ TestFace()

◆ usage()

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

Definition at line 556 of file ftrandom.c.

References d, default_dir_list, default_ext_list, e, fprintf, name, and out.

Referenced by main().

Variable Documentation

◆ check_outlines

int check_outlines = 0
static

Definition at line 56 of file ftrandom.c.

Referenced by main(), and TestFace().

◆ child_pid

int child_pid
static

Definition at line 502 of file ftrandom.c.

Referenced by abort_test(), and do_test().

◆ default_dir_list

char* default_dir_list[]
static
Initial value:
=
{
"/usr/local/share/fonts" ,
0
}

Definition at line 63 of file ftrandom.c.

Referenced by main(), and usage().

◆ default_ext_list

char* default_ext_list[]
static
Initial value:
=
{
"ttf",
"otf",
"ttc",
"cid",
"pfb",
"pfa",
"bdf",
"pcf",
"pfr",
"fon",
"otb",
"cff",
0
}

Definition at line 69 of file ftrandom.c.

Referenced by main(), and usage().

◆ error_count

unsigned int error_count = 1
static

Definition at line 86 of file ftrandom.c.

Referenced by end_graf(), error(), getErrorCnt(), initialize(), main(), and show_whatever().

◆ error_fraction

double error_fraction = 0.0
static

Definition at line 87 of file ftrandom.c.

Referenced by getErrorCnt(), and main().

◆ fcnt

◆ font_size

FT_F26Dot6 font_size = 12 * 64
static

Definition at line 89 of file ftrandom.c.

Referenced by main(), and TestFace().

◆ fontlist

struct fontlist * fontlist
static

Referenced by ReadSplineFontInfo().

◆ nohints

int nohints = 0
static

Definition at line 57 of file ftrandom.c.

Referenced by main(), and TestFace().

◆ outlinefuncs

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:140
static int FT_ConicTo(const FT_Vector *_cp, const FT_Vector *to, void *user)
Definition: ftrandom.c:127
static int FT_LineTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:116
static int FT_MoveTo(const FT_Vector *to, void *user)
Definition: ftrandom.c:105

Definition at line 154 of file ftrandom.c.

Referenced by TestFace().

◆ rasterize

int rasterize = 0
static

◆ results_dir

char* results_dir = "results"
static

Definition at line 59 of file ftrandom.c.

Referenced by do_test(), and main().