summaryrefslogtreecommitdiff
path: root/macfonts.h
diff options
context:
space:
mode:
authorGeorge Williams <gww@silcom.com>2001-11-07 06:56:00 +0000
committerGeorge Williams <gww@silcom.com>2001-11-07 06:56:00 +0000
commit0bd8f845ad35973e10656118f7a309164695b9c8 (patch)
treeea7995702091bbd5ae4be0afcee9013983881c06 /macfonts.h
Initial revision
Diffstat (limited to 'macfonts.h')
-rw-r--r--macfonts.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/macfonts.h b/macfonts.h
new file mode 100644
index 0000000..41461d8
--- /dev/null
+++ b/macfonts.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 2001 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.
+ */
+
+#define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
+#define true 1
+#define false 0
+
+#define forever for (;;)
+
+enum style_flags { sf_bold = 1, sf_italic = 2, sf_underline = 4, sf_outline = 8,
+ sf_shadow = 0x10, sf_condense = 0x20, sf_extend = 0x40 };
+
+typedef struct fond {
+ char *fondname;
+ int first, last;
+ int assoc_cnt;
+ struct assoc {
+ short size, style, id;
+ } *assoc;
+ /* size==0 => scalable */
+ /* style>>8 is the bit depth (0=>1, 1=>2, 2=>4, 3=>8) */
+ /* search order for ID is sfnt, NFNT, FONT */
+ int stylewidthcnt;
+ struct stylewidths {
+ short style;
+ short *widthtab; /* 4.12 fixed number with the width specified as a fraction of an em */
+ } *stylewidths;
+ int stylekerncnt;
+ struct stylekerns {
+ short style;
+ int kernpairs;
+ struct kerns {
+ unsigned char ch1, ch2;
+ short offset; /* 4.12 */
+ } *kerns;
+ } *stylekerns;
+ struct fond *next;
+} FOND;
+
+extern int tolatin1;
+extern const char *macnames[];
+extern const char *styles[];
+
+extern int getushort(FILE *f);
+extern long getlong(FILE *f);
+extern int cleanfilename(char *filename);
+
+extern void SearchNFNTResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
+ long name_list, FOND *fonds);