1 /* Copyright (C) 2000-2008 by George Williams */
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
6 * Redistributions of source code must retain the above copyright notice, this
7 * list of conditions and the following disclaimer.
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.
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.
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.
31 /* All coordinates are in millimeters */
32 /* they will be displayed to the user scaled by the units field of the design */
34 #include "splinefont.h"
43 typedef struct entpen
{
45 struct gradient
*grad
;
46 struct epattern
*tile
;
51 typedef struct textunit
{
54 float size
; /* in points */
57 struct textunit
*next
;
60 typedef struct entity
{
61 enum entity_type
{ et_splines
, et_text
, et_image
, et_group
} type
;
63 struct filledsplines
{
65 unsigned int isfillable
: 1; /* All splinesets are closed */
66 Pen fill
, stroke
; /* A value of 0xffffffff means do not fill or stroke */
70 real transform
[6]; /* The stroke may be quite different depending on the transformation (ie. ellipse not circle, rotated, etc) */
80 Color col
; /* that gets poured into imagemasks */
91 typedef struct entlayer
{
94 unsigned int isvisible
: 1;
99 struct tileinstance
{ real scale
; struct gwindow
*pixmap
; struct tileinstance
*next
; }
104 typedef struct splinedesign
{
105 int lcnt
, lmax
, active
;
108 real width
, height
; /* in millimeters */
109 int16 hpages
, vpages
;
110 real pwidth
, pheight
; /* in millimeters */
111 real units
; /* if user wants to see things in */
112 /* centimeters then units will be 10, if inches then 25.4, if points */
113 /* then 25.4/72, if 1/1200" then 25.4/1200, etc. */
115 } SplineDesign
, Design
;
117 extern Entity
*EntityInterpretPS(FILE *ps
,int *width
);
118 extern Entity
*EntityInterpretSVG(char *filename
,char *memory
, int memlen
, int em_size
,int ascent
);
119 extern Entity
*EntityInterpretPDFPage(FILE *pdf
,int select_page
);
120 extern SplinePointList
*SplinesFromEntities(Entity
*ent
,int *flags
,int is_stroked
);
121 extern void SCAppendEntityLayers(SplineChar
*sc
, Entity
*ent
);
123 /* Used for type3 fonts briefly */
124 /* This is not a "real" structure. It is a temporary hack that encompasses */
125 /* various possibilities, the combination of which won't occur in reality */
126 typedef struct entitychar
{
137 struct pskeyval
*entries
;
141 enum pstype
{ ps_void
, ps_num
, ps_bool
, ps_string
, ps_instr
, ps_lit
,
142 ps_mark
, ps_array
, ps_dict
} type
;
147 struct pskeydict dict
; /* and for arrays too */
157 typedef struct retstack
{