#define bkwd cntr[0]
#define frwd cntr[1]
+ /* various extended structures used at some stage of transformation */
+ void *ext;
+
union {
struct {
int val[2][3]; /* integer values */
char flags;
#define GEF_FLOAT 0x02 /* entry contains floating point data */
+#define GEF_LINE 0x04 /* entry looks like a line even if it's a curve */
unsigned char dir; /* used to temporarily store the values for
* the directions of the ends of curves */
#define GE_LINE 'L'
#define GE_CURVE 'C'
#define GE_PATH 'P'
+
+ /* indexes of the points to be used for calculation of the tangents */
+ signed char ftg; /* front tangent */
+ signed char rtg; /* rear tangent, -1 means "idx 2 of the previous entry" */
} GENTRY;
/* stem structure, describes one [hv]stem */
} GLYPH;
+/* description of a dot for calculation of its distance to a curve */
+
+struct dot_dist {
+ double p[2 /*X,Y*/]; /* coordinates of a dot */
+ double dist2; /* squared distance from the dot to the curve */
+ short seg; /* the closest segment of the curve */
+};
+
extern int stdhw, stdvw; /* dominant stems widths */
extern int stemsnaph[12], stemsnapv[12]; /* most typical stem width */
void docorrectwidth(void);
void addkernpair( unsigned id1, unsigned id2, int unscval);
void print_kerning( FILE *afm_file);
+
+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);