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)  

edgelist.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2008 by George Williams */
2 /*
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5 
6  * Redistributions of source code must retain the above copyright notice, this
7  * list of conditions and the following disclaimer.
8 
9  * Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12 
13  * The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15 
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 #ifndef _EDGELIST_H
28 #define _EDGELIST_H
29 #include "splinefont.h"
30 
31 typedef struct hints {
33  real b1, b2, e1, e2;
35  unsigned int adjustb: 1;
36  unsigned int adjuste: 1;
37  struct hints *next;
39 
40 /* Instead of y and x coordinates these are based on major and other */
41 /* major maybe either x or y depending on what we're interested in */
42 /* at the moment, and other will be the other one. Of course it's */
43 /* consistant accross the datastructure at any given time */
44 typedef struct edge {
45  real mmin, mmax; /* relative to es->mmin */
50  unsigned int up: 1; /* line is directed up in the spline list */
51  unsigned int max_adjusted: 1; /* by hstem hints */
52  unsigned int min_adjusted: 1;
53  Spline *spline; /* spline which generated this segment */
54  struct edge *esnext, *aenext;
55  struct edge *before, *after;
56  int last_opos, last_mpos;
57  real oldt; /* only used for FindIntersections of RemoveOverlap */
58 } Edge;
59 
60 typedef struct edgelist {
61  Edge **edges;
62  int cnt;
66  int bytes_per_line;
67  uint8 *bitmap;
69  SplineChar *sc;
70  int layer;
71  char *interesting;
72  int major, other;
73  unsigned int genmajoredges: 1; /* generate a list of edges parallel to the major axis */
74  Edge *majors; /* ordered so that lowest edge is first */
75  Edge *majorhold; /* to hold major edges as we pass them and they become useless */
76  Hints *hhints, *vhints;
77  int is_overlap;
78  DBounds bbox; /* Not always set. {m,o}{min,max} a provide scaled bbox, this is in glyph units */
80 
81 extern void FreeEdges(EdgeList *es);
82 extern double TOfNextMajor(Edge *e, EdgeList *es, double sought_y );
83 extern void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es, int ignore_clip);
84 extern Edge *ActiveEdgesInsertNew(EdgeList *es, Edge *active,int i);
87 
88 /* Version which is better for everything other than rasterization */
89 /* (I think) */
90 typedef struct edgeinfo {
91  /* The spline is broken up at all extrema. So... */
92  /* The spline between tmin and tmax is monotonic in both coordinates */
93  /* If the spline becomes vert/horizontal that will be at one of the */
94  /* end points too */
95  Spline *spline;
99  unsigned int up: 1;
100  unsigned int hv: 1;
101  unsigned int hvbottom: 1;
102  unsigned int hvtop: 1;
103  unsigned int hor: 1;
104  unsigned int vert: 1;
105  unsigned int almosthor: 1;
106  unsigned int almostvert: 1;
107  unsigned int horattmin: 1;
108  unsigned int horattmax: 1;
109  unsigned int vertattmin: 1;
110  unsigned int vertattmax: 1;
111  unsigned hup: 1;
112  unsigned vup: 1;
113  real tcur; /* Value of t for current major coord */
114  real ocur; /* Value of the other coord for current major coord */
115  struct edgeinfo *next;
116  struct edgeinfo *ordered;
117  struct edgeinfo *aenext;
118  struct edgeinfo *splinenext;
119  SplineChar *sc;
120  int major;
121 } EI;
122 
123 typedef struct eilist {
124  EI *edges;
127  int low, high, cnt;
128  EI **ordered;
129  char *ends; /* flag to say an edge ends on this line */
130  SplineChar *sc;
131  int layer;
132  int major;
134  EI **bottoms, **tops; /* Used only be FindNeeded in RemoveOverlap */
135  unsigned leavetiny: 1;
136  enum overlap_type ot;
138 
139 extern void ElFreeEI(EIList *el);
140 extern void ELFindEdges(SplineChar *sc, EIList *el);
141 extern void ELOrder(EIList *el, int major );
142 extern real EITOfNextMajor(EI *e, EIList *el, real sought_m );
143 extern int EISameLine(EI *e, EI *n, real i, int major);
144 extern int EISkipExtremum(EI *e, real i, int major);
145 extern EI *EIActiveEdgesFindStem(EI *apt, real i, int major);
146 extern EI *EIActiveListReorder(EI *active,int *change);
147 extern EI *EIActiveEdgesRefigure(EIList *el, EI *active,real i,int major,
148  int *_change);
149 #endif
#define sc
Definition: aptex-macros.h:57
#define active
Definition: aptex-macros.h:325
Definition: Hints.h:30
#define n
Definition: t4ht.c:1290
double real
Definition: dvips.h:66
static FIELD_PTR prev
Definition: genind.c:36
small capitals from c petite p scientific i
Definition: afcover.h:80
int major
Definition: pdfcolor.c:526
unsigned char uint8
Definition: tiff.h:60
struct edgeinfo EI
float EITOfNextMajor(EI *e, EIList *el, float sought_m)
Definition: autohint.c:853
void ElFreeEI(EIList *el)
Definition: autohint.c:595
struct hints Hints
struct edge Edge
EI * EIActiveListReorder(EI *active, int *change)
Definition: autohint.c:891
void FreeEdges(EdgeList *es)
Definition: splinefill.c:61
struct eilist EIList
EI * EIActiveEdgesFindStem(EI *apt, float i, int major)
int EISkipExtremum(EI *e, float i, int major)
Definition: autohint.c:1021
EI * EIActiveEdgesRefigure(EIList *el, EI *active, float i, int major, int *_change)
Definition: autohint.c:925
void ELFindEdges(SplineChar *sc, EIList *el)
Definition: autohint.c:723
int EISameLine(EI *e, EI *n, float i, int major)
Definition: autohint.c:987
void ELOrder(EIList *el, int major)
Definition: autohint.c:774
struct edgelist EdgeList
overlap_type
Definition: splinefont.h:232
Edge * ActiveEdgesInsertNew(EdgeList *es, Edge *active, int i)
Definition: splinefill.c:452
void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es, int ignore_clip)
Definition: splinefill.c:431
Edge * ActiveEdgesFindStem(Edge *apt, Edge **prev, double i)
double TOfNextMajor(Edge *e, EdgeList *es, double sought_y)
Definition: splinefill.c:112
Edge * ActiveEdgesRefigure(EdgeList *es, Edge *active, double i)
Definition: splinefill.c:481
ShellFileEnvironment e
Definition: sh6.c:388
struct edge * after
Definition: edgelist.h:55
struct edge * esnext
Definition: edgelist.h:54
unsigned int min_adjusted
Definition: edgelist.h:52
Spline * spline
Definition: edgelist.h:53
struct edge * aenext
Definition: edgelist.h:54
unsigned int max_adjusted
Definition: edgelist.h:51
double oldt
Definition: edgelist.h:57
unsigned int up
Definition: edgelist.h:50
double o_mmax
Definition: edgelist.h:48
float o_mmin
Definition: edgelist.h:48
double m_cur
Definition: edgelist.h:49
int last_opos
Definition: edgelist.h:56
float tmin
Definition: edgelist.h:47
float t_cur
Definition: edgelist.h:49
double tmax
Definition: edgelist.h:47
struct edge * before
Definition: edgelist.h:55
double mmax
Definition: edgelist.h:45
float t_mmin
Definition: edgelist.h:46
float mmin
Definition: edgelist.h:45
float o_cur
Definition: edgelist.h:49
double t_mmax
Definition: edgelist.h:46
int last_mpos
Definition: edgelist.h:56
SplineChar * sc
Definition: edgelist.h:114
unsigned hup
Definition: edgelist.h:106
float coordmin[2]
Definition: edgelist.h:92
unsigned vup
Definition: edgelist.h:107
unsigned int horattmin
Definition: edgelist.h:102
struct edgeinfo * next
Definition: edgelist.h:110
int major
Definition: edgelist.h:115
unsigned int horattmax
Definition: edgelist.h:103
unsigned int hvtop
Definition: edgelist.h:97
unsigned int almosthor
Definition: edgelist.h:100
double ocur
Definition: edgelist.h:114
unsigned int vert
Definition: edgelist.h:99
unsigned int hor
Definition: edgelist.h:98
unsigned int almostvert
Definition: edgelist.h:101
float tmin
Definition: edgelist.h:91
double tcur
Definition: edgelist.h:113
unsigned int hv
Definition: edgelist.h:95
struct edgeinfo * aenext
Definition: edgelist.h:112
float coordmax[2]
Definition: edgelist.h:93
unsigned int vertattmax
Definition: edgelist.h:105
unsigned int vertattmin
Definition: edgelist.h:104
struct edgeinfo * splinenext
Definition: edgelist.h:113
double tmax
Definition: edgelist.h:96
Spline * spline
Definition: edgelist.h:90
unsigned int up
Definition: edgelist.h:94
struct edgeinfo * ordered
Definition: edgelist.h:111
unsigned int hvbottom
Definition: edgelist.h:96
uint8 * bitmap
Definition: edgelist.h:67
unsigned int genmajoredges
Definition: edgelist.h:73
double scale
Definition: edgelist.h:65
Edge * splinesetfirst
Definition: edgelist.h:68
Edge * majors
Definition: edgelist.h:74
float omin
Definition: edgelist.h:64
Hints * hhints
Definition: edgelist.h:76
Hints * vhints
Definition: edgelist.h:76
int layer
Definition: edgelist.h:70
Edge * majorhold
Definition: edgelist.h:75
int is_overlap
Definition: edgelist.h:77
DBounds bbox
Definition: edgelist.h:78
int major
Definition: edgelist.h:72
double mmax
Definition: edgelist.h:63
SplineChar * sc
Definition: edgelist.h:69
char * interesting
Definition: edgelist.h:71
int other
Definition: edgelist.h:72
int bytes_per_line
Definition: edgelist.h:66
int cnt
Definition: edgelist.h:62
float mmin
Definition: edgelist.h:63
Edge ** edges
Definition: edgelist.h:61
Edge * last
Definition: edgelist.h:68
double omax
Definition: edgelist.h:64
char * ends
Definition: edgelist.h:124
EI * splinefirst
Definition: edgelist.h:128
EI * edges
Definition: edgelist.h:119
int major
Definition: edgelist.h:127
unsigned leavetiny
Definition: edgelist.h:130
float coordmax[2]
Definition: edgelist.h:121
float coordmin[2]
Definition: edgelist.h:120
int layer
Definition: edgelist.h:126
enum overlap_type ot
Definition: edgelist.h:131
SplineChar * sc
Definition: edgelist.h:125
EI * splinelast
Definition: edgelist.h:128
int high
Definition: edgelist.h:122
int low
Definition: edgelist.h:122
EI ** ordered
Definition: edgelist.h:123
EI ** tops
Definition: edgelist.h:129
EI ** bottoms
Definition: edgelist.h:129
int cnt
Definition: edgelist.h:122
Definition: edgelist.h:31
unsigned int adjustb
Definition: edgelist.h:35
float b2
Definition: edgelist.h:33
float e1
Definition: edgelist.h:33
float width
Definition: edgelist.h:32
double base
Definition: edgelist.h:32
double b1
Definition: edgelist.h:33
float e2
Definition: edgelist.h:33
struct hints * next
Definition: edgelist.h:37
unsigned int adjuste
Definition: edgelist.h:36
double ab
Definition: edgelist.h:34
float ae
Definition: edgelist.h:34