summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/libs/ff-woff/fontforge/sd.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/dvisvgm/libs/ff-woff/fontforge/sd.h
Initial commit
Diffstat (limited to 'dviware/dvisvgm/libs/ff-woff/fontforge/sd.h')
-rw-r--r--dviware/dvisvgm/libs/ff-woff/fontforge/sd.h168
1 files changed, 168 insertions, 0 deletions
diff --git a/dviware/dvisvgm/libs/ff-woff/fontforge/sd.h b/dviware/dvisvgm/libs/ff-woff/fontforge/sd.h
new file mode 100644
index 0000000000..9e9bd56c1d
--- /dev/null
+++ b/dviware/dvisvgm/libs/ff-woff/fontforge/sd.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 2000-2012 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SD_H
+#define _SD_H
+# include <gimage.h>
+
+/* All coordinates are in millimeters */
+/* they will be displayed to the user scaled by the units field of the design */
+
+#include "splinefont.h"
+
+struct epattern {
+ struct entity *tile;
+ real width, height;
+ DBounds bbox;
+ real transform[6];
+};
+
+typedef struct entpen {
+ Color col;
+ struct gradient *grad;
+ struct epattern *tile;
+ float scale;
+ float opacity;
+} Pen;
+
+typedef struct textunit {
+ unichar_t *text;
+ SplineFont *sf;
+ float size; /* in points */
+ float kernafter;
+ Pen fill;
+ struct textunit *next;
+} TextUnit;
+
+struct filledsplines {
+ SplineSet *splines;
+ unsigned int isfillable: 1; /* All splinesets are closed */
+ Pen fill, stroke; /* A value of 0xffffffff means do not fill or stroke */
+ float stroke_width;
+ enum linejoin join;
+ enum linecap cap;
+ real transform[6]; /* The stroke may be quite different depending on the transformation (ie. ellipse not circle, rotated, etc) */
+};
+
+struct text {
+ TextUnit *text;
+ real transform[6];
+ struct entity *bound;
+};
+
+struct image {
+ GImage *image;
+ real transform[6];
+ Color col; /* that gets poured into imagemasks */
+};
+
+struct group {
+ struct entity *group;
+};
+
+enum entity_type { et_splines, et_text, et_image, et_group };
+
+typedef struct entity {
+ enum entity_type type;
+ union {
+ struct filledsplines splines;
+ struct text text;
+ struct image image;
+ struct group group;
+ } u;
+ SplineSet *clippath;
+ DBounds bb;
+ struct entity *next;
+} Entity;
+
+typedef struct entlayer {
+ Entity *entities;
+ char *name;
+ unsigned int isvisible: 1;
+} EntLayer;
+
+typedef struct tile {
+ Entity *tile;
+ struct tileinstance { real scale; struct gwindow *pixmap; struct tileinstance *next; }
+ *instances;
+ char *name;
+} Tile;
+
+typedef struct splinedesign {
+ int lcnt, lmax, active;
+ EntLayer *layers;
+
+ real width, height; /* in millimeters */
+ int16 hpages, vpages;
+ real pwidth, pheight; /* in millimeters */
+ real units; /* if user wants to see things in */
+ /* centimeters then units will be 10, if inches then 25.4, if points */
+ /* then 25.4/72, if 1/1200" then 25.4/1200, etc. */
+ struct dview *dvs;
+} SplineDesign, Design;
+
+/* Used for type3 fonts briefly */
+/* This is not a "real" structure. It is a temporary hack that encompasses */
+/* various possibilities, the combination of which won't occur in reality */
+typedef struct entitychar {
+ Entity *splines;
+ RefChar *refs;
+ int width, vwidth;
+ SplineChar *sc;
+ uint8 fromtype3;
+} EntityChar;
+
+extern SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked);
+
+struct pskeydict {
+ int16 cnt, max;
+ uint8 is_executable;
+ struct pskeyval *entries;
+};
+
+enum pstype { ps_void, ps_num, ps_bool, ps_string, ps_instr, ps_lit,
+ ps_mark, ps_array, ps_dict };
+
+union vals {
+ real val;
+ int tf;
+ char *str;
+ struct pskeydict dict; /* and for arrays too */
+};
+
+struct pskeyval {
+ enum pstype type;
+ union vals u;
+ char *key;
+};
+
+typedef struct retstack {
+ int max;
+ int cnt;
+ real *stack;
+} RetStack;
+
+#endif