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)  

pt1.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#include <netinet/in.h>
#include <unistd.h>
#include "ttf.h"
#include "pt1.h"
#include "global.h"
Include dependency graph for pt1.c:

Go to the source code of this file.

Classes

struct  gex_con
 
struct  ray
 

Macros

#define FBIGVAL   (1e20)
 
#define FEPS   (100000./FBIGVAL)
 
#define X   0
 
#define Y   1
 
#define NREFDOTS   3
 
#define GEXF_QUL   0x00000001 /* in up-left quadrant */
 
#define GEXF_QUR   0x00000002 /* in up-right quadrant */
 
#define GEXF_QDR   0x00000004 /* in down-right quadrant */
 
#define GEXF_QDL   0x00000008 /* in down-left quadrant */
 
#define GEXF_QMASK   0x0000000F /* quadrant mask */
 
#define GEXF_QTO_IDEAL(f)   (((f)&0xF)<<4)
 
#define GEXF_QFROM_IDEAL(f)   (((f)&0xF0)>>4)
 
#define GEXF_IDQ_L   0x00000090 /* left */
 
#define GEXF_IDQ_R   0x00000060 /* right */
 
#define GEXF_IDQ_U   0x00000030 /* up */
 
#define GEXF_IDQ_D   0x000000C0 /* down */
 
#define GEXF_JLINE   0x00000100 /* into one line */
 
#define GEXF_JIGN   0x00000200 /* if one entry's tangent angle is ignored */
 
#define GEXF_JID   0x00000400 /* if one entry is idealized to hor/vert */
 
#define GEXF_JFLAT   0x00000800 /* if one entry is flattened */
 
#define GEXF_JGOOD   0x00001000 /* perfectly, no additional maodifications */
 
#define GEXF_JMASK   0x00001F00 /* the mask of all above */
 
#define GEXF_JCVMASK   0x00001E00 /* the mask of all above except JLINE */
 
#define GEXF_JIGN1   0x00002000
 
#define GEXF_JIGN2   0x00004000
 
#define GEXF_JIGNDIR(dir)   (GEXF_JIGN1<<(dir))
 
#define GEXF_JID1   0x00008000
 
#define GEXF_JID2   0x00010000
 
#define GEXF_JIDDIR(dir)   (GEXF_JID1<<(dir))
 
#define GEXF_JFLAT1   0x00020000
 
#define GEXF_JFLAT2   0x00040000
 
#define GEXF_JFLATDIR(dir)   (GEXF_JFLAT1<<(dir))
 
#define GEXF_VERT   0x00100000 /* is nearly vertical */
 
#define GEXF_HOR   0x00200000 /* is nearly horizontal */
 
#define GEXF_FLAT   0x00400000 /* is nearly flat */
 
#define GEXF_VDOTS   0x01000000 /* the dots are valid */
 
#define X_CON(ge)   ((GEX_CON *)((ge)->ext))
 
#define X_CON_D(ge)   (X_CON(ge)->d)
 
#define X_CON_DX(ge)   (X_CON(ge)->d[0])
 
#define X_CON_DY(ge)   (X_CON(ge)->d[1])
 
#define X_CON_ISD(ge)   (X_CON(ge)->isd)
 
#define X_CON_ISDX(ge)   (X_CON(ge)->isd[0])
 
#define X_CON_ISDY(ge)   (X_CON(ge)->isd[1])
 
#define X_CON_SIN2(ge)   (X_CON(ge)->sin2)
 
#define X_CON_LEN2(ge)   (X_CON(ge)->len2)
 
#define X_CON_F(ge)   (X_CON(ge)->flags)
 
#define MAX_STACK   1000
 
#define setbasestem(from, to)    (xbstem[0]=from, xbstem[1]=to, xblast=1)
 
#define isbaseempty()   (xblast<=0)
 
#define SPLIT(pt1, pt2)   ( (pt1) + k1*((pt2)-(pt1)) ) /* order is important! */
 
#define TIMESLARGER   10. /* how many times larger must be a curve to not change too much */
 
#define TIMESLARGER   10. /* how much larger must be a curve to not change too much */
 
#define x1   seg[0][X]
 
#define y1   seg[0][Y]
 
#define x2   seg[1][X]
 
#define y2   seg[1][Y]
 
#define xdot   dot[X]
 
#define ydot   dot[Y]
 
#define HANDLE_LIMITS(less12, lesscr1, lesscr2)
 
#define NAPSECT   16
 
#define NWSECT   4
 
#define B   0
 
#define C   1
 
#define MAXSECT   2
 
#define NORMSECT   2
 
#define STEPEPS   1.
 
#define CVEPS   1.5
 
#define CVEPS2   (CVEPS*CVEPS)
 
#define SMOOTHSIN2   0.25 /* 0.25==sin(30 degrees)^2 */
 
#define SMALL_LINE2   (15.*15.)
 
#define TIMES_LINE2   (3.*3.)
 
#define MAXDOTS   ((NREFDOTS+1)*12)
 
#define MAXBLUEWIDTH   (24)
 
#define MAXHYST   (2000) /* size of the hystogram */
 
#define HYSTBASE   500
 
#define MINDIST   10 /* minimal distance between the widths */
 

Typedefs

typedef struct gex_con GEX_CON
 

Functions

static void fixcvdir (GENTRY *ge, int dir)
 
static void fixcvends (GENTRY *ge)
 
static int fgetcvdir (GENTRY *ge)
 
static int igetcvdir (GENTRY *ge)
 
static int fiszigzag (GENTRY *ge)
 
static int iiszigzag (GENTRY *ge)
 
static GENTRYfreethisge (GENTRY *ge)
 
static void addgeafter (GENTRY *oge, GENTRY *nge)
 
static GENTRYnewgentry (int flags)
 
static void debugstems (char *name, STEM *hstems, int nhs, STEM *vstems, int nvs)
 
static int addbluestems (STEM *s, int n)
 
static void sortstems (STEM *s, int n)
 
static int stemoverlap (STEM *s1, STEM *s2)
 
static int steminblue (STEM *s)
 
static void markbluestems (STEM *s, int nold)
 
static int joinmainstems (STEM *s, int nold, int useblues)
 
static void joinsubstems (STEM *s, short *pairs, int nold, int useblues)
 
static void fixendpath (GENTRY *ge)
 
static void fdelsmall (GLYPH *g, double minlen)
 
static void alloc_gex_con (GENTRY *ge)
 
static double fjointsin2 (GENTRY *ge1, GENTRY *ge2)
 
static double fcvarea (GENTRY *ge)
 
static double fcvval (GENTRY *ge, int axis, double t)
 
static void fsampledots (GENTRY *ge, double dots[][2], int ndots)
 
static void fnormalizege (GENTRY *ge)
 
static void fanalyzege (GENTRY *ge)
 
static void fanalyzejoint (GENTRY *ge)
 
static void fconcisecontour (GLYPH *g, GENTRY *ge)
 
static double fclosegap (GENTRY *from, GENTRY *to, int axis, double gap, double *ret)
 
int isign (int x)
 
int fsign (double x)
 
void rmoveto (int dx, int dy)
 
void rlineto (int dx, int dy)
 
void rrcurveto (int dx1, int dy1, int dx2, int dy2, int dx3, int dy3)
 
void closepath (void)
 
void assertpath (GENTRY *from, char *file, int line, char *name)
 
void assertisfloat (GLYPH *g, char *msg)
 
void assertisint (GLYPH *g, char *msg)
 
void fg_rmoveto (GLYPH *g, double x, double y)
 
void ig_rmoveto (GLYPH *g, int x, int y)
 
void fg_rlineto (GLYPH *g, double x, double y)
 
void ig_rlineto (GLYPH *g, int x, int y)
 
void fg_rrcurveto (GLYPH *g, double x1, double y1, double x2, double y2, double x3, double y3)
 
void ig_rrcurveto (GLYPH *g, int x1, int y1, int x2, int y2, int x3, int y3)
 
void g_closepath (GLYPH *g)
 
static int iround (double val)
 
void dumppaths (GLYPH *g, GENTRY *start, GENTRY *end)
 
void pathtoint (GLYPH *g)
 
int fcheckcv (GENTRY *ge, double dx, double dy)
 
int icheckcv (GENTRY *ge, int dx, int dy)
 
void fclosepaths (GLYPH *g)
 
void smoothjoints (GLYPH *g)
 
static int subfrombase (int from, int to)
 
static void printbasestem (void)
 
static void uniformstems (STEM *s, short *pairs, int ns)
 
static int findstemat (int value, int origin, GENTRY *ge, STEM *sp, short *pairs, int ns, int prevbest)
 
static int gssentry (GENTRY *ge, STEM *hs, short *hpairs, int nhs, STEM *vs, short *vpairs, int nvs, STEMBOUNDS *s, short *egp, int *nextvsi, int *nexthsi)
 
static void groupsubstems (GLYPH *g, STEM *hs, short *hpairs, int nhs, STEM *vs, short *vpairs, int nvs)
 
void buildstems (GLYPH *g)
 
void fstraighten (GLYPH *g)
 
static int fsqequation (double a, double b, double c, double *res, double min, double max)
 
void ffixquadrants (GLYPH *g)
 
void fsplitzigzags (GLYPH *g)
 
static int fcrossraysxx (double crossdot[2][2])
 
int fcrossrayscv (double curve[4][2], double *max1, double *max2)
 
int fcrossraysge (GENTRY *ge1, GENTRY *ge2, double *max1, double *max2, double crossdot[2][2])
 
double fdotsegdist2 (double seg[2][2], double dot[2])
 
double fdotcurvdist2 (double curve[4][2], struct dot_dist *dots, int ndots, double *maxp)
 
void fapproxcurve (double cv[4][2], struct dot_dist *dots, int ndots)
 
void fforceconcise (GLYPH *g)
 
void print_glyph (int glyphno)
 
int print_glyph_subs (int glyphno, int startid)
 
void print_glyph_metrics (int code, int glyphno)
 
static int besthyst (int *hyst, int base, int *best, int nbest, int width, int *bestindp)
 
static int bestblue (short *zhyst, short *physt, short *ozhyst, int *bluetab)
 
void findblues (void)
 
void docorrectwidth (void)
 
void stemstatistics (void)
 
void reversepathsfromto (GENTRY *from, GENTRY *to)
 
void reversepaths (GLYPH *g)
 
void addkernpair (unsigned id1, unsigned id2, int unscval)
 
void print_kerning (FILE *afm_file)
 

Variables

static int ggoodcv =0
 
static int ggoodcvdots =0
 
static int gbadcv =0
 
static int gbadcvdots =0
 
int stdhw
 
int stdvw
 
int stemsnaph [12]
 
int stemsnapv [12]
 
int bluevalues [14]
 
int nblues
 
int otherblues [10]
 
int notherb
 
int bbox [4]
 
double italic_angle
 
GLYPHglyph_list
 
int encoding [1024]
 
int kerning_pairs = 0
 
static short xbstem [2000 *2]
 
static int xblast = -1
 
static int gssentry_lastgrp =0
 
static struct ray ray [3]
 

Macro Definition Documentation

◆ B

#define B   0

Definition at line 249 of file gensi.hpp.

Referenced by fapproxcurve().

◆ C

#define C   1

◆ CVEPS

#define CVEPS   1.5

Definition at line 5625 of file pt1.c.

◆ CVEPS2

#define CVEPS2   (CVEPS*CVEPS)

Definition at line 5626 of file pt1.c.

◆ FBIGVAL

#define FBIGVAL   (1e20)

Definition at line 27 of file pt1.c.

◆ FEPS

#define FEPS   (100000./FBIGVAL)

Definition at line 28 of file pt1.c.

◆ GEXF_FLAT

#define GEXF_FLAT   0x00400000 /* is nearly flat */

Definition at line 87 of file pt1.c.

◆ GEXF_HOR

#define GEXF_HOR   0x00200000 /* is nearly horizontal */

Definition at line 86 of file pt1.c.

◆ GEXF_IDQ_D

#define GEXF_IDQ_D   0x000000C0 /* down */

Definition at line 60 of file pt1.c.

◆ GEXF_IDQ_L

#define GEXF_IDQ_L   0x00000090 /* left */

Definition at line 57 of file pt1.c.

◆ GEXF_IDQ_R

#define GEXF_IDQ_R   0x00000060 /* right */

Definition at line 58 of file pt1.c.

◆ GEXF_IDQ_U

#define GEXF_IDQ_U   0x00000030 /* up */

Definition at line 59 of file pt1.c.

◆ GEXF_JCVMASK

#define GEXF_JCVMASK   0x00001E00 /* the mask of all above except JLINE */

Definition at line 72 of file pt1.c.

◆ GEXF_JFLAT

#define GEXF_JFLAT   0x00000800 /* if one entry is flattened */

Definition at line 68 of file pt1.c.

◆ GEXF_JFLAT1

#define GEXF_JFLAT1   0x00020000

Definition at line 81 of file pt1.c.

◆ GEXF_JFLAT2

#define GEXF_JFLAT2   0x00040000

Definition at line 82 of file pt1.c.

◆ GEXF_JFLATDIR

#define GEXF_JFLATDIR (   dir)    (GEXF_JFLAT1<<(dir))

Definition at line 83 of file pt1.c.

◆ GEXF_JGOOD

#define GEXF_JGOOD   0x00001000 /* perfectly, no additional maodifications */

Definition at line 69 of file pt1.c.

◆ GEXF_JID

#define GEXF_JID   0x00000400 /* if one entry is idealized to hor/vert */

Definition at line 67 of file pt1.c.

◆ GEXF_JID1

#define GEXF_JID1   0x00008000

Definition at line 78 of file pt1.c.

◆ GEXF_JID2

#define GEXF_JID2   0x00010000

Definition at line 79 of file pt1.c.

◆ GEXF_JIDDIR

#define GEXF_JIDDIR (   dir)    (GEXF_JID1<<(dir))

Definition at line 80 of file pt1.c.

◆ GEXF_JIGN

#define GEXF_JIGN   0x00000200 /* if one entry's tangent angle is ignored */

Definition at line 66 of file pt1.c.

◆ GEXF_JIGN1

#define GEXF_JIGN1   0x00002000

Definition at line 75 of file pt1.c.

◆ GEXF_JIGN2

#define GEXF_JIGN2   0x00004000

Definition at line 76 of file pt1.c.

◆ GEXF_JIGNDIR

#define GEXF_JIGNDIR (   dir)    (GEXF_JIGN1<<(dir))

Definition at line 77 of file pt1.c.

◆ GEXF_JLINE

#define GEXF_JLINE   0x00000100 /* into one line */

Definition at line 65 of file pt1.c.

◆ GEXF_JMASK

#define GEXF_JMASK   0x00001F00 /* the mask of all above */

Definition at line 71 of file pt1.c.

◆ GEXF_QDL

#define GEXF_QDL   0x00000008 /* in down-left quadrant */

Definition at line 51 of file pt1.c.

◆ GEXF_QDR

#define GEXF_QDR   0x00000004 /* in down-right quadrant */

Definition at line 50 of file pt1.c.

◆ GEXF_QFROM_IDEAL

#define GEXF_QFROM_IDEAL (   f)    (((f)&0xF0)>>4)

Definition at line 56 of file pt1.c.

◆ GEXF_QMASK

#define GEXF_QMASK   0x0000000F /* quadrant mask */

Definition at line 52 of file pt1.c.

◆ GEXF_QTO_IDEAL

#define GEXF_QTO_IDEAL (   f)    (((f)&0xF)<<4)

Definition at line 55 of file pt1.c.

◆ GEXF_QUL

#define GEXF_QUL   0x00000001 /* in up-left quadrant */

Definition at line 48 of file pt1.c.

◆ GEXF_QUR

#define GEXF_QUR   0x00000002 /* in up-right quadrant */

Definition at line 49 of file pt1.c.

◆ GEXF_VDOTS

#define GEXF_VDOTS   0x01000000 /* the dots are valid */

Definition at line 89 of file pt1.c.

◆ GEXF_VERT

#define GEXF_VERT   0x00100000 /* is nearly vertical */

Definition at line 85 of file pt1.c.

◆ HANDLE_LIMITS

#define HANDLE_LIMITS (   less12,
  lesscr1,
  lesscr2 
)
Value:
if( less12 ) { \
if( lesscr1 ) { \
xcross = x1; \
ycross = y1; \
} else if( !(lesscr2) ) { \
xcross = x2; \
ycross = y2; \
} \
} else { \
if( !(lesscr1) ) { \
xcross = x1; \
ycross = y1; \
} else if( lesscr2 ) { \
xcross = x2; \
ycross = y2; \
} \
} \
/* end of macro */
#define x1
#define y1
#define y2
#define x2

◆ HYSTBASE

#define HYSTBASE   500

Definition at line 6563 of file pt1.c.

◆ isbaseempty

#define isbaseempty ( )    (xblast<=0)

Definition at line 2521 of file pt1.c.

◆ MAX_STACK

#define MAX_STACK   1000

◆ MAXBLUEWIDTH

#define MAXBLUEWIDTH   (24)

Definition at line 6552 of file pt1.c.

◆ MAXDOTS

#define MAXDOTS   ((NREFDOTS+1)*12)

◆ MAXHYST

#define MAXHYST   (2000) /* size of the hystogram */

Definition at line 6562 of file pt1.c.

◆ MAXSECT

#define MAXSECT   2

◆ MINDIST

#define MINDIST   10 /* minimal distance between the widths */

◆ NAPSECT

#define NAPSECT   16

◆ NORMSECT

#define NORMSECT   2

◆ NREFDOTS

#define NREFDOTS   3

Definition at line 42 of file pt1.c.

◆ NWSECT

#define NWSECT   4

◆ setbasestem

#define setbasestem (   from,
  to 
)     (xbstem[0]=from, xbstem[1]=to, xblast=1)

Definition at line 2519 of file pt1.c.

◆ SMALL_LINE2

#define SMALL_LINE2   (15.*15.)

Definition at line 5630 of file pt1.c.

◆ SMOOTHSIN2

#define SMOOTHSIN2   0.25 /* 0.25==sin(30 degrees)^2 */

Definition at line 5628 of file pt1.c.

◆ SPLIT

#define SPLIT (   pt1,
  pt2 
)    ( (pt1) + k1*((pt2)-(pt1)) ) /* order is important! */

◆ STEPEPS

#define STEPEPS   1.

◆ TIMES_LINE2

#define TIMES_LINE2   (3.*3.)

Definition at line 5632 of file pt1.c.

◆ TIMESLARGER [1/2]

#define TIMESLARGER   10. /* how many times larger must be a curve to not change too much */

◆ TIMESLARGER [2/2]

#define TIMESLARGER   10. /* how much larger must be a curve to not change too much */

◆ X

#define X   0

Definition at line 31 of file pt1.c.

◆ x1

#define x1   seg[0][X]

◆ x2

#define x2   seg[1][X]

◆ X_CON

#define X_CON (   ge)    ((GEX_CON *)((ge)->ext))

Definition at line 96 of file pt1.c.

◆ X_CON_D

#define X_CON_D (   ge)    (X_CON(ge)->d)

Definition at line 97 of file pt1.c.

◆ X_CON_DX

#define X_CON_DX (   ge)    (X_CON(ge)->d[0])

Definition at line 98 of file pt1.c.

◆ X_CON_DY

#define X_CON_DY (   ge)    (X_CON(ge)->d[1])

Definition at line 99 of file pt1.c.

◆ X_CON_F

#define X_CON_F (   ge)    (X_CON(ge)->flags)

Definition at line 105 of file pt1.c.

◆ X_CON_ISD

#define X_CON_ISD (   ge)    (X_CON(ge)->isd)

Definition at line 100 of file pt1.c.

◆ X_CON_ISDX

#define X_CON_ISDX (   ge)    (X_CON(ge)->isd[0])

Definition at line 101 of file pt1.c.

◆ X_CON_ISDY

#define X_CON_ISDY (   ge)    (X_CON(ge)->isd[1])

Definition at line 102 of file pt1.c.

◆ X_CON_LEN2

#define X_CON_LEN2 (   ge)    (X_CON(ge)->len2)

Definition at line 104 of file pt1.c.

◆ X_CON_SIN2

#define X_CON_SIN2 (   ge)    (X_CON(ge)->sin2)

Definition at line 103 of file pt1.c.

◆ xdot

#define xdot   dot[X]

◆ Y

#define Y   1

Definition at line 32 of file pt1.c.

◆ y1

#define y1   seg[0][Y]

◆ y2

#define y2   seg[1][Y]

◆ ydot

#define ydot   dot[Y]

Typedef Documentation

◆ GEX_CON

typedef struct gex_con GEX_CON

Definition at line 1 of file pt1.c.

Function Documentation

◆ addbluestems()

static int addbluestems ( STEM s,
int  n 
)
static

Definition at line 1737 of file pt1.c.

References bluevalues, i, n, nblues, notherb, otherblues, s, ST_TOPZONE, ST_UP, and ST_ZONE.

Referenced by buildstems().

◆ addgeafter()

static void addgeafter ( GENTRY oge,
GENTRY nge 
)
static

◆ addkernpair()

void addkernpair ( unsigned  id1,
unsigned  id2,
int  unscval 
)

Definition at line 7143 of file pt1.c.

References BITMAP_BYTES, calloc(), exit(), flags, fprintf, g, GF_USED, glyph_list, i, IS_BITMAP, iscale(), kerning_pairs, memset(), n, NULL, numglyphs, p, realloc, and SET_BITMAP.

Referenced by kerning().

◆ alloc_gex_con()

static void alloc_gex_con ( GENTRY ge)
static

Definition at line 5570 of file pt1.c.

References calloc(), exit(), gentry::ext, and fprintf.

Referenced by fforceconcise().

◆ assertisfloat()

void assertisfloat ( GLYPH g,
char *  msg 
)

Definition at line 353 of file pt1.c.

References abort(), fprintf, g, GEF_FLOAT, and GF_FLOAT.

Referenced by fclosepaths(), fforceconcise(), fg_rlineto(), fg_rmoveto(), fg_rrcurveto(), fsplitzigzags(), and pathtoint().

◆ assertisint()

void assertisint ( GLYPH g,
char *  msg 
)

Definition at line 371 of file pt1.c.

References abort(), fprintf, g, GEF_FLOAT, and GF_FLOAT.

Referenced by buildstems(), ig_rlineto(), ig_rmoveto(), ig_rrcurveto(), and smoothjoints().

◆ assertpath()

void assertpath ( GENTRY from,
char *  file,
int  line,
char *  name 
)

◆ bestblue()

static int bestblue ( short *  zhyst,
short *  physt,
short *  ozhyst,
int bluetab 
)
static

Definition at line 6632 of file pt1.c.

References first, HYSTBASE, i, ind, j, last, max, MAXBLUEWIDTH, MAXHYST, and w.

Referenced by findblues().

◆ besthyst()

static int besthyst ( int hyst,
int  base,
int best,
int  nbest,
int  width,
int bestindp 
)
static

Definition at line 6566 of file pt1.c.

References base, i, j, last, max, MAXHYST, memset(), w, and width.

Referenced by stemstatistics().

◆ buildstems()

◆ closepath()

void closepath ( void  )

Definition at line 263 of file pt1.c.

References fprintf, and pfa_file.

Referenced by print_glyph().

◆ debugstems()

static void debugstems ( char *  name,
STEM hstems,
int  nhs,
STEM vstems,
int  nvs 
)
static

Definition at line 1706 of file pt1.c.

References flags, fprintf, i, name, pfa_file, ST_END, ST_FLAT, ST_TOPZONE, ST_UP, ST_ZONE, and to.

Referenced by buildstems().

◆ docorrectwidth()

void docorrectwidth ( void  )

Definition at line 6906 of file pt1.c.

References correctwidth, fprintf, g, GE_CURVE, GE_LINE, GF_USED, glyph_list, i, maxwidth, gentry::next, numglyphs, stdhw, gentry::type, and WARNING_3.

Referenced by main().

◆ dumppaths()

◆ fanalyzege()

◆ fanalyzejoint()

◆ fapproxcurve()

void fapproxcurve ( double  cv[4][2],
struct dot_dist dots,
int  ndots 
)

Definition at line 5269 of file pt1.c.

References B, bc, C, cv, dots(), fabs, FBIGVAL, fdotcurvdist2(), fprintf, i, j, k, MAXSECT, NORMSECT, NULL, p, sqrt(), STEPEPS, and to.

Referenced by dosubfrag(), and fconcisecontour().

◆ fcheckcv()

int fcheckcv ( GENTRY ge,
double  dx,
double  dy 
)

Definition at line 1329 of file pt1.c.

References abort(), fabs, gentry::flags, fprintf, GE_CURVE, GEF_FLOAT, gentry::prev, and gentry::type.

◆ fclosegap()

static double fclosegap ( GENTRY from,
GENTRY to,
int  axis,
double  gap,
double *  ret 
)
static

Definition at line 4502 of file pt1.c.

References base, gentry::cntr, fabs, FEPS, fprintf, fsign(), GE_CURVE, j, k, limit, gentry::next, gentry::prev, ret, scale, TIMESLARGER, to, and gentry::type.

Referenced by fclosepaths(), fdelsmall(), and fstraighten().

◆ fclosepaths()

◆ fconcisecontour()

◆ fcrossrayscv()

int fcrossrayscv ( double  curve[4][2],
double *  max1,
double *  max2 
)

Definition at line 4909 of file pt1.c.

References fcrossraysxx(), ray::maxp, X, ray::x1, ray::x2, Y, ray::y1, and ray::y2.

Referenced by dosubfrag().

◆ fcrossraysge()

int fcrossraysge ( GENTRY ge1,
GENTRY ge2,
double *  max1,
double *  max2,
double  crossdot[2][2] 
)

◆ fcrossraysxx()

static int fcrossraysxx ( double  crossdot[2][2])
static

Definition at line 4841 of file pt1.c.

References ray::b, fabs, FEPS, fprintf, i, ISDBG, ray::isvert, ray::k, k, max, ray::maxp, cordic::x, ray::x1, x1, ray::x2, x2, y, ray::y1, y1, ray::y2, and y2.

Referenced by fcrossrayscv(), and fcrossraysge().

◆ fcvarea()

static double fcvarea ( GENTRY ge)
static

◆ fcvval()

static double fcvval ( GENTRY ge,
int  axis,
double  t 
)
static

Definition at line 5513 of file pt1.c.

References mt, gentry::prev, t, and t2.

Referenced by fanalyzege(), and fsampledots().

◆ fdelsmall()

static void fdelsmall ( GLYPH g,
double  minlen 
)
static

◆ fdotcurvdist2()

double fdotcurvdist2 ( double  curve[4][2],
struct dot_dist dots,
int  ndots,
double *  maxp 
)

Definition at line 5087 of file pt1.c.

References count, d, dots(), fdotsegdist2(), i, max, NAPSECT, nt, NWSECT, p, printf(), sqrt(), step(), t, t2, cordic::x, X, y, and Y.

Referenced by dosubfrag(), fapproxcurve(), and fconcisecontour().

◆ fdotsegdist2()

double fdotsegdist2 ( double  seg[2][2],
double  dot[2] 
)

Definition at line 4995 of file pt1.c.

References fabs, FEPS, HANDLE_LIMITS, printf(), x1, x2, xdot, y1, y2, and ydot.

Referenced by fanalyzege(), fanalyzejoint(), fconcisecontour(), fdotcurvdist2(), and fjointsin2().

◆ ffixquadrants()

void ffixquadrants ( GLYPH g)

Definition at line 4041 of file pt1.c.

References a, addgeafter(), b, c, dir, fprintf, fsign(), fsqequation(), g, GE_CURVE, GEF_FLOAT, i, ISDBG, j, k1, newgentry(), gentry::next, np, gentry::prev, sp, SPLIT, and gentry::type.

Referenced by convert_glyf().

◆ fforceconcise()

◆ fg_rlineto()

void fg_rlineto ( GLYPH g,
double  x,
double  y 
)

◆ fg_rmoveto()

void fg_rmoveto ( GLYPH g,
double  x,
double  y 
)

◆ fg_rrcurveto()

void fg_rrcurveto ( GLYPH g,
double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)

◆ fgetcvdir()

static int fgetcvdir ( GENTRY ge)
static

◆ findblues()

◆ findstemat()

static int findstemat ( int  value,
int  origin,
GENTRY ge,
STEM sp,
short *  pairs,
int  ns,
int  prevbest 
)
static

Definition at line 2864 of file pt1.c.

References abs, flags, fprintf, i, ISDBG, max, min, ns, sp, ST_END, and v.

Referenced by gssentry().

◆ fiszigzag()

static int fiszigzag ( GENTRY ge)
static

Definition at line 4240 of file pt1.c.

References a, b, fabs, FBIGVAL, FEPS, GE_CURVE, k, k1, gentry::prev, and gentry::type.

Referenced by fsplitzigzags().

◆ fixcvdir()

static void fixcvdir ( GENTRY ge,
int  dir 
)
static

◆ fixcvends()

static void fixcvends ( GENTRY ge)
static

Definition at line 752 of file pt1.c.

References abort(), abs, gentry::flags, fprintf, GE_CURVE, GE_LINE, GEF_FLOAT, isign(), gentry::prev, gentry::type, x0, x1, x2, x3, y0, y1, y2, and y3.

Referenced by fixcvdir(), and smoothjoints().

◆ fixendpath()

static void fixendpath ( GENTRY ge)
static

Definition at line 4473 of file pt1.c.

References gentry::flags, GE_MOVE, GEF_FLOAT, gentry::prev, and gentry::type.

Referenced by fstraighten().

◆ fjointsin2()

static double fjointsin2 ( GENTRY ge1,
GENTRY ge2 
)
static

Definition at line 5440 of file pt1.c.

References d, fdotsegdist2(), gentry::ftg, gentry::prev, gentry::rtg, sqrt(), X, and Y.

Referenced by fanalyzege().

◆ fnormalizege()

static void fnormalizege ( GENTRY ge)
static

◆ freethisge()

static GENTRY * freethisge ( GENTRY ge)
static

◆ fsampledots()

static void fsampledots ( GENTRY ge,
double  dots[][2],
int  ndots 
)
static

Definition at line 5537 of file pt1.c.

References d, dots(), fcvval(), GE_CURVE, i, gentry::prev, t, and gentry::type.

Referenced by fconcisecontour().

◆ fsign()

int fsign ( double  x)

Definition at line 170 of file pt1.c.

References cordic::x.

Referenced by dosubfrag(), fanalyzege(), fclosegap(), fdelsmall(), ffixquadrants(), fstraighten(), and limcurve().

◆ fsplitzigzags()

◆ fsqequation()

static int fsqequation ( double  a,
double  b,
double  c,
double *  res,
double  min,
double  max 
)
static

Definition at line 3964 of file pt1.c.

References a, b, c, D, fabs, fprintf, ISDBG, max, min, n, and sqrt().

Referenced by ffixquadrants().

◆ fstraighten()

void fstraighten ( GLYPH g)

Definition at line 3833 of file pt1.c.

References dir, fabs, fclosegap(), fixendpath(), fprintf, freethisge(), fsign(), g, GE_CURVE, GE_LINE, i, ISDBG, gentry::next, NULL, gentry::prev, and gentry::type.

Referenced by convert_glyf().

◆ g_closepath()

void g_closepath ( GLYPH g)

◆ groupsubstems()

static void groupsubstems ( GLYPH g,
STEM hs,
short *  hpairs,
int  nhs,
STEM vs,
short *  vpairs,
int  nvs 
)
static

◆ gssentry()

static int gssentry ( GENTRY ge,
STEM hs,
short *  hpairs,
int  nhs,
STEM vs,
short *  vpairs,
int  nvs,
STEMBOUNDS s,
short *  egp,
int nextvsi,
int nexthsi 
)
static

◆ icheckcv()

int icheckcv ( GENTRY ge,
int  dx,
int  dy 
)

Definition at line 1355 of file pt1.c.

References abort(), gentry::flags, fprintf, GE_CURVE, GEF_FLOAT, gentry::prev, and gentry::type.

Referenced by smoothjoints().

◆ ig_rlineto()

void ig_rlineto ( GLYPH g,
int  x,
int  y 
)

Definition at line 530 of file pt1.c.

References assertisint(), fprintf, free, g, GE_LINE, ISDBG, newgentry(), gentry::next, gentry::prev, gentry::type, WARNING_1, cordic::x, and y.

Referenced by bmp_outline(), and ig_rrcurveto().

◆ ig_rmoveto()

void ig_rmoveto ( GLYPH g,
int  x,
int  y 
)

Definition at line 440 of file pt1.c.

References assertisint(), fprintf, g, GE_CURVE, GE_LINE, GE_MOVE, ISDBG, newgentry(), gentry::next, gentry::prev, gentry::type, cordic::x, and y.

Referenced by bmp_outline().

◆ ig_rrcurveto()

void ig_rrcurveto ( GLYPH g,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

◆ igetcvdir()

static int igetcvdir ( GENTRY ge)
static

◆ iiszigzag()

static int iiszigzag ( GENTRY ge)
static

Definition at line 4190 of file pt1.c.

References a, b, fabs, FBIGVAL, GE_CURVE, k, k1, gentry::prev, and gentry::type.

◆ iround()

static int iround ( double  val)
static

Definition at line 1174 of file pt1.c.

Referenced by pathtoint().

◆ isign()

int isign ( int  x)

◆ joinmainstems()

static int joinmainstems ( STEM s,
int  nold,
int  useblues 
)
static

Definition at line 1984 of file pt1.c.

References a, abs, b, bluevalues, c, flags, fprintf, i, ISDBG, j, k, MAX_STACK, nblues, notherb, otherblues, pfa_file, s, ST_3, ST_BLUE, ST_END, ST_FLAT, ST_TOPZONE, ST_UP, ST_ZONE, stemoverlap(), w1, w2, w3, and WARNING_1.

Referenced by buildstems().

◆ joinsubstems()

static void joinsubstems ( STEM s,
short *  pairs,
int  nold,
int  useblues 
)
static

Definition at line 2664 of file pt1.c.

References f, flags, fprintf, i, isbaseempty, ISDBG, j, MAX_STEMS, mx, pfa_file, putc, s, setbasestem, ST_BLUE, ST_END, ST_FLAT, ST_UP, ST_ZONE, subfrombase(), to, v, and cordic::x.

Referenced by buildstems().

◆ markbluestems()

static void markbluestems ( STEM s,
int  nold 
)
static

Definition at line 1891 of file pt1.c.

References a, b, bluevalues, c, flags, fprintf, i, ISDBG, j, nblues, notherb, otherblues, pfa_file, s, ST_BLUE, ST_END, ST_UP, and ST_ZONE.

Referenced by buildstems().

◆ newgentry()

◆ pathtoint()

◆ print_glyph()

◆ print_glyph_metrics()

void print_glyph_metrics ( int  code,
int  glyphno 
)

Definition at line 6497 of file pt1.c.

References afm_file, fprintf, g, glyph_list, and iscale().

Referenced by main().

◆ print_glyph_subs()

int print_glyph_subs ( int  glyphno,
int  startid 
)

Definition at line 6466 of file pt1.c.

References fprintf, g, glyph_list, i, pfa_file, and subhints.

Referenced by main().

◆ print_kerning()

void print_kerning ( FILE afm_file)

Definition at line 7205 of file pt1.c.

References afm_file, fprintf, g, GF_USED, glyph_list, i, j, kerning_pairs, glyph::name, numglyphs, and p.

Referenced by main().

◆ printbasestem()

static void printbasestem ( void  )
static

Definition at line 2649 of file pt1.c.

References i, printf(), xblast, and xbstem.

◆ reversepaths()

void reversepaths ( GLYPH g)

Definition at line 7133 of file pt1.c.

References g, NULL, and reversepathsfromto().

Referenced by draw_simple_glyf(), and main().

◆ reversepathsfromto()

void reversepathsfromto ( GENTRY from,
GENTRY to 
)

Definition at line 7055 of file pt1.c.

References addgeafter(), cur, exit(), f, fprintf, GE_CURVE, GE_LINE, GEF_FLOAT, i, ilast, ISDBG, n, gentry::next, next, gentry::prev, to, and gentry::type.

Referenced by draw_simple_glyf(), and reversepaths().

◆ rlineto()

void rlineto ( int  dx,
int  dy 
)

Definition at line 220 of file pt1.c.

References fprintf, optimize, and pfa_file.

Referenced by print_glyph(), and rrcurveto().

◆ rmoveto()

void rmoveto ( int  dx,
int  dy 
)

Definition at line 206 of file pt1.c.

References fprintf, optimize, and pfa_file.

Referenced by print_glyph().

◆ rrcurveto()

void rrcurveto ( int  dx1,
int  dy1,
int  dx2,
int  dy2,
int  dx3,
int  dy3 
)

Definition at line 237 of file pt1.c.

References fprintf, optimize, pfa_file, and rlineto().

Referenced by print_glyph().

◆ smoothjoints()

void smoothjoints ( GLYPH g)

◆ sortstems()

static void sortstems ( STEM s,
int  n 
)
static

Definition at line 1785 of file pt1.c.

References flags, i, j, n, s, ST_END, ST_FLAT, ST_UP, ST_ZONE, and cordic::x.

Referenced by buildstems().

◆ steminblue()

static int steminblue ( STEM s)
static

Definition at line 1862 of file pt1.c.

References bluevalues, i, nblues, notherb, otherblues, s, ST_UP, and val.

◆ stemoverlap()

static int stemoverlap ( STEM s1,
STEM s2 
)
static

Definition at line 1837 of file pt1.c.

References fprintf, ISDBG, pfa_file, check-static-inits::result, s1, and s2.

Referenced by joinmainstems().

◆ stemstatistics()

void stemstatistics ( void  )

Definition at line 6954 of file pt1.c.

References besthyst(), flags, g, GF_USED, glyph_list, i, j, k, MAXHYST, memset(), MINDIST, ns, numglyphs, s, ST_END, stdhw, stdvw, stemsnaph, stemsnapv, and w.

Referenced by main().

◆ subfrombase()

static int subfrombase ( int  from,
int  to 
)
static

Definition at line 2525 of file pt1.c.

References a, b, i, isbaseempty, j, to, xblast, and xbstem.

Referenced by joinsubstems().

◆ uniformstems()

static void uniformstems ( STEM s,
short *  pairs,
int  ns 
)
static

Definition at line 2808 of file pt1.c.

References abs, dir, flags, fprintf, i, ISDBG, ns, s, ST_END, ST_UP, to, and val.

Referenced by buildstems().

Variable Documentation

◆ bbox

int bbox[4]

Definition at line 117 of file pt1.c.

◆ bluevalues

◆ encoding

int encoding[1024]

Definition at line 121 of file pt1.c.

◆ gbadcv

int gbadcv =0
static

Definition at line 108 of file pt1.c.

Referenced by fconcisecontour(), and print_glyph().

◆ gbadcvdots

int gbadcvdots =0
static

Definition at line 108 of file pt1.c.

Referenced by fconcisecontour(), and print_glyph().

◆ ggoodcv

int ggoodcv =0
static

Definition at line 108 of file pt1.c.

Referenced by fconcisecontour(), and print_glyph().

◆ ggoodcvdots

int ggoodcvdots =0
static

Definition at line 108 of file pt1.c.

Referenced by fconcisecontour(), and print_glyph().

◆ glyph_list

◆ gssentry_lastgrp

int gssentry_lastgrp =0
static

Definition at line 2949 of file pt1.c.

Referenced by groupsubstems(), and gssentry().

◆ italic_angle

double italic_angle

Definition at line 118 of file pt1.c.

Referenced by findblues().

◆ kerning_pairs

int kerning_pairs = 0

Definition at line 122 of file pt1.c.

Referenced by addkernpair(), and print_kerning().

◆ nblues

int nblues

Definition at line 114 of file pt1.c.

Referenced by addbluestems(), findblues(), joinmainstems(), main(), markbluestems(), and steminblue().

◆ notherb

int notherb

Definition at line 116 of file pt1.c.

Referenced by addbluestems(), findblues(), joinmainstems(), main(), markbluestems(), and steminblue().

◆ otherblues

◆ ray

struct ray ray[3]
static

Definition at line 4620 of file pt1.c.

Referenced by InterpolateMissingSector().

◆ stdhw

int stdhw

Definition at line 110 of file pt1.c.

Referenced by docorrectwidth(), dumpcffprivate(), main(), and stemstatistics().

◆ stdvw

int stdvw

Definition at line 110 of file pt1.c.

Referenced by dumpcffprivate(), main(), and stemstatistics().

◆ stemsnaph

int stemsnaph[12]

Definition at line 111 of file pt1.c.

Referenced by dumpcffprivate(), main(), and stemstatistics().

◆ stemsnapv

int stemsnapv[12]

Definition at line 111 of file pt1.c.

Referenced by dumpcffprivate(), main(), and stemstatistics().

◆ xblast

int xblast = -1
static

Definition at line 2517 of file pt1.c.

Referenced by printbasestem(), and subfrombase().

◆ xbstem

short xbstem[2000 *2]
static

Definition at line 2515 of file pt1.c.

Referenced by printbasestem(), and subfrombase().