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.
29 /* This file contains the data structures needed to read in an old sfd file */
30 /* features and lookups and scripts are handled differently. That means that */
31 /* the KernPair, KernClass, PST, FPST, AnchorClass, StateMachine data structures */
32 /* are organized differently. Also we've got a script language list which */
33 /* doesn't exist in the new format and we don't have OTLookup */
35 #include "splinefont.h"
37 #define SLI_UNKNOWN 0xffff
38 #define SLI_NESTED 0xfffe
40 typedef struct anchorclass1
{
43 uint16 script_lang_index
;
50 typedef struct kernpair1
{
55 typedef struct kernclass1
{
61 typedef struct generic_pst1
{
64 uint16 script_lang_index
; /* 0xffff means none */
68 typedef struct generic_fpst1
{
70 uint16 script_lang_index
;
75 typedef struct splinefont1
{
78 struct table_ordering
{ uint32 table_tag
; uint32
*ordered_features
; struct table_ordering
*next
; } *orders
;
80 /* Any GPOS/GSUB entry (PST, AnchorClass, kerns, FPST */
81 /* Has an entry saying what scripts/languages it should appear it */
82 /* Things like fractions will appear in almost all possible script/lang */
83 /* combinations, while alphabetic ligatures will only live in one script */
84 /* Rather than store the complete list of possibilities in each PST we */
85 /* store all choices used here, and just store an index into this list */
86 /* in the PST. All lists are terminated by a 0 entry */
87 struct script_record
{
94 uint16 tt_cur
, tt_max
;
96 enum possub_type type
;
102 extern int SFFindBiggestScriptLangIndex(SplineFont
*_sf
,uint32 script
,uint32 lang
);
103 extern int SFAddScriptIndex(SplineFont1
*sf
,uint32
*scripts
,int scnt
);
104 extern void SFD_AssignLookups(SplineFont1
*sf
);