Debian Codegraph @

fontforgeexe/fontinfo.c

raw symbols SCIP
1 /* -*- coding: utf-8 -*- */
2 /* Copyright (C) 2000-2012 by George Williams */
3 /*
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13
14 * The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #include <fontforge-config.h>
30
31 #include "autowidth.h"
32 #include "bitmapchar.h"
33 #include "dumppfa.h"
34 #include "encoding.h"
35 #include "featurefile.h"
36 #include "fontforgeui.h"
37 #include "gfile.h"
38 #include "gkeysym.h"
39 #include "gresedit.h"
40 #include "gutils.h"
41 #include "lookups.h"
42 #include "namelist.h"
43 #include "ofl.h"
44 #include "parsepfa.h"
45 #include "parsettf.h"
46 #include "psread.h"
47 #include "sfd.h"
48 #include "sfundo.h"
49 #include "splineorder2.h"
50 #include "splinesaveafm.h"
51 #include "splineutil.h"
52 #include "splineutil2.h"
53 #include "tottf.h"
54 #include "unicoderange.h"
55 #include "ustring.h"
56 #include "utype.h"
57
58 #include "gtk/show_histogram_shim.hpp"
59
60 #include <locale.h>
61 #include <math.h>
62 #include <time.h>
63 #include <unistd.h>
64
65 extern int _GScrollBar_Width;
66 extern GBox _ggadget_Default_Box;
67 #define ACTIVE_BORDER (_ggadget_Default_Box.active_border)
68 #define MAIN_FOREGROUND (_ggadget_Default_Box.main_foreground)
69
70 GResFont fontinfo_font = GRESFONT_INIT("400 12pt " SANS_UI_FAMILIES);
71
72 static int last_aspect=0;
73
74 GTextInfo emsizes[] = {
75 { (unichar_t *) "1000", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
76 { (unichar_t *) "1024", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
77 { (unichar_t *) "2048", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
78 { (unichar_t *) "4096", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
79 GTEXTINFO_EMPTY
80 };
81
82 /* Note that we are storing integer data in a pointer field, hence the casts. They are not to be dereferenced. */
83 GTextInfo interpretations[] = {
84 /* GT: See the long comment at "Property|New" */
85 /* GT: The msgstr should contain a translation of "None", ignore "Interpretation|" */
86 /* GT: In french this could be "Aucun" or "Aucune" depending on the gender */
87 /* GT: of "Interpretation" */
88 { (unichar_t *) N_("Interpretation|None"), NULL, 0, 0, (void *) ui_none, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
89 /* { (unichar_t *) N_("Adobe Public Use Defs."), NULL, 0, 0, (void *) ui_adobe, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
90 /* { (unichar_t *) N_("Greek"), NULL, 0, 0, (void *) ui_greek, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
91 { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) ui_japanese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
92 { (unichar_t *) N_("Traditional Chinese"), NULL, 0, 0, (void *) ui_trad_chinese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
93 { (unichar_t *) N_("Simplified Chinese"), NULL, 0, 0, (void *) ui_simp_chinese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
94 { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) ui_korean, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
95 /* { (unichar_t *) N_("AMS Public Use"), NULL, 0, 0, (void *) ui_ams, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
96 GTEXTINFO_EMPTY
97 };
98 GTextInfo macstyles[] = {
99 { (unichar_t *) N_("MacStyles|Bold"), NULL, 0, 0, (void *) sf_bold, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
100 { (unichar_t *) N_("MacStyles|Italic"), NULL, 0, 0, (void *) sf_italic, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
101 { (unichar_t *) N_("MacStyles|Condense"), NULL, 0, 0, (void *) sf_condense, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
102 { (unichar_t *) N_("MacStyles|Expand"), NULL, 0, 0, (void *) sf_extend, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
103 { (unichar_t *) N_("MacStyles|Underline"), NULL, 0, 0, (void *) sf_underline, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
104 { (unichar_t *) N_("MacStyles|Outline"), NULL, 0, 0, (void *) sf_outline, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
105 { (unichar_t *) N_("MacStyles|Shadow"), NULL, 0, 0, (void *) sf_shadow, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
106 GTEXTINFO_EMPTY
107 };
108 static GTextInfo widthclass[] = {
109 { (unichar_t *) N_("Ultra-Condensed (50%)"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
110 { (unichar_t *) N_("Extra-Condensed (62.5%)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
111 { (unichar_t *) N_("Condensed (75%)"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
112 { (unichar_t *) N_("Semi-Condensed (87.5%)"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
113 { (unichar_t *) N_("Medium (100%)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
114 { (unichar_t *) N_("Semi-Expanded (112.5%)"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
115 { (unichar_t *) N_("Expanded (125%)"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
116 { (unichar_t *) N_("Extra-Expanded (150%)"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
117 { (unichar_t *) N_("Ultra-Expanded (200%)"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
118 GTEXTINFO_EMPTY
119 };
120 static GTextInfo weightclass[] = {
121 { (unichar_t *) N_("100 Thin"), NULL, 0, 0, (void *) 100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
122 { (unichar_t *) N_("200 Extra-Light"), NULL, 0, 0, (void *) 200, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
123 { (unichar_t *) N_("300 Light"), NULL, 0, 0, (void *) 300, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
124 { (unichar_t *) N_("400 Regular"), NULL, 0, 0, (void *) 400, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
125 { (unichar_t *) N_("500 Medium"), NULL, 0, 0, (void *) 500, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
126 { (unichar_t *) N_("600 Semi-Bold"), NULL, 0, 0, (void *) 600, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
127 { (unichar_t *) N_("700 Bold"), NULL, 0, 0, (void *) 700, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
128 { (unichar_t *) N_("800 Extra-Bold"), NULL, 0, 0, (void *) 800, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
129 { (unichar_t *) N_("900 Black"), NULL, 0, 0, (void *) 900, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
130 GTEXTINFO_EMPTY
131 };
132 static GTextInfo fstype[] = {
133 { (unichar_t *) N_("Never Embed/No Editing"), NULL, 0, 0, (void *) 0x02, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
134 { (unichar_t *) N_("Printable Document"), NULL, 0, 0, (void *) 0x04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
135 { (unichar_t *) N_("Editable Document"), NULL, 0, 0, (void *) 0x08, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
136 { (unichar_t *) N_("Installable Font"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
137 GTEXTINFO_EMPTY
138 };
139 static GTextInfo pfmfamily[] = {
140 { (unichar_t *) N_("Serif"), NULL, 0, 0, (void *) 0x11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
141 { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
142 { (unichar_t *) N_("Monospace"), NULL, 0, 0, (void *) 0x31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
143 /* GT: See the long comment at "Property|New" */
144 /* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
145 /* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
146 /* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
147 { (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 0x41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
148 { (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 0x51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
149 GTEXTINFO_EMPTY
150 };
151 static GTextInfo ibmfamily[] = {
152 { (unichar_t *) N_("No Classification"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
153 { (unichar_t *) N_("Old Style Serifs"), NULL, 0, 0, (void *) 0x100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
154 { (unichar_t *) N_("OSS Rounded Legibility"), NULL, 0, 0, (void *) 0x101, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
155 { (unichar_t *) N_("OSS Geralde"), NULL, 0, 0, (void *) 0x102, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
156 { (unichar_t *) N_("OSS Venetian"), NULL, 0, 0, (void *) 0x103, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
157 { (unichar_t *) N_("OSS Modified Venetian"), NULL, 0, 0, (void *) 0x104, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
158 { (unichar_t *) N_("OSS Dutch Modern"), NULL, 0, 0, (void *) 0x105, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
159 { (unichar_t *) N_("OSS Dutch Trad"), NULL, 0, 0, (void *) 0x106, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
160 { (unichar_t *) N_("OSS Contemporary"), NULL, 0, 0, (void *) 0x107, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
161 { (unichar_t *) N_("OSS Calligraphic"), NULL, 0, 0, (void *) 0x108, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
162 { (unichar_t *) N_("OSS Miscellaneous"), NULL, 0, 0, (void *) 0x10f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
163 { (unichar_t *) N_("Transitional Serifs"), NULL, 0, 0, (void *) 0x200, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
164 { (unichar_t *) N_("TS Direct Line"), NULL, 0, 0, (void *) 0x201, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
165 { (unichar_t *) N_("TS Script"), NULL, 0, 0, (void *) 0x202, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
166 { (unichar_t *) N_("TS Miscellaneous"), NULL, 0, 0, (void *) 0x20f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
167 { (unichar_t *) N_("Modern Serifs"), NULL, 0, 0, (void *) 0x300, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
168 { (unichar_t *) N_("MS Italian"), NULL, 0, 0, (void *) 0x301, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
169 { (unichar_t *) N_("MS Script"), NULL, 0, 0, (void *) 0x302, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
170 { (unichar_t *) N_("MS Miscellaneous"), NULL, 0, 0, (void *) 0x30f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
171 { (unichar_t *) N_("Clarendon Serifs"), NULL, 0, 0, (void *) 0x400, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
172 { (unichar_t *) N_("CS Clarendon"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
173 { (unichar_t *) N_("CS Modern"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
174 { (unichar_t *) N_("CS Traditional"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
175 { (unichar_t *) N_("CS Newspaper"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
176 { (unichar_t *) N_("CS Stub Serif"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
177 { (unichar_t *) N_("CS Monotone"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
178 { (unichar_t *) N_("CS Typewriter"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
179 { (unichar_t *) N_("CS Miscellaneous"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
180 { (unichar_t *) N_("Slab Serifs"), NULL, 0, 0, (void *) 0x500, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
181 { (unichar_t *) N_("Slab Serifs|SS Monotone"), NULL, 0, 0, (void *) 0x501, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
182 { (unichar_t *) N_("Slab Serifs|SS Humanist"), NULL, 0, 0, (void *) 0x502, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
183 { (unichar_t *) N_("Slab Serifs|SS Geometric"), NULL, 0, 0, (void *) 0x503, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
184 { (unichar_t *) N_("Slab Serifs|SS Swiss"), NULL, 0, 0, (void *) 0x504, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
185 { (unichar_t *) N_("Slab Serifs|SS Typewriter"), NULL, 0, 0, (void *) 0x505, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
186 { (unichar_t *) N_("Slab Serifs|SS Miscellaneous"), NULL, 0, 0, (void *) 0x50f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
187 { (unichar_t *) N_("Freeform Serifs"), NULL, 0, 0, (void *) 0x700, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
188 { (unichar_t *) N_("FS Modern"), NULL, 0, 0, (void *) 0x701, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
189 { (unichar_t *) N_("FS Miscellaneous"), NULL, 0, 0, (void *) 0x70f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
190 { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x800, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
191 { (unichar_t *) N_("Sans-Serif|SS IBM NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
192 { (unichar_t *) N_("Sans-Serif|SS Humanist"), NULL, 0, 0, (void *) 0x802, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
193 { (unichar_t *) N_("Sans-Serif|SS Low-x Round Geometric"), NULL, 0, 0, (void *) 0x803, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
194 { (unichar_t *) N_("Sans-Serif|SS High-x Round Geometric"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
195 { (unichar_t *) N_("Sans-Serif|SS NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x805, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
196 { (unichar_t *) N_("Sans-Serif|SS Modified Grotesque Gothic"), NULL, 0, 0, (void *) 0x806, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
197 { (unichar_t *) N_("Sans-Serif|SS Typewriter Gothic"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
198 { (unichar_t *) N_("Sans-Serif|SS Matrix"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
199 { (unichar_t *) N_("Sans-Serif|SS Miscellaneous"), NULL, 0, 0, (void *) 0x80f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
200 { (unichar_t *) N_("Ornamentals"), NULL, 0, 0, (void *) 0x900, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
201 { (unichar_t *) N_("O Engraver"), NULL, 0, 0, (void *) 0x901, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
202 { (unichar_t *) N_("O Black Letter"), NULL, 0, 0, (void *) 0x902, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
203 { (unichar_t *) N_("O Decorative"), NULL, 0, 0, (void *) 0x903, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
204 { (unichar_t *) N_("O Three Dimensional"), NULL, 0, 0, (void *) 0x904, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
205 { (unichar_t *) N_("O Miscellaneous"), NULL, 0, 0, (void *) 0x90f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
206 { (unichar_t *) N_("Scripts"), NULL, 0, 0, (void *) 0xa00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
207 { (unichar_t *) N_("S Uncial"), NULL, 0, 0, (void *) 0xa01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
208 { (unichar_t *) N_("S Brush Joined"), NULL, 0, 0, (void *) 0xa02, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
209 { (unichar_t *) N_("S Formal Joined"), NULL, 0, 0, (void *) 0xa03, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
210 { (unichar_t *) N_("S Monotone Joined"), NULL, 0, 0, (void *) 0xa04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
211 { (unichar_t *) N_("S Calligraphic"), NULL, 0, 0, (void *) 0xa05, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
212 { (unichar_t *) N_("S Brush Unjoined"), NULL, 0, 0, (void *) 0xa06, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
213 { (unichar_t *) N_("S Formal Unjoined"), NULL, 0, 0, (void *) 0xa07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
214 { (unichar_t *) N_("S Monotone Unjoined"), NULL, 0, 0, (void *) 0xa08, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
215 { (unichar_t *) N_("S Miscellaneous"), NULL, 0, 0, (void *) 0xa0f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
216 { (unichar_t *) N_("Symbolic"), NULL, 0, 0, (void *) 0xc00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
217 { (unichar_t *) N_("Sy Mixed Serif"), NULL, 0, 0, (void *) 0xc03, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
218 { (unichar_t *) N_("Sy Old Style Serif"), NULL, 0, 0, (void *) 0xc06, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
219 { (unichar_t *) N_("Sy Neo-grotesque Sans Serif"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
220 { (unichar_t *) N_("Sy Miscellaneous"), NULL, 0, 0, (void *) 0xc0f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
221 GTEXTINFO_EMPTY
222 };
223 static GTextInfo stylemap[] = {
224 { (unichar_t *) N_("Automatic"), NULL, 0, 0, (void *) -1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
225 { (unichar_t *) N_("None"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
226 { (unichar_t *) N_("Regular"), NULL, 0, 0, (void *) 0x40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
227 { (unichar_t *) N_("Italic"), NULL, 0, 0, (void *) 0x01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
228 { (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 0x20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
229 { (unichar_t *) N_("Bold Italic"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
230 GTEXTINFO_EMPTY
231 };
232 static GTextInfo os2versions[] = {
233 { (unichar_t *) N_("OS2Version|Automatic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
234 { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
235 { (unichar_t *) N_("2"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
236 { (unichar_t *) N_("3"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
237 { (unichar_t *) N_("4"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
238 GTEXTINFO_EMPTY
239 };
240 static GTextInfo gaspversions[] = {
241 { (unichar_t *) N_("0"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
242 { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
243 GTEXTINFO_EMPTY
244 };
245 static GTextInfo panfamily[] = {
246 { (unichar_t *) N_("PanoseFamily|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
247 { (unichar_t *) N_("PanoseFamily|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
248 { (unichar_t *) N_("Latin: Text and Display"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
249 /* GT: See the long comment at "Property|New" */
250 /* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
251 /* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
252 /* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
253 { (unichar_t *) N_("cursive|Latin: Handwritten"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
254 { (unichar_t *) N_("Latin: Decorative"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
255 { (unichar_t *) N_("Latin: Pictorial and Symbol"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
256 { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
257 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
258 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
259 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
260 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
261 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
262 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
263 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
264 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
265 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
266 GTEXTINFO_EMPTY
267 };
268 static GTextInfo panunknown[] = {
269 { (unichar_t *) "Any", NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
270 { (unichar_t *) "No Fit", NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
271 { (unichar_t *) "2", NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
272 { (unichar_t *) "3", NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
273 { (unichar_t *) "4", NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
274 { (unichar_t *) "5", NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
275 { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
276 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
277 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
278 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
279 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
280 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
281 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
282 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
283 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
284 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
285 GTEXTINFO_EMPTY
286 };
287 static GTextInfo panserifs[] = {
288 { (unichar_t *) N_("PanoseSerifs|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
289 { (unichar_t *) N_("PanoseSerifs|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
290 { (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
291 { (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
292 { (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
293 { (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
294 { (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
295 { (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
296 { (unichar_t *) N_("Bone"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
297 { (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
298 { (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
299 { (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
300 { (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
301 { (unichar_t *) N_("Perpendicular Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
302 { (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
303 { (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
304 GTEXTINFO_EMPTY
305 };
306 static GTextInfo panweight[] = {
307 { (unichar_t *) N_("PanoseWeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
308 { (unichar_t *) N_("PanoseWeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
309 { (unichar_t *) N_("Very Light"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
310 { (unichar_t *) N_("Light"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
311 { (unichar_t *) N_("PanoseWeight|Thin"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
312 { (unichar_t *) N_("Book"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
313 { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
314 { (unichar_t *) N_("Demi"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
315 { (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
316 { (unichar_t *) N_("Heavy"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
317 { (unichar_t *) N_("Black"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
318 { (unichar_t *) N_("Extra Black (Nord)"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
319 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
320 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
321 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
322 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
323 GTEXTINFO_EMPTY
324 };
325 static GTextInfo panprop[] = {
326 { (unichar_t *) N_("PanoseProportion|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
327 { (unichar_t *) N_("PanoseProportion|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
328 { (unichar_t *) N_("Old Style"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
329 { (unichar_t *) N_("Modern"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
330 { (unichar_t *) N_("Even Width"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
331 { (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
332 { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
333 { (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
334 { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
335 { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
336 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
337 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
338 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
339 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
340 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
341 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
342 GTEXTINFO_EMPTY
343 };
344 static GTextInfo pancontrast[] = {
345 { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
346 { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
347 { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
348 { (unichar_t *) N_("PanoseContrast|Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
349 { (unichar_t *) N_("PanoseContrast|Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
350 { (unichar_t *) N_("PanoseContrast|Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
351 { (unichar_t *) N_("PanoseContrast|Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
352 { (unichar_t *) N_("PanoseContrast|Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
353 { (unichar_t *) N_("PanoseContrast|High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
354 { (unichar_t *) N_("PanoseContrast|Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
355 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
356 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
357 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
358 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
359 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
360 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
361 GTEXTINFO_EMPTY
362 };
363 static GTextInfo panstrokevar[] = {
364 { (unichar_t *) N_("PanoseStrokeVariation|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
365 { (unichar_t *) N_("PanoseStrokeVariation|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
366 { (unichar_t *) N_("No Variation"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
367 { (unichar_t *) N_("Gradual/Diagonal"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
368 { (unichar_t *) N_("Gradual/Transitional"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
369 { (unichar_t *) N_("Gradual/Vertical"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
370 { (unichar_t *) N_("Gradual/Horizontal"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
371 { (unichar_t *) N_("Rapid/Vertical"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
372 { (unichar_t *) N_("Rapid/Horizontal"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
373 { (unichar_t *) N_("Instant/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
374 { (unichar_t *) N_("Instant/Horizontal"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
375 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
376 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
377 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
378 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
379 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
380 GTEXTINFO_EMPTY
381 };
382 static GTextInfo panarmstyle[] = {
383 { (unichar_t *) N_("PanoseArmStyle|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
384 { (unichar_t *) N_("PanoseArmStyle|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
385 { (unichar_t *) N_("Straight Arms/Horizontal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
386 { (unichar_t *) N_("Straight Arms/Wedge"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
387 { (unichar_t *) N_("Straight Arms/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
388 { (unichar_t *) N_("Straight Arms/Single Serif"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
389 { (unichar_t *) N_("Straight Arms/Double Serif"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
390 { (unichar_t *) N_("Non-Straight Arms/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
391 { (unichar_t *) N_("Non-Straight Arms/Wedge"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
392 { (unichar_t *) N_("Non-Straight Arms/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
393 { (unichar_t *) N_("Non-Straight Arms/Single Serif"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
394 { (unichar_t *) N_("Non-Straight Arms/Double Serif"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
395 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
396 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
397 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
398 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
399 GTEXTINFO_EMPTY
400 };
401 static GTextInfo panletterform[] = {
402 { (unichar_t *) N_("PanoseLetterform|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
403 { (unichar_t *) N_("PanoseLetterform|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
404 { (unichar_t *) N_("Normal/Contact"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
405 { (unichar_t *) N_("Normal/Weighted"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
406 { (unichar_t *) N_("Normal/Boxed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
407 { (unichar_t *) N_("Normal/Flattened"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
408 { (unichar_t *) N_("Normal/Rounded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
409 { (unichar_t *) N_("Normal/Off-Center"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
410 { (unichar_t *) N_("Normal/Square"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
411 { (unichar_t *) N_("Oblique/Contact"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
412 { (unichar_t *) N_("Oblique/Weighted"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
413 { (unichar_t *) N_("Oblique/Boxed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
414 { (unichar_t *) N_("Oblique/Flattened"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
415 { (unichar_t *) N_("Oblique/Rounded"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
416 { (unichar_t *) N_("Oblique/Off-Center"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
417 { (unichar_t *) N_("Oblique/Square"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
418 GTEXTINFO_EMPTY
419 };
420 static GTextInfo panmidline[] = {
421 { (unichar_t *) N_("PanoseMidline|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
422 { (unichar_t *) N_("PanoseMidline|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
423 { (unichar_t *) N_("PanoseMidline|Standard/Trimmed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
424 { (unichar_t *) N_("PanoseMidline|Standard/Pointed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
425 { (unichar_t *) N_("PanoseMidline|Standard/Serifed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
426 { (unichar_t *) N_("PanoseMidline|High/Trimmed"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
427 { (unichar_t *) N_("PanoseMidline|High/Pointed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
428 { (unichar_t *) N_("PanoseMidline|High/Serifed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
429 { (unichar_t *) N_("PanoseMidline|Constant/Trimmed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
430 { (unichar_t *) N_("PanoseMidline|Constant/Pointed"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
431 { (unichar_t *) N_("PanoseMidline|Constant/Serifed"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
432 { (unichar_t *) N_("PanoseMidline|Low/Trimmed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
433 { (unichar_t *) N_("PanoseMidline|Low/Pointed"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
434 { (unichar_t *) N_("PanoseMidline|Low/Serifed"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
435 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
436 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
437 GTEXTINFO_EMPTY
438 };
439 static GTextInfo panxheight[] = {
440 { (unichar_t *) N_("PanoseXHeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
441 { (unichar_t *) N_("PanoseXHeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
442 { (unichar_t *) N_("PanoseXHeight|Constant/Small"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
443 { (unichar_t *) N_("PanoseXHeight|Constant/Standard"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
444 { (unichar_t *) N_("PanoseXHeight|Constant/Large"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
445 { (unichar_t *) N_("PanoseXHeight|Ducking/Small"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
446 { (unichar_t *) N_("PanoseXHeight|Ducking/Standard"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
447 { (unichar_t *) N_("PanoseXHeight|Ducking/Large"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
448 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
449 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
450 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
451 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
452 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
453 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
454 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
455 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
456 GTEXTINFO_EMPTY
457 };
458 /* Latin: Hand written */
459 static GTextInfo pantool[] = {
460 { (unichar_t *) N_("PanoseTool|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
461 { (unichar_t *) N_("PanoseTool|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
462 { (unichar_t *) N_("Flat Nib"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
463 { (unichar_t *) N_("Pressure Point"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
464 { (unichar_t *) N_("Engraved"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
465 { (unichar_t *) N_("Ball (Round Cap)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
466 { (unichar_t *) N_("Brush"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
467 { (unichar_t *) N_("Rough"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
468 { (unichar_t *) N_("Felt Pen or Brush Tip"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
469 { (unichar_t *) N_("Wild Brush - Drips a lot"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
470 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
471 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
472 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
473 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
474 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
475 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
476 GTEXTINFO_EMPTY
477 };
478 static GTextInfo panspacing[] = {
479 { (unichar_t *) N_("PanoseSpacing|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
480 { (unichar_t *) N_("PanoseSpacing|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
481 { (unichar_t *) N_("Proportional Spaced"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
482 { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
483 { (unichar_t *) "4", NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
484 { (unichar_t *) "5", NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
485 { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
486 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
487 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
488 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
489 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
490 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
491 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
492 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
493 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
494 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
495 GTEXTINFO_EMPTY
496 };
497 static GTextInfo panasprat[] = {
498 { (unichar_t *) N_("PanoseAspectRatio|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
499 { (unichar_t *) N_("PanoseAspectRatio|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
500 { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
501 { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
502 { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
503 { (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
504 { (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
505 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
506 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
507 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
508 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
509 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
510 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
511 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
512 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
513 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
514 GTEXTINFO_EMPTY
515 };
516 static GTextInfo pancontrast2[] = {
517 { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
518 { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
519 { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
520 { (unichar_t *) N_("Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
521 { (unichar_t *) N_("Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
522 { (unichar_t *) N_("Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
523 { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
524 { (unichar_t *) N_("Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
525 { (unichar_t *) N_("High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
526 { (unichar_t *) N_("Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
527 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
528 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
529 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
530 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
531 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
532 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
533 GTEXTINFO_EMPTY
534 };
535 static GTextInfo pantopology[] = {
536 { (unichar_t *) N_("PanoseTopology|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
537 { (unichar_t *) N_("PanoseTopology|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
538 { (unichar_t *) N_("Roman Disconnected"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
539 { (unichar_t *) N_("Roman Trailing"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
540 { (unichar_t *) N_("Roman Connected"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
541 { (unichar_t *) N_("Cursive Disconnected"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
542 { (unichar_t *) N_("Cursive Trailing"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
543 { (unichar_t *) N_("Cursive Connected"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
544 { (unichar_t *) N_("Blackletter Disconnected"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
545 { (unichar_t *) N_("Blackletter Trailing"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
546 { (unichar_t *) N_("Blackletter Connected"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
547 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
548 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
549 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
550 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
551 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
552 GTEXTINFO_EMPTY
553 };
554 static GTextInfo panform[] = {
555 { (unichar_t *) N_("PanoseForm|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
556 { (unichar_t *) N_("PanoseForm|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
557 { (unichar_t *) N_("Upright/No Wrapping"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
558 { (unichar_t *) N_("Upright/Some Wrapping"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
559 { (unichar_t *) N_("Upright/More Wrapping"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
560 { (unichar_t *) N_("Upright/Extreme Wrapping"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
561 { (unichar_t *) N_("Oblique/No Wrapping"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
562 { (unichar_t *) N_("Oblique/Some Wrapping"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
563 { (unichar_t *) N_("Oblique/More Wrapping"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
564 { (unichar_t *) N_("Oblique/Extreme Wrapping"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
565 { (unichar_t *) N_("Exaggerated/No Wrapping"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
566 { (unichar_t *) N_("Exaggerated/Some Wrapping"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
567 { (unichar_t *) N_("Exaggerated/More Wrapping"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
568 { (unichar_t *) N_("Exaggerated/Extreme Wrapping"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
569 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
570 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
571 GTEXTINFO_EMPTY
572 };
573 static GTextInfo panfinials[] = {
574 { (unichar_t *) N_("PanoseFinials|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
575 { (unichar_t *) N_("PanoseFinials|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
576 { (unichar_t *) N_("None/No Loops"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
577 { (unichar_t *) N_("None/Closed Loops"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
578 { (unichar_t *) N_("None/Open Loops"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
579 { (unichar_t *) N_("Sharp/No Loops"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
580 { (unichar_t *) N_("Sharp/Closed Loops"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
581 { (unichar_t *) N_("Sharp/Open Loops"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
582 { (unichar_t *) N_("Tapered/No Loops"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
583 { (unichar_t *) N_("Tapered/Closed Loops"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
584 { (unichar_t *) N_("Tapered/Open Loops"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
585 { (unichar_t *) N_("Round/No Loops"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
586 { (unichar_t *) N_("Round/Closed Loops"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
587 { (unichar_t *) N_("Round/Open Loops"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
588 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
589 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
590 GTEXTINFO_EMPTY
591 };
592 static GTextInfo panxascent[] = {
593 { (unichar_t *) N_("PanoseXAscent|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
594 { (unichar_t *) N_("PanoseXAscent|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
595 { (unichar_t *) N_("PanoseXAscent|Very Low"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
596 { (unichar_t *) N_("PanoseXAscent|Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
597 { (unichar_t *) N_("PanoseXAscent|Medium"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
598 { (unichar_t *) N_("PanoseXAscent|High"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
599 { (unichar_t *) N_("PanoseXAscent|Very High"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
600 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
601 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
602 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
603 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
604 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
605 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
606 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
607 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
608 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
609 GTEXTINFO_EMPTY
610 };
611 /* Latin: Decorative */
612 static GTextInfo panclass[] = {
613 { (unichar_t *) N_("PanoseClass|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
614 { (unichar_t *) N_("PanoseClass|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
615 { (unichar_t *) N_("Derivative"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
616 { (unichar_t *) N_("Non-standard Topology"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
617 { (unichar_t *) N_("Non-standard Elements"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
618 { (unichar_t *) N_("Non-standard Aspect"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
619 { (unichar_t *) N_("Initials"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
620 { (unichar_t *) N_("Cartoon"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
621 { (unichar_t *) N_("Picture Stems"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
622 { (unichar_t *) N_("Ornamented"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
623 { (unichar_t *) N_("Text and Background"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
624 { (unichar_t *) N_("Collage"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
625 { (unichar_t *) N_("Montage"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
626 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
627 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
628 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
629 GTEXTINFO_EMPTY
630 };
631 static GTextInfo panaspect[] = {
632 { (unichar_t *) N_("PanoseAspect|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
633 { (unichar_t *) N_("PanoseAspect|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
634 { (unichar_t *) N_("Super Condensed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
635 { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
636 { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
637 { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
638 { (unichar_t *) N_("Extended"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
639 { (unichar_t *) N_("Very Extended"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
640 { (unichar_t *) N_("Super Extended"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
641 { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
642 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
643 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
644 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
645 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
646 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
647 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
648 GTEXTINFO_EMPTY
649 };
650 static GTextInfo pancontrast3[] = {
651 { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
652 { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
653 { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
654 { (unichar_t *) N_("Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
655 { (unichar_t *) N_("Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
656 { (unichar_t *) N_("Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
657 { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
658 { (unichar_t *) N_("Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
659 { (unichar_t *) N_("High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
660 { (unichar_t *) N_("Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
661 { (unichar_t *) N_("Horizontal Low"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
662 { (unichar_t *) N_("Horizontal Medium"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
663 { (unichar_t *) N_("Horizontal High"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
664 { (unichar_t *) N_("Broken"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
665 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
666 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
667 GTEXTINFO_EMPTY
668 };
669 static GTextInfo panserifvar[] = {
670 { (unichar_t *) N_("PanoseSerifVariant|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
671 { (unichar_t *) N_("PanoseSerifVariant|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
672 { (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
673 { (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
674 { (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
675 { (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
676 { (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
677 { (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
678 /*!*/{ (unichar_t *) N_("Oval"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
679 { (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
680 { (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
681 { (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
682 { (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
683 { (unichar_t *) N_("Perpendicular Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
684 { (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
685 { (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
686 /* Um, these guys are only supposed to go up to 15, so why does this have a 16? */
687 /*!*/{ (unichar_t *) N_("PanoseSerivfs|Script"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
688 GTEXTINFO_EMPTY
689 };
690 static GTextInfo pantreatment[] = {
691 { (unichar_t *) N_("PanoseTreatment|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
692 { (unichar_t *) N_("PanoseTreatment|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
693 { (unichar_t *) N_("Standard Solid Fill"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
694 { (unichar_t *) N_("No Fill"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
695 { (unichar_t *) N_("Patterned Fill"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
696 { (unichar_t *) N_("Complex Fill"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
697 { (unichar_t *) N_("Shaped Fill"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
698 { (unichar_t *) N_("Drawn or Distressed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
699 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
700 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
701 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
702 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
703 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
704 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
705 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
706 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
707 GTEXTINFO_EMPTY
708 };
709 static GTextInfo panlining[] = {
710 { (unichar_t *) N_("PanoseLining|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
711 { (unichar_t *) N_("PanoseLining|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
712 { (unichar_t *) N_("PanoseLining|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
713 { (unichar_t *) N_("PanoseLining|Inline"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
714 { (unichar_t *) N_("PanoseLining|Outline"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
715 { (unichar_t *) N_("PanoseLining|Engraved (Multiple Lines)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
716 { (unichar_t *) N_("PanoseLining|Shadow"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
717 { (unichar_t *) N_("PanoseLining|Relief"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
718 { (unichar_t *) N_("PanoseLining|Backdrop"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
719 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
720 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
721 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
722 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
723 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
724 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
725 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
726 GTEXTINFO_EMPTY
727 };
728 static GTextInfo pantopology2[] = {
729 { (unichar_t *) N_("PanoseTopology|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
730 { (unichar_t *) N_("PanoseTopology|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
731 { (unichar_t *) N_("Standard"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
732 { (unichar_t *) N_("Square"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
733 { (unichar_t *) N_("Multiple Segment"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
734 { (unichar_t *) N_("Deco (E,M,S) Waco Midline"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
735 { (unichar_t *) N_("Uneven Weighting"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
736 { (unichar_t *) N_("Diverse Arms"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
737 { (unichar_t *) N_("Diverse Forms"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
738 { (unichar_t *) N_("Lombardic Forms"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
739 { (unichar_t *) N_("Upper Case in Lower Case"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
740 { (unichar_t *) N_("Implied Topology"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
741 { (unichar_t *) N_("Horseshoe E and A"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
742 { (unichar_t *) N_("Cursive"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
743 { (unichar_t *) N_("Blackletter"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
744 { (unichar_t *) N_("Swash Variance"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
745 GTEXTINFO_EMPTY
746 };
747 static GTextInfo pancharrange[] = {
748 { (unichar_t *) N_("PanoseCharRange|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
749 { (unichar_t *) N_("PanoseCharRange|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
750 { (unichar_t *) N_("Extended Collection"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
751 { (unichar_t *) N_("Literals"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
752 { (unichar_t *) N_("No Lower Case"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
753 { (unichar_t *) N_("Small Caps"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
754 { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
755 { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
756 { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
757 { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
758 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
759 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
760 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
761 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
762 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
763 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
764 GTEXTINFO_EMPTY
765 };
766 /* Latin: Symbol */
767 static GTextInfo pankind[] = {
768 { (unichar_t *) N_("PanoseKind|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
769 { (unichar_t *) N_("PanoseKind|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
770 { (unichar_t *) N_("Montages"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
771 { (unichar_t *) N_("Pictures"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
772 { (unichar_t *) N_("Shapes"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
773 { (unichar_t *) N_("Scientific"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
774 { (unichar_t *) N_("Music"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
775 { (unichar_t *) N_("Expert"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
776 { (unichar_t *) N_("Patterns"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
777 { (unichar_t *) N_("Borders"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
778 { (unichar_t *) N_("Icons"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
779 { (unichar_t *) N_("Logos"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
780 { (unichar_t *) N_("Industry Specific"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
781 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
782 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
783 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
784 GTEXTINFO_EMPTY
785 };
786 static GTextInfo panasprat2[] = {
787 { (unichar_t *) N_("PanoseAspect|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
788 { (unichar_t *) N_("PanoseAspect|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
789 { (unichar_t *) N_("No Width"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
790 { (unichar_t *) N_("Exceptionally Wide"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
791 { (unichar_t *) N_("Super Wide"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
792 { (unichar_t *) N_("Very Wide"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
793 { (unichar_t *) N_("Wide"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
794 { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
795 { (unichar_t *) N_("Narrow"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
796 { (unichar_t *) N_("Very Narrow"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
797 { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
798 { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
799 { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
800 { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
801 { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
802 { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
803 GTEXTINFO_EMPTY
804 };
805
806 static struct titlelist { char *name; GTextInfo *variants; } panoses[][9] = {
807 /*Any*/ {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
808 /*NoFit*/ {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
809 /*LtnTxt*/ {{ N_("_Serifs"), panserifs }, { N_("Panose|_Weight"), panweight }, { N_("_Proportion"), panprop }, { N_("_Contrast"), pancontrast }, { N_("Stroke _Variation"), panstrokevar }, { N_("_Arm Style"), panarmstyle }, { N_("_Letterform"), panletterform }, { N_("_Midline"), panmidline }, { N_("_X-Height"), panxheight }},
810 /*LtnHnd*/ {{ N_("_Tool"), pantool }, { N_("Panose|_Weight"), panweight }, { N_("_Spacing"), panspacing }, { N_("_Aspect Ratio"), panasprat }, { N_("_Contrast"), pancontrast2 }, { N_("_Topology"), pantopology }, { N_("F_orm"), panform }, { N_("F_inials"), panfinials }, { N_("_X-Ascent"), panxascent }},
811 /*LtnDcr*/ {{ N_("_Class"), panclass }, { N_("Panose|_Weight"), panweight }, { N_("_Aspect"), panaspect }, { N_("C_ontrast"), pancontrast3 }, { N_("_Serif Variant"), panserifvar }, { N_("T_reatment"), pantreatment }, { N_("_Lining"), panlining }, { N_("_Topology"), pantopology2 }, { N_("Char. _Range"), pancharrange }},
812 /* Yup, really should be "unknown", no weights permitted, nor aspect ratios */
813 /*LtnSym*/ {{ N_("_Kind"), pankind }, { N_("Panose|_Weight"), panunknown }, { N_("_Spacing"), panspacing }, { N_("_Aspect Ratio"), panunknown }, { N_("AR: Char 94"), panasprat2 }, { N_("AR: Char 119"), panasprat2 }, { N_("AR: Char 157"), panasprat2 }, { N_("AR: Char 163"), panasprat2 }, { N_("AR: Char 211"), panasprat2 }},
814 /* 6 */ {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
815 {{NULL, NULL}}
816 };
817
818 /* There is a similar list at the end of python.c, untranslated strings for */
819 /* scripting use */
820 static GTextInfo mslanguages[] = {
821 { (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) 0x436, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
822 { (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) 0x41c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
823 { (unichar_t *) N_("Alsatian"), NULL, 0, 0, (void *) 0x484, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
824 /* GT: See the long comment at "Property|New" */
825 /* GT: The msgstr should contain a translation of "Malayalam", ignore "Lang|" */
826 { (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) 0x45e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
827 { (unichar_t *) N_("Arabic (Saudi Arabia)"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
828 { (unichar_t *) N_("Arabic (Iraq)"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
829 { (unichar_t *) N_("Arabic (Egypt)"), NULL, 0, 0, (void *) 0xc01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
830 { (unichar_t *) N_("Arabic (Libya)"), NULL, 0, 0, (void *) 0x1001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
831 { (unichar_t *) N_("Arabic (Algeria)"), NULL, 0, 0, (void *) 0x1401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
832 { (unichar_t *) N_("Arabic (Morocco)"), NULL, 0, 0, (void *) 0x1801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
833 { (unichar_t *) N_("Arabic (Tunisia)"), NULL, 0, 0, (void *) 0x1C01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
834 { (unichar_t *) N_("Arabic (Oman)"), NULL, 0, 0, (void *) 0x2001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
835 { (unichar_t *) N_("Arabic (Yemen)"), NULL, 0, 0, (void *) 0x2401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
836 { (unichar_t *) N_("Arabic (Syria)"), NULL, 0, 0, (void *) 0x2801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
837 { (unichar_t *) N_("Arabic (Jordan)"), NULL, 0, 0, (void *) 0x2c01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
838 { (unichar_t *) N_("Arabic (Lebanon)"), NULL, 0, 0, (void *) 0x3001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
839 { (unichar_t *) N_("Arabic (Kuwait)"), NULL, 0, 0, (void *) 0x3401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
840 { (unichar_t *) N_("Arabic (U.A.E.)"), NULL, 0, 0, (void *) 0x3801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
841 { (unichar_t *) N_("Arabic (Bahrain)"), NULL, 0, 0, (void *) 0x3c01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
842 { (unichar_t *) N_("Arabic (Qatar)"), NULL, 0, 0, (void *) 0x4001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
843 { (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) 0x42b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
844 { (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) 0x44d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
845 { (unichar_t *) N_("Azeri (Latin)"), NULL, 0, 0, (void *) 0x42c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
846 { (unichar_t *) N_("Azeri (Cyrillic)"), NULL, 0, 0, (void *) 0x82c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
847 { (unichar_t *) N_("Bashkir"), NULL, 0, 0, (void *) 0x46d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
848 { (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) 0x42d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
849 { (unichar_t *) N_("Byelorussian"), NULL, 0, 0, (void *) 0x423, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
850 { (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) 0x445, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
851 { (unichar_t *) N_("Bengali Bangladesh"), NULL, 0, 0, (void *) 0x845, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
852 { (unichar_t *) N_("Bosnian (Cyrillic)"), NULL, 0, 0, (void *) 0x201a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
853 { (unichar_t *) N_("Bosnian (Latin)"), NULL, 0, 0, (void *) 0x141a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
854 { (unichar_t *) N_("Breton"), NULL, 0, 0, (void *) 0x47e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
855 { (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
856 { (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
857 { (unichar_t *) N_("Cambodian"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
858 { (unichar_t *) N_("Chinese (Taiwan)"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
859 { (unichar_t *) N_("Chinese (PRC)"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
860 { (unichar_t *) N_("Chinese (Hong Kong)"), NULL, 0, 0, (void *) 0xc04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
861 { (unichar_t *) N_("Chinese (Singapore)"), NULL, 0, 0, (void *) 0x1004, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
862 { (unichar_t *) N_("Chinese (Macau)"), NULL, 0, 0, (void *) 0x1404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
863 { (unichar_t *) N_("Corsican"), NULL, 0, 0, (void *) 0x483, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
864 { (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) 0x41a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
865 { (unichar_t *) N_("Croatian Bosnia/Herzegovina"), NULL, 0, 0, (void *) 0x101a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
866 { (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
867 { (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
868 { (unichar_t *) N_("Dari"), NULL, 0, 0, (void *) 0x48c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
869 { (unichar_t *) N_("Divehi"), NULL, 0, 0, (void *) 0x465, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
870 { (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) 0x413, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
871 { (unichar_t *) N_("Flemish (Belgian Dutch)"), NULL, 0, 0, (void *) 0x813, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
872 { (unichar_t *) N_("English (British)"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
873 { (unichar_t *) N_("English (US)"), NULL, 0, 0, (void *) 0x409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
874 { (unichar_t *) N_("English (Canada)"), NULL, 0, 0, (void *) 0x1009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
875 { (unichar_t *) N_("English (Australian)"), NULL, 0, 0, (void *) 0xc09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
876 { (unichar_t *) N_("English (New Zealand)"), NULL, 0, 0, (void *) 0x1409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
877 { (unichar_t *) N_("English (Irish)"), NULL, 0, 0, (void *) 0x1809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
878 { (unichar_t *) N_("English (South Africa)"), NULL, 0, 0, (void *) 0x1c09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
879 { (unichar_t *) N_("English (Jamaica)"), NULL, 0, 0, (void *) 0x2009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
880 { (unichar_t *) N_("English (Caribbean)"), NULL, 0, 0, (void *) 0x2409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
881 { (unichar_t *) N_("English (Belize)"), NULL, 0, 0, (void *) 0x2809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
882 { (unichar_t *) N_("English (Trinidad)"), NULL, 0, 0, (void *) 0x2c09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
883 { (unichar_t *) N_("English (Zimbabwe)"), NULL, 0, 0, (void *) 0x3009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
884 { (unichar_t *) N_("English (Philippines)"), NULL, 0, 0, (void *) 0x3409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
885 { (unichar_t *) N_("English (India)"), NULL, 0, 0, (void *) 0x4009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
886 { (unichar_t *) N_("English (Malaysia)"), NULL, 0, 0, (void *) 0x4409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
887 { (unichar_t *) N_("English (Singapore)"), NULL, 0, 0, (void *) 0x4809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
888 { (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) 0x425, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
889 { (unichar_t *) N_("Faeroese"), NULL, 0, 0, (void *) 0x438, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
890 { (unichar_t *) N_("Filipino"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
891 { (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) 0x40b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
892 { (unichar_t *) N_("French French"), NULL, 0, 0, (void *) 0x40c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
893 { (unichar_t *) N_("French Belgium"), NULL, 0, 0, (void *) 0x80c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
894 { (unichar_t *) N_("French Canadian"), NULL, 0, 0, (void *) 0xc0c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
895 { (unichar_t *) N_("French Swiss"), NULL, 0, 0, (void *) 0x100c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
896 { (unichar_t *) N_("French Luxembourg"), NULL, 0, 0, (void *) 0x140c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
897 { (unichar_t *) N_("French Monaco"), NULL, 0, 0, (void *) 0x180c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
898 { (unichar_t *) N_("Frisian"), NULL, 0, 0, (void *) 0x462, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
899 { (unichar_t *) N_("Gaelic (Irish)"), NULL, 0, 0, (void *) 0x83c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
900 { (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) 0x456, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
901 { (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) 0x437, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
902 { (unichar_t *) N_("German German"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
903 { (unichar_t *) N_("German Swiss"), NULL, 0, 0, (void *) 0x807, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
904 { (unichar_t *) N_("German Austrian"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
905 { (unichar_t *) N_("German Luxembourg"), NULL, 0, 0, (void *) 0x1007, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
906 { (unichar_t *) N_("German Liechtenstein"), NULL, 0, 0, (void *) 0x1407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
907 { (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) 0x408, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
908 { (unichar_t *) N_("Greenlandic"), NULL, 0, 0, (void *) 0x46f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
909 { (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) 0x447, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
910 { (unichar_t *) N_("Hausa"), NULL, 0, 0, (void *) 0x468, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
911 { (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) 0x40d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
912 { (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) 0x439, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
913 { (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) 0x40e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
914 { (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
915 { (unichar_t *) N_("Igbo"), NULL, 0, 0, (void *) 0x470, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
916 { (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) 0x421, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
917 { (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) 0x45d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
918 { (unichar_t *) N_("Inuktitut (Latin)"), NULL, 0, 0, (void *) 0x85d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
919 { (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) 0x410, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
920 { (unichar_t *) N_("Italian Swiss"), NULL, 0, 0, (void *) 0x810, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
921 { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) 0x411, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
922 { (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) 0x44b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
923 { (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) 0x43f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
924 { (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
925 { (unichar_t *) N_("Kinyarwanda"), NULL, 0, 0, (void *) 0x487, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
926 { (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) 0x440, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
927 { (unichar_t *) N_("Konkani"), NULL, 0, 0, (void *) 0x457, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
928 { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) 0x412, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
929 { (unichar_t *) NU_("K’iche"), NULL, 0, 0, (void *) 0x486, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
930 { (unichar_t *) N_("Lao"), NULL, 0, 0, (void *) 0x454, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
931 { (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) 0x426, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
932 { (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) 0x427, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
933 { (unichar_t *) N_("Lower Sorbian"), NULL, 0, 0, (void *) 0x82e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
934 { (unichar_t *) N_("Luxembourgish"), NULL, 0, 0, (void *) 0x46e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
935 { (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) 0x42f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
936 { (unichar_t *) N_("Malay"), NULL, 0, 0, (void *) 0x43e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
937 { (unichar_t *) N_("Malay (Brunei)"), NULL, 0, 0, (void *) 0x83e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
938 { (unichar_t *) N_("Lang|Malayalam"), NULL, 0, 0, (void *) 0x44c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
939 { (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) 0x43a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
940 { (unichar_t *) N_("Maori"), NULL, 0, 0, (void *) 0x481, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
941 { (unichar_t *) N_("Mapudungun"), NULL, 0, 0, (void *) 0x47a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
942 { (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) 0x44e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
943 { (unichar_t *) N_("Mohawk"), NULL, 0, 0, (void *) 0x47c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
944 { (unichar_t *) N_("Mongolian (Cyrillic)"), NULL, 0, 0, (void *) 0x450, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
945 { (unichar_t *) N_("Mongolian (Mongolian)"), NULL, 0, 0, (void *) 0x850, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
946 { (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) 0x461, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
947 { (unichar_t *) N_("Norwegian (Bokmal)"), NULL, 0, 0, (void *) 0x414, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
948 { (unichar_t *) N_("Norwegian (Nynorsk)"), NULL, 0, 0, (void *) 0x814, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
949 { (unichar_t *) N_("Occitan"), NULL, 0, 0, (void *) 0x482, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
950 { (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) 0x448, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
951 { (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) 0x463, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
952 { (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) 0x415, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
953 { (unichar_t *) N_("Portuguese (Brasil)"), NULL, 0, 0, (void *) 0x416, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
954 { (unichar_t *) N_("Portuguese (Portugal)"), NULL, 0, 0, (void *) 0x816, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
955 { (unichar_t *) N_("Punjabi (India)"), NULL, 0, 0, (void *) 0x446, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
956 { (unichar_t *) N_("Quecha (Bolivia)"), NULL, 0, 0, (void *) 0x46b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
957 { (unichar_t *) N_("Quecha (Ecuador)"), NULL, 0, 0, (void *) 0x86b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
958 { (unichar_t *) N_("Quecha (Peru)"), NULL, 0, 0, (void *) 0xc6b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
959 { (unichar_t *) N_("Rhaeto-Romanic"), NULL, 0, 0, (void *) 0x417, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
960 { (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) 0x418, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
961 { (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) 0x419, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
962 { (unichar_t *) N_("Sakha"), NULL, 0, 0, (void *) 0x485, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
963 { (unichar_t *) N_("Sami (Lappish)"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
964 { (unichar_t *) N_("Sami (Inari)"), NULL, 0, 0, (void *) 0x243b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
965 { (unichar_t *) N_("Sami (Lule) (Norway)"), NULL, 0, 0, (void *) 0x103b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
966 { (unichar_t *) N_("Sami (Lule) (Sweden)"), NULL, 0, 0, (void *) 0x143b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
967 { (unichar_t *) N_("Sami (Northern) (Finland)"), NULL, 0, 0, (void *) 0xc3b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
968 { (unichar_t *) N_("Sami (Northern) (Sweden)"), NULL, 0, 0, (void *) 0x83b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
969 { (unichar_t *) N_("Sami (Skolt)"), NULL, 0, 0, (void *) 0x203b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
970 { (unichar_t *) N_("Sami (Southern) (Norway)"), NULL, 0, 0, (void *) 0x183b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
971 { (unichar_t *) N_("Sami (Southern) (Sweden)"), NULL, 0, 0, (void *) 0x1c3b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
972 { (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) 0x44f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
973 { (unichar_t *) N_("Sepedi"), NULL, 0, 0, (void *) 0x46c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
974 { (unichar_t *) N_("Serbian (Cyrillic)"), NULL, 0, 0, (void *) 0xc1a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
975 { (unichar_t *) N_("Serbian (Latin)"), NULL, 0, 0, (void *) 0x81a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
976 { (unichar_t *) N_("Serbian (Cyrillic) (Bosnia and Herzegovina)"), NULL, 0, 0, (void *) 0x1c1a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
977 { (unichar_t *) N_("Serbian (Latin) (Bosnia and Herzegovina)"), NULL, 0, 0, (void *) 0x181a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
978 { (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) 0x45b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
979 { (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) 0x41b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
980 { (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) 0x424, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
981 { (unichar_t *) N_("Sorbian"), NULL, 0, 0, (void *) 0x42e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
982 { (unichar_t *) N_("Spanish (Traditional)"), NULL, 0, 0, (void *) 0x40a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
983 { (unichar_t *) N_("Spanish Mexico"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
984 { (unichar_t *) N_("Spanish (Modern)"), NULL, 0, 0, (void *) 0xc0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
985 { (unichar_t *) N_("Spanish (Guatemala)"), NULL, 0, 0, (void *) 0x100a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
986 { (unichar_t *) N_("Spanish (Costa Rica)"), NULL, 0, 0, (void *) 0x140a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
987 { (unichar_t *) N_("Spanish (Panama)"), NULL, 0, 0, (void *) 0x180a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
988 { (unichar_t *) N_("Spanish (Dominican Republic)"), NULL, 0, 0, (void *) 0x1c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
989 { (unichar_t *) N_("Spanish (Venezuela)"), NULL, 0, 0, (void *) 0x200a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
990 { (unichar_t *) N_("Spanish (Colombia)"), NULL, 0, 0, (void *) 0x240a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
991 { (unichar_t *) N_("Spanish (Peru)"), NULL, 0, 0, (void *) 0x280a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
992 { (unichar_t *) N_("Spanish (Argentina)"), NULL, 0, 0, (void *) 0x2c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
993 { (unichar_t *) N_("Spanish (Ecuador)"), NULL, 0, 0, (void *) 0x300a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
994 { (unichar_t *) N_("Spanish (Chile)"), NULL, 0, 0, (void *) 0x340a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
995 { (unichar_t *) N_("Spanish (Uruguay)"), NULL, 0, 0, (void *) 0x380a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
996 { (unichar_t *) N_("Spanish (Paraguay)"), NULL, 0, 0, (void *) 0x3c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
997 { (unichar_t *) N_("Spanish (Bolivia)"), NULL, 0, 0, (void *) 0x400a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
998 { (unichar_t *) N_("Spanish (El Salvador)"), NULL, 0, 0, (void *) 0x440a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
999 { (unichar_t *) N_("Spanish (Honduras)"), NULL, 0, 0, (void *) 0x480a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1000 { (unichar_t *) N_("Spanish (Nicaragua)"), NULL, 0, 0, (void *) 0x4c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1001 { (unichar_t *) N_("Spanish (Puerto Rico)"), NULL, 0, 0, (void *) 0x500a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1002 { (unichar_t *) N_("Spanish (United States)"), NULL, 0, 0, (void *) 0x540a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1003 { (unichar_t *) N_("Swahili (Kenyan)"), NULL, 0, 0, (void *) 0x441, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1004 { (unichar_t *) N_("Swedish (Sweden)"), NULL, 0, 0, (void *) 0x41d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1005 { (unichar_t *) N_("Swedish (Finland)"), NULL, 0, 0, (void *) 0x81d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1006 { (unichar_t *) N_("Lang|Syriac"), NULL, 0, 0, (void *) 0x45a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1007 { (unichar_t *) N_("Lang|Tagalog"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1008 { (unichar_t *) N_("Tajik"), NULL, 0, 0, (void *) 0x428, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1009 { (unichar_t *) N_("Tamazight (Latin)"), NULL, 0, 0, (void *) 0x85f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1010 { (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) 0x449, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1011 { (unichar_t *) N_("Tatar (Tatarstan)"), NULL, 0, 0, (void *) 0x444, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1012 { (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) 0x44a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1013 { (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) 0x41e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1014 { (unichar_t *) N_("Tibetan (PRC)"), NULL, 0, 0, (void *) 0x451, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1015 { (unichar_t *) N_("Tswana"), NULL, 0, 0, (void *) 0x432, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1016 { (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) 0x41f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1017 { (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) 0x442, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1018 { (unichar_t *) N_("Lang|Uighur"), NULL, 0, 0, (void *) 0x480, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1019 { (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) 0x422, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1020 { (unichar_t *) N_("Urdu (Pakistan)"), NULL, 0, 0, (void *) 0x420, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1021 { (unichar_t *) N_("Uzbek (Latin)"), NULL, 0, 0, (void *) 0x443, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1022 { (unichar_t *) N_("Uzbek (Cyrillic)"), NULL, 0, 0, (void *) 0x843, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1023 { (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) 0x42a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1024 { (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) 0x452, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1025 { (unichar_t *) N_("Wolof"), NULL, 0, 0, (void *) 0x488, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1026 { (unichar_t *) N_("Xhosa"), NULL, 0, 0, (void *) 0x434, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1027 { (unichar_t *) N_("Lang|Yi"), NULL, 0, 0, (void *) 0x478, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1028 { (unichar_t *) N_("Yoruba"), NULL, 0, 0, (void *) 0x46a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1029 { (unichar_t *) N_("Zulu"), NULL, 0, 0, (void *) 0x435, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1030 GTEXTINFO_EMPTY
1031 };
1032 /* There is a similar list at the end of python.c, untranslated strings for */
1033 /* scripting use */
1034 static GTextInfo ttfnameids[] = {
1035 /* Put styles (docs call it subfamily) first because it is most likely to change */
1036 { (unichar_t *) N_("Styles (SubFamily)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1037 { (unichar_t *) N_("Copyright"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1038 { (unichar_t *) N_("Family"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1039 { (unichar_t *) N_("Fullname"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1040 { (unichar_t *) N_("UniqueID"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1041 { (unichar_t *) N_("Version"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1042 /* Don't give user access to PostScriptName, we set that elsewhere */
1043 { (unichar_t *) N_("Trademark"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1044 { (unichar_t *) N_("Manufacturer"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1045 { (unichar_t *) N_("Designer"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1046 { (unichar_t *) N_("Descriptor"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1047 { (unichar_t *) N_("Vendor URL"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1048 { (unichar_t *) N_("Designer URL"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1049 { (unichar_t *) N_("License"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1050 { (unichar_t *) N_("License URL"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1051 /* slot 15 is reserved */
1052 { (unichar_t *) N_("Preferred Family"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1053 { (unichar_t *) N_("Preferred Styles"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1054 { (unichar_t *) N_("Compatible Full"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1055 { (unichar_t *) N_("Sample Text"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1056 { (unichar_t *) N_("CID findfont Name"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1057 { (unichar_t *) N_("WWS Family"), NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1058 { (unichar_t *) N_("WWS Subfamily"), NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1059 GTEXTINFO_EMPTY
1060 };
1061 static GTextInfo otfssfeattags[] = {
1062 /* These should not be translated. They are tags */
1063 { (unichar_t *) "ss01", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1064 { (unichar_t *) "ss02", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1065 { (unichar_t *) "ss03", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1066 { (unichar_t *) "ss04", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1067 { (unichar_t *) "ss05", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1068 { (unichar_t *) "ss06", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1069 { (unichar_t *) "ss07", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1070 { (unichar_t *) "ss08", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1071 { (unichar_t *) "ss09", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','0','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1072 { (unichar_t *) "ss10", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1073 { (unichar_t *) "ss11", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1074 { (unichar_t *) "ss12", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1075 { (unichar_t *) "ss13", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1076 { (unichar_t *) "ss14", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1077 { (unichar_t *) "ss15", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1078 { (unichar_t *) "ss16", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1079 { (unichar_t *) "ss17", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1080 { (unichar_t *) "ss18", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1081 { (unichar_t *) "ss19", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','1','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1082 { (unichar_t *) "ss20", NULL, 0, 0, (void *) (intptr_t) CHR('s','s','2','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1083
1084 { (unichar_t *) "cv01", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1085 { (unichar_t *) "cv02", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1086 { (unichar_t *) "cv03", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1087 { (unichar_t *) "cv04", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1088 { (unichar_t *) "cv05", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1089 { (unichar_t *) "cv06", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1090 { (unichar_t *) "cv07", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1091 { (unichar_t *) "cv08", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1092 { (unichar_t *) "cv09", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','0','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1093 { (unichar_t *) "cv10", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1094 { (unichar_t *) "cv11", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1095 { (unichar_t *) "cv12", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1096 { (unichar_t *) "cv13", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1097 { (unichar_t *) "cv14", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1098 { (unichar_t *) "cv15", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1099 { (unichar_t *) "cv16", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1100 { (unichar_t *) "cv17", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1101 { (unichar_t *) "cv18", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1102 { (unichar_t *) "cv19", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','1','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1103 { (unichar_t *) "cv20", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1104 { (unichar_t *) "cv21", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1105 { (unichar_t *) "cv22", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1106 { (unichar_t *) "cv23", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1107 { (unichar_t *) "cv24", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1108 { (unichar_t *) "cv25", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1109 { (unichar_t *) "cv26", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1110 { (unichar_t *) "cv27", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1111 { (unichar_t *) "cv28", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1112 { (unichar_t *) "cv29", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','2','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1113 { (unichar_t *) "cv30", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1114 { (unichar_t *) "cv31", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1115 { (unichar_t *) "cv32", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1116 { (unichar_t *) "cv33", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1117 { (unichar_t *) "cv34", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1118 { (unichar_t *) "cv35", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1119 { (unichar_t *) "cv36", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1120 { (unichar_t *) "cv37", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1121 { (unichar_t *) "cv38", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1122 { (unichar_t *) "cv39", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','3','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1123 { (unichar_t *) "cv40", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1124 { (unichar_t *) "cv41", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1125 { (unichar_t *) "cv42", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1126 { (unichar_t *) "cv43", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1127 { (unichar_t *) "cv44", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1128 { (unichar_t *) "cv45", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1129 { (unichar_t *) "cv46", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1130 { (unichar_t *) "cv47", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1131 { (unichar_t *) "cv48", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1132 { (unichar_t *) "cv49", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','4','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1133 { (unichar_t *) "cv50", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1134 { (unichar_t *) "cv51", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1135 { (unichar_t *) "cv52", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1136 { (unichar_t *) "cv53", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1137 { (unichar_t *) "cv54", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1138 { (unichar_t *) "cv55", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1139 { (unichar_t *) "cv56", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1140 { (unichar_t *) "cv57", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1141 { (unichar_t *) "cv58", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1142 { (unichar_t *) "cv59", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','5','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1143 { (unichar_t *) "cv60", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1144 { (unichar_t *) "cv61", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1145 { (unichar_t *) "cv62", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1146 { (unichar_t *) "cv63", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1147 { (unichar_t *) "cv64", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1148 { (unichar_t *) "cv65", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1149 { (unichar_t *) "cv66", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1150 { (unichar_t *) "cv67", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1151 { (unichar_t *) "cv68", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1152 { (unichar_t *) "cv69", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','6','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1153 { (unichar_t *) "cv70", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1154 { (unichar_t *) "cv71", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1155 { (unichar_t *) "cv72", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1156 { (unichar_t *) "cv73", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1157 { (unichar_t *) "cv74", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1158 { (unichar_t *) "cv75", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1159 { (unichar_t *) "cv76", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1160 { (unichar_t *) "cv77", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1161 { (unichar_t *) "cv78", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1162 { (unichar_t *) "cv79", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','7','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1163 { (unichar_t *) "cv80", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1164 { (unichar_t *) "cv81", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1165 { (unichar_t *) "cv82", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1166 { (unichar_t *) "cv83", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1167 { (unichar_t *) "cv84", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1168 { (unichar_t *) "cv85", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1169 { (unichar_t *) "cv86", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1170 { (unichar_t *) "cv87", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1171 { (unichar_t *) "cv88", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1172 { (unichar_t *) "cv89", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','8','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1173 { (unichar_t *) "cv90", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1174 { (unichar_t *) "cv91", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1175 { (unichar_t *) "cv92", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1176 { (unichar_t *) "cv93", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1177 { (unichar_t *) "cv94", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1178 { (unichar_t *) "cv95", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1179 { (unichar_t *) "cv96", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1180 { (unichar_t *) "cv97", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1181 { (unichar_t *) "cv98", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1182 { (unichar_t *) "cv99", NULL, 0, 0, (void *) (intptr_t) CHR('c','v','9','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1183
1184 GTEXTINFO_EMPTY
1185 };
1186 static GTextInfo otfssfeatfields[] = {
1187 { (unichar_t *) N_("Feature Name"), NULL, 0, 0, (void *) (intptr_t) otffn_featname, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1188 { (unichar_t *) N_("Tooltip Text"), NULL, 0, 0, (void *) (intptr_t) otffn_tooltiptext, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1189 { (unichar_t *) N_("featname|Sample Text"), NULL, 0, 0, (void *) (intptr_t) otffn_sampletext, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1190 //{ (unichar_t *) N_("Character List"), NULL, 0, 0, (void *) (intptr_t) otffn_characters, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1191 { (unichar_t *) N_("Parameter Name 1"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1192 { (unichar_t *) N_("Parameter Name 2"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 1, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1193 { (unichar_t *) N_("Parameter Name 3"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 2, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1194 { (unichar_t *) N_("Parameter Name 4"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 3, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1195 { (unichar_t *) N_("Parameter Name 5"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 4, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1196 { (unichar_t *) N_("Parameter Name 6"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 5, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1197 { (unichar_t *) N_("Parameter Name 7"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 6, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1198 { (unichar_t *) N_("Parameter Name 8"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 7, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1199 { (unichar_t *) N_("Parameter Name 9"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 8, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1200 { (unichar_t *) N_("Parameter Name 10"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 9, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1201 { (unichar_t *) N_("Parameter Name 11"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 10, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1202 { (unichar_t *) N_("Parameter Name 12"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 11, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1203 { (unichar_t *) N_("Parameter Name 13"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 12, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1204 { (unichar_t *) N_("Parameter Name 14"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 13, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1205 { (unichar_t *) N_("Parameter Name 15"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 14, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1206 { (unichar_t *) N_("Parameter Name 16"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 15, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1207 { (unichar_t *) N_("Parameter Name 17"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 16, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1208 { (unichar_t *) N_("Parameter Name 18"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 17, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1209 { (unichar_t *) N_("Parameter Name 19"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 18, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1210 { (unichar_t *) N_("Parameter Name 20"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 19, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1211 { (unichar_t *) N_("Parameter Name 21"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 20, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1212 { (unichar_t *) N_("Parameter Name 22"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 21, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1213 { (unichar_t *) N_("Parameter Name 23"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 22, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1214 { (unichar_t *) N_("Parameter Name 24"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 23, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1215 { (unichar_t *) N_("Parameter Name 25"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 24, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1216 { (unichar_t *) N_("Parameter Name 26"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 25, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1217 { (unichar_t *) N_("Parameter Name 27"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 26, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1218 { (unichar_t *) N_("Parameter Name 28"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 27, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1219 { (unichar_t *) N_("Parameter Name 29"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 28, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1220 { (unichar_t *) N_("Parameter Name 30"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 29, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1221 { (unichar_t *) N_("Parameter Name 31"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 30, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1222 { (unichar_t *) N_("Parameter Name 32"), NULL, 0, 0, (void *) (intptr_t) otffn_paramname_begin + 31, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1223 GTEXTINFO_EMPTY
1224 };
1225 /* Put styles (docs call it subfamily) first because it is most likely to change */
1226 static GTextInfo unicoderangenames[] = {
1227 { (unichar_t *) N_("Basic Latin"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1228 { (unichar_t *) N_("Latin-1 Supplement"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1229 { (unichar_t *) N_("Latin Extended-A"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1230 { (unichar_t *) N_("Latin Extended-B"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1231 { (unichar_t *) N_("IPA Ext & Phonetic Ext (& Supplement)"),NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1232 { (unichar_t *) N_("Modifier Letters & Modifier Tone Letters"),
1233 NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1234 { (unichar_t *) N_("Combining Diacritical Marks (& Supplement)"),
1235 NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1236 { (unichar_t *) N_("Greek and Coptic"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1237 { (unichar_t *) N_("Coptic"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1238 { (unichar_t *) N_("Cyrillic (& Supplement & Ext A/B)"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1239 { (unichar_t *) N_("Armenian"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1240 { (unichar_t *) N_("Hebrew"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1241 { (unichar_t *) N_("Vai"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1242 { (unichar_t *) N_("Arabic (& Supplement)"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1243 { (unichar_t *) N_("NKo"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1244 { (unichar_t *) N_("Devanagari"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1245 { (unichar_t *) N_("Bengali"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1246 { (unichar_t *) N_("Gurmukhi"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1247 { (unichar_t *) N_("Gujarati"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1248 { (unichar_t *) N_("Oriya"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1249 { (unichar_t *) N_("Tamil"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1250 { (unichar_t *) N_("Telugu"), NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1251 { (unichar_t *) N_("Kannada"), NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1252 { (unichar_t *) N_("Malayalam"), NULL, 0, 0, (void *) 23, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1253 { (unichar_t *) N_("Thai"), NULL, 0, 0, (void *) 24, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1254 { (unichar_t *) N_("Lao"), NULL, 0, 0, (void *) 25, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1255 { (unichar_t *) N_("Georgian (& Supplement)"), NULL, 0, 0, (void *) 26, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1256 { (unichar_t *) N_("Balinese"), NULL, 0, 0, (void *) 27, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1257 { (unichar_t *) N_("Hangul Jamo"), NULL, 0, 0, (void *) 28, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1258 { (unichar_t *) N_("Latin Extended Additional/C/D"), NULL, 0, 0, (void *) 29, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1259 { (unichar_t *) N_("Greek Extended"), NULL, 0, 0, (void *) 30, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1260 { (unichar_t *) N_("General/Supplemental Punctuation"), NULL, 0, 0, (void *) 31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1261 { (unichar_t *) N_("Subscripts and Superscripts"), NULL, 0, 0, (void *) 32, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1262 { (unichar_t *) N_("Currency Symbols"), NULL, 0, 0, (void *) 33, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1263 { (unichar_t *) N_("Combining Diacritical Marks for Symbols"), NULL, 0, 0, (void *) 34, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1264 { (unichar_t *) N_("Letterlike Symbols"), NULL, 0, 0, (void *) 35, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1265 { (unichar_t *) N_("Numeric Forms"), NULL, 0, 0, (void *) 36, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1266 { (unichar_t *) N_("Arrows & Sup Arrows A/B & Misc Arrows"),NULL, 0, 0, (void *) 37, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1267 { (unichar_t *) N_("Math Operators & Sup Math Operators & Misc Math Symbols A/B"),
1268 NULL, 0, 0, (void *) 38, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1269 { (unichar_t *) N_("Miscellaneous Technical"), NULL, 0, 0, (void *) 39, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1270 { (unichar_t *) N_("Control Pictures"), NULL, 0, 0, (void *) 40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1271 { (unichar_t *) N_("Optical Character Recognition"), NULL, 0, 0, (void *) 41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1272 { (unichar_t *) N_("Enclosed Alphanumerics"), NULL, 0, 0, (void *) 42, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1273 { (unichar_t *) N_("Box Drawing"), NULL, 0, 0, (void *) 43, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1274 { (unichar_t *) N_("Block Elements"), NULL, 0, 0, (void *) 44, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1275 { (unichar_t *) N_("Geometric Shapes"), NULL, 0, 0, (void *) 45, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1276 { (unichar_t *) N_("Miscellaneous Symbols"), NULL, 0, 0, (void *) 46, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1277 { (unichar_t *) N_("Dingbats"), NULL, 0, 0, (void *) 47, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1278 { (unichar_t *) N_("CJK Symbols and Punctuation"), NULL, 0, 0, (void *) 48, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1279 { (unichar_t *) N_("Hiragana"), NULL, 0, 0, (void *) 49, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1280 { (unichar_t *) N_("Katakana (& Phonetic Extensions)"), NULL, 0, 0, (void *) 50, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1281 { (unichar_t *) N_("Bopomofo (& Extended)"), NULL, 0, 0, (void *) 51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1282 { (unichar_t *) N_("Hangul Compatibility Jamo"), NULL, 0, 0, (void *) 52, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1283 { (unichar_t *) N_("Phags-pa"), NULL, 0, 0, (void *) 53, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1284 { (unichar_t *) N_("Enclosed CJK Letters and Months"), NULL, 0, 0, (void *) 54, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1285 { (unichar_t *) N_("CJK Compatibility"), NULL, 0, 0, (void *) 55, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1286 { (unichar_t *) N_("Hangul Syllables"), NULL, 0, 0, (void *) 56, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1287 { (unichar_t *) N_("Non-Basic Multilingual Plane"), NULL, 0, 0, (void *) 57, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1288 { (unichar_t *) N_("Phoenician"), NULL, 0, 0, (void *) 58, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1289 { (unichar_t *) N_("CJK (& Ext A/B) & CJK Radicals Sup & Kangxi & IDC & Kanbun"),
1290 NULL, 0, 0, (void *) 59, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1291 { (unichar_t *) N_("Private Use Area"), NULL, 0, 0, (void *) 60, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1292 { (unichar_t *) N_("CJK Strokes & CJK Compat Ideographs (& Sup)"),
1293 NULL, 0, 0, (void *) 61, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1294 { (unichar_t *) N_("Alphabetic Presentation Forms"), NULL, 0, 0, (void *) 62, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1295 { (unichar_t *) N_("Arabic Presentation Forms-A"), NULL, 0, 0, (void *) 63, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1296 { (unichar_t *) N_("Combining Half Marks"), NULL, 0, 0, (void *) 64, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1297 { (unichar_t *) N_("Vertical Forms & CJK Compatibility Forms"),
1298 NULL, 0, 0, (void *) 65, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1299 { (unichar_t *) N_("Small Form Variants"), NULL, 0, 0, (void *) 66, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1300 { (unichar_t *) N_("Arabic Presentation Forms-B"), NULL, 0, 0, (void *) 67, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1301 { (unichar_t *) N_("Halfwidth and Fullwidth Forms"), NULL, 0, 0, (void *) 68, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1302 { (unichar_t *) N_("Specials"), NULL, 0, 0, (void *) 69, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1303 { (unichar_t *) N_("Tibetan"), NULL, 0, 0, (void *) 70, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1304 { (unichar_t *) N_("Syriac"), NULL, 0, 0, (void *) 71, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1305 { (unichar_t *) N_("Thaana"), NULL, 0, 0, (void *) 72, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1306 { (unichar_t *) N_("Sinhala"), NULL, 0, 0, (void *) 73, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1307 { (unichar_t *) N_("Myanmar"), NULL, 0, 0, (void *) 74, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1308 { (unichar_t *) N_("Ethiopic (& Supplement/Extended)"), NULL, 0, 0, (void *) 75, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1309 { (unichar_t *) N_("Cherokee"), NULL, 0, 0, (void *) 76, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1310 { (unichar_t *) N_("Unified Canadian Aboriginal Syllabics"),NULL, 0, 0, (void *) 77, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1311 { (unichar_t *) N_("Ogham"), NULL, 0, 0, (void *) 78, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1312 { (unichar_t *) N_("Runic"), NULL, 0, 0, (void *) 79, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1313 { (unichar_t *) N_("Khmer & Khmer Symbols"), NULL, 0, 0, (void *) 80, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1314 { (unichar_t *) N_("Mongolian"), NULL, 0, 0, (void *) 81, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1315 { (unichar_t *) N_("Braille Patterns"), NULL, 0, 0, (void *) 82, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1316 { (unichar_t *) N_("Yi Syllables/Radicals"), NULL, 0, 0, (void *) 83, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1317 { (unichar_t *) N_("Tagalog/Hanunoo/Buhid/Tagbanwa"), NULL, 0, 0, (void *) 84, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1318 { (unichar_t *) N_("Old Italic"), NULL, 0, 0, (void *) 85, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1319 { (unichar_t *) N_("Gothic"), NULL, 0, 0, (void *) 86, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1320 { (unichar_t *) N_("Deseret"), NULL, 0, 0, (void *) 87, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1321 { (unichar_t *) N_("Byzantine Music & Music & Ancient Greek Music"),
1322 NULL, 0, 0, (void *) 88, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1323 { (unichar_t *) N_("Mathematical Alphanumeric Symbols"), NULL, 0, 0, (void *) 89, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1324 { (unichar_t *) N_("Supplementary Private Use Area A/B"), NULL, 0, 0, (void *) 90, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1325 { (unichar_t *) N_("Variation Selectors (& Supplement)"), NULL, 0, 0, (void *) 91, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1326 { (unichar_t *) N_("Tags"), NULL, 0, 0, (void *) 92, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1327 { (unichar_t *) N_("Limbu"), NULL, 0, 0, (void *) 93, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1328 { (unichar_t *) N_("Tai Le"), NULL, 0, 0, (void *) 94, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1329 { (unichar_t *) N_("New Tai Lue"), NULL, 0, 0, (void *) 95, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1330 { (unichar_t *) N_("Buginese"), NULL, 0, 0, (void *) 96, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1331 { (unichar_t *) N_("Glagolitic"), NULL, 0, 0, (void *) 97, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1332 { (unichar_t *) N_("Tifinagh"), NULL, 0, 0, (void *) 98, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1333 { (unichar_t *) N_("Yijing Hexagram Symbols"), NULL, 0, 0, (void *) 99, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1334 { (unichar_t *) N_("Syloti Nagri"), NULL, 0, 0, (void *) 100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1335 { (unichar_t *) N_("Linear B Syllabary/Ideograms & Aegean Numbers"),
1336 NULL, 0, 0, (void *) 101, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1337 { (unichar_t *) N_("Ancient Greek Numbers"), NULL, 0, 0, (void *) 102, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1338 { (unichar_t *) N_("Ugaritic"), NULL, 0, 0, (void *) 103, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1339 { (unichar_t *) N_("Old Persian"), NULL, 0, 0, (void *) 104, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1340 { (unichar_t *) N_("Shavian"), NULL, 0, 0, (void *) 105, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1341 { (unichar_t *) N_("Osmanya"), NULL, 0, 0, (void *) 106, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1342 { (unichar_t *) N_("Cypriot Syllabary"), NULL, 0, 0, (void *) 107, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1343 { (unichar_t *) N_("Kharoshthi"), NULL, 0, 0, (void *) 108, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1344 { (unichar_t *) N_("Tai Xuan Jing Symbols"), NULL, 0, 0, (void *) 109, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1345 { (unichar_t *) N_("Cuneiform (& Numbers and Punctuation)"),NULL, 0, 0, (void *) 110, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1346 { (unichar_t *) N_("Counting Rod Numerals"), NULL, 0, 0, (void *) 111, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1347 { (unichar_t *) N_("Sundanese"), NULL, 0, 0, (void *) 112, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1348 { (unichar_t *) N_("Lepcha"), NULL, 0, 0, (void *) 113, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1349 { (unichar_t *) N_("Ol Chiki"), NULL, 0, 0, (void *) 114, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1350 { (unichar_t *) N_("Saurashtra"), NULL, 0, 0, (void *) 115, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1351 { (unichar_t *) N_("Kayah Li"), NULL, 0, 0, (void *) 116, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1352 { (unichar_t *) N_("Rejang"), NULL, 0, 0, (void *) 117, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1353 { (unichar_t *) N_("Cham"), NULL, 0, 0, (void *) 118, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1354 { (unichar_t *) N_("Ancient Symbols"), NULL, 0, 0, (void *) 119, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1355 { (unichar_t *) N_("Phaistos Disc"), NULL, 0, 0, (void *) 120, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1356 { (unichar_t *) N_("Lycian/Carian/Lydian"), NULL, 0, 0, (void *) 121, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1357 { (unichar_t *) N_("Mahjong/Domino Tiles"), NULL, 0, 0, (void *) 122, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1358 { (unichar_t *) N_("Unassigned Bit 123"), NULL, 0, 0, (void *) 123, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1359 { (unichar_t *) N_("Unassigned Bit 124"), NULL, 0, 0, (void *) 124, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1360 { (unichar_t *) N_("Unassigned Bit 125"), NULL, 0, 0, (void *) 125, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1361 { (unichar_t *) N_("Unassigned Bit 126"), NULL, 0, 0, (void *) 126, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1362 { (unichar_t *) N_("Unassigned Bit 127"), NULL, 0, 0, (void *) 127, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1363 GTEXTINFO_EMPTY
1364 };
1365 static GTextInfo codepagenames[] = {
1366 { (unichar_t *) N_("1252, Latin-1"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1367 { (unichar_t *) N_("1250, Latin-2 (Eastern Europe)"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1368 { (unichar_t *) N_("1251, Cyrillic"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1369 { (unichar_t *) N_("1253, Greek"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1370 { (unichar_t *) N_("1254, Turkish"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1371 { (unichar_t *) N_("1255, Hebrew"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1372 { (unichar_t *) N_("1256, Arabic"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1373 { (unichar_t *) N_("1257, Windows Baltic"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1374 { (unichar_t *) N_("1258, Vietnamese"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1375 { (unichar_t *) N_("Reserved Bit 9"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1376 { (unichar_t *) N_("Reserved Bit 10"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1377 { (unichar_t *) N_("Reserved Bit 11"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1378 { (unichar_t *) N_("Reserved Bit 12"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1379 { (unichar_t *) N_("Reserved Bit 13"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1380 { (unichar_t *) N_("Reserved Bit 14"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1381 { (unichar_t *) N_("Reserved Bit 15"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1382 { (unichar_t *) N_("874, Thai"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1383 { (unichar_t *) N_("932, JIS/Japan"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1384 { (unichar_t *) N_("936, Simplified Chinese"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1385 { (unichar_t *) N_("949, Korean Wansung"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1386 { (unichar_t *) N_("950, Traditional Chinese"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1387 { (unichar_t *) N_("1361, Korean Johab"), NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1388 { (unichar_t *) N_("Reserved Bit 22"), NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1389 { (unichar_t *) N_("Reserved Bit 23"), NULL, 0, 0, (void *) 23, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1390 { (unichar_t *) N_("Reserved Bit 24"), NULL, 0, 0, (void *) 24, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1391 { (unichar_t *) N_("Reserved Bit 25"), NULL, 0, 0, (void *) 25, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1392 { (unichar_t *) N_("Reserved Bit 26"), NULL, 0, 0, (void *) 26, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1393 { (unichar_t *) N_("Reserved Bit 27"), NULL, 0, 0, (void *) 27, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1394 { (unichar_t *) N_("Reserved Bit 28"), NULL, 0, 0, (void *) 28, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1395 { (unichar_t *) N_("Mac Roman"), NULL, 0, 0, (void *) 29, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1396 { (unichar_t *) N_("OEM Charset"), NULL, 0, 0, (void *) 30, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1397 { (unichar_t *) N_("Symbol Charset"), NULL, 0, 0, (void *) 31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1398 { (unichar_t *) N_("Reserved Bit 32"), NULL, 0, 0, (void *) 32, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1399 { (unichar_t *) N_("Reserved Bit 33"), NULL, 0, 0, (void *) 33, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1400 { (unichar_t *) N_("Reserved Bit 34"), NULL, 0, 0, (void *) 34, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1401 { (unichar_t *) N_("Reserved Bit 35"), NULL, 0, 0, (void *) 35, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1402 { (unichar_t *) N_("Reserved Bit 36"), NULL, 0, 0, (void *) 36, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1403 { (unichar_t *) N_("Reserved Bit 37"), NULL, 0, 0, (void *) 37, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1404 { (unichar_t *) N_("Reserved Bit 38"), NULL, 0, 0, (void *) 38, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1405 { (unichar_t *) N_("Reserved Bit 39"), NULL, 0, 0, (void *) 39, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1406 { (unichar_t *) N_("Reserved Bit 40"), NULL, 0, 0, (void *) 40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1407 { (unichar_t *) N_("Reserved Bit 41"), NULL, 0, 0, (void *) 41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1408 { (unichar_t *) N_("Reserved Bit 42"), NULL, 0, 0, (void *) 42, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1409 { (unichar_t *) N_("Reserved Bit 43"), NULL, 0, 0, (void *) 43, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1410 { (unichar_t *) N_("Reserved Bit 44"), NULL, 0, 0, (void *) 44, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1411 { (unichar_t *) N_("Reserved Bit 45"), NULL, 0, 0, (void *) 45, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1412 { (unichar_t *) N_("Reserved Bit 46"), NULL, 0, 0, (void *) 46, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1413 { (unichar_t *) N_("Reserved Bit 47"), NULL, 0, 0, (void *) 47, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1414 { (unichar_t *) N_("869, IBM Greek"), NULL, 0, 0, (void *) 48, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1415 { (unichar_t *) N_("866, MS-DOS Russian"), NULL, 0, 0, (void *) 49, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1416 { (unichar_t *) N_("865, MS_DOS Nordic"), NULL, 0, 0, (void *) 50, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1417 { (unichar_t *) N_("864, Arabic"), NULL, 0, 0, (void *) 51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1418 { (unichar_t *) N_("863, MS-DOS Canadian French"), NULL, 0, 0, (void *) 52, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1419 { (unichar_t *) N_("862, Hebrew"), NULL, 0, 0, (void *) 53, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1420 { (unichar_t *) N_("861, MS-DOS Icelandic"), NULL, 0, 0, (void *) 54, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1421 { (unichar_t *) N_("860, MS-DOS Portuguese"), NULL, 0, 0, (void *) 55, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1422 { (unichar_t *) N_("857, IBM Turkish"), NULL, 0, 0, (void *) 56, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1423 { (unichar_t *) N_("855, IBM Cyrillic; primarily Russian"), NULL, 0, 0, (void *) 57, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1424 { (unichar_t *) N_("852, Latin 2"), NULL, 0, 0, (void *) 58, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1425 { (unichar_t *) N_("775, MS-DOS Baltic"), NULL, 0, 0, (void *) 59, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1426 { (unichar_t *) N_("737, Greek; former 437 G"), NULL, 0, 0, (void *) 60, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1427 { (unichar_t *) N_("708, Arabic ASMO 708"), NULL, 0, 0, (void *) 61, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1428 { (unichar_t *) N_("850, WE/Latin 1"), NULL, 0, 0, (void *) 62, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1429 { (unichar_t *) N_("437, US"), NULL, 0, 0, (void *) 63, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1430 GTEXTINFO_EMPTY
1431 };
1432 static char *TN_DefaultName(GGadget *g, int r, int c);
1433 static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c);
1434 static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c);
1435 static struct col_init ci[] = {
1436 { me_enum, NULL, mslanguages, TN_LangEnable, N_("Language") },
1437 { me_enum, NULL, ttfnameids, TN_StrIDEnable, N_("String ID") },
1438 { me_func, TN_DefaultName, NULL, NULL, N_("String") }
1439 };
1440 static struct col_init ssci[] = {
1441 { me_enum, NULL, mslanguages, NULL, N_("Language") },
1442 { me_enum, NULL, otfssfeattags, NULL, N_("Feature Tags") },
1443 { me_enum, NULL, otfssfeatfields, NULL, N_("Field") },
1444 { me_string, NULL, NULL, NULL, N_("Friendly Name") }
1445 };
1446 static struct col_init sizeci[] = {
1447 { me_enum, NULL, mslanguages, NULL, N_("Language") },
1448 { me_string, NULL, NULL, NULL, N_("Name") }
1449 };
1450 static GTextInfo gridfit[] = {
1451 { (unichar_t *) N_("No Grid Fit"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1452 { (unichar_t *) N_("Grid Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1453 GTEXTINFO_EMPTY
1454 };
1455 static GTextInfo antialias[] = {
1456 { (unichar_t *) N_("No Anti-Alias"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1457 { (unichar_t *) N_("Anti-Alias"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1458 GTEXTINFO_EMPTY
1459 };
1460 static GTextInfo symsmooth[] = {
1461 { (unichar_t *) N_("No Symmetric-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1462 { (unichar_t *) N_("Symmetric-Smoothing"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1463 GTEXTINFO_EMPTY
1464 };
1465 static GTextInfo gfsymsmooth[] = {
1466 { (unichar_t *) N_("No Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1467 { (unichar_t *) N_("Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1468 GTEXTINFO_EMPTY
1469 };
1470 static struct col_init gaspci[] = {
1471 { me_int , NULL, NULL, NULL, N_("Gasp|For Pixels Per EM <= Value") },
1472 { me_enum, NULL, gridfit, NULL, N_("Gasp|Grid Fit") }, /* 1 */
1473 { me_enum, NULL, antialias, NULL, N_("Gasp|Anti-Alias") }, /* 2 */
1474 { me_enum, NULL, symsmooth, NULL, N_("Gasp|Symmetric Smoothing") }, /* 8 */
1475 { me_enum, NULL, gfsymsmooth, NULL, N_("Gasp|Grid Fit w/ Sym Smooth") } /* 4 */
1476 };
1477 static GTextInfo splineorder[] = {
1478 { (unichar_t *) N_("Cubic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1479 { (unichar_t *) N_("Quadratic"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1480 GTEXTINFO_EMPTY
1481 };
1482 static GTextInfo layertype[] = {
1483 { (unichar_t *) N_("Layer|Foreground"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
1484 { (unichar_t *) N_("Layer|Background"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1485 GTEXTINFO_EMPTY
1486 };
1487 static void Layers_BackgroundEnable(GGadget *g,GMenuItem *mi, int r, int c);
1488 static struct col_init layersci[] = {
1489 { me_string, NULL, NULL, NULL, N_("Layer Name") },
1490 { me_enum , NULL, splineorder, NULL, N_("Curve Type") },
1491 { me_enum , NULL, layertype, Layers_BackgroundEnable, N_("Type") },
1492 { me_int , NULL, NULL, NULL, N_("Orig layer") }
1493 };
1494 static char *GFI_Mark_PickGlyphsForClass(GGadget *g,int r, int c);
1495 static struct col_init marks_ci[] = {
1496 { me_string, NULL, NULL, NULL, N_("Set Name") },
1497 { me_funcedit, GFI_Mark_PickGlyphsForClass, NULL, NULL, N_("Glyphs in the set") },
1498 };
1499 static struct col_init markc_ci[] = {
1500 { me_string, NULL, NULL, NULL, N_("Class Name") },
1501 { me_funcedit, GFI_Mark_PickGlyphsForClass, NULL, NULL, N_("Glyphs in the class") },
1502 };
1503
1504 struct langstyle { int lang; const char *str; };
1505 #define LANGSTYLE_EMPTY { 0, NULL }
1506
1507 static const char regulareng[] = "Regular";
1508 static const char demiboldeng[] = "DemiBold";
1509 static const char demiboldeng3[] = "Demi";
1510 static const char demiboldeng5[] = "SemiBold";
1511 static const char boldeng[] = "Bold";
1512 static const char thineng[] = "Thin";
1513 static const char lighteng[] = "Light";
1514 static const char extralighteng[] = "ExtraLight";
1515 static const char extralighteng2[] = "VeryLight";
1516 static const char mediumeng[] = "Medium";
1517 static const char bookeng[] = "Book";
1518 static const char heavyeng[] = "Heavy";
1519 static const char blackeng[] = "Black";
1520 static const char italiceng[] = "Italic";
1521 static const char obliqueeng[] = "Oblique";
1522 static const char condensedeng[] = "Condensed";
1523 static const char expandedeng[] = "Expanded";
1524 static const char outlineeng[] = "Outline";
1525
1526 static const char regularfren[] = "Normal";
1527 static const char boldfren[] = "Gras";
1528 static const char demiboldfren[] = "DemiGras";
1529 static const char demiboldfren2[] = "Demi";
1530 static const char mediumfren[] = "Normal";
1531 static const char lightfren[] = "Maigre";
1532 static const char blackfren[] = "ExtraGras";
1533 static const char italicfren[] = "Italique";
1534 static const char obliquefren[] = "Oblique";
1535 static const char condensedfren[] = "Etroite";
1536 static const char expandedfren[] = "Elargi";
1537 static const char outlinefren[] = "Contour";
1538
1539 static const char regulargerm[] = "Standard";
1540 static const char demiboldgerm[] = "Halbfett";
1541 static const char demiboldgerm2[] = "Schmallfett";
1542 static const char boldgerm[] = "Fett";
1543 static const char boldgerm2[] = "Dick";
1544 static const char blackgerm[] = "Schwarz";
1545 static const char lightgerm[] = "Mager";
1546 static const char mediumgerm[] = "Mittel";
1547 static const char bookgerm[] = "Buchschrift";
1548 static const char italicgerm[] = "Kursiv";
1549 static const char obliquegerm[] = "SchrÀg";
1550 static const char condensedgerm[] = "Schmal";
1551 static const char expandedgerm[] = "Breit";
1552 static const char outlinegerm[] = "Konturert";
1553
1554 static const char regularspan[] = "Normal";
1555 static const char boldspan[] = "Negrita";
1556 static const char lightspan[] = "Fina";
1557 static const char blackspan[] = "Supernegra";
1558 static const char italicspan[] = "Cursiva";
1559 static const char condensedspan[] = "Condensada";
1560 static const char expandedspan[] = "Amplida";
1561
1562 static const char regulardutch[] = "Normaal";
1563 static const char mediumdutch[] = "Gemiddeld";
1564 static const char bookdutch[] = "Boek";
1565 static const char bolddutch[] = "Vet";
1566 static const char demibolddutch[] = "Dik";
1567 /*static const char demibolddutch[] = "Halfvet";*/
1568 static const char lightdutch[] = "Licht";
1569 /*static const char lightdutch[] = "Licht mager";*/
1570 static const char blackdutch[] = "Extra vet";
1571 static const char italicdutch[] = "Cursief";
1572 static const char italicdutch2[] = "italiek";
1573 static const char obliquedutch2[] = "oblique";
1574 static const char obliquedutch[] = "Schuin";
1575 static const char condenseddutch[] = "Smal";
1576 static const char expandeddutch[] = "Breed";
1577 static const char outlinedutch[] = "Uitlijning";
1578 /*static const char outlinedutch[] = "Contour";*/
1579
1580 static const char regularswed[] = "Mager";
1581 static const char boldswed[] = "Fet";
1582 static const char lightswed[] = "Extrafin";
1583 static const char blackswed[] = "Extrafet";
1584 static const char italicswed[] = "Kursiv";
1585 static const char condensedswed[] = "Smal";
1586 static const char expandedswed[] = "Bred";
1587
1588 static const char regulardanish[] = "Normal";
1589 static const char bolddanish[] = "Fed";
1590 static const char demibolddanish[] = "Halvfed";
1591 static const char lightdanish[] = "Fin";
1592 static const char mediumdanish[] = "Medium";
1593 static const char blackdanish[] = "Extrafed";
1594 static const char italicdanish[] = "Kursiv";
1595 static const char condenseddanish[] = "Smal";
1596 static const char expandeddanish[] = "Bred";
1597 static const char outlinedanish[] = "Kontour";
1598
1599 static const char regularnor[] = "Vanlig";
1600 static const char boldnor[] = "Halvfet";
1601 static const char lightnor[] = "Mager";
1602 static const char blacknor[] = "Fet";
1603 static const char italicnor[] = "Kursiv";
1604 static const char condensednor[] = "Smal";
1605 static const char expandednor[] = "Sperret";
1606
1607 static const char regularital[] = "Normale";
1608 static const char demiboldital[] = "Nerretto";
1609 static const char boldital[] = "Nero";
1610 static const char thinital[] = "Fine";
1611 static const char lightital[] = "Chiaro";
1612 static const char mediumital[] = "Medio";
1613 static const char bookital[] = "Libro";
1614 static const char heavyital[] = "Nerissimo";
1615 static const char blackital[] = "ExtraNero";
1616 static const char italicital[] = "Cursivo";
1617 static const char obliqueital[] = "Obliquo";
1618 static const char condensedital[] = "Condensato";
1619 static const char expandedital[] = "Allargato";
1620
1621 static const char regularru[] = "ĐžĐ±Ń‹Ń‡ĐœŃ‹Đč";
1622 static const char demiboldru[] = "ĐŸĐŸĐ»ŃƒĐ¶ĐžŃ€ĐœŃ‹Đč";
1623 static const char boldru[] = "ĐžĐ±Ń‹Ń‡ĐœŃ‹Đč";
1624 static const char heavyru[] = "ĐĄĐČĐ”Ń€Ń…Đ¶ĐžŃ€ĐœŃ‹Đč";
1625 static const char blackru[] = "Đ§Ń‘Ń€ĐœŃ‹Đč";
1626 static const char thinru[] = "ĐąĐŸĐœĐșĐžĐč";
1627 static const char lightru[] = "ĐĄĐČДтлыĐč";
1628 static const char italicru[] = "КурсоĐČ";
1629 static const char obliqueru[] = "НаĐșĐ»ĐŸĐœ";
1630 static const char condensedru[] = "ĐŁĐ·ĐșĐžĐč";
1631 static const char expandedru[] = "ĐšĐžŃ€ĐŸĐșĐžĐč";
1632
1633 static const char regularhu[] = "NormĂĄl";
1634 static const char demiboldhu[] = "Negyedkövér";
1635 static const char demiboldhu2[] = "Félkövér";
1636 static const char boldhu[] = "Félkövér";
1637 static const char boldhu2[] = "Håromnegyedkövér";
1638 static const char thinhu[] = "SovĂĄny";
1639 static const char lighthu[] = "VilĂĄgos";
1640 static const char mediumhu[] = "Közepes";
1641 static const char bookhu[] = "HalvĂĄny";
1642 static const char bookhu2[] = "Könyv";
1643 static const char heavyhu[] = "Kövér";
1644 static const char heavyhu2[] = "Extrakövér";
1645 static const char blackhu[] = "Fekete";
1646 static const char blackhu2[] = "Sötét";
1647 static const char italichu[] = "DƑlt";
1648 static const char obliquehu[] = "Döntött";
1649 static const char obliquehu2[] = "Ferde";
1650 static const char condensedhu[] = "Keskeny";
1651 static const char expandedhu[] = "Széles";
1652 static const char outlinehu[] = "KontĂșros";
1653
1654 static const char regularpl[] = "podstawowa";
1655 static const char demiboldpl[] = "póƂgruba";
1656 static const char boldpl[] = "pogrubiona";
1657 static const char thinpl[] = "cienka";
1658 static const char lightpl[] = "bardzo cienka";
1659 static const char heavypl[] = "bardzo gruba";
1660 static const char italicpl[] = "pochyƂa";
1661 static const char obliquepl[] = "pochyƂa";
1662 static const char condensedpl[] = "wąska";
1663 static const char expandedpl[] = "szeroka";
1664 static const char outlinepl[] = "konturowa";
1665 static const char mediumpl[] = "zwykƂa";
1666 static const char bookpl[] = "zwykƂa";
1667
1668 static struct langstyle regs[] = { {0x409, regulareng}, { 0x40c, regularfren }, { 0x410, regularital }, { 0x407, regulargerm }, { 0x40a, regularspan }, { 0x419, regularru }, { 0x40e, regularhu },
1669 { 0x413, regulardutch}, { 0x41d, regularswed }, { 0x414, regularnor },
1670 { 0x406, regulardanish}, {0x415, regularpl }, { 0x804, "æ­Łćžž"},
1671 { 0x408, "ÎșÎ±ÎœÎżÎœÎčÎșÎź"}, { 0x42a, "Chuáș©n"}, { 0x418, "Normal"}, LANGSTYLE_EMPTY};
1672 static struct langstyle meds[] = { {0x409, mediumeng}, { 0x410, mediumital },
1673 { 0x40c, mediumfren }, { 0x407, mediumgerm }, { 0x40e, mediumhu },
1674 { 0x406, mediumdanish}, {0x415, mediumpl }, { 0x804, "侭等"},
1675 { 0x408, "Â”Î”ÏƒÎ±ÎŻÎ±"}, { 0x42a, "Vừa"}, { 0x413, mediumdutch},
1676 { 0x418, "Mediu"}, LANGSTYLE_EMPTY};
1677 static struct langstyle books[] = { {0x409, bookeng}, { 0x410, bookital },
1678 { 0x407, bookgerm }, { 0x40e, bookhu }, { 0x40e, bookhu2 },
1679 { 0x415, bookpl}, { 0x804, "äčŠäœ“"}, { 0x408, "ßÎčĂŸÎ»ÎŻÎżÏ…"},
1680 { 0x42a, "SĂĄch"}, { 0x413, bookdutch}, { 0x418, "Carte"}, LANGSTYLE_EMPTY};
1681 static struct langstyle bolds[] = { {0x409, boldeng}, { 0x410, boldital }, { 0x40c, boldfren }, { 0x407, boldgerm }, { 0x407, boldgerm2 }, { 0x40a, boldspan}, { 0x419, boldru }, { 0x40e, boldhu }, { 0x40e, boldhu2 },
1682 { 0x413, bolddutch}, { 0x41d, boldswed }, { 0x414, boldnor },
1683 { 0x406, bolddanish}, { 0x415, boldpl}, { 0x804, "çČ—äœ“"},
1684 { 0x408, "Î­ÎœÏ„ÎżÎœÎ·"}, { 0x42a, "Đáș­m"}, {0x418,"Aldin"}, LANGSTYLE_EMPTY};
1685 static struct langstyle italics[] = { {0x409, italiceng}, { 0x410, italicital }, { 0x40c, italicfren }, { 0x407, italicgerm }, { 0x40a, italicspan}, { 0x419, italicru }, { 0x40e, italichu },
1686 { 0x413, italicdutch}, { 0x413, italicdutch2}, { 0x41d, italicswed }, { 0x414, italicnor },
1687 { 0x406, italicdanish}, { 0x415, italicpl}, { 0x804, "斜䜓"},
1688 { 0x408, "ΛΔÎčÏˆÎŻÎ±Ï‚"}, { 0x42a, "NghiĂȘng" }, { 0x418, "Cursiv"}, LANGSTYLE_EMPTY};
1689 static struct langstyle obliques[] = { {0x409, obliqueeng}, { 0x410, obliqueital },
1690 { 0x40c, obliquefren }, { 0x407, obliquegerm }, { 0x419, obliqueru },
1691 { 0x40e, obliquehu }, { 0x40e, obliquehu2 }, {0x415, obliquepl},
1692 { 0x804, "斜䜓"}, { 0x408, "Ï€Î»ÎŹÎłÎčα"},
1693 { 0x42a, "XiĂȘn" }, { 0x413, obliquedutch}, { 0x413, obliquedutch2},
1694 { 0x418, "Înclinat"}, LANGSTYLE_EMPTY};
1695 static struct langstyle demibolds[] = { {0x409, demiboldeng}, {0x409, demiboldeng3}, {0x409, demiboldeng5},
1696 { 0x410, demiboldital }, { 0x40c, demiboldfren }, { 0x40c, demiboldfren2 }, { 0x407, demiboldgerm }, { 0x407, demiboldgerm2 },
1697 { 0x419, demiboldru }, { 0x40e, demiboldhu }, { 0x40e, demiboldhu2 },
1698 { 0x406, demibolddanish}, { 0x415, demiboldpl },
1699 { 0x804, "ç•„çȗ"}, { 0x408, "η”ÎčÎ­ÎœÏ„ÎżÎœÎ·"},
1700 { 0x42a, "Ná»­a đáș­m"}, { 0x413, demibolddutch},
1701 {0x418, "Semialdin"}, LANGSTYLE_EMPTY};
1702 static struct langstyle heavys[] = { {0x409, heavyeng}, { 0x410, heavyital },
1703 { 0x419, heavyru }, { 0x40e, heavyhu }, { 0x40e, heavyhu2 },
1704 { 0x415, heavypl }, { 0x804, "çȗ"}, LANGSTYLE_EMPTY};
1705 static struct langstyle blacks[] = { {0x409, blackeng}, { 0x410, blackital }, { 0x40c, blackfren }, { 0x407, blackgerm }, { 0x419, blackru }, { 0x40e, blackhu }, { 0x40e, blackhu2 }, { 0x40a, blackspan },
1706 { 0x413, blackdutch}, { 0x41d, blackswed }, { 0x414, blacknor }, { 0x406, blackdanish},
1707 { 0x415, heavypl }, { 0x804, "黑"}, { 0x408, "”αύρα"},
1708 { 0x42a, "Đen"}, { 0x418, "Negru"}, LANGSTYLE_EMPTY };
1709 static struct langstyle thins[] = { {0x409, thineng}, { 0x410, thinital },
1710 { 0x419, thinru }, { 0x40e, thinhu }, { 0x415, thinpl},
1711 { 0x804, "细"}, LANGSTYLE_EMPTY};
1712 static struct langstyle extralights[] = { {0x409, extralighteng}, {0x409, extralighteng2},
1713 { 0x804, "极细"}, LANGSTYLE_EMPTY};
1714 static struct langstyle lights[] = { {0x409, lighteng}, {0x410, lightital}, {0x40c, lightfren}, {0x407, lightgerm}, { 0x419, lightru }, { 0x40e, lighthu }, { 0x40a, lightspan },
1715 { 0x413, lightdutch}, { 0x41d, lightswed }, { 0x414, lightnor },
1716 { 0x406, lightdanish}, { 0x415, lightpl}, { 0x804, "细"},
1717 { 0x408, "Î»Î”Ï€Ï„Îź"}, { 0x42a, "Nháșč" }, { 0x418, "Subțire"}, LANGSTYLE_EMPTY};
1718 static struct langstyle condenseds[] = { {0x409, condensedeng}, {0x410, condensedital}, {0x40c, condensedfren}, {0x407, condensedgerm}, { 0x419, condensedru }, { 0x40e, condensedhu }, { 0x40a, condensedspan },
1719 { 0x413, condenseddutch}, { 0x41d, condensedswed },
1720 { 0x414, condensednor }, { 0x406, condenseddanish},
1721 { 0x415, condensedpl }, { 0x804, "ćŽ‹çŒ©"},
1722 { 0x408, "πυÎșÎœÎź"}, { 0x42a, "Háșčp" }, { 0x418, "Îngust"}, LANGSTYLE_EMPTY};
1723 static struct langstyle expandeds[] = { {0x409, expandedeng}, {0x410, expandedital}, {0x40c, expandedfren}, {0x407, expandedgerm}, { 0x419, expandedru }, { 0x40e, expandedhu }, { 0x40a, expandedspan },
1724 { 0x413, expandeddutch}, { 0x41d, expandedswed }, { 0x414, expandednor },
1725 { 0x406, expandeddanish}, { 0x415, expandedpl }, { 0x804, "ćŠ ćźœ"},
1726 { 0x408, "αραÎčÎź"}, { 0x42a, "Rộng" }, { 0x418, "Expandat"}, LANGSTYLE_EMPTY};
1727 static struct langstyle outlines[] = { {0x409, outlineeng}, {0x40c, outlinefren},
1728 {0x407, outlinegerm}, {0x40e, outlinehu}, { 0x406, outlinedanish},
1729 {0x415, outlinepl}, { 0x804, "èœźć»“"}, { 0x408, "πΔρÎčÎłÏÎŹÎŒÎŒÎ±Ï„ÎżÏ‚"},
1730 {0x42a, "Nét ngoài" }, { 0x413, outlinedutch}, {0x418, "Contur"}, LANGSTYLE_EMPTY};
1731 static struct langstyle *stylelist[] = {regs, meds, books, demibolds, bolds, heavys, blacks,
1732 extralights, lights, thins, italics, obliques, condenseds, expandeds, outlines, NULL };
1733
1734 #define CID_Features 101 /* Mac stuff */
1735 #define CID_FeatureDel 103
1736 #define CID_FeatureEdit 105
1737
1738 #define CID_Family 1002
1739 #define CID_Weight 1003
1740 #define CID_ItalicAngle 1004
1741 #define CID_UPos 1005
1742 #define CID_UWidth 1006
1743 #define CID_Ascent 1007
1744 #define CID_Descent 1008
1745 #define CID_Notice 1010
1746 #define CID_Version 1011
1747 #define CID_UniqueID 1012
1748 #define CID_HasVerticalMetrics 1013
1749 #define CID_Fontname 1016
1750 #define CID_Em 1017
1751 #define CID_Scale 1018
1752 #define CID_Interpretation 1021
1753 #define CID_Namelist 1024
1754 #define CID_Revision 1025
1755
1756 #define CID_WoffMajor 1050
1757 #define CID_WoffMinor 1051
1758 #define CID_WoffMetadata 1052
1759
1760 #define CID_XUID 1113
1761 #define CID_Human 1114
1762 #define CID_SameAsFontname 1115
1763 #define CID_HasDefBase 1116
1764 #define CID_DefBaseName 1117
1765 #define CID_UseXUID 1118
1766 #define CID_UseUniqueID 1119
1767
1768 #define CID_GuideOrder2 1200
1769 #define CID_IsMixed 1217
1770 #define CID_IsOrder3 1218
1771 #define CID_IsOrder2 1219
1772 #define CID_IsMultiLayer 1220
1773 #define CID_IsStrokedFont 1222
1774 #define CID_StrokeWidth 1223
1775 #define CID_Backgrounds 1226
1776
1777 #define CID_Private 2001
1778 #define CID_Guess 2004
1779 #define CID_Hist 2006
1780
1781 #define CID_TTFTabs 3000
1782 #define CID_WeightClass 3001
1783 #define CID_WidthClass 3002
1784 #define CID_PFMFamily 3003
1785 #define CID_FSType 3004
1786 #define CID_NoSubsetting 3005
1787 #define CID_OnlyBitmaps 3006
1788 #define CID_LineGap 3007
1789 #define CID_VLineGap 3008
1790 #define CID_VLineGapLab 3009
1791 #define CID_WinAscent 3010
1792 #define CID_WinAscentLab 3011
1793 #define CID_WinAscentIsOff 3012
1794 #define CID_WinDescent 3013
1795 #define CID_WinDescentLab 3014
1796 #define CID_WinDescentIsOff 3015
1797 #define CID_TypoAscent 3016
1798 #define CID_TypoAscentLab 3017
1799 #define CID_TypoAscentIsOff 3018
1800 #define CID_TypoDescent 3019
1801 #define CID_TypoDescentLab 3020
1802 #define CID_TypoDescentIsOff 3021
1803 #define CID_TypoLineGap 3022
1804 #define CID_HHeadAscent 3023
1805 #define CID_HHeadAscentLab 3024
1806 #define CID_HHeadAscentIsOff 3025
1807 #define CID_HHeadDescent 3026
1808 #define CID_HHeadDescentLab 3027
1809 #define CID_HHeadDescentIsOff 3028
1810 #define CID_Vendor 3029
1811 #define CID_IBMFamily 3030
1812 #define CID_OS2Version 3031
1813 #define CID_UseTypoMetrics 3032
1814 #define CID_WeightWidthSlopeOnly 3033
1815 // Maybe we could insert these above and change the numbering.
1816 #define CID_CapHeight 3034
1817 #define CID_CapHeightLab 3035
1818 #define CID_XHeight 3036
1819 #define CID_XHeightLab 3037
1820 #define CID_StyleMap 3038
1821
1822 #define CID_SubSuperDefault 3100
1823 #define CID_SubXSize 3101
1824 #define CID_SubYSize 3102
1825 #define CID_SubXOffset 3103
1826 #define CID_SubYOffset 3104
1827 #define CID_SuperXSize 3105
1828 #define CID_SuperYSize 3106
1829 #define CID_SuperXOffset 3107
1830 #define CID_SuperYOffset 3108
1831 #define CID_StrikeoutSize 3109
1832 #define CID_StrikeoutPos 3110
1833
1834 #define CID_PanFamily 4001
1835 #define CID_PanSerifs 4002
1836 #define CID_PanWeight 4003
1837 #define CID_PanProp 4004
1838 #define CID_PanContrast 4005
1839 #define CID_PanStrokeVar 4006
1840 #define CID_PanArmStyle 4007
1841 #define CID_PanLetterform 4008
1842 #define CID_PanMidLine 4009
1843 #define CID_PanXHeight 4010
1844 #define CID_PanDefault 4011
1845 #define CID_PanFamilyLab 4021
1846 #define CID_PanSerifsLab 4022
1847 #define CID_PanWeightLab 4023
1848 #define CID_PanPropLab 4024
1849 #define CID_PanContrastLab 4025
1850 #define CID_PanStrokeVarLab 4026
1851 #define CID_PanArmStyleLab 4027
1852 #define CID_PanLetterformLab 4028
1853 #define CID_PanMidLineLab 4029
1854 #define CID_PanXHeightLab 4030
1855
1856 #define CID_TNLangSort 5001
1857 #define CID_TNStringSort 5002
1858 #define CID_TNVScroll 5003
1859 #define CID_TNHScroll 5004
1860 #define CID_TNames 5005
1861
1862 #define CID_Language 5006 /* Used by AskForLangNames */
1863
1864 #define CID_SSNames 5050
1865
1866 #define CID_Gasp 5100
1867 #define CID_GaspVersion 5101
1868 #define CID_HeadClearType 5102
1869
1870 #define CID_Comment 6001
1871 #define CID_FontLog 6002
1872
1873 #define CID_MarkClasses 7101
1874
1875 #define CID_MarkSets 7201
1876
1877 #define CID_TeXText 8001
1878 #define CID_TeXMathSym 8002
1879 #define CID_TeXMathExt 8003
1880 #define CID_MoreParams 8005
1881 #define CID_TeXExtraSpLabel 8006
1882 #define CID_TeX 8007 /* through 8014 */
1883 #define CID_TeXBox 8030
1884
1885 #define CID_DesignSize 8301
1886 #define CID_DesignBottom 8302
1887 #define CID_DesignTop 8303
1888 #define CID_StyleID 8304
1889 #define CID_StyleName 8305
1890
1891 #define CID_Tabs 10001
1892 #define CID_OK 10002
1893 #define CID_Cancel 10003
1894 #define CID_MainGroup 10004
1895 #define CID_TopBox 10005
1896
1897 #define CID_Lookups 11000
1898 #define CID_LookupTop 11001
1899 #define CID_LookupUp 11002
1900 #define CID_LookupDown 11003
1901 #define CID_LookupBottom 11004
1902 #define CID_AddLookup 11005
1903 #define CID_AddSubtable 11006
1904 #define CID_EditMetadata 11007
1905 #define CID_EditSubtable 11008
1906 #define CID_DeleteLookup 11009
1907 #define CID_MergeLookup 11010
1908 #define CID_RevertLookups 11011
1909 #define CID_LookupSort 11012
1910 #define CID_ImportLookups 11013
1911 #define CID_LookupWin 11020 /* (GSUB, add 1 for GPOS) */
1912 #define CID_LookupVSB 11022 /* (GSUB, add 1 for GPOS) */
1913 #define CID_LookupHSB 11024 /* (GSUB, add 1 for GPOS) */
1914 #define CID_SaveLookup 11026
1915 #define CID_SaveFeat 11027
1916 #define CID_AddAllAlternates 11028
1917 #define CID_AddDFLT 11029
1918 #define CID_AddLanguage 11030
1919 #define CID_RmLanguage 11031
1920
1921 #define CID_MacAutomatic 16000
1922 #define CID_MacStyles 16001
1923 #define CID_MacFOND 16002
1924
1925 #define CID_Unicode 16100
1926 #define CID_UnicodeEmpties 16101
1927 #define CID_UnicodeTab 16102
1928 #define CID_URangesDefault 16110
1929 #define CID_UnicodeRanges 16111
1930 #define CID_UnicodeList 16112
1931 #define CID_CPageDefault 16120
1932 #define CID_CodePageRanges 16121
1933 #define CID_CodePageList 16122
1934
1935 const char *UI_TTFNameIds(int id) {
1936 int i;
1937
1938 FontInfoInit();
1939 for ( i=0; ttfnameids[i].text!=NULL; ++i )
1940 if ( ttfnameids[i].userdata == (void *) (intptr_t) id )
1941 return( (char *) ttfnameids[i].text );
1942
1943 if ( id==6 )
1944 return( "PostScript" );
1945
1946 return( _("Unknown") );
1947 }
1948
1949 const char *UI_MSLangString(int language) {
1950 int i;
1951
1952 FontInfoInit();
1953 for ( i=0; mslanguages[i].text!=NULL; ++i )
1954 if ( mslanguages[i].userdata == (void *) (intptr_t) language )
1955 return( (char *) mslanguages[i].text );
1956
1957 language &= 0xff;
1958 for ( i=0; mslanguages[i].text!=NULL; ++i )
1959 if ( ((intptr_t) mslanguages[i].userdata & 0xff) == language )
1960 return( (char *) mslanguages[i].text );
1961
1962 return( _("Unknown") );
1963 }
1964
1965 /* These are PostScript names, and as such should not be translated */
1966 enum { pt_number, pt_boolean, pt_array, pt_code };
1967 static struct { const char *name; short type, arr_size, present; } KnownPrivates[] = {
1968 { "BlueValues", pt_array, 14, 0 },
1969 { "OtherBlues", pt_array, 10, 0 },
1970 { "BlueFuzz", pt_number, 0, 0 },
1971 { "FamilyBlues", pt_array, 14, 0 },
1972 { "FamilyOtherBlues", pt_array, 10, 0 },
1973 { "BlueScale", pt_number, 0, 0 },
1974 { "BlueShift", pt_number, 0, 0 },
1975 { "StdHW", pt_array, 1, 0 },
1976 { "StdVW", pt_array, 1, 0 },
1977 { "StemSnapH", pt_array, 12, 0 },
1978 { "StemSnapV", pt_array, 12, 0 },
1979 { "ForceBold", pt_boolean, 0, 0 },
1980 { "LanguageGroup", pt_number, 0, 0 },
1981 { "RndStemUp", pt_number, 0, 0 },
1982 { "lenIV", pt_number, 0, 0 },
1983 { "ExpansionFactor", pt_number, 0, 0 },
1984 { "Erode", pt_code, 0, 0 },
1985 /* I am deliberately not including Subrs and OtherSubrs */
1986 /* The first could not be entered (because it's a set of binary strings) */
1987 /* And the second has special meaning to us and must be handled with care */
1988 { NULL, 0, 0, 0 }
1989 };
1990
1991 static GTextInfo psprivate_nameids[] = {
1992 /* Don't translate these here either */
1993 { (unichar_t *) "BlueValues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1994 { (unichar_t *) "OtherBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1995 { (unichar_t *) "BlueFuzz", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1996 { (unichar_t *) "FamilyBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1997 { (unichar_t *) "FamilyOtherBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1998 { (unichar_t *) "BlueScale", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
1999 { (unichar_t *) "BlueShift", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2000 { (unichar_t *) "StdHW", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2001 { (unichar_t *) "StdVW", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2002 { (unichar_t *) "StemSnapH", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2003 { (unichar_t *) "StemSnapV", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2004 { (unichar_t *) "ForceBold", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2005 { (unichar_t *) "LanguageGroup", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2006 { (unichar_t *) "RndStemUp", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2007 { (unichar_t *) "lenIV", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2008 { (unichar_t *) "ExpansionFactor", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2009 { (unichar_t *) "Erode", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
2010 GTEXTINFO_EMPTY
2011 };
2012
2013 static void PI_KeyEnable(GGadget *g,GMenuItem *mi, int r, int c) {
2014 int i,j, rows;
2015 struct matrix_data *strings = _GMatrixEditGet(g, &rows);
2016 int cols = GMatrixEditGetColCnt(g);
2017 int found;
2018
2019 for ( i=0; mi[i].ti.text!=NULL; ++i ) {
2020 found = 0;
2021 for ( j=0; j<rows; ++j ) {
2022 if ( strcmp((char *) mi[i].ti.text,strings[j*cols+0].u.md_str)==0 ) {
2023 found=1;
2024 break;
2025 }
2026 }
2027 if ( j==r && found ) {
2028 mi[i].ti.disabled = false;
2029 mi[i].ti.selected = true;
2030 } else {
2031 mi[i].ti.disabled = found;
2032 mi[i].ti.selected = false;
2033 }
2034 }
2035 }
2036
2037 static struct col_init psprivate_ci[] = {
2038 { me_stringchoice, NULL, psprivate_nameids, PI_KeyEnable, N_("Key") },
2039 { me_string, NULL, NULL, NULL, N_("Value") }
2040 };
2041
2042 static char *rpldecimal(const char *orig,const char *decimal_point, locale_t tmplocale) {
2043 char *end;
2044 char *new, *npt; const char *pt;
2045 int dlen;
2046 double dval;
2047 char buffer[40];
2048 locale_t oldlocale;
2049
2050 /* if the current locale uses a "." for a decimal point the we don't need */
2051 /* to translate the number, just check that it is valid */
2052 if ( strcmp(decimal_point,".")==0 ) {
2053 strtod(orig,&end);
2054 while ( isspace(*end)) ++end;
2055 if ( *end!='\0' )
2056 return( NULL );
2057 return( copy(orig));
2058 }
2059
2060 npt = new = malloc(2*strlen(orig)+10);
2061 dlen = strlen(decimal_point);
2062 /* now I want to change the number as little as possible. So if they use */
2063 /* arabic numerals we can get by with just switching the decimal point */
2064 /* If they use some other number convention, then parse in the old locale*/
2065 /* and sprintf in the PostScript ("C") locale. This might lose some */
2066 /* precision but the basic idea will get across */
2067 for ( pt=orig; *pt; ) {
2068 if ( strncmp(pt,decimal_point,dlen)==0 ) {
2069 pt += dlen;
2070 *npt++ = '.';
2071 } else
2072 *npt++ = *pt++;
2073 }
2074 *npt = '\0';
2075
2076 oldlocale = uselocale_hack(tmplocale);
2077 strtod(new,&end);
2078 uselocale_hack(oldlocale);
2079 while ( isspace(*end)) ++end;
2080 if ( *end=='\0' ) {
2081 char *ret = copy(new);
2082 free(new);
2083 return( ret );
2084 }
2085
2086 /* OK, can we parse the number in the original local? */
2087 dval = strtod(new,&end);
2088 while ( isspace(*end)) ++end;
2089 if ( *end!='\0' ) {
2090 free(new);
2091 return( NULL );
2092 }
2093 free(new);
2094 oldlocale = uselocale_hack(tmplocale);
2095 sprintf( buffer, "%g", dval );
2096 uselocale_hack(oldlocale);
2097 return( copy(buffer));
2098 }
2099
2100 static char *rplarraydecimal(const char *orig,const char *decimal_point, locale_t tmplocale) {
2101 char *new, *npt, *rpl;
2102 int nlen;
2103 const char *start, *pt; int ch;
2104
2105 nlen = 2*strlen(orig)+10;
2106 npt = new = calloc(1,nlen+1);
2107 *npt++ = '[';
2108
2109 for ( pt=orig; isspace(*pt) || *pt=='['; ++pt );
2110 while ( *pt!=']' && *pt!='\0' ) {
2111 start=pt;
2112 while ( *pt!=']' && *pt!=' ' && *pt!='\0' ) ++pt;
2113 ch = *pt; *(char *) pt = '\0';
2114 rpl = rpldecimal(start,decimal_point,tmplocale);
2115 *(char *) pt = ch;
2116 if ( rpl==NULL ) {
2117 gwwv_post_notice(_("Bad type"),_("Expected array of numbers.\nFailed to parse \"%.*s\" as a number."),
2118 pt-start, start);
2119 free(new);
2120 return( NULL );
2121 }
2122 if ( npt-new + strlen(rpl) + 2 >nlen ) {
2123 int noff = npt-new;
2124 new = realloc(new,nlen += strlen(rpl)+100);
2125 npt = new+noff;
2126 }
2127 if ( npt[-1]!='[' )
2128 *npt++ = ' ';
2129 strcpy(npt,rpl);
2130 free(rpl);
2131 npt += strlen(npt);
2132 while ( isspace(*pt)) ++pt;
2133 }
2134 *npt++ =']';
2135 *npt = '\0';
2136 rpl = copy(new);
2137 free(new);
2138 return( rpl );
2139 }
2140
2141 static void PSPrivate_FinishEdit(GGadget *g,int r, int c, int wasnew) {
2142 int rows, cols = GMatrixEditGetColCnt(g);
2143 struct matrix_data *strings = _GMatrixEditGet(g, &rows);
2144 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2145 char *key = strings[r*cols+0].u.md_str;
2146 char *val = strings[r*cols+1].u.md_str;
2147 char *pt, *ept, *newval;
2148 locale_t tmplocale;
2149 struct psdict *tempdict;
2150
2151 if ( key==NULL )
2152 return;
2153
2154 if ( c==0 && (wasnew || val==NULL || *val=='\0')) {
2155 tempdict = calloc(1,sizeof(*tempdict));
2156 SFPrivateGuess(d->sf,ly_fore,tempdict,key,true);
2157 strings[r*cols+1].u.md_str = copy(PSDictHasEntry(tempdict,key));
2158 PSDictFree(tempdict);
2159 } else if ( c==1 && val!=NULL ) {
2160 struct lconv *loc = localeconv();
2161 int i;
2162 for ( i=0; KnownPrivates[i].name!=NULL; ++i )
2163 if ( strcmp(KnownPrivates[i].name,key)==0 )
2164 break;
2165 if ( KnownPrivates[i].name==NULL ) /* If we don't recognize it, leave it be */
2166 return;
2167
2168 tmplocale = newlocale_hack(LC_NUMERIC_MASK, "C", NULL);
2169 if (tmplocale == NULL) fprintf(stderr, "Locale error.\n");
2170
2171 for ( pt=val; isspace(*pt); ++pt );
2172 for ( ept = val+strlen(val-1); ept>pt && isspace(*ept); --ept );
2173 if ( KnownPrivates[i].type==pt_boolean ) {
2174 if ( strcasecmp(val,"true")==0 || strcasecmp(val,"t")==0 || strtol(val,NULL,10)!=0 ) {
2175 /* If they make a mistake about case, correct it */
2176 strings[r*cols+1].u.md_str = copy("true");
2177 free(val);
2178 GGadgetRedraw(g);
2179 } else if ( strcasecmp(val,"false")==0 || strcasecmp(val,"f")==0 || (*val=='0' && strtol(val,NULL,10)==0) ) {
2180 strings[r*cols+1].u.md_str = copy("false");
2181 free(val);
2182 GGadgetRedraw(g);
2183 } else
2184 /* GT: The words "true" and "false" should be left untranslated. We are restricted */
2185 /* GT: here by what PostScript understands, and it only understands the English */
2186 /* GT: words. You may, of course, change it to something like ("true" (vrai) ou "false" (faux)) */
2187 gwwv_post_notice(_("Bad type"),_("Expected boolean value.\n(\"true\" or \"false\")"));
2188 } else if ( KnownPrivates[i].type==pt_code ) {
2189 if ( *pt!='\0' && (*pt!='{' || (ept>=pt && *ept!='}')) )
2190 gwwv_post_notice(_("Bad type"),_("Expected PostScript code.\nWhich usually begins with a \"{\" and ends with a \"}\"."));
2191 } else if ( KnownPrivates[i].type==pt_number ) {
2192 newval = rpldecimal(val,loc->decimal_point,tmplocale);
2193 if ( newval==NULL )
2194 gwwv_post_notice(_("Bad type"),_("Expected number."));
2195 else if ( strcmp(newval,val)==0 )
2196 free(newval); /* No change */
2197 else {
2198 strings[r*cols+1].u.md_str = newval;
2199 free(val);
2200 GGadgetRedraw(g);
2201 }
2202 } else if ( KnownPrivates[i].type==pt_array ) {
2203 newval = rplarraydecimal(val,loc->decimal_point,tmplocale);
2204 if ( newval==NULL )
2205 gwwv_post_notice(_("Bad type"),_("Expected number."));
2206 else if ( strcmp(newval,val)==0 )
2207 free(newval); /* No change */
2208 else {
2209 strings[r*cols+1].u.md_str = newval;
2210 free(val);
2211 GGadgetRedraw(g);
2212 }
2213 }
2214 if (tmplocale != NULL) { freelocale_hack(tmplocale); tmplocale = NULL; }
2215 }
2216 }
2217
2218 static void PSPrivate_MatrixInit(struct matrixinit *mi,struct gfi_data *d) {
2219 SplineFont *sf = d->sf;
2220 int i,j;
2221 struct matrix_data *md;
2222
2223 memset(mi,0,sizeof(*mi));
2224 mi->col_cnt = 2;
2225 mi->col_init = psprivate_ci;
2226
2227 mi->initial_row_cnt = sf->private_dict==NULL?0:sf->private_dict->next;
2228 md = calloc(2*(mi->initial_row_cnt+1),sizeof(struct matrix_data));
2229 if ( sf->private_dict!=NULL ) {
2230 for ( i=j=0; i<sf->private_dict->next; ++i ) {
2231 md[2*j ].u.md_str = copy(sf->private_dict->keys[i]);
2232 md[2*j+1].u.md_str = copy(sf->private_dict->values[i]);
2233 ++j;
2234 }
2235 }
2236 mi->matrix_data = md;
2237
2238 mi->finishedit = PSPrivate_FinishEdit;
2239 }
2240
2241 static struct psdict *GFI_ParsePrivate(struct gfi_data *d) {
2242 struct psdict *ret = calloc(1,sizeof(struct psdict));
2243 GGadget *private = GWidgetGetControl(d->gw,CID_Private);
2244 int rows, cols = GMatrixEditGetColCnt(private);
2245 struct matrix_data *strings = GMatrixEditGet(private, &rows);
2246 int i,j;
2247
2248 ret->cnt = rows;
2249 ret->keys = malloc(rows*sizeof(char *));
2250 ret->values = malloc(rows*sizeof(char *));
2251 for ( i=j=0; i<rows; ++i ) {
2252 if ( strings[i*cols+0].u.md_str!=NULL && strings[i*cols+1].u.md_str!=NULL ) {
2253 ret->keys[j] = copy(strings[i*cols+0].u.md_str);
2254 ret->values[j++] = copy(strings[i*cols+1].u.md_str);
2255 }
2256 }
2257 ret->next = j;
2258 return( ret );
2259 }
2260
2261 static void PSPrivate_EnableButtons(GGadget *g, int r, int c) {
2262 int rows, cols = GMatrixEditGetColCnt(g);
2263 struct matrix_data *strings = _GMatrixEditGet(g, &rows);
2264 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2265 char *key = r>=0 && r<rows ? strings[r*cols+0].u.md_str : NULL;
2266 int has_hist = key!=NULL && (
2267 strcmp(key,"BlueValues")==0 ||
2268 strcmp(key,"OtherBlues")==0 ||
2269 strcmp(key,"StdHW")==0 ||
2270 strcmp(key,"StemSnapH")==0 ||
2271 strcmp(key,"StdVW")==0 ||
2272 strcmp(key,"StemSnapV")==0);
2273 int has_guess = key!=NULL && (has_hist ||
2274 strcmp(key,"BlueScale")==0 ||
2275 strcmp(key,"BlueShift")==0 ||
2276 strcmp(key,"BlueFuzz")==0 ||
2277 strcmp(key,"ForceBold")==0 ||
2278 strcmp(key,"LanguageGroup")==0 ||
2279 strcmp(key,"ExpansionFactor")==0);
2280 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess), has_guess);
2281 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist ), has_hist );
2282 }
2283
2284 static int PI_Guess(GGadget *g, GEvent *e) {
2285 GWindow gw;
2286 struct gfi_data *d;
2287 GGadget *private;
2288 struct psdict *tempdict;
2289 struct matrix_data *strings;
2290 int rows, cols, r;
2291 char *key, *ret;
2292
2293 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2294 gw = GGadgetGetWindow(g);
2295 d = GDrawGetUserData(gw);
2296 private = GWidgetGetControl(gw,CID_Private);
2297 strings = GMatrixEditGet(private, &rows); /* Commit any changes made thus far */
2298 cols = GMatrixEditGetColCnt(private);
2299 r = GMatrixEditGetActiveRow(private);
2300 key = strings[r*cols+0].u.md_str;
2301 tempdict = calloc(1,sizeof(*tempdict));
2302 SFPrivateGuess(d->sf,ly_fore,tempdict,key,true);
2303 ret = copy(PSDictHasEntry(tempdict,key));
2304 if ( ret!=NULL ) {
2305 free(strings[r*cols+1].u.md_str);
2306 strings[r*cols+1].u.md_str = ret;
2307 GGadgetRedraw(private);
2308 }
2309 PSDictFree(tempdict);
2310 }
2311 return( true );
2312 }
2313
2314 static int PI_Hist(GGadget *g, GEvent *e) {
2315 GWindow gw;
2316 struct gfi_data *d;
2317 GGadget *private;
2318 struct psdict *tempdict;
2319 enum hist_type h;
2320 struct matrix_data *strings;
2321 int rows, cols, r;
2322 char *key, *ret;
2323
2324 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2325 gw = GGadgetGetWindow(g);
2326 d = GDrawGetUserData(gw);
2327 private = GWidgetGetControl(gw,CID_Private);
2328 strings = _GMatrixEditGet(private, &rows);
2329 cols = GMatrixEditGetColCnt(private);
2330 r = GMatrixEditGetActiveRow(private);
2331 key = strings[r*cols+0].u.md_str;
2332 if ( strcmp(key,"BlueValues")==0 ||
2333 strcmp(key,"OtherBlues")==0 )
2334 h = hist_blues;
2335 else if ( strcmp(key,"StdHW")==0 ||
2336 strcmp(key,"StemSnapH")==0 )
2337 h = hist_hstem;
2338 else if ( strcmp(key,"StdVW")==0 ||
2339 strcmp(key,"StemSnapV")==0 )
2340 h = hist_vstem;
2341 else
2342 return( true ); /* can't happen */
2343 tempdict = GFI_ParsePrivate(d);
2344 SFHistogram(d->gw, d->sf,ly_fore,tempdict,NULL,NULL,h);
2345 ret = copy(PSDictHasEntry(tempdict,key));
2346 if ( ret!=NULL ) {
2347 free(strings[r*cols+1].u.md_str);
2348 strings[r*cols+1].u.md_str = ret;
2349 GGadgetRedraw(private);
2350 }
2351 PSDictFree(tempdict);
2352 }
2353 return( true );
2354 }
2355
2356 static int GFI_NameChange(GGadget *g, GEvent *e) {
2357 if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2358 GWindow gw = GGadgetGetWindow(g);
2359 struct gfi_data *gfi = GDrawGetUserData(gw);
2360 const unichar_t *uname = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
2361 unichar_t ubuf[50];
2362 int i,j;
2363 for ( j=0; noticeweights[j]!=NULL; ++j ) {
2364 for ( i=0; noticeweights[j][i]!=NULL; ++i ) {
2365 if ( uc_strstrmatch(uname,noticeweights[j][i])!=NULL ) {
2366 uc_strcpy(ubuf, noticeweights[j]==knownweights ?
2367 realweights[i] : noticeweights[j][i]);
2368 GGadgetSetTitle(GWidgetGetControl(gw,CID_Weight),ubuf);
2369 break;
2370 }
2371 }
2372 if ( noticeweights[j][i]!=NULL )
2373 break;
2374 }
2375
2376 /* If the user didn't set the full name yet, we guess it from the
2377 * postrscript name */
2378 if ( gfi->human_untitled ) {
2379 unichar_t *cp = u_copy(uname);
2380 int i=0;
2381 /* replace the last hyphen with space */
2382 for( i=u_strlen(cp); i>=0; i-- ) {
2383 if( cp[i] == '-' ) {
2384 cp[i] = ' ';
2385 break;
2386 }
2387 }
2388 /* If the postscript name ends with "Regular" it is recommended not
2389 * to include it in the full name */
2390 if(u_endswith(cp,c_to_u(" Regular")) || u_endswith(cp,c_to_u(" regular"))) {
2391 cp[u_strlen(cp) - strlen(" Regular")] ='\0';
2392 }
2393 GGadgetSetTitle(GWidgetGetControl(gw,CID_Human),cp);
2394 free(cp);
2395 }
2396 if ( gfi->family_untitled ) {
2397 const unichar_t *ept = uname+u_strlen(uname); unichar_t *temp;
2398 for ( i=0; knownweights[i]!=NULL; ++i ) {
2399 if (( temp = uc_strstrmatch(uname,knownweights[i]))!=NULL && temp<ept && temp!=uname )
2400 ept = temp;
2401 }
2402 if (( temp = uc_strstrmatch(uname,"ital"))!=NULL && temp<ept && temp!=uname )
2403 ept = temp;
2404 if (( temp = uc_strstrmatch(uname,"obli"))!=NULL && temp<ept && temp!=uname )
2405 ept = temp;
2406 if (( temp = uc_strstrmatch(uname,"kurs"))!=NULL && temp<ept && temp!=uname )
2407 ept = temp;
2408 if (( temp = uc_strstrmatch(uname,"slanted"))!=NULL && temp<ept && temp!=uname )
2409 ept = temp;
2410 if (( temp = u_strchr(uname,'-'))!=NULL && temp!=uname )
2411 ept = temp;
2412 temp = u_copyn(uname,ept-uname);
2413 GGadgetSetTitle(GWidgetGetControl(gw,CID_Family),temp);
2414 }
2415 }
2416 return( true );
2417 }
2418
2419 static int GFI_FamilyChange(GGadget *g, GEvent *e) {
2420 if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2421 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2422 gfi->family_untitled = false;
2423 }
2424 return( true );
2425 }
2426
2427 static int GFI_DefBaseChange(GGadget *g, GEvent *e) {
2428 if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2429 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2430 GGadgetSetChecked(GWidgetGetControl(gfi->gw,*_GGadgetGetTitle(g)!='\0'?CID_HasDefBase:CID_SameAsFontname),
2431 true);
2432 }
2433 return( true );
2434 }
2435
2436 static int GFI_HumanChange(GGadget *g, GEvent *e) {
2437 if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2438 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2439 gfi->human_untitled = false;
2440 }
2441 return( true );
2442 }
2443
2444 static int GFI_VMetricsCheck(GGadget *g, GEvent *e) {
2445 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
2446 GWindow gw = GGadgetGetWindow(g);
2447 int checked = GGadgetIsChecked(g);
2448 GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGap),checked);
2449 GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGapLab),checked);
2450 }
2451 return( true );
2452 }
2453
2454 static int GFI_EmChanged(GGadget *g, GEvent *e) {
2455 if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2456 char buf[20]; unichar_t ubuf[20];
2457 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2458 const unichar_t *ret = _GGadgetGetTitle(g); unichar_t *end;
2459 int val = u_strtol(ret,&end,10), ascent, descent;
2460 if ( *end )
2461 return( true );
2462 switch ( GGadgetGetCid(g)) {
2463 case CID_Em:
2464 ascent = rint( ((double) val)*d->sf->ascent/(d->sf->ascent+d->sf->descent) );
2465 descent = val - ascent;
2466 break;
2467 case CID_Ascent:
2468 ascent = val;
2469 ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
2470 descent = u_strtol(ret,&end,10);
2471 if ( *end )
2472 return( true );
2473 break;
2474 case CID_Descent:
2475 descent = val;
2476 ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
2477 ascent = u_strtol(ret,&end,10);
2478 if ( *end )
2479 return( true );
2480 break;
2481 }
2482 sprintf( buf, "%d", ascent ); if ( ascent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2483 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Ascent),ubuf);
2484 sprintf( buf, "%d", descent ); if ( descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2485 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Descent),ubuf);
2486 sprintf( buf, "%d", ascent+descent ); if ( ascent+descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2487 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Em),ubuf);
2488 }
2489 return( true );
2490 }
2491
2492 static int GFI_GuessItalic(GGadget *g, GEvent *e) {
2493 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2494 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2495 double val = SFGuessItalicAngle(d->sf);
2496 char buf[30]; unichar_t ubuf[30];
2497 sprintf( buf, "%.1f", val);
2498 uc_strcpy(ubuf,buf);
2499 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_ItalicAngle),ubuf);
2500 }
2501 return( true );
2502 }
2503
2504 static void GFI_Close(struct gfi_data *d) {
2505
2506 GDrawDestroyWindow(d->gw);
2507 if ( d->sf->fontinfo == d )
2508 d->sf->fontinfo = NULL;
2509 FVRefreshAll(d->sf);
2510 d->done = true;
2511 /* d will be freed by destroy event */;
2512 }
2513
2514 static void GFI_Mark_FinishEdit(GGadget *g,int r, int c, int wasnew) {
2515 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2516 int is_markclass = GGadgetGetCid(g) == CID_MarkClasses;
2517
2518 if ( c==0 ) {
2519 /* Name can't be null. No spaces. No duplicates */
2520 int rows, cols = GMatrixEditGetColCnt(g);
2521 struct matrix_data *classes = _GMatrixEditGet(g,&rows);
2522 char *pt;
2523 int i;
2524
2525 if ( classes[r*cols+c].u.md_str==NULL || *classes[r*cols+c].u.md_str=='\0' ) {
2526 ff_post_error(_("No Name"), _("Please specify a name for this mark class or set"));
2527 return;
2528 }
2529 for ( pt = classes[r*cols+c].u.md_str; *pt!='\0'; ++pt ) {
2530 if ( *pt==' ' ) {
2531 ff_post_error(_("Bad Name"), _("Mark class/set names should not contain spaces."));
2532 return;
2533 }
2534 }
2535 for ( i=0; i<rows; ++i ) if ( i!=r ) {
2536 if ( strcmp(classes[r*cols+c].u.md_str,classes[i*cols+c].u.md_str)==0 ) {
2537 ff_post_error(_("Duplicate Name"), _("This name was previously used to identify mark class/set #%d."), i+1);
2538 return;
2539 }
2540 }
2541 } else {
2542 if ( is_markclass )
2543 ME_ClassCheckUnique(g, r, c, d->sf);
2544 else
2545 ME_SetCheckUnique(g, r, c, d->sf);
2546 }
2547 }
2548
2549 static char *GFI_Mark_PickGlyphsForClass(GGadget *g,int r, int c) {
2550 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2551 int rows, cols = GMatrixEditGetColCnt(g);
2552 struct matrix_data *classes = _GMatrixEditGet(g,&rows);
2553 char *new = GlyphSetFromSelection(d->sf,d->def_layer,classes[r*cols+c].u.md_str);
2554 return( new );
2555 }
2556
2557 static void GFI_Mark_DeleteClass(GGadget *g,int whichclass) {
2558 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2559 int rows/*, cols = GMatrixEditGetColCnt(g)*/;
2560 struct matrix_data *classes = _GMatrixEditGet(g,&rows);
2561 int is_markclass = GGadgetGetCid(g) == CID_MarkClasses;
2562 SplineFont *sf = d->sf;
2563 OTLookup *otl;
2564 int isgpos;
2565
2566 whichclass += is_markclass; /* Classes begin at 1, Sets begin at 0 */
2567 for ( isgpos=0; isgpos<2; ++isgpos ) {
2568 for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
2569 if ( is_markclass ) {
2570 int old = (otl->lookup_flags & pst_markclass)>>8;
2571 if ( old==whichclass ) {
2572 ff_post_notice(_("Mark Class was in use"),_("This mark class (%s) was used in lookup %s"),
2573 classes[2*whichclass-2].u.md_str,otl->lookup_name);
2574 otl->lookup_flags &= ~ pst_markclass;
2575 } else if ( old>whichclass ) {
2576 otl->lookup_flags &= ~ pst_markclass;
2577 otl->lookup_flags |= (old-1)<<8;
2578 }
2579 } else if ( otl->lookup_flags&pst_usemarkfilteringset ) {
2580 int old = (otl->lookup_flags & pst_markset)>>16;
2581 if ( old==whichclass ) {
2582 ff_post_notice(_("Mark Set was in use"),_("This mark set (%s) was used in lookup %s"),
2583 classes[2*whichclass+0].u.md_str,otl->lookup_name);
2584 otl->lookup_flags &= ~ pst_markset;
2585 otl->lookup_flags &= ~pst_usemarkfilteringset;
2586 } else if ( old>whichclass ) {
2587 otl->lookup_flags &= ~ pst_markset;
2588 otl->lookup_flags |= (old-1)<<16;
2589 }
2590 }
2591 }
2592 }
2593 }
2594
2595 static unichar_t **GFI_GlyphListCompletion(GGadget *t,int from_tab) {
2596 struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(GGadgetGetWindow(t)));
2597 SplineFont *sf = d->sf;
2598
2599 return( SFGlyphNameCompletion(sf,t,from_tab,true));
2600 }
2601
2602 static void GFI_CancelClose(struct gfi_data *d) {
2603 int isgpos,i,j;
2604
2605 MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(
2606 d->gw,CID_Features))));
2607 for ( isgpos=0; isgpos<2; ++isgpos ) {
2608 struct lkdata *lk = &d->tables[isgpos];
2609 for ( i=0; i<lk->cnt; ++i ) {
2610 if ( lk->all[i].isnew )
2611 SFRemoveLookup(d->sf,lk->all[i].lookup,0);
2612 else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
2613 if ( lk->all[i].subtables[j].isnew )
2614 SFRemoveLookupSubTable(d->sf,lk->all[i].subtables[j].subtable,0);
2615 }
2616 free(lk->all[i].subtables);
2617 }
2618 free(lk->all);
2619 }
2620 GFI_Close(d);
2621 }
2622
2623 static struct otfname *OtfNameFromStyleNames(GGadget *me) {
2624 int i;
2625 int rows;
2626 struct matrix_data *strings = GMatrixEditGet(me, &rows);
2627 struct otfname *head=NULL, *last, *cur;
2628
2629 for ( i=0; i<rows; ++i ) {
2630 cur = chunkalloc(sizeof(struct otfname));
2631 cur->lang = strings[2*i ].u.md_ival;
2632 cur->name = copy(strings[2*i+1].u.md_str);
2633 if ( head==NULL )
2634 head = cur;
2635 else
2636 last->next = cur;
2637 last = cur;
2638 }
2639 return( head );
2640 }
2641
2642 void GListDelSelected(GGadget *list) {
2643 int32_t len; int i,j;
2644 GTextInfo **old, **new;
2645
2646 old = GGadgetGetList(list,&len);
2647 new = calloc(len+1,sizeof(GTextInfo *));
2648 for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
2649 new[j] = malloc(sizeof(GTextInfo));
2650 *new[j] = *old[i];
2651 new[j]->text = u_copy(new[j]->text);
2652 ++j;
2653 }
2654 new[j] = calloc(1,sizeof(GTextInfo));
2655 GGadgetSetList(list,new,false);
2656 }
2657
2658 GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line) {
2659 GTextInfo **old, **new;
2660 int32_t i,len;
2661
2662 old = GGadgetGetList(list,&len);
2663 new = calloc(len+1,sizeof(GTextInfo *));
2664 for ( i=0; i<len; ++i ) {
2665 new[i] = malloc(sizeof(GTextInfo));
2666 *new[i] = *old[i];
2667 if ( i!=pos )
2668 new[i]->text = u_copy(new[i]->text);
2669 else
2670 new[i]->text = u_copy(line);
2671 }
2672 new[i] = calloc(1,sizeof(GTextInfo));
2673 GGadgetSetList(list,new,false);
2674 GGadgetScrollListToPos(list,pos);
2675 return( new[pos]);
2676 }
2677
2678 GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select) {
2679 GTextInfo **old, **new;
2680 int32_t i,len;
2681
2682 old = GGadgetGetList(list,&len);
2683 new = calloc(len+2,sizeof(GTextInfo *));
2684 for ( i=0; i<len; ++i ) {
2685 new[i] = malloc(sizeof(GTextInfo));
2686 *new[i] = *old[i];
2687 new[i]->text = u_copy(new[i]->text);
2688 if ( select ) new[i]->selected = false;
2689 }
2690 new[i] = calloc(1,sizeof(GTextInfo));
2691 new[i]->fg = new[i]->bg = COLOR_DEFAULT;
2692 new[i]->userdata = NULL;
2693 new[i]->text = u_copy(line);
2694 new[i]->selected = select;
2695 new[i+1] = calloc(1,sizeof(GTextInfo));
2696 GGadgetSetList(list,new,false);
2697 GGadgetScrollListToPos(list,i);
2698 return( new[i]);
2699 }
2700
2701 GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line) {
2702 GTextInfo **old, **new;
2703 int32_t i,len;
2704
2705 old = GGadgetGetList(list,&len);
2706 new = calloc(len+1,sizeof(GTextInfo *));
2707 for ( i=0; i<len; ++i ) {
2708 new[i] = malloc(sizeof(GTextInfo));
2709 *new[i] = *old[i];
2710 if ( i!=pos )
2711 new[i]->text = u_copy(new[i]->text);
2712 else
2713 new[i]->text = utf82u_copy(line);
2714 }
2715 new[i] = calloc(1,sizeof(GTextInfo));
2716 GGadgetSetList(list,new,false);
2717 GGadgetScrollListToPos(list,pos);
2718 return( new[pos]);
2719 }
2720
2721 GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select) {
2722 GTextInfo **old, **new;
2723 int32_t i,len;
2724
2725 old = GGadgetGetList(list,&len);
2726 new = calloc(len+2,sizeof(GTextInfo *));
2727 for ( i=0; i<len; ++i ) {
2728 new[i] = malloc(sizeof(GTextInfo));
2729 *new[i] = *old[i];
2730 new[i]->text = u_copy(new[i]->text);
2731 if ( select ) new[i]->selected = false;
2732 }
2733 new[i] = calloc(1,sizeof(GTextInfo));
2734 new[i]->fg = new[i]->bg = COLOR_DEFAULT;
2735 new[i]->userdata = NULL;
2736 new[i]->text = utf82u_copy(line);
2737 new[i]->selected = select;
2738 new[i+1] = calloc(1,sizeof(GTextInfo));
2739 GGadgetSetList(list,new,false);
2740 GGadgetScrollListToPos(list,i);
2741 return( new[i]);
2742 }
2743
2744 static int GFI_Cancel(GGadget *g, GEvent *e) {
2745 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2746 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2747 GFI_CancelClose(d);
2748 }
2749 return( true );
2750 }
2751
2752 static void BadFamily() {
2753 ff_post_error(_("Bad Family Name"),_("Bad Family Name, must begin with an alphabetic character."));
2754 }
2755
2756 static int SetFontName(GWindow gw, SplineFont *sf) {
2757 const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
2758 const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
2759 const unichar_t *uweight = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Weight));
2760 const unichar_t *uhum = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Human));
2761 int diff = uc_strcmp(ufont,sf->fontname)!=0;
2762
2763 free(sf->familyname);
2764 free(sf->fontname);
2765 free(sf->weight);
2766 free(sf->fullname);
2767 sf->familyname = cu_copy(ufamily);
2768 sf->fontname = cu_copy(ufont);
2769 sf->weight = cu_copy(uweight);
2770 sf->fullname = cu_copy(uhum);
2771 return( diff );
2772 }
2773
2774 static int CheckNames(struct gfi_data *d) {
2775 const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family));
2776 const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname));
2777 unichar_t *end; const unichar_t *pt;
2778 char *buts[3];
2779 buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
2780
2781 if ( u_strlen(ufont)>63 ) {
2782 ff_post_error(_("Bad Font Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"));
2783 return( false );
2784 }
2785
2786 if ( *ufamily=='\0' ) {
2787 ff_post_error(_("A Font Family name is required"),_("A Font Family name is required"));
2788 return( false );
2789 }
2790 /* A postscript name cannot be a number. There are two ways it can be a */
2791 /* number, it can be a real (which we can check for with strtod) or */
2792 /* it can be a "radix number" which is <intval>'#'<intval>. I'll only */
2793 /* do a cursory test for that */
2794 u_strtod(ufamily,&end);
2795 if ( *end=='\0' || (isdigit(ufamily[0]) && u_strchr(ufamily,'#')!=NULL) ) {
2796 ff_post_error(_("Bad Font Family Name"),_("A PostScript name may not be a number"));
2797 return( false );
2798 }
2799 if ( u_strlen(ufamily)>31 ) {
2800 if ( gwwv_ask(_("Bad Font Family Name"),(const char **) buts,0,1,_("Some versions of Windows will refuse to install postscript fonts if the familyname is longer than 31 characters. Do you want to continue anyway?"))==1 )
2801 return( false );
2802 } else {
2803 if ( u_strlen(ufont)>31 ) {
2804 if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Some versions of Windows will refuse to install postscript fonts if the fontname is longer than 31 characters. Do you want to continue anyway?"))==1 )
2805 return( false );
2806 } else if ( u_strlen(ufont)>29 ) {
2807 if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Adobe's fontname spec (5088.FontNames.pdf) says that fontnames should not be longer than 29 characters. Do you want to continue anyway?"))==1 )
2808 return( false );
2809 }
2810 }
2811 while ( *ufamily ) {
2812 if ( *ufamily<' ' || *ufamily>=0x7f ) {
2813 ff_post_error(_("Bad Font Family Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
2814 return( false );
2815 }
2816 ++ufamily;
2817 }
2818
2819 u_strtod(ufont,&end);
2820 if ( (*end=='\0' || (isdigit(ufont[0]) && u_strchr(ufont,'#')!=NULL)) &&
2821 *ufont!='\0' ) {
2822 ff_post_error(_("Bad Font Name"),_("A PostScript name may not be a number"));
2823 return( false );
2824 }
2825 for ( pt=ufont; *pt; ++pt ) {
2826 if ( *pt<=' ' || *pt>=0x7f ||
2827 *pt=='(' || *pt=='[' || *pt=='{' || *pt=='<' ||
2828 *pt==')' || *pt==']' || *pt=='}' || *pt=='>' ||
2829 *pt=='%' || *pt=='/' ) {
2830 ff_post_error(_("Bad Font Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
2831 return( false );
2832 }
2833 }
2834 return( true );
2835 }
2836
2837 static int ttfspecials[] = { ttf_copyright, ttf_family, ttf_fullname,
2838 ttf_subfamily, ttf_version, -1 };
2839
2840 static char *tn_recalculatedef(struct gfi_data *d,int cur_id) {
2841 char versionbuf[40], *v;
2842
2843 switch ( cur_id ) {
2844 case ttf_copyright:
2845 return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Notice)));
2846 case ttf_family:
2847 return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Family)));
2848 case ttf_fullname:
2849 return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Human)));
2850 case ttf_subfamily:
2851 return( u2utf8_copy(_uGetModifiers(
2852 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)),
2853 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family)),
2854 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Weight)))));
2855 case ttf_version:
2856 sprintf(versionbuf,_("Version %.20s"),
2857 v=GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Version)));
2858 free(v);
2859 return( copy(versionbuf));
2860 default:
2861 return( NULL );
2862 }
2863 }
2864
2865 static char *TN_DefaultName(GGadget *g, int r, int c) {
2866 struct gfi_data *d = GGadgetGetUserData(g);
2867 int rows;
2868 struct matrix_data *strings = GMatrixEditGet(g, &rows);
2869
2870 if ( strings==NULL || !strings[3*r+2].user_bits )
2871 return( NULL );
2872
2873 return( tn_recalculatedef(d,strings[3*r+1].u.md_ival ));
2874 }
2875
2876 static const char *langname(int lang,char *buffer) {
2877 int i;
2878 for ( i=0; mslanguages[i].text!=NULL; ++i )
2879 if ( mslanguages[i].userdata == (void *) (intptr_t) lang )
2880 return( (char *) mslanguages[i].text );
2881
2882 sprintf( buffer, "%04X", lang );
2883 return( buffer );
2884 }
2885
2886 static int strid_sorter(const void *pt1, const void *pt2) {
2887 const struct matrix_data *n1 = pt1, *n2 = pt2;
2888 char buf1[20], buf2[20];
2889 const char *l1, *l2;
2890
2891 if ( n1[1].u.md_ival!=n2[1].u.md_ival )
2892 return( n1[1].u.md_ival - n2[1].u.md_ival );
2893
2894 l1 = langname(n1[0].u.md_ival,buf1);
2895 l2 = langname(n2[0].u.md_ival,buf2);
2896 return( strcoll(l1,l2));
2897 }
2898
2899 static int lang_sorter(const void *pt1, const void *pt2) {
2900 const struct matrix_data *n1 = pt1, *n2 = pt2;
2901 char buf1[20], buf2[20];
2902 const char *l1, *l2;
2903
2904 if ( n1[0].u.md_ival==n2[0].u.md_ival )
2905 return( n1[1].u.md_ival - n2[1].u.md_ival );
2906
2907 l1 = langname(n1[0].u.md_ival,buf1);
2908 l2 = langname(n2[0].u.md_ival,buf2);
2909 return( strcoll(l1,l2));
2910 }
2911
2912 static int ms_thislocale = 0;
2913 static int specialvals(const struct matrix_data *n) {
2914 if ( n[0].u.md_ival == ms_thislocale )
2915 return( -10000000 );
2916 else if ( (n[0].u.md_ival&0x3ff) == (ms_thislocale&0x3ff) )
2917 return( -10000000 + (n[0].u.md_ival&~0x3ff) );
2918 if ( n[0].u.md_ival == 0x409 ) /* English */
2919 return( -1000000 );
2920 else if ( (n[0].u.md_ival&0x3ff) == 9 )
2921 return( -1000000 + (n[0].u.md_ival&~0x3ff) );
2922
2923 return( 1 );
2924 }
2925
2926 static int speciallang_sorter(const void *pt1, const void *pt2) {
2927 const struct matrix_data *n1 = pt1, *n2 = pt2;
2928 char buf1[20], buf2[20];
2929 const char *l1, *l2;
2930 int pos1=1, pos2=1;
2931
2932 /* sort so that entries for the current language are first, then English */
2933 /* then alphabetical order */
2934 if ( n1[0].u.md_ival==n2[0].u.md_ival )
2935 return( n1[1].u.md_ival - n2[1].u.md_ival );
2936
2937 pos1 = specialvals(n1); pos2 = specialvals(n2);
2938 if ( pos1<0 || pos2<0 )
2939 return( pos1-pos2 );
2940 l1 = langname(n1[0].u.md_ival,buf1);
2941 l2 = langname(n2[0].u.md_ival,buf2);
2942 return( strcoll(l1,l2));
2943 }
2944
2945 static void TTFNames_Resort(struct gfi_data *d) {
2946 int(*compar)(const void *, const void *);
2947 GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
2948 int rows;
2949 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
2950
2951 if ( strings==NULL )
2952 return;
2953
2954 if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNLangSort)) )
2955 compar = lang_sorter;
2956 else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNStringSort)) )
2957 compar = strid_sorter;
2958 else
2959 compar = speciallang_sorter;
2960 ms_thislocale = d->langlocalecode;
2961 qsort(strings,rows,3*sizeof(struct matrix_data),compar);
2962 }
2963
2964 static int GFI_Char(struct gfi_data *d,GEvent *event) {
2965 if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
2966 help("ui/dialogs/fontinfo.html", NULL);
2967 return( true );
2968 } else if ( GMenuIsCommand(event,H_("Save All|Alt+Ctl+S") )) {
2969 MenuSaveAll(NULL,NULL,NULL);
2970 return( true );
2971 } else if ( GMenuIsCommand(event,H_("Quit|Ctl+Q") )) {
2972 MenuExit(NULL,NULL,NULL);
2973 return( true );
2974 } else if ( GMenuIsCommand(event,H_("Close|Ctl+Shft+Q") )) {
2975 GFI_CancelClose(d);
2976 return( true );
2977 }
2978 return( false );
2979 }
2980
2981 static int CheckActiveStyleTranslation(struct gfi_data *d,
2982 struct matrix_data *strings,int r, int rows, int iswws ) {
2983 int i,j, other_pos;
2984 char *english, *new=NULL, *temp, *pt;
2985 int other_lang = strings[3*r].u.md_ival;
2986 int changed = false;
2987 int search_sid = iswws ? ttf_wwssubfamily : ttf_subfamily;
2988
2989 for ( i=rows-1; i>=0 ; --i )
2990 if ( strings[3*i+1].u.md_ival==search_sid &&
2991 strings[3*i].u.md_ival == 0x409 )
2992 break;
2993 if ( i<0 && iswws ) {
2994 for ( i=rows-1; i>=0; --i )
2995 if ( strings[3*i+1].u.md_ival==ttf_subfamily &&
2996 strings[3*i].u.md_ival == other_lang ) {
2997 new = copy(strings[3*i+2].u.md_str);
2998 changed = true;
2999 break;
3000 }
3001 } else {
3002 if ( i<0 || (english = strings[3*i+2].u.md_str)==NULL )
3003 new = tn_recalculatedef(d,ttf_subfamily);
3004 else
3005 new = copy(english);
3006 for ( i=0; stylelist[i]!=NULL; ++i ) {
3007 other_pos = -1;
3008 for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
3009 if ( stylelist[i][j].lang == other_lang ) {
3010 other_pos = j;
3011 break;
3012 }
3013 }
3014 if ( other_pos==-1 )
3015 continue;
3016 for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
3017 if ( stylelist[i][j].lang == 0x409 &&
3018 (pt = strstrmatch(new,stylelist[i][j].str))!=NULL ) {
3019 if ( pt==new && strlen(stylelist[i][j].str)==strlen(new) ) {
3020 free(new);
3021 free(strings[3*r+2].u.md_str);
3022 if ( other_lang==0x415 ) {
3023 /* polish needs a word before the translation */
3024 strings[3*r+2].u.md_str = malloc(strlen("odmiana ")+strlen(stylelist[i][other_pos].str)+1);
3025 strcpy(strings[3*r+2].u.md_str,"odmiana ");
3026 strcat(strings[3*r+2].u.md_str,stylelist[i][other_pos].str);
3027 } else
3028 strings[3*r+2].u.md_str = copy(stylelist[i][other_pos].str);
3029 return( true );
3030 }
3031 temp = malloc((strlen(new)
3032 + strlen(stylelist[i][other_pos].str)
3033 - strlen(stylelist[i][j].str)
3034 +1));
3035 strncpy(temp,new,pt-new);
3036 strcpy(temp+(pt-new),stylelist[i][other_pos].str);
3037 strcat(temp+(pt-new),pt+strlen(stylelist[i][j].str));
3038 free(new);
3039 new = temp;
3040 changed = true;
3041 continue;
3042 }
3043 }
3044 }
3045 }
3046 if ( changed ) {
3047 free(strings[3*r+2].u.md_str);
3048 if ( other_lang==0x415 ) {
3049 /* polish needs a word before the translation */
3050 strings[3*r+2].u.md_str = malloc(strlen("odmiana ")+strlen(new)+1);
3051 strcpy(strings[3*r+2].u.md_str,"odmiana ");
3052 strcat(strings[3*r+2].u.md_str,new);
3053 free(new);
3054 } else
3055 strings[3*r+2].u.md_str = new;
3056 } else
3057 free(new);
3058 return( changed );
3059 }
3060
3061 #define MID_ToggleBase 1
3062 #define MID_MultiEdit 2
3063 #define MID_Delete 3
3064
3065 static void TN_StrPopupDispatch(GWindow gw, GMenuItem *mi, GEvent *e) {
3066 struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(gw));
3067 GGadget *g = GWidgetGetControl(d->gw,CID_TNames);
3068
3069 switch ( mi->mid ) {
3070 case MID_ToggleBase: {
3071 int rows;
3072 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3073 strings[3*d->tn_active+2].frozen = !strings[3*d->tn_active+2].frozen;
3074 if ( strings[3*d->tn_active+2].frozen ) {
3075 free( strings[3*d->tn_active+2].u.md_str );
3076 strings[3*d->tn_active+2].u.md_str = NULL;
3077 } else {
3078 strings[3*d->tn_active+2].u.md_str = tn_recalculatedef(d,strings[3*d->tn_active+1].u.md_ival);
3079 }
3080 GGadgetRedraw(g);
3081 } break;
3082 case MID_MultiEdit:
3083 GMatrixEditStringDlg(g,d->tn_active,2);
3084 break;
3085 case MID_Delete:
3086 GMatrixEditDeleteRow(g,d->tn_active);
3087 break;
3088 }
3089 }
3090
3091 static int menusort(const void *m1, const void *m2) {
3092 const GMenuItem *mi1 = m1, *mi2 = m2;
3093
3094 /* Should do a strcoll here, but I never wrote one */
3095 if ( mi1->ti.text_is_1byte && mi2->ti.text_is_1byte )
3096 return( strcoll( (char *) (mi1->ti.text), (char *) (mi2->ti.text)) );
3097 else
3098 return( u_strcmp(mi1->ti.text,mi2->ti.text));
3099 }
3100
3101 static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c) {
3102 int rows, i, j;
3103 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3104
3105 for ( i=0; mi[i].ti.text!=NULL; ++i ) {
3106 int strid = (intptr_t) mi[i].ti.userdata;
3107 for ( j=0; j<rows; ++j ) if ( j!=r )
3108 if ( strings[3*j].u.md_ival == strings[3*r].u.md_ival &&
3109 strings[3*j+1].u.md_ival == strid ) {
3110 mi[i].ti.disabled = true;
3111 break;
3112 }
3113 }
3114 qsort(mi,i,sizeof(mi[0]),menusort);
3115 }
3116
3117 static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c) {
3118 int i;
3119
3120 for ( i=0; mi[i].ti.text!=NULL; ++i );
3121 qsort(mi,i,sizeof(mi[0]),menusort);
3122 }
3123
3124 static void TN_NewName(GGadget *g,int row) {
3125 int rows;
3126 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3127
3128 strings[3*row+1].u.md_ival = ttf_subfamily;
3129 }
3130
3131 static void TN_FinishEdit(GGadget *g,int row,int col,int wasnew) {
3132 int i,rows;
3133 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3134 uint8_t found[ttf_namemax];
3135 struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
3136 int ret = false;
3137
3138 if ( col==2 ) {
3139 if ( strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0' ) {
3140 GMatrixEditDeleteRow(g,row);
3141 ret = true;
3142 }
3143 } else {
3144 if ( col==0 ) {
3145 memset(found,0,sizeof(found));
3146 found[ttf_idontknow] = true; /* reserved name id */
3147 for ( i=0; i<rows; ++i ) if ( i!=row ) {
3148 if ( strings[3*i].u.md_ival == strings[3*row].u.md_ival ) /* Same language */
3149 found[strings[3*i+1].u.md_ival] = true;
3150 }
3151 if ( found[ strings[3*row+1].u.md_ival ] ) {
3152 /* This language already has an entry for this strid */
3153 /* pick another */
3154 if ( !found[ttf_subfamily] ) {
3155 strings[3*row+1].u.md_ival = ttf_subfamily;
3156 ret = true;
3157 } else {
3158 for ( i=0; i<ttf_namemax; ++i )
3159 if ( !found[i] ) {
3160 strings[3*row+1].u.md_ival = i;
3161 ret = true;
3162 break;
3163 }
3164 }
3165 }
3166 }
3167 if ( (strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0') ) {
3168 for ( i=0; i<rows; ++i ) if ( i!=row ) {
3169 if ( strings[3*row+1].u.md_ival == strings[3*i+1].u.md_ival &&
3170 (strings[3*row].u.md_ival&0xff) == (strings[3*i].u.md_ival&0xff)) {
3171 /* Same string, same language, different locale */
3172 /* first guess is the same as the other string. */
3173 if ( strings[3*i+2].u.md_str==NULL )
3174 strings[3*row+2].u.md_str = tn_recalculatedef(d,strings[3*row+1].u.md_ival );
3175 else
3176 strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
3177 ret = true;
3178 break;
3179 }
3180 }
3181 if ( i==rows ) {
3182 /* If we didn't find anything above, and if we've got a style */
3183 /* (subfamily) see if we can guess a translation from the english */
3184 if ( strings[3*row+1].u.md_ival == ttf_subfamily )
3185 ret |= CheckActiveStyleTranslation(d,strings,row,rows,false);
3186 else if ( strings[3*row+1].u.md_ival == ttf_wwssubfamily ) {
3187 /* First see if there is a wwssubfamily we can translate */
3188 /* then see if there is a subfamily we can copy */
3189 ret |= CheckActiveStyleTranslation(d,strings,row,rows,true);
3190 } else if ( strings[3*row+1].u.md_ival == ttf_wwsfamily ) {
3191 /* Copy the normal family */
3192 for ( i=rows-1; i>=0; --i )
3193 if ( strings[3*i+1].u.md_ival==ttf_family &&
3194 strings[3*i].u.md_ival == strings[3*row].u.md_ival ) {
3195 strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
3196 ret = true;
3197 break;
3198 }
3199 if ( (i<0 || strings[3*i+2].u.md_str==NULL) &&
3200 strings[3*row].u.md_ival == 0x409 ) {
3201 strings[3*row+2].u.md_str = tn_recalculatedef(d,ttf_family);
3202 ret = true;
3203 }
3204 }
3205 }
3206 }
3207 }
3208 if ( ret )
3209 GGadgetRedraw(g);
3210 }
3211
3212 static int TN_CanDelete(GGadget *g,int row) {
3213 int rows;
3214 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3215 if ( strings==NULL )
3216 return( false );
3217
3218 return( !strings[3*row+2].user_bits );
3219 }
3220
3221 static void TN_PopupMenu(GGadget *g,GEvent *event,int r,int c) {
3222 struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
3223 int rows;
3224 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3225 GMenuItem mi[5];
3226 int i;
3227
3228 if ( strings==NULL )
3229 return;
3230
3231 d->tn_active = r;
3232
3233 memset(mi,'\0',sizeof(mi));
3234 for ( i=0; i<3; ++i ) {
3235 mi[i].ti.fg = COLOR_DEFAULT;
3236 mi[i].ti.bg = COLOR_DEFAULT;
3237 mi[i].mid = i+1;
3238 mi[i].invoke = TN_StrPopupDispatch;
3239 mi[i].ti.text_is_1byte = true;
3240 }
3241 mi[MID_Delete-1].ti.disabled = strings[3*r+2].user_bits;
3242 mi[MID_ToggleBase-1].ti.disabled = !strings[3*r+2].user_bits;
3243 if ( strings[3*r+2].frozen ) {
3244 mi[MID_MultiEdit-1].ti.disabled = true;
3245 mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Detach from PostScript Names");
3246 } else {
3247 char *temp;
3248 mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Same as PostScript Names");
3249 temp = tn_recalculatedef(d,strings[3*r+1].u.md_ival);
3250 mi[MID_ToggleBase-1].ti.disabled = (temp==NULL);
3251 free(temp);
3252 }
3253 if ( c!=2 )
3254 mi[MID_MultiEdit-1].ti.disabled = true;
3255 mi[MID_MultiEdit-1].ti.text = (unichar_t *) _("Multi-line edit");
3256 mi[MID_Delete-1].ti.text = (unichar_t *) _("Delete");
3257 GMenuCreatePopupMenu(event->w,event, mi);
3258 }
3259
3260 static int TN_PassChar(GGadget *g,GEvent *e) {
3261 return( GFI_Char(GGadgetGetUserData(g),e));
3262 }
3263
3264 static char *TN_BigEditTitle(GGadget *g,int r, int c) {
3265 char buf[100], buf2[20];
3266 const char *lang;
3267 int k;
3268 int rows;
3269 struct matrix_data *strings = GMatrixEditGet(g, &rows);
3270
3271 lang = langname(strings[3*r].u.md_ival,buf2);
3272 for ( k=0; ttfnameids[k].text!=NULL && ttfnameids[k].userdata!=(void *) (intptr_t) strings[3*r+1].u.md_ival;
3273 ++k );
3274 snprintf(buf,sizeof(buf),_("%1$.30s string for %2$.30s"),
3275 lang, (char *) ttfnameids[k].text );
3276 return( copy( buf ));
3277 }
3278
3279 static void TNMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3280 SplineFont *sf = d->sf;
3281 int i,j,k,cnt;
3282 uint8_t sawEnglishUS[ttf_namemax];
3283 struct ttflangname *tln;
3284 struct matrix_data *md;
3285
3286 d->langlocalecode = MSLanguageFromLocale();
3287
3288 memset(mi,0,sizeof(*mi));
3289 mi->col_cnt = 3;
3290 mi->col_init = ci;
3291
3292 md = NULL;
3293 for ( k=0; k<2; ++k ) {
3294 memset(sawEnglishUS,0,sizeof(sawEnglishUS));
3295 cnt = 0;
3296 for ( tln = sf->names; tln!=NULL; tln = tln->next ) {
3297 for ( i=0; i<ttf_namemax; ++i ) if ( i!=ttf_postscriptname && tln->names[i]!=NULL ) {
3298 if ( md!=NULL ) {
3299 md[3*cnt ].u.md_ival = tln->lang;
3300 md[3*cnt+1].u.md_ival = i;
3301 md[3*cnt+2].u.md_str = copy(tln->names[i]);
3302 }
3303 ++cnt;
3304 if ( tln->lang==0x409 )
3305 sawEnglishUS[i] = true;
3306 }
3307 }
3308 for ( i=0; ttfspecials[i]!=-1; ++i ) if ( !sawEnglishUS[ttfspecials[i]] ) {
3309 if ( md!=NULL ) {
3310 md[3*cnt ].u.md_ival = 0x409;
3311 md[3*cnt+1].u.md_ival = ttfspecials[i];
3312 md[3*cnt+2].u.md_str = NULL;
3313 /* if frozen is set then can't remove or edit. (old basedon bit) */
3314 md[3*cnt].frozen = md[3*cnt+1].frozen = md[3*cnt+2].frozen = true;
3315 /* if user_bits is set then can't remove. (old cantremove bit) */
3316 md[3*cnt].user_bits = md[3*cnt+1].user_bits = md[3*cnt+2].user_bits = true;
3317 }
3318 ++cnt;
3319 }
3320 if ( md==NULL )
3321 md = calloc(3*(cnt+10),sizeof(struct matrix_data));
3322 }
3323 for ( i=0; i<cnt; ++i ) if ( md[3*cnt].u.md_ival==0x409 ) {
3324 for ( j=0; ttfspecials[j]!=-1 && ttfspecials[j]!=md[3*cnt+1].u.md_ival; ++j );
3325 md[3*i].user_bits = md[3*i+1].user_bits = md[3*i+2].user_bits =
3326 ( ttfspecials[j]!=-1 );
3327 }
3328 mi->matrix_data = md;
3329 mi->initial_row_cnt = cnt;
3330
3331 mi->initrow = TN_NewName;
3332 mi->finishedit = TN_FinishEdit;
3333 mi->candelete = TN_CanDelete;
3334 mi->popupmenu = TN_PopupMenu;
3335 mi->handle_key = TN_PassChar;
3336 mi->bigedittitle = TN_BigEditTitle;
3337 }
3338
3339 static int GFI_SortBy(GGadget *g, GEvent *e) {
3340 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
3341 struct gfi_data *d = (struct gfi_data *) GDrawGetUserData(GGadgetGetWindow(g));
3342 TTFNames_Resort(d);
3343 GGadgetRedraw(GWidgetGetControl(d->gw,CID_TNames));
3344 }
3345 return( true );
3346 }
3347
3348 static int GFI_HelpOFL(GGadget *g, GEvent *e) {
3349 /* F1 Help to open a browser to sil.org Open Source License and FAQ */
3350 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3351 help("http://scripts.sil.org/OFL", NULL);
3352 }
3353 return( true );
3354 }
3355
3356 static int GFI_AddOFL(GGadget *g, GEvent *e) {
3357 /* Add sil.org Open Source License (see ofl.c), and modify with current date */
3358 /* Author, and Font Family Name for rows[0,1] of the license. You can access */
3359 /* this routine from GUI at Element->Font_Info->TTF_Names. info at PS_Names. */
3360 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3361 GGadget *tng = GWidgetGetControl(GGadgetGetWindow(g),CID_TNames);
3362 int rows;
3363 struct matrix_data *tns, *newtns;
3364 int i,j,k,l,m, extras, len;
3365 char *all, *pt, **data, *bpt;
3366
3367 tns = GMatrixEditGet(tng, &rows); newtns = NULL;
3368 for ( k=0; k<2; ++k ) {
3369 extras = 0;
3370 for ( i=0; ofl_str_lang_data[i].data!=NULL; ++i ) {
3371 for ( j=rows-1; j>=0; --j ) {
3372 if ( tns[j*3+1].u.md_ival==ofl_str_lang_data[i].strid &&
3373 tns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang ) {
3374 if ( k ) {
3375 free(newtns[j*3+2].u.md_str);
3376 newtns[j*3+2].u.md_str = NULL;
3377 }
3378 break;
3379 }
3380 }
3381 if ( j<0 )
3382 j = rows + extras++;
3383 if ( k ) {
3384 newtns[j*3+1].u.md_ival = ofl_str_lang_data[i].strid;
3385 newtns[j*3+0].u.md_ival = ofl_str_lang_data[i].lang;
3386 data = ofl_str_lang_data[i].data;
3387 for ( m=0; m<2; ++m ) {
3388 len = 0;
3389 for ( l=0; data[l]!=NULL; ++l ) {
3390 bpt = data[l];
3391 if ( m ) {
3392 strcpy( pt, bpt );
3393 pt += strlen( bpt );
3394 *pt++ = '\n';
3395 } else
3396 len += strlen( bpt ) + 1; /* for a new line */
3397 }
3398 if ( !m )
3399 newtns[j*3+2].u.md_str = all = pt = malloc(len+2);
3400 }
3401 if ( pt>all ) pt[-1] = '\0';
3402 else *pt = '\0';
3403 }
3404 }
3405 if ( !k ) {
3406 newtns = calloc((rows+extras)*3,sizeof(struct matrix_data));
3407 memcpy(newtns,tns,rows*3*sizeof(struct matrix_data));
3408 for ( i=0; i<rows; ++i )
3409 newtns[3*i+2].u.md_str = copy(newtns[3*i+2].u.md_str);
3410 }
3411 }
3412 GMatrixEditSet(tng, newtns, rows+extras, false);
3413 ff_post_notice(_("Using the OFL for your open fonts"),_(
3414 "The OFL is a community-approved software license designed for libre/open font projects. \n"
3415 "Fonts under the OFL can be used, studied, copied, modified, embedded, merged and redistributed while giving authors enough control and artistic integrity. For more details including an FAQ see http://scripts.sil.org/OFL. \n\n"
3416 "This font metadata will help users, designers and distribution channels to know who you are, how to contact you and what rights you are granting. \n"
3417 "When releasing modified versions, remember to add your additional notice, including any extra Reserved Font Name(s). FontForge used to add RFN's by default, but no longer does, as they are used by a minority of OFL fonts and FontForge's RFN's were often legally invalid. Please see the official SIL FAQ and FontForge GitHub issue №4434 for more information. \n\n"
3418 "Have fun designing open fonts! đŸ”ŁđŸ”§đŸ„ł" ));
3419 }
3420 return( true );
3421 }
3422
3423 static int ss_cmp(const void *_md1, const void *_md2) {
3424 const struct matrix_data *md1 = _md1, *md2 = _md2;
3425
3426 char buf1[20], buf2[20];
3427 const char *l1, *l2;
3428
3429 if ( md1[1].u.md_ival == md2[1].u.md_ival ) {
3430 if ( md1[2].u.md_ival == md2[2].u.md_ival ) {
3431 l1 = langname(md1[0].u.md_ival,buf1);
3432 l2 = langname(md2[0].u.md_ival,buf2);
3433 return( strcoll(l1,l2));
3434 }
3435 return( md1[2].u.md_ival - md2[2].u.md_ival );
3436 }
3437 return( md1[1].u.md_ival - md2[1].u.md_ival );
3438 }
3439
3440 static void SSMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3441 SplineFont *sf = d->sf;
3442 struct matrix_data *md;
3443 struct otffeatname *fn;
3444 struct otfname *on;
3445 int cnt;
3446
3447 memset(mi,0,sizeof(*mi));
3448 mi->col_cnt = 4;
3449 mi->col_init = ssci;
3450
3451 for ( cnt=0, fn=sf->feat_names; fn!=NULL; fn=fn->next ) {
3452 for ( on=fn->names; on!=NULL; on=on->next, ++cnt );
3453 }
3454 md = calloc(4*(cnt+10),sizeof(struct matrix_data));
3455 for ( cnt=0, fn=sf->feat_names; fn!=NULL; fn=fn->next ) {
3456 for ( on=fn->names; on!=NULL; on=on->next, ++cnt ) {
3457 md[4*cnt ].u.md_ival = on->lang;
3458 md[4*cnt+1].u.md_ival = fn->tag;
3459 md[4*cnt+2].u.md_ival = fn->field;
3460 md[4*cnt+3].u.md_str = copy(on->name);
3461 }
3462 }
3463 qsort( md, cnt, 4*sizeof(struct matrix_data), ss_cmp );
3464 mi->matrix_data = md;
3465 mi->initial_row_cnt = cnt;
3466 }
3467
3468 static int size_cmp(const void *_md1, const void *_md2) {
3469 const struct matrix_data *md1 = _md1, *md2 = _md2;
3470
3471 char buf1[20], buf2[20];
3472 const char *l1, *l2;
3473
3474 l1 = langname(md1[0].u.md_ival,buf1);
3475 l2 = langname(md2[0].u.md_ival,buf2);
3476 return( strcoll(l1,l2));
3477 }
3478
3479 static void SizeMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3480 SplineFont *sf = d->sf;
3481 struct matrix_data *md;
3482 struct otfname *on;
3483 int cnt;
3484
3485 memset(mi,0,sizeof(*mi));
3486 mi->col_cnt = 2;
3487 mi->col_init = sizeci;
3488
3489 for ( cnt=0, on=sf->fontstyle_name; on!=NULL; on=on->next )
3490 ++cnt;
3491 md = calloc(2*(cnt+10),sizeof(struct matrix_data));
3492 for ( cnt=0, on=sf->fontstyle_name; on!=NULL; on=on->next, ++cnt ) {
3493 md[2*cnt ].u.md_ival = on->lang;
3494 md[2*cnt+1].u.md_str = copy(on->name);
3495 }
3496 qsort( md, cnt, 2*sizeof(struct matrix_data), size_cmp );
3497 mi->matrix_data = md;
3498 mi->initial_row_cnt = cnt;
3499 }
3500
3501 static int Gasp_Default(GGadget *g, GEvent *e) {
3502 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3503 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
3504 GGadget *gg = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
3505 int rows;
3506 struct matrix_data *gasp;
3507
3508 if ( !SFHasInstructions(d->sf)) {
3509 rows = 1;
3510 gasp = calloc(rows*5,sizeof(struct matrix_data));
3511 gasp[0].u.md_ival = 65535;
3512 gasp[1].u.md_ival = 0; /* no grid fit (we have no instructions, we can't grid fit) */
3513 gasp[2].u.md_ival = 1; /* do anti-alias */
3514 gasp[3].u.md_ival = 0; /* do symmetric smoothing */
3515 gasp[4].u.md_ival = 0; /* do no grid fit w/ sym smooth */
3516 } else {
3517 rows = 3;
3518 gasp = calloc(rows*5,sizeof(struct matrix_data));
3519 gasp[0].u.md_ival = 8; gasp[1].u.md_ival = 0; gasp[2].u.md_ival = 1;
3520 gasp[3].u.md_ival = 0; gasp[4].u.md_ival = 0;
3521 gasp[5].u.md_ival = 16; gasp[6].u.md_ival = 1; gasp[7].u.md_ival = 0;
3522 gasp[8].u.md_ival = 0; gasp[9].u.md_ival = 0;
3523 gasp[10].u.md_ival = 65535; gasp[11].u.md_ival = 1; gasp[12].u.md_ival = 1;
3524 gasp[13].u.md_ival = 0; gasp[14].u.md_ival = 0;
3525 }
3526 GMatrixEditSet(gg,gasp,rows,false);
3527 }
3528 return( true );
3529 }
3530
3531 static int Gasp_CanDelete(GGadget *g,int row) {
3532 int rows;
3533 struct matrix_data *gasp = GMatrixEditGet(g, &rows);
3534 if ( gasp==NULL )
3535 return( false );
3536
3537 /* Only allow them to delete the sentinal entry if that would give us an */
3538 /* empty gasp table */
3539 return( gasp[5*row].u.md_ival!=0xffff || rows==1 );
3540 }
3541
3542 static int gasp_comp(const void *_md1, const void *_md2) {
3543 const struct matrix_data *md1 = _md1, *md2 = _md2;
3544 return( md1->u.md_ival - md2->u.md_ival );
3545 }
3546
3547 static void Gasp_FinishEdit(GGadget *g,int row,int col,int wasnew) {
3548 int rows;
3549 struct matrix_data *gasp = GMatrixEditGet(g, &rows);
3550
3551 if ( col==0 ) {
3552 qsort(gasp,rows,5*sizeof(struct matrix_data),gasp_comp);
3553 GGadgetRedraw(g);
3554 }
3555 }
3556
3557 static void GaspMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3558 SplineFont *sf = d->sf;
3559 int i;
3560 struct matrix_data *md;
3561
3562 memset(mi,0,sizeof(*mi));
3563 mi->col_cnt = 5;
3564 mi->col_init = gaspci;
3565
3566 if ( sf->gasp_cnt==0 ) {
3567 md = calloc(5,sizeof(struct matrix_data));
3568 mi->initial_row_cnt = 0;
3569 } else {
3570 md = calloc(5*sf->gasp_cnt,sizeof(struct matrix_data));
3571 for ( i=0; i<sf->gasp_cnt; ++i ) {
3572 md[5*i ].u.md_ival = sf->gasp[i].ppem;
3573 md[5*i+1].u.md_ival = (sf->gasp[i].flags&1)?1:0;
3574 md[5*i+2].u.md_ival = (sf->gasp[i].flags&2)?1:0;
3575 md[5*i+3].u.md_ival = (sf->gasp[i].flags&8)?1:0;
3576 md[5*i+4].u.md_ival = (sf->gasp[i].flags&4)?1:0;
3577 }
3578 mi->initial_row_cnt = sf->gasp_cnt;
3579 }
3580 mi->matrix_data = md;
3581
3582 mi->finishedit = Gasp_FinishEdit;
3583 mi->candelete = Gasp_CanDelete;
3584 mi->handle_key = TN_PassChar;
3585 }
3586
3587 static int GFI_GaspVersion(GGadget *g, GEvent *e) {
3588 if ( e->u.control.subtype == et_listselected ) {
3589 int version = GGadgetGetFirstListSelectedItem(g);
3590 GGadget *gasp = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
3591 if ( version == 0 ) {
3592 GMatrixEditShowColumn(gasp,3,false);
3593 GMatrixEditShowColumn(gasp,4,false);
3594 } else {
3595 GMatrixEditShowColumn(gasp,3,true);
3596 GMatrixEditShowColumn(gasp,4,true);
3597 }
3598 GGadgetRedraw(gasp);
3599 }
3600 return( true );
3601 }
3602
3603 static void Layers_BackgroundEnable(GGadget *g,GMenuItem *mi, int r, int c) {
3604 int disable = r<=ly_fore;
3605 mi[0].ti.disabled = disable;
3606 mi[1].ti.disabled = disable;
3607 }
3608
3609 static int Layers_CanDelete(GGadget *g,int row) {
3610 return( row>ly_fore );
3611 }
3612
3613 static void Layers_InitRow(GGadget *g,int row) {
3614 int rows, cols = GMatrixEditGetColCnt(g);
3615 struct matrix_data *layers = GMatrixEditGet(g, &rows);
3616 int isquadratic = GGadgetIsChecked(GWidgetGetControl(GGadgetGetWindow(g),CID_IsOrder2));
3617
3618 layers[row*cols+1].u.md_ival = isquadratic;
3619 }
3620
3621 static void LayersMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3622 SplineFont *sf = d->sf;
3623 int i,j;
3624 struct matrix_data *md;
3625
3626 memset(mi,0,sizeof(*mi));
3627 mi->col_cnt = 4;
3628 mi->col_init = layersci;
3629
3630 md = calloc(4*(sf->layer_cnt+1),sizeof(struct matrix_data));
3631 for ( i=j=0; i<sf->layer_cnt; ++i ) {
3632 md[4*j ].u.md_str = copy(sf->layers[i].name);
3633 md[4*j+1].u.md_ival = sf->layers[i].order2;
3634 md[4*j+2].u.md_ival = sf->layers[i].background;
3635 md[4*j+3].u.md_ival = i+1;
3636 ++j;
3637 }
3638 mi->initial_row_cnt = sf->layer_cnt;
3639 mi->matrix_data = md;
3640
3641 mi->initrow = Layers_InitRow;
3642 mi->candelete = Layers_CanDelete;
3643 }
3644
3645 static int GFI_Type3Change(GGadget *g, GEvent *e) {
3646 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
3647 GWindow gw = GGadgetGetWindow(g);
3648 int type3 = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
3649 int mixed = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMixed));
3650 GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsMixed), !type3);
3651 if ( type3 )
3652 GGadgetSetChecked(GWidgetGetControl(gw,CID_IsMixed), false );
3653 GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsOrder2), !type3);
3654 if ( type3 )
3655 GGadgetSetChecked(GWidgetGetControl(gw,CID_IsOrder2), false );
3656 GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsOrder3), !type3);
3657 if ( type3 )
3658 GGadgetSetChecked(GWidgetGetControl(gw,CID_IsOrder3), true );
3659 GGadgetSetEnabled(GWidgetGetControl(gw,CID_GuideOrder2), !type3 && mixed);
3660 GGadgetSetEnabled(GWidgetGetControl(gw,CID_Backgrounds), !type3);
3661 }
3662 return( true );
3663 }
3664
3665 static int GFI_OrderChange(GGadget *g, GEvent *e) {
3666 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
3667 GWindow gw = GGadgetGetWindow(g);
3668 GGadget *backs = GWidgetGetControl(gw,CID_Backgrounds);
3669 int mixed = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMixed));
3670 int cubic = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsOrder3));
3671 GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsMultiLayer), cubic);
3672 GGadgetSetEnabled(GWidgetGetControl(gw,CID_GuideOrder2), mixed);
3673 if ( !mixed ) {
3674 GGadgetSetChecked(GWidgetGetControl(gw,CID_GuideOrder2), !cubic );
3675 }
3676 GGadgetSetEnabled(backs, true);
3677 GMatrixEditEnableColumn(backs, 1, mixed);
3678 if ( !mixed ) {
3679 int col = GMatrixEditGetColCnt(backs), rows, i;
3680 struct matrix_data *md = GMatrixEditGet(backs, &rows);
3681 for ( i=0; i<rows; ++i )
3682 md[i*col+1].u.md_ival = !cubic;
3683 }
3684 GGadgetRedraw(backs);
3685 }
3686 return( true );
3687 }
3688
3689 static void BDFsSetAsDs(SplineFont *sf) {
3690 BDFFont *bdf;
3691 real scale;
3692
3693 for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
3694 scale = bdf->pixelsize / (real) (sf->ascent+sf->descent);
3695 bdf->ascent = rint(sf->ascent*scale);
3696 bdf->descent = bdf->pixelsize-bdf->ascent;
3697 }
3698 }
3699
3700 static char *texparams[] = { N_("Slant:"), N_("Space:"), N_("Stretch:"),
3701 N_("Shrink:"), N_("XHeight:"), N_("Quad:"),
3702 /* GT: Extra Space, see below for a full comment */
3703 N_("Extra Sp:"), NULL };
3704 static char *texpopups[] = { N_("In an italic font the horizontal change per unit vertical change"),
3705 N_("The amount of space between words when using this font"),
3706 N_("The amount of stretchable space between words when using this font"),
3707 N_("The amount the space between words may shrink when using this font"),
3708 N_("The height of the lower case letters with flat tops"),
3709 N_("The width of one em"),
3710 N_("Either:\nThe amount of extra space to be added after a sentence\nOr the space to be used within math formulae"),
3711 NULL};
3712
3713 static int ParseTeX(struct gfi_data *d) {
3714 int i, err=false;
3715 double em = (d->sf->ascent+d->sf->descent), val;
3716
3717 for ( i=0; texparams[i]!=0 ; ++i ) {
3718 val = GetReal8(d->gw,CID_TeX+i,texparams[i],&err);
3719 d->texdata.params[i] = rint( val/em * (1<<20) );
3720 }
3721 if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
3722 d->texdata.type = tex_text;
3723 else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
3724 d->texdata.type = tex_math;
3725 else
3726 d->texdata.type = tex_mathext;
3727 return( !err );
3728 }
3729
3730 static int ttfmultuniqueids(SplineFont *sf,struct gfi_data *d) {
3731 struct ttflangname *tln;
3732 int found = false;
3733 int i;
3734
3735 if ( d->names_set ) {
3736 GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
3737 int rows;
3738 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3739 for ( i=0; i<rows; ++i )
3740 if ( strings[3*i+1].u.md_ival==ttf_uniqueid ) {
3741 if ( found )
3742 return( true );
3743 found = true;
3744 }
3745 } else {
3746 for ( tln = sf->names; tln!=NULL; tln=tln->next )
3747 if ( tln->names[ttf_uniqueid]!=NULL ) {
3748 if ( found )
3749 return( true );
3750 found = true;
3751 }
3752 }
3753 return( false );
3754 }
3755
3756 static int ttfuniqueidmatch(SplineFont *sf,struct gfi_data *d) {
3757 struct ttflangname *tln;
3758 int i;
3759
3760 if ( sf->names==NULL )
3761 return( false );
3762
3763 if ( !d->names_set ) {
3764 for ( tln = sf->names; tln!=NULL; tln=tln->next )
3765 if ( tln->names[ttf_uniqueid]!=NULL )
3766 return( true );
3767 } else {
3768 GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
3769 int rows;
3770 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3771
3772 for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
3773 if ( tln->names[ttf_uniqueid]==NULL )
3774 continue; /* Not set, so if it has been given a new value */
3775 /* that's a change, and if it hasn't that's ok */
3776 for ( i=0; i<rows; ++i )
3777 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
3778 break;
3779 if ( i==rows )
3780 continue; /* removed. That's a change */
3781 if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )==0 )
3782 return( true ); /* name unchanged */
3783 }
3784 }
3785 return( false );
3786 }
3787
3788 static void ttfuniqueidfixup(SplineFont *sf,struct gfi_data *d) {
3789 struct ttflangname *tln;
3790 char *changed = NULL;
3791 int i;
3792
3793 if ( sf->names==NULL )
3794 return;
3795
3796 if ( !d->names_set ) {
3797 for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
3798 free( tln->names[ttf_uniqueid]);
3799 tln->names[ttf_uniqueid] = NULL;
3800 }
3801 } else {
3802 GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
3803 int rows;
3804 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3805
3806 /* see if any instances of the name have changed */
3807 for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
3808 if ( tln->names[ttf_uniqueid]==NULL )
3809 continue;
3810 for ( i=0; i<rows; ++i )
3811 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
3812 break;
3813 if ( i==rows )
3814 continue;
3815 if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )!=0 )
3816 changed = copy(strings[3*i+2].u.md_str );
3817 break;
3818 }
3819 /* All unique ids should be the same, if any changed set the unchanged */
3820 /* ones to the one that did (or the first of many if several changed) */
3821 for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
3822 if ( tln->names[ttf_uniqueid]==NULL )
3823 continue;
3824 for ( i=0; i<rows; ++i )
3825 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
3826 break;
3827 if ( i==rows )
3828 continue;
3829 if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str)==0 ) {
3830 free(strings[3*i+2].u.md_str);
3831 strings[3*i+2].u.md_str = changed!=NULL
3832 ? copy( changed )
3833 : NULL;
3834 }
3835 }
3836 }
3837 }
3838
3839 static void StoreTTFNames(struct gfi_data *d) {
3840 struct ttflangname *tln;
3841 SplineFont *sf = d->sf;
3842 int i;
3843 GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
3844 int rows;
3845 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3846
3847 TTFLangNamesFree(sf->names); sf->names = NULL;
3848
3849 for ( i=0; i<rows; ++i ) {
3850 for ( tln=sf->names; tln!=NULL && tln->lang!=strings[3*i].u.md_ival; tln=tln->next );
3851 if ( tln==NULL ) {
3852 tln = chunkalloc(sizeof(struct ttflangname));
3853 tln->lang = strings[3*i].u.md_ival;
3854 tln->next = sf->names;
3855 sf->names = tln;
3856 }
3857 tln->names[strings[3*i+1].u.md_ival] = copy(strings[3*i+2].u.md_str );
3858 }
3859
3860 TTF_PSDupsDefault(sf);
3861 }
3862
3863 static int SSNameValidate(struct gfi_data *d) {
3864 GGadget *edit = GWidgetGetControl(d->gw,CID_SSNames);
3865 int rows;
3866 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3867 int i, j, k;
3868 uint32_t tag;
3869
3870 for ( i=0; i<rows; ++i ) {
3871 if ( strings[4*i+3].u.md_str == NULL )
3872 continue;
3873 tag = strings[4*i+1].u.md_ival;
3874 if ( (tag & 0xffff0000) == CHR('s','s','\0','\0') && strings[4*i+2].u.md_ival != otffn_featname ) {
3875 ff_post_error(_("Invalid field"),_("The feature '%c%c%c%c' cannot contain Tooltip Text, Sample Text or Parameter Names."),
3876 tag>>24, tag>>16, tag>>8, tag
3877 );
3878 return( false );
3879 }
3880 for ( j=i+1; j<rows; ++j ) {
3881 if ( strings[4*j+3].u.md_str == NULL )
3882 continue;
3883 if ( strings[4*i ].u.md_ival == strings[4*j ].u.md_ival &&
3884 strings[4*i+1].u.md_ival == strings[4*j+1].u.md_ival &&
3885 strings[4*i+2].u.md_ival == strings[4*j+2].u.md_ival ) {
3886 for ( k=0; mslanguages[k].text!=NULL &&
3887 ((intptr_t) mslanguages[k].userdata)!=strings[4*i].u.md_ival; ++k );
3888 if ( mslanguages[k].text==NULL )
3889 k=0;
3890 ff_post_error(_("Duplicate StyleSet Name"),_("The feature '%c%c%c%c' is named twice in language %s\n%.80s\n%.80s"),
3891 tag>>24, tag>>16, tag>>8, tag,
3892 mslanguages[k].text,
3893 strings[4*i+3].u.md_str,
3894 strings[4*j+3].u.md_str
3895 );
3896 return( false );
3897 }
3898 }
3899 }
3900 return( true );
3901 }
3902
3903 static void StoreSSNames(struct gfi_data *d) {
3904 GGadget *edit = GWidgetGetControl(d->gw,CID_SSNames);
3905 int rows;
3906 struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3907 int i;
3908 uint32_t tag, lang;
3909 enum otffn_field field;
3910 struct otffeatname *fn;
3911 struct otfname *on;
3912 SplineFont *sf = d->sf;
3913
3914 OtfFeatNameListFree(sf->feat_names);
3915 sf->feat_names = NULL;
3916
3917 qsort( strings, rows, 4*sizeof(struct matrix_data), ss_cmp );
3918 for ( i=rows-1; i>=0; --i ) {
3919 if ( strings[4*i+3].u.md_str == NULL )
3920 continue;
3921 field = strings[4*i+2].u.md_ival;
3922 tag = strings[4*i+1].u.md_ival;
3923 lang = strings[4*i].u.md_ival;
3924 for ( fn=sf->feat_names; fn!=NULL && (fn->tag!=tag || fn->field!=field); fn=fn->next );
3925 if ( fn==NULL ) {
3926 fn = chunkalloc(sizeof(*fn));
3927 fn->tag = tag;
3928 fn->field = field;
3929 fn->next = sf->feat_names;
3930 sf->feat_names = fn;
3931 }
3932 on = chunkalloc(sizeof(*on));
3933 on->next = fn->names;
3934 fn->names = on;
3935 on->lang = lang;
3936 on->name = copy(strings[4*i+3].u.md_str );
3937 }
3938 }
3939
3940 static void GFI_ApplyLookupChanges(struct gfi_data *gfi) {
3941 int i,j, isgpos;
3942 OTLookup *last;
3943 SplineFont *sf = gfi->sf;
3944 struct lookup_subtable *sublast;
3945
3946 for ( isgpos=0; isgpos<2; ++isgpos ) {
3947 struct lkdata *lk = &gfi->tables[isgpos];
3948 for ( i=0; i<lk->cnt; ++i ) {
3949 if ( lk->all[i].deleted )
3950 SFRemoveLookup(gfi->sf,lk->all[i].lookup,0);
3951 else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
3952 if ( lk->all[i].subtables[j].deleted )
3953 SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable,0);
3954 }
3955 }
3956 last = NULL;
3957 for ( i=0; i<lk->cnt; ++i ) {
3958 if ( !lk->all[i].deleted ) {
3959 if ( last!=NULL )
3960 last->next = lk->all[i].lookup;
3961 else if ( isgpos )
3962 sf->gpos_lookups = lk->all[i].lookup;
3963 else
3964 sf->gsub_lookups = lk->all[i].lookup;
3965 last = lk->all[i].lookup;
3966 sublast = NULL;
3967 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
3968 if ( !lk->all[i].subtables[j].deleted ) {
3969 if ( sublast!=NULL )
3970 sublast->next = lk->all[i].subtables[j].subtable;
3971 else
3972 last->subtables = lk->all[i].subtables[j].subtable;
3973 sublast = lk->all[i].subtables[j].subtable;
3974 sublast->lookup = last;
3975 }
3976 }
3977 if ( sublast!=NULL )
3978 sublast->next = NULL;
3979 else
3980 last->subtables = NULL;
3981 }
3982 free(lk->all[i].subtables);
3983 }
3984 if ( last!=NULL )
3985 last->next = NULL;
3986 else if ( isgpos )
3987 sf->gpos_lookups = NULL;
3988 else
3989 sf->gsub_lookups = NULL;
3990 free(lk->all);
3991 }
3992 }
3993
3994 static void hexparse(GWindow gw, int cid, char *name, uint32_t *data, int len, int *err) {
3995 int i;
3996 const unichar_t *ret;
3997 unichar_t *end;
3998
3999 ret = _GGadgetGetTitle(GWidgetGetControl(gw,cid));
4000 end = (unichar_t *) ret;
4001 for ( i=0; i<len; ++i ) {
4002 if ( i!=0 ) {
4003 if ( *end=='.' )
4004 ++end;
4005 else {
4006 *err = true;
4007 ff_post_error(_("Bad hex number"), _("Bad hex number in %s"), name);
4008 return;
4009 }
4010 }
4011 data[len-1-i] = u_strtoul(end,&end,16);
4012 }
4013 if ( *end!='\0' ) {
4014 *err = true;
4015 ff_post_error(_("Bad hex number"), _("Bad hex number in %s"), name);
4016 return;
4017 }
4018 }
4019
4020 static int GFI_AnyLayersRemoved(struct gfi_data *d) {
4021 GGadget *backs = GWidgetGetControl(d->gw,CID_Backgrounds);
4022 int rows, cols = GMatrixEditGetColCnt(backs), r, origr, l;
4023 struct matrix_data *layers = GMatrixEditGet(backs, &rows);
4024 SplineFont *sf = d->sf;
4025 int anytrue_before, anytrue_after;
4026
4027 for ( l=0; l<sf->layer_cnt; ++l )
4028 sf->layers[l].ticked = false;
4029
4030 anytrue_before = anytrue_after = false;
4031 for ( r=ly_fore; r<sf->layer_cnt; ++r ) {
4032 if ( sf->layers[r].order2 )
4033 anytrue_before = true;
4034 }
4035 for ( r=0; r<rows; ++r ) if ( (origr = layers[r*cols+3].u.md_ival)!=0 ) {
4036 --origr;
4037 sf->layers[origr].ticked = true;
4038 if ( origr>=ly_fore && layers[r*cols+1].u.md_ival )
4039 anytrue_after = true;
4040 }
4041
4042 for ( l=sf->layer_cnt-1; l>ly_fore; --l ) if ( !sf->layers[l].ticked )
4043 return( 1 | (anytrue_before && !anytrue_after? 2 : 0) );
4044
4045 return( 0 | (anytrue_before && !anytrue_after? 2 : 0) );
4046 }
4047
4048 static int GFI_SetLayers(struct gfi_data *d) {
4049 GGadget *backs = GWidgetGetControl(d->gw,CID_Backgrounds);
4050 int rows, cols = GMatrixEditGetColCnt(backs), r, origr, l;
4051 struct matrix_data *layers = GMatrixEditGet(backs, &rows);
4052 SplineFont *sf = d->sf;
4053 int changed = false;
4054
4055 for ( l=0; l<sf->layer_cnt; ++l )
4056 sf->layers[l].ticked = false;
4057
4058 for ( r=0; r<rows; ++r ) if ( (origr = layers[r*cols+3].u.md_ival)!=0 ) {
4059 /* It's an old layer. Do we need to change anything? */
4060 --origr;
4061 sf->layers[origr].ticked = true;
4062 if ( sf->layers[origr].order2 != layers[r*cols+1].u.md_ival ) {
4063 if ( layers[r*cols+1].u.md_ival )
4064 SFConvertLayerToOrder2(sf,origr);
4065 else
4066 SFConvertLayerToOrder3(sf,origr);
4067 changed = true;
4068 }
4069 if ( sf->layers[origr].background != layers[r*cols+2].u.md_ival ) {
4070 SFLayerSetBackground(sf,origr,layers[r*cols+2].u.md_ival);
4071 changed = true;
4072 }
4073 if ( layers[r*cols+0].u.md_str!=NULL && *layers[r*cols+0].u.md_str!='\0' &&
4074 strcmp( sf->layers[origr].name, layers[r*cols+0].u.md_str)!=0 ) {
4075 free( sf->layers[origr].name );
4076 sf->layers[origr].name = copy( layers[r*cols+0].u.md_str );
4077 changed = true;
4078 }
4079 }
4080
4081 for ( l=sf->layer_cnt-1; l>ly_fore; --l ) if ( !sf->layers[l].ticked ) {
4082 SFRemoveLayer(sf,l);
4083 changed = true;
4084 }
4085
4086 l = 0;
4087 for ( r=0; r<rows; ++r ) if ( layers[r*cols+3].u.md_ival==0 ) {
4088 SFAddLayer(sf,layers[r*cols+0].u.md_str,layers[r*cols+1].u.md_ival, layers[r*cols+2].u.md_ival);
4089 changed = true;
4090 }
4091 if ( changed )
4092 CVLayerPaletteCheck(sf);
4093 return( changed );
4094 }
4095
4096
4097 char* DumpSplineFontMetadata(SplineFont *sf) {
4098 FILE *sfd;
4099 if ( (sfd=GFileTmpfile()) ) {
4100 SFD_DumpSplineFontMetadata( sfd, sf );
4101 char *str = FileToAllocatedString( sfd );
4102 fclose(sfd);
4103 return( str );
4104 }
4105 return( 0 );
4106 }
4107
4108 static int GFI_OK(GGadget *g, GEvent *e) {
4109 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate )
4110 {
4111 GWindow gw = GGadgetGetWindow(g);
4112 struct gfi_data *d = GDrawGetUserData(gw);
4113 SplineFont *sf = d->sf, *_sf;
4114
4115 // printf("at top of GFI_OK\n");
4116
4117 char* sfdfrag = DumpSplineFontMetadata( sf );
4118 SFUndoes* undo = SFUndoCreateSFD( sfut_fontinfo,
4119 _("Font Information Dialog"),
4120 sfdfrag );
4121 SFUndoPushFront( &sf->undoes, undo );
4122
4123
4124
4125 int interp;
4126 int reformat_fv=0, retitle_fv=false;
4127 int upos, uwid, as, des, err = false, weight=0;
4128 int uniqueid, linegap=0, vlinegap=0, winascent=0, windescent=0;
4129 int tlinegap=0, tascent=0, tdescent=0, hascent=0, hdescent=0;
4130 int capheight=0, xheight=0;
4131 int winaoff=true, windoff=true;
4132 int taoff=true, tdoff=true, haoff = true, hdoff = true;
4133 real ia, cidversion;
4134 const unichar_t *txt, *fond; unichar_t *end;
4135 int i,j, mcs;
4136 int vmetrics, namechange, guideorder2;
4137 int xuidchanged = false, usexuid, useuniqueid;
4138 GTextInfo *pfmfam, *ibmfam, *fstype, *nlitem, *stylemap;
4139 int32_t len;
4140 GTextInfo **ti;
4141 int subs[4], super[4], strike[2];
4142 struct otfname *fontstyle_name;
4143 int design_size, size_top, size_bottom, styleid;
4144 int strokedfont = false;
4145 real strokewidth;
4146 int multilayer = false;
4147 char os2_vendor[4];
4148 NameList *nl;
4149 extern int allow_utf8_glyphnames;
4150 int os2version;
4151 int rows, gasprows, mc_rows, ms_rows;
4152 struct matrix_data *strings = GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
4153 struct matrix_data *gasp = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Gasp), &gasprows);
4154 struct matrix_data *markclasses = GMatrixEditGet(GWidgetGetControl(d->gw,CID_MarkClasses), &mc_rows);
4155 struct matrix_data *marksets = GMatrixEditGet(GWidgetGetControl(d->gw,CID_MarkSets), &ms_rows);
4156 int was_ml = sf->multilayer, was_stroke = sf->strokedfont;
4157 uint32_t codepages[2], uranges[4];
4158 int layer_cnt;
4159 struct matrix_data *layers = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Backgrounds), &layer_cnt);
4160 int layer_flags;
4161 int sfntRevision=sfntRevisionUnset, woffMajor=woffUnset, woffMinor=woffUnset;
4162
4163 if ( strings==NULL || gasp==NULL || layers==NULL )
4164 return( true );
4165 if ( gasprows>0 && gasp[5*gasprows-5].u.md_ival!=65535 ) {
4166 ff_post_error(_("Bad Grid Fitting table"),_("The 'gasp' (Grid Fit) table must end with a pixel entry of 65535"));
4167 return( true );
4168 }
4169 {
4170 int i;
4171 static struct {
4172 int cid;
4173 char *tit, *msg;
4174 } msgs[] = {
4175 { CID_Notice, N_("Bad Copyright"), NU_("Copyright text (in the Names pane) must be entirely ASCII. So, use (c) instead of ©.")},
4176 { CID_Human, N_("Bad Human Fontname"), N_("The human-readable fontname text (in the Names pane) must be entirely ASCII.")},
4177 { CID_Weight, N_("Bad Weight"), N_("The weight text (in the Names pane) must be entirely ASCII.")},
4178 { CID_Version, N_("Bad Version"), N_("The version text (in the Names pane) must be entirely ASCII.")},
4179 { 0, NULL, NULL }
4180 };
4181 for ( i = 0; msgs[i].cid!=0 ; ++i )
4182 if ( !uAllAscii(_GGadgetGetTitle(GWidgetGetControl(d->gw,msgs[i].cid))) ) {
4183 ff_post_error(_(msgs[i].tit),_(msgs[i].msg));
4184 return( true );
4185 }
4186 }
4187 if ( (layer_flags = GFI_AnyLayersRemoved(d))!=0 ) {
4188 char *buts[3];
4189 buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
4190 if ( layer_flags & 1 ) {
4191 if ( gwwv_ask(_("Deleting a layer cannot be UNDONE!"),(const char **) buts,0,1,_(
4192 "You are about to delete a layer.\n"
4193 "This will lose all contours in that layer.\n"
4194 "If this is the last quadratic layer it will\n"
4195 "lose all truetype instructions.\n\n"
4196 "Deleting a layer cannot be undone.\n\n"
4197 "Is this really your intent?"))==1 )
4198 return( true );
4199 } else if ( layer_flags & 2 ) {
4200 if ( gwwv_ask(_("Removing instructions cannot be UNDONE!"),(const char **) buts,0,1,_(
4201 "You are about to change the last quadratic\n"
4202 "layer to cubic. When this happens FontForge\n"
4203 "will remove all truetype instructions.\n\n"
4204 "This cannot be undone.\n\n"
4205 "Is this really your intent?"))==1 )
4206 return( true );
4207 }
4208 }
4209 if ( layer_cnt>=BACK_LAYER_MAX-2 ) {
4210 ff_post_error(_("Too many layers"),_("FontForge supports at most %d layers"),BACK_LAYER_MAX-2);
4211 return( true );
4212 }
4213 if ( !CheckNames(d))
4214 return( true );
4215
4216 if ( ttfmultuniqueids(sf,d)) {
4217 char *buts[3];
4218 buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
4219 if ( gwwv_ask(_("Too many Unique Font IDs"),(const char **) buts,0,1,_("You should only specify the TrueType Unique Font Identification string in one language. This font has more. Do you want to continue anyway?"))==1 )
4220 return( true );
4221 }
4222 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
4223 if ( !isalpha(*txt)) {
4224 BadFamily();
4225 return( true );
4226 }
4227 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ItalicAngle));
4228 ia = u_strtod(txt,&end);
4229 if ( *end!='\0' ) {
4230 GGadgetProtest8(_("_Italic Angle:"));
4231 return(true);
4232 }
4233 guideorder2 = GGadgetIsChecked(GWidgetGetControl(gw,CID_GuideOrder2));
4234 strokedfont = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsStrokedFont));
4235 strokewidth = GetReal8(gw,CID_StrokeWidth,_("Stroke _Width:"),&err);
4236 multilayer = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
4237 vmetrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_HasVerticalMetrics));
4238 upos = GetReal8(gw,CID_UPos, _("Underline _Position:"),&err);
4239 uwid = GetReal8(gw,CID_UWidth,S_("Underline|_Height:"),&err);
4240 GetInt8(gw,CID_Em,_("_Em Size:"),&err); /* just check for errors. redundant info */
4241 as = GetInt8(gw,CID_Ascent,_("_Ascent:"),&err);
4242 des = GetInt8(gw,CID_Descent,_("_Descent:"),&err);
4243 uniqueid = GetInt8(gw,CID_UniqueID,_("UniqueID"),&err);
4244 design_size = rint(10*GetReal8(gw,CID_DesignSize,_("De_sign Size:"),&err));
4245 size_bottom = rint(10*GetReal8(gw,CID_DesignBottom,_("_Bottom"),&err));
4246 size_top = rint(10*GetReal8(gw,CID_DesignTop,_("_Top"),&err));
4247 styleid = GetInt8(gw,CID_StyleID,_("Style _ID:"),&err);
4248 fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
4249 OtfNameListFree(fontstyle_name);
4250 if ( design_size==0 && ( size_bottom!=0 || size_top!=0 || styleid!=0 || fontstyle_name!=NULL )) {
4251 ff_post_error(_("Bad Design Size Info"),_("If the design size is 0, then all other fields on that pane must be zero (or unspecified) too."));
4252 return( true );
4253 } else if ( styleid!=0 && fontstyle_name==NULL ) {
4254 ff_post_error(_("Bad Design Size Info"),_("If you specify a style id for the design size, then you must specify a style name"));
4255 return( true );
4256 } else if ( fontstyle_name!=NULL && styleid==0 ) {
4257 ff_post_error(_("Bad Design Size Info"),_("If you specify a style name for the design size, then you must specify a style id"));
4258 return( true );
4259 } else if ( design_size<0 ) {
4260 ff_post_error(_("Bad Design Size Info"),_("If you specify a design size, it must be positive"));
4261 return( true );
4262 } else if ( size_bottom!=0 && size_bottom>design_size ) {
4263 ff_post_error(_("Bad Design Size Info"),_("In the design size range, the bottom field must be less than the design size."));
4264 return( true );
4265 } else if ( size_top!=0 && size_top<design_size ) {
4266 ff_post_error(_("Bad Design Size Info"),_("In the design size range, the bottom top must be more than the design size."));
4267 return( true );
4268 } else if ( styleid!=0 && size_top==0 ) {
4269 ff_post_error(_("Bad Design Size Info"),_("If you specify a style id for the design size, then you must specify a size range"));
4270 return( true );
4271 } else if ( size_top!=0 && styleid==0 ) {
4272 ff_post_notice(_("Bad Design Size Info"),_("If you specify a design size range, then you are supposed to specify a style id and style name too. FontForge will allow you to leave those fields blank, but other applications may not."));
4273 /* no return, this is just a warning */
4274 }
4275
4276 if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_Revision))!='\0' )
4277 sfntRevision = rint(65536.*GetReal8(gw,CID_Revision,_("sfnt Revision:"),&err));
4278 if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMajor))!='\0' ) {
4279 woffMajor = GetInt8(gw,CID_WoffMajor,_("Woff Major Version:"),&err);
4280 woffMinor = 0;
4281 if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMinor))!='\0' )
4282 woffMinor = GetInt8(gw,CID_WoffMinor,_("Woff Minor Version:"),&err);
4283 }
4284 if ( err )
4285 return(true);
4286
4287 memset(codepages,0,sizeof(codepages));
4288 memset(uranges,0,sizeof(uranges));
4289 if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_CPageDefault)) )
4290 hexparse(gw,CID_CodePageRanges,_("MS Code Pages"),codepages,2,&err );
4291 if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_URangesDefault)) )
4292 hexparse(gw,CID_UnicodeRanges,_("MS Unicode Ranges"),uranges,4,&err );
4293 if ( err )
4294 return( true );
4295
4296 if ( sf->subfontcnt!=0 ) {
4297 cidversion = GetReal8(gw,CID_Version,_("_Version"),&err);
4298 if ( err )
4299 return(true);
4300 }
4301 os2version = sf->os2_version;
4302 if ( d->ttf_set ) {
4303 char *os2v = GGadgetGetTitle8(GWidgetGetControl(gw,CID_OS2Version));
4304 if ( strcasecmp(os2v,(char *) os2versions[0].text )== 0 )
4305 os2version = 0;
4306 else
4307 os2version = GetInt8(gw,CID_OS2Version,_("Weight, Width, Slope Only"),&err);
4308 free(os2v);
4309 /* Only use the normal routine if we get no value, because */
4310 /* "400 Book" is a reasonable setting, but would cause GetInt */
4311 /* to complain */
4312 weight = u_strtol(_GGadgetGetTitle(GWidgetGetControl(gw,CID_WeightClass)),NULL,10);
4313 if ( weight == 0 ) {
4314 int i;
4315 char *wc = GGadgetGetTitle8(GWidgetGetControl(gw,CID_WeightClass));
4316 for ( i=0; widthclass[i].text!=NULL; ++i ) {
4317 if ( strcmp(wc,(char *) widthclass[i].text)==0 ) {
4318 weight = (intptr_t) widthclass[i].userdata;
4319 break;
4320 }
4321 }
4322 free(wc);
4323 }
4324 if ( weight == 0 )
4325 weight = GetInt8(gw,CID_WeightClass,_("_Weight Class"),&err);
4326 linegap = GetInt8(gw,CID_LineGap,_("HHead _Line Gap:"),&err);
4327 tlinegap = GetInt8(gw,CID_TypoLineGap,_("Typo Line _Gap:"),&err);
4328 if ( vmetrics )
4329 vlinegap = GetInt8(gw,CID_VLineGap,_("VHead _Column Spacing:"),&err);
4330 winaoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinAscentIsOff));
4331 windoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinDescentIsOff));
4332 winascent = GetInt8(gw,CID_WinAscent,winaoff ? _("Win _Ascent Offset:") : _("Win Ascent:"),&err);
4333 windescent = GetInt8(gw,CID_WinDescent,windoff ? _("Win _Descent Offset:") : _("Win Descent:"),&err);
4334 taoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoAscentIsOff));
4335 tdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoDescentIsOff));
4336 tascent = GetInt8(gw,CID_TypoAscent,taoff ? _("_Typo Ascent Offset:") : _("Typo Ascent:"),&err);
4337 tdescent = GetInt8(gw,CID_TypoDescent,tdoff ? _("T_ypo Descent Offset:") : _("Typo Descent:"),&err);
4338 haoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadAscentIsOff));
4339 hdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadDescentIsOff));
4340 hascent = GetInt8(gw,CID_HHeadAscent,haoff ? _("_HHead Ascent Offset:") : _("HHead Ascent:"),&err);
4341 hdescent = GetInt8(gw,CID_HHeadDescent,hdoff ? _("HHead De_scent Offset:") : _("HHead Descent:"),&err);
4342 capheight = GetInt8(gw,CID_CapHeight, _("Ca_pital Height:"),&err);
4343 xheight = GetInt8(gw,CID_XHeight, _("_X Height:"),&err);
4344 if ( err )
4345 return(true);
4346
4347 if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault)) ) {
4348 for ( i=0; i<4; ++i )
4349 subs[i] = GetInt8(gw,CID_SubXSize+i,_("Subscript"),&err);
4350 for ( i=0; i<4; ++i )
4351 super[i] = GetInt8(gw,CID_SuperXSize+i,_("Superscript"),&err);
4352 for ( i=0; i<2; ++i )
4353 strike[i] = GetInt8(gw,CID_StrikeoutSize+i,_("Strikeout"),&err);
4354 }
4355 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Vendor));
4356 if ( u_strlen(txt)>4 || txt[0]>0x7e || (txt[0]!='\0' && (txt[1]>0x7e ||
4357 (txt[1]!='\0' && (txt[2]>0x7e || (txt[2]!='\0' && txt[3]>0x7e))))) ) {
4358 if ( u_strlen(txt)>4 )
4359 ff_post_error(_("Bad IBM Family"),_("Tag must be 4 characters long"));
4360 else
4361 ff_post_error(_("Bad IBM Family"),_("A tag must be 4 ASCII characters"));
4362 return( true );
4363 }
4364 os2_vendor[0] = txt[0]==0 ? ' ' : txt[0];
4365 os2_vendor[1] = txt[0]==0 || txt[1]=='\0' ? ' ' : txt[1];
4366 os2_vendor[2] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' ? ' ' : txt[2];
4367 os2_vendor[3] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' || txt[3]=='\0' ? ' ' : txt[3];
4368 }
4369 if ( err )
4370 return(true);
4371 if ( d->tex_set ) {
4372 if ( !ParseTeX(d))
4373 return( true );
4374 }
4375 if ( as+des>16384 || des<0 || as<0 ) {
4376 ff_post_error(_("Bad Ascent/Descent"),_("Ascent and Descent must be positive and their sum less than 16384"));
4377 return( true );
4378 }
4379 mcs = -1;
4380 if ( !GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic)) ) {
4381 mcs = 0;
4382 ti = GGadgetGetList(GWidgetGetControl(d->gw,CID_MacStyles),&len);
4383 for ( i=0; i<len; ++i )
4384 if ( ti[i]->selected )
4385 mcs |= (int) (intptr_t) ti[i]->userdata;
4386 if ( (mcs&sf_condense) && (mcs&sf_extend)) {
4387 ff_post_error(_("Bad Style"),_("A style may not have both condense and extend set (it makes no sense)"));
4388 return( true );
4389 }
4390 }
4391
4392 nlitem = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_Namelist));
4393 if ( nlitem==NULL )
4394 nl = DefaultNameListForNewFonts();
4395 else {
4396 char *name = u2utf8_copy(nlitem->text);
4397 nl = NameListByName(name);
4398 free(name);
4399 }
4400 if ( nl->uses_unicode && !allow_utf8_glyphnames ) {
4401 ff_post_error(_("Namelist contains non-ASCII names"),_("Glyph names should be limited to characters in the ASCII character set,\nbut there are names in this namelist which use characters outside\nthat range."));
4402 return(true);
4403 }
4404 if ( !SSNameValidate(d))
4405 return( true );
4406 if ( strokedfont!=sf->strokedfont || multilayer!=sf->multilayer ) {
4407 if ( sf->strokedfont && multilayer )
4408 SFSetLayerWidthsStroked(sf,sf->strokewidth);
4409 else if ( sf->multilayer )
4410 SFSplinesFromLayers(sf,strokedfont);
4411 SFReinstanciateRefs(sf);
4412 if ( multilayer!=sf->multilayer ) {
4413 sf->multilayer = multilayer;
4414 SFLayerChange(sf);
4415 }
4416 for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
4417 sf->glyphs[i]->changedsincelasthinted = !strokedfont && !multilayer;
4418 }
4419 sf->strokedfont = strokedfont;
4420 sf->strokewidth = strokewidth;
4421 GDrawSetCursor(gw,ct_watch);
4422 namechange = SetFontName(gw,sf);
4423 if ( namechange ) retitle_fv = true;
4424 usexuid = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseXUID));
4425 useuniqueid = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseUniqueID));
4426 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_XUID));
4427 xuidchanged = (sf->xuid==NULL && *txt!='\0') ||
4428 (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0);
4429 if ( namechange &&
4430 ((uniqueid!=0 && uniqueid==sf->uniqueid && useuniqueid) ||
4431 (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 && usexuid) ||
4432 ttfuniqueidmatch(sf,d)) ) {
4433 char *buts[4];
4434 int ans;
4435 buts[0] = _("Change");
4436 buts[1] = _("Retain");
4437 buts[2] = _("_Cancel");
4438 buts[3] = NULL;
4439 ans = gwwv_ask(_("Change UniqueID?"),(const char **) buts,0,2,_("You have changed this font's name without changing the UniqueID (or XUID).\nThis is probably not a good idea, would you like me to\ngenerate a random new value?"));
4440 if ( ans==2 ) {
4441 GDrawSetCursor(gw,ct_pointer);
4442 return(true);
4443 }
4444 if ( ans==0 ) {
4445 if ( uniqueid!=0 && uniqueid==sf->uniqueid )
4446 uniqueid = 4000000 + (rand()&0x3ffff);
4447 if ( sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 ) {
4448 SFRandomChangeXUID(sf);
4449 xuidchanged = true;
4450 }
4451 }
4452 if ( ttfuniqueidmatch(sf,d))
4453 ttfuniqueidfixup(sf,d);
4454 } else {
4455 free(sf->xuid);
4456 sf->xuid = *txt=='\0'?NULL:cu_copy(txt);
4457 }
4458 sf->use_xuid = usexuid;
4459 sf->use_uniqueid = useuniqueid;
4460
4461 sf->sfntRevision = sfntRevision;
4462
4463 free(sf->woffMetadata);
4464 sf->woffMetadata = NULL;
4465 if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMetadata))!='\0' )
4466 sf->woffMetadata = GGadgetGetTitle8(GWidgetGetControl(gw,CID_WoffMetadata));
4467 sf->woffMajor = woffMajor;
4468 sf->woffMinor = woffMinor;
4469
4470 free(sf->gasp);
4471 sf->gasp_cnt = gasprows;
4472 if ( gasprows==0 )
4473 sf->gasp = NULL;
4474 else {
4475 sf->gasp = malloc(gasprows*sizeof(struct gasp));
4476 sf->gasp_version = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_GaspVersion));
4477 for ( i=0; i<gasprows; ++i ) {
4478 sf->gasp[i].ppem = gasp[5*i].u.md_ival;
4479 if ( sf->gasp_version==0 )
4480 sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
4481 (gasp[5*i+2].u.md_ival<<1);
4482 else
4483 sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
4484 (gasp[5*i+2].u.md_ival<<1) |
4485 (gasp[5*i+4].u.md_ival<<2) |
4486 (gasp[5*i+3].u.md_ival<<3);
4487 }
4488 }
4489 sf->head_optimized_for_cleartype = GGadgetIsChecked(GWidgetGetControl(gw,CID_HeadClearType));
4490
4491 OtfNameListFree(sf->fontstyle_name);
4492 sf->fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
4493 sf->design_size = design_size;
4494 sf->design_range_bottom = size_bottom;
4495 sf->design_range_top = size_top;
4496 sf->fontstyle_id = styleid;
4497
4498 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Notice));
4499 free(sf->copyright); sf->copyright = cu_copy(txt);
4500 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Comment));
4501 free(sf->comments); sf->comments = u2utf8_copy(*txt?txt:NULL);
4502 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_FontLog));
4503 free(sf->fontlog); sf->fontlog = u2utf8_copy(*txt?txt:NULL);
4504 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_DefBaseName));
4505 if ( *txt=='\0' || GGadgetIsChecked(GWidgetGetControl(gw,CID_SameAsFontname)) )
4506 txt = NULL;
4507 free(sf->defbasefilename); sf->defbasefilename = u2utf8_copy(txt);
4508 if ( sf->subfontcnt!=0 ) {
4509 sf->cidversion = cidversion;
4510 } else {
4511 txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Version));
4512 free(sf->version); sf->version = cu_copy(txt);
4513 }
4514 fond = _GGadgetGetTitle(GWidgetGetControl(gw,CID_MacFOND));
4515 free(sf->fondname); sf->fondname = NULL;
4516 if ( *fond )
4517 sf->fondname = cu_copy(fond);
4518 sf->macstyle = mcs;
4519 sf->italicangle = ia;
4520 sf->upos = upos;
4521 sf->uwidth = uwid;
4522 sf->uniqueid = uniqueid;
4523 sf->texdata = d->texdata;
4524 if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_CPageDefault)) ) {
4525 memcpy(sf->pfminfo.codepages,codepages,sizeof(codepages));
4526 sf->pfminfo.hascodepages = true;
4527 } else
4528 sf->pfminfo.hascodepages = false;
4529 if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_URangesDefault)) ) {
4530 memcpy(sf->pfminfo.unicoderanges,uranges,sizeof(uranges));
4531 sf->pfminfo.hasunicoderanges = true;
4532 } else
4533 sf->pfminfo.hasunicoderanges = false;
4534
4535 interp = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_Interpretation));
4536 if ( interp==-1 ) sf->uni_interp = ui_none;
4537 else sf->uni_interp = (intptr_t) interpretations[interp].userdata;
4538
4539 sf->for_new_glyphs = nl;
4540
4541 if ( sf->hasvmetrics!=vmetrics )
4542 CVPaletteDeactivate(); /* Force a refresh later */
4543 _sf = sf->cidmaster?sf->cidmaster:sf;
4544 _sf->hasvmetrics = vmetrics;
4545 for ( j=0; j<_sf->subfontcnt; ++j )
4546 _sf->subfonts[j]->hasvmetrics = vmetrics;
4547
4548 PSDictFree(sf->private_dict);
4549 sf->private_dict = GFI_ParsePrivate(d);
4550
4551 if ( d->names_set )
4552 StoreTTFNames(d);
4553 StoreSSNames(d);
4554 if ( d->ttf_set ) {
4555 sf->os2_version = os2version;
4556 sf->use_typo_metrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseTypoMetrics));
4557 sf->weight_width_slope_only = GGadgetIsChecked(GWidgetGetControl(gw,CID_WeightWidthSlopeOnly));
4558 sf->pfminfo.weight = weight;
4559 sf->pfminfo.width = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_WidthClass))+1;
4560 pfmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PFMFamily));
4561 if ( pfmfam!=NULL )
4562 sf->pfminfo.pfmfamily = (intptr_t) (pfmfam->userdata);
4563 else
4564 sf->pfminfo.pfmfamily = 0x11;
4565 ibmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_IBMFamily));
4566 if ( ibmfam!=NULL )
4567 sf->pfminfo.os2_family_class = (intptr_t) (ibmfam->userdata);
4568 else
4569 sf->pfminfo.os2_family_class = 0x00;
4570 stylemap = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_StyleMap));
4571 if ( stylemap!=NULL )
4572 sf->pfminfo.stylemap = (intptr_t) (stylemap->userdata);
4573 else
4574 sf->pfminfo.stylemap = -1;
4575 memcpy(sf->pfminfo.os2_vendor,os2_vendor,sizeof(os2_vendor));
4576 fstype = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_FSType));
4577 if ( fstype!=NULL )
4578 sf->pfminfo.fstype = (intptr_t) (fstype->userdata);
4579 else
4580 sf->pfminfo.fstype = 0xc;
4581 if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_NoSubsetting)))
4582 sf->pfminfo.fstype |=0x100;
4583 if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_OnlyBitmaps)))
4584 sf->pfminfo.fstype |=0x200;
4585 for ( i=0; i<10; ++i )
4586 sf->pfminfo.panose[i] = (intptr_t) (GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PanFamily+i))->userdata);
4587 sf->pfminfo.panose_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
4588 sf->pfminfo.os2_typolinegap = tlinegap;
4589 sf->pfminfo.linegap = linegap;
4590 if ( vmetrics )
4591 sf->pfminfo.vlinegap = vlinegap;
4592 sf->pfminfo.os2_winascent = winascent;
4593 sf->pfminfo.os2_windescent = windescent;
4594 sf->pfminfo.winascent_add = winaoff;
4595 sf->pfminfo.windescent_add = windoff;
4596 sf->pfminfo.os2_typoascent = tascent;
4597 sf->pfminfo.os2_typodescent = tdescent;
4598 sf->pfminfo.typoascent_add = taoff;
4599 sf->pfminfo.typodescent_add = tdoff;
4600 sf->pfminfo.hhead_ascent = hascent;
4601 sf->pfminfo.hhead_descent = hdescent;
4602 sf->pfminfo.hheadascent_add = haoff;
4603 sf->pfminfo.hheaddescent_add = hdoff;
4604 sf->pfminfo.os2_capheight = capheight;
4605 sf->pfminfo.os2_xheight = xheight;
4606 sf->pfminfo.pfmset = true;
4607
4608 sf->pfminfo.subsuper_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault));
4609 if ( sf->pfminfo.subsuper_set ) {
4610 sf->pfminfo.os2_subxsize = subs[0];
4611 sf->pfminfo.os2_subysize = subs[1];
4612 sf->pfminfo.os2_subxoff = subs[2];
4613 sf->pfminfo.os2_subyoff = subs[3];
4614 sf->pfminfo.os2_supxsize = super[0];
4615 sf->pfminfo.os2_supysize = super[1];
4616 sf->pfminfo.os2_supxoff = super[2];
4617 sf->pfminfo.os2_supyoff = super[3];
4618 sf->pfminfo.os2_strikeysize = strike[0];
4619 sf->pfminfo.os2_strikeypos = strike[1];
4620 }
4621 }
4622 /* must come after all scaleable fields (linegap, etc.) */
4623 if ( as!=sf->ascent || des!=sf->descent ) {
4624 if ( as+des != sf->ascent+sf->descent && GGadgetIsChecked(GWidgetGetControl(gw,CID_Scale)) )
4625 SFScaleToEm(sf,as,des);
4626 else {
4627 sf->ascent = as;
4628 sf->descent = des;
4629 }
4630 BDFsSetAsDs(sf);
4631 reformat_fv = true;
4632 CIDMasterAsDes(sf);
4633 }
4634 GFI_SetLayers(d);
4635 if ( guideorder2!=sf->grid.order2 ) {
4636 if ( guideorder2 )
4637 SFConvertGridToOrder2(sf);
4638 else
4639 SFConvertGridToOrder3(sf);
4640 }
4641 GFI_ApplyLookupChanges(d);
4642 if ( retitle_fv )
4643 FVSetTitles(sf);
4644 if ( reformat_fv || was_ml!=sf->multilayer || was_stroke!=sf->strokedfont )
4645 FontViewReformatAll(sf);
4646 sf->changed = true;
4647 SFSetModTime(sf);
4648 sf->changed_since_autosave = true;
4649 sf->changed_since_xuidchanged = !xuidchanged;
4650 /* Just in case they changed the blue values and we are showing blues */
4651 /* in outline views... */
4652 for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
4653 CharView *cv;
4654 for ( cv = (CharView *) (sf->glyphs[i]->views); cv!=NULL; cv=(CharView *) (cv->b.next) ) {
4655 GDrawRequestExpose(cv->v,NULL,false);
4656 }
4657 }
4658 MacFeatListFree(sf->features);
4659 sf->features = GGadgetGetUserData(GWidgetGetControl(d->gw,CID_Features));
4660 last_aspect = d->old_aspect;
4661
4662 /* Class 0 is unused */
4663 MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
4664 sf->mark_class_cnt = mc_rows + 1;
4665 sf->mark_classes = malloc((mc_rows+1)*sizeof(char *));
4666 sf->mark_class_names = malloc((mc_rows+1)*sizeof(char *));
4667 sf->mark_classes[0] = sf->mark_class_names[0] = NULL;
4668 for ( i=0; i<mc_rows; ++i ) {
4669 sf->mark_class_names[i+1] = copy(markclasses[2*i+0].u.md_str);
4670 sf->mark_classes[i+1] = GlyphNameListDeUnicode(markclasses[2*i+1].u.md_str);
4671 }
4672
4673 /* Set 0 is used */
4674 MarkSetFree(sf->mark_set_cnt,sf->mark_sets,sf->mark_set_names);
4675 sf->mark_set_cnt = ms_rows;
4676 sf->mark_sets = malloc((ms_rows)*sizeof(char *));
4677 sf->mark_set_names = malloc((ms_rows)*sizeof(char *));
4678 for ( i=0; i<ms_rows; ++i ) {
4679 sf->mark_set_names[i] = copy(marksets[2*i+0].u.md_str);
4680 sf->mark_sets[i] = GlyphNameListDeUnicode(marksets[2*i+1].u.md_str);
4681 }
4682
4683 GFI_Close(d);
4684
4685 SFReplaceFontnameBDFProps(sf);
4686 MVReFeatureAll(sf);
4687 MVReKernAll(sf);
4688 }
4689 return( true );
4690 }
4691
4692 static void GFI_AsDsLab(struct gfi_data *d, int cid, int onlylabel) {
4693 int isoffset = GGadgetIsChecked(GWidgetGetControl(d->gw,cid));
4694 DBounds b;
4695 int ocid, labcid;
4696 double val;
4697 char buf[40];
4698 char *offt, *baret;
4699 int ismax=0;
4700 unichar_t *end;
4701
4702 switch ( cid ) {
4703 case CID_WinAscentIsOff:
4704 offt = _("Win Ascent Offset:"); baret = _("Win Ascent:");
4705 ocid = CID_WinAscent; labcid = CID_WinAscentLab;
4706 ismax = true;
4707 break;
4708 case CID_WinDescentIsOff:
4709 offt = _("Win Descent Offset:"); baret = _("Win Descent:");
4710 ocid = CID_WinDescent; labcid = CID_WinDescentLab;
4711 break;
4712 case CID_TypoAscentIsOff:
4713 offt = _("Typo Ascent Offset:"); baret = _("Typo Ascent:");
4714 ocid = CID_TypoAscent; labcid = CID_TypoAscentLab;
4715 ismax = true;
4716 break;
4717 case CID_TypoDescentIsOff:
4718 offt = _("Typo Descent Offset:"); baret = _("Typo Descent:");
4719 ocid = CID_TypoDescent; labcid = CID_TypoDescentLab;
4720 break;
4721 case CID_HHeadAscentIsOff:
4722 offt = _("HHead Ascent Offset:"); baret = _("HHead Ascent:");
4723 ocid = CID_HHeadAscent; labcid = CID_HHeadAscentLab;
4724 ismax = true;
4725 break;
4726 case CID_HHeadDescentIsOff:
4727 offt = _("HHead Descent Offset:"); baret = _("HHead Descent:");
4728 ocid = CID_HHeadDescent; labcid = CID_HHeadDescentLab;
4729 break;
4730 default:
4731 return;
4732 }
4733
4734 GGadgetSetTitle8(GWidgetGetControl(d->gw,labcid),
4735 isoffset?offt:baret);
4736 if ( onlylabel )
4737 return;
4738
4739 if ( cid == CID_TypoAscentIsOff ) {
4740 const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4741 double av=u_strtod(as,&end);
4742 b.maxy = *end=='\0' ? av : d->sf->ascent;
4743 } else if ( cid == CID_TypoDescentIsOff ) {
4744 const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4745 double dv=u_strtod(ds,&end);
4746 b.miny = *end=='\0' ? -dv : -d->sf->descent;
4747 } else {
4748 CIDLayerFindBounds(d->sf,ly_fore,&b);
4749 if ( cid == CID_WinDescentIsOff ) b.miny = -b.miny;
4750 }
4751
4752 val = u_strtod(_GGadgetGetTitle(GWidgetGetControl(d->gw,ocid)),NULL);
4753 if ( isoffset )
4754 sprintf( buf,"%g",rint( val-(ismax ? b.maxy : b.miny)) );
4755 else
4756 sprintf( buf,"%g",rint( val+(ismax ? b.maxy : b.miny)) );
4757 GGadgetSetTitle8(GWidgetGetControl(d->gw,ocid),buf);
4758 }
4759
4760 static int GFI_AsDesIsOff(GGadget *g, GEvent *e) {
4761 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4762 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4763 GFI_AsDsLab(d,GGadgetGetCid(g),false);
4764 }
4765 return( true );
4766 }
4767
4768 static void _GFI_PanoseDefault(struct gfi_data *d) {
4769 int i;
4770 int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_PanDefault));
4771
4772 for ( i=0; i<10; ++i ) {
4773 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamily+i),!isdefault);
4774 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamilyLab+i),!isdefault);
4775 }
4776 if ( isdefault ) {
4777 char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
4778 struct pfminfo info;
4779 int old1, old2;
4780 memset(&info,0,sizeof(info));
4781 old1 = d->sf->pfminfo.pfmset; old2 = d->sf->pfminfo.panose_set;
4782 d->sf->pfminfo.pfmset = false; d->sf->pfminfo.panose_set = false;
4783 SFDefaultOS2Info(&info,d->sf,n);
4784 d->sf->pfminfo.pfmset = old1; d->sf->pfminfo.panose_set = old2;
4785 free(n);
4786 for ( i=0; i<10; ++i )
4787 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
4788 }
4789 }
4790
4791 static int GFI_PanoseDefault(GGadget *g, GEvent *e) {
4792 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4793 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4794 _GFI_PanoseDefault(d);
4795 }
4796 return( true );
4797 }
4798
4799 static int GFI_ShowPanoseDocs(GGadget *g, GEvent *e) {
4800 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
4801 help("http://panose.com/", NULL);
4802 }
4803 return( true );
4804 }
4805
4806 static void GFI_SetPanoseLists(struct gfi_data *d) {
4807 int kind = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_PanFamily));
4808 int i;
4809
4810 if ( kind>=0 && kind!=d->last_panose_family ) {
4811 if ( kind>6 ) kind=6; /* No data for any kinds beyond 5, so anything bigger is just undefined, and that's 6 */
4812 for ( i=1; i<10; ++i ) {
4813 GGadget *lab = GWidgetGetControl(d->gw,CID_PanFamilyLab+i);
4814 GGadget *list = GWidgetGetControl(d->gw,CID_PanFamily+i);
4815 int temp = GGadgetGetFirstListSelectedItem(list);
4816 if ( kind==5 && i==2 ) temp=1;
4817 if ( temp>=16 && (kind!=4 || i!=5)) temp=15;
4818 else if ( temp>16 ) temp=16; /* Decorative.serifvar has 17 elements */
4819 GGadgetSetTitle8WithMn(lab,panoses[kind][i-1].name);
4820 GGadgetSetList(list,GTextInfoArrayFromList(panoses[kind][i-1].variants,NULL),false);
4821 GGadgetSelectOneListItem(list,temp);
4822 }
4823 }
4824 }
4825
4826 static int GFI_ChangePanoseFamily(GGadget *g, GEvent *e) {
4827 if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
4828 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4829 GFI_SetPanoseLists(d);
4830 }
4831 return( true );
4832 }
4833
4834 static void GFI_SubSuperSet(struct gfi_data *d, struct pfminfo *info) {
4835 char buffer[40];
4836 unichar_t ubuf[40];
4837
4838 sprintf( buffer, "%d", info->os2_subxsize );
4839 uc_strcpy(ubuf,buffer);
4840 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXSize),ubuf);
4841
4842 sprintf( buffer, "%d", info->os2_subysize );
4843 uc_strcpy(ubuf,buffer);
4844 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYSize),ubuf);
4845
4846 sprintf( buffer, "%d", info->os2_subxoff );
4847 uc_strcpy(ubuf,buffer);
4848 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXOffset),ubuf);
4849
4850 sprintf( buffer, "%d", info->os2_subyoff );
4851 uc_strcpy(ubuf,buffer);
4852 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYOffset),ubuf);
4853
4854
4855 sprintf( buffer, "%d", info->os2_supxsize );
4856 uc_strcpy(ubuf,buffer);
4857 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXSize),ubuf);
4858
4859 sprintf( buffer, "%d", info->os2_supysize );
4860 uc_strcpy(ubuf,buffer);
4861 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYSize),ubuf);
4862
4863 sprintf( buffer, "%d", info->os2_supxoff );
4864 uc_strcpy(ubuf,buffer);
4865 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXOffset),ubuf);
4866
4867 sprintf( buffer, "%d", info->os2_supyoff );
4868 uc_strcpy(ubuf,buffer);
4869 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYOffset),ubuf);
4870
4871
4872 sprintf( buffer, "%d", info->os2_strikeysize );
4873 uc_strcpy(ubuf,buffer);
4874 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutSize),ubuf);
4875
4876 sprintf( buffer, "%d", info->os2_strikeypos );
4877 uc_strcpy(ubuf,buffer);
4878 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutPos),ubuf);
4879 }
4880
4881 static void _GFI_SubSuperDefault(struct gfi_data *d) {
4882 int i;
4883 int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault));
4884
4885 for ( i=0; i<10; ++i )
4886 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_SubXSize+i),!isdefault);
4887 if ( isdefault ) {
4888 const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4889 const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4890 const unichar_t *ia = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4891 unichar_t *aend, *dend, *iend;
4892 double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend),iav=u_strtod(ia,&iend);
4893 struct pfminfo info;
4894 if ( *aend!='\0' ) av = d->sf->ascent;
4895 if ( *dend!='\0' ) dv = d->sf->descent;
4896 if ( *iend!='\0' ) iav = d->sf->italicangle;
4897 memset(&info,0,sizeof(info));
4898 SFDefaultOS2SubSuper(&info,(int) (dv+av), iav);
4899 GFI_SubSuperSet(d,&info);
4900 }
4901 }
4902
4903 static int GFI_SubSuperDefault(GGadget *g, GEvent *e) {
4904 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4905 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4906 _GFI_SubSuperDefault(d);
4907 }
4908 return( true );
4909 }
4910
4911 static void TTFSetup(struct gfi_data *d) {
4912 struct pfminfo info;
4913 char buffer[10]; unichar_t ubuf[10];
4914 int i, lg, vlg, tlg;
4915 const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4916 const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4917 unichar_t *aend, *dend;
4918 double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend);
4919
4920 info = d->sf->pfminfo;
4921 if ( !info.pfmset ) {
4922 /* Base this stuff on the CURRENT name */
4923 /* if the user just created a font, and named it *Bold, then the sf */
4924 /* won't yet have Bold in its name, and basing the weight on it would*/
4925 /* give the wrong answer. That's why we don't do this init until we */
4926 /* get to one of the ttf aspects, it gives the user time to set the */
4927 /* name properly */
4928 /* And on CURRENT values of ascent and descent */
4929 char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
4930 if ( *aend=='\0' && *dend=='\0' ) {
4931 if ( info.linegap==0 )
4932 info.linegap = rint(.09*(av+dv));
4933 if ( info.vlinegap==0 )
4934 info.vlinegap = info.linegap;
4935 if ( info.os2_typolinegap==0 )
4936 info.os2_typolinegap = info.linegap;
4937 }
4938 lg = info.linegap; vlg = info.vlinegap; tlg = info.os2_typolinegap;
4939 SFDefaultOS2Info(&info,d->sf,n);
4940 if ( lg != 0 )
4941 info.linegap = lg;
4942 if ( vlg!= 0 )
4943 info.vlinegap = vlg;
4944 if ( tlg!=0 )
4945 info.os2_typolinegap = tlg;
4946 free(n);
4947 }
4948
4949 if ( info.weight>0 && info.weight<=900 && info.weight%100==0 )
4950 GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),
4951 (char *) weightclass[info.weight/100-1].text);
4952 else {
4953 sprintf( buffer, "%d", info.weight );
4954 GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),buffer);
4955 }
4956 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_WidthClass),info.width-1);
4957 for ( i=0; pfmfamily[i].text!=NULL; ++i )
4958 if ( (intptr_t) (pfmfamily[i].userdata)==info.pfmfamily ) {
4959 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PFMFamily),i);
4960 break;
4961 }
4962
4963 if ( d->sf->os2_version>=0 && d->sf->os2_version<=4 )
4964 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_OS2Version),d->sf->os2_version);
4965 else {
4966 sprintf( buffer,"%d", d->sf->os2_version );
4967 GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_OS2Version),buffer);
4968 }
4969 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_UseTypoMetrics),d->sf->use_typo_metrics);
4970 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WeightWidthSlopeOnly),d->sf->weight_width_slope_only);
4971
4972 for ( i=0; ibmfamily[i].text!=NULL; ++i )
4973 if ( (intptr_t) (ibmfamily[i].userdata)==info.os2_family_class ) {
4974 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_IBMFamily),i);
4975 break;
4976 }
4977 if ( info.os2_vendor[0]!='\0' ) {
4978 ubuf[0] = info.os2_vendor[0];
4979 ubuf[1] = info.os2_vendor[1];
4980 ubuf[2] = info.os2_vendor[2];
4981 ubuf[3] = info.os2_vendor[3];
4982 ubuf[4] = 0;
4983 } else if ( TTFFoundry!=NULL )
4984 uc_strncpy(ubuf,TTFFoundry,4);
4985 else
4986 uc_strcpy(ubuf,"PfEd");
4987 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Vendor),ubuf);
4988
4989 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_PanDefault),!info.panose_set);
4990 _GFI_PanoseDefault(d);
4991 if ( info.panose_set ) {
4992 for ( i=0; i<10; ++i ) {
4993 int v = info.panose[i];
4994 if ( v>=16 && (info.panose[0]!=4 || i!=5 )) v=15;
4995 else if ( v>16 ) v=16; /* Sigh Decorative.SerifVar has 17 elements */
4996 GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),v);
4997 if ( i==0 )
4998 GFI_SetPanoseLists(d);
4999 }
5000 }
5001
5002 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault),!info.subsuper_set);
5003 if ( info.subsuper_set )
5004 GFI_SubSuperSet(d,&info);
5005 _GFI_SubSuperDefault(d);
5006
5007 d->ttf_set = true;
5008 /* FSType is already set */
5009 sprintf( buffer, "%d", info.linegap );
5010 uc_strcpy(ubuf,buffer);
5011 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_LineGap),ubuf);
5012 sprintf( buffer, "%d", info.vlinegap );
5013 uc_strcpy(ubuf,buffer);
5014 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_VLineGap),ubuf);
5015 sprintf( buffer, "%d", info.os2_typolinegap );
5016 uc_strcpy(ubuf,buffer);
5017 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoLineGap),ubuf);
5018
5019 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinAscentIsOff),info.winascent_add);
5020 GFI_AsDsLab(d,CID_WinAscentIsOff,true);
5021 sprintf( buffer, "%d", info.os2_winascent );
5022 uc_strcpy(ubuf,buffer);
5023 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinAscent),ubuf);
5024 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinDescentIsOff),info.windescent_add);
5025 GFI_AsDsLab(d,CID_WinDescentIsOff,true);
5026 sprintf( buffer, "%d", info.os2_windescent );
5027 uc_strcpy(ubuf,buffer);
5028 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinDescent),ubuf);
5029
5030 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoAscentIsOff),info.typoascent_add);
5031 GFI_AsDsLab(d,CID_TypoAscentIsOff,true);
5032 sprintf( buffer, "%d", info.os2_typoascent );
5033 uc_strcpy(ubuf,buffer);
5034 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoAscent),ubuf);
5035 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoDescentIsOff),info.typodescent_add);
5036 GFI_AsDsLab(d,CID_TypoDescentIsOff,true);
5037 sprintf( buffer, "%d", info.os2_typodescent );
5038 uc_strcpy(ubuf,buffer);
5039 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoDescent),ubuf);
5040
5041 sprintf( buffer, "%d", info.os2_capheight );
5042 uc_strcpy(ubuf,buffer);
5043 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_CapHeight),ubuf);
5044 sprintf( buffer, "%d", info.os2_xheight );
5045 uc_strcpy(ubuf,buffer);
5046 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_XHeight),ubuf);
5047
5048 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadAscentIsOff),info.hheadascent_add);
5049 GFI_AsDsLab(d,CID_HHeadAscentIsOff,true);
5050 sprintf( buffer, "%d", info.hhead_ascent );
5051 uc_strcpy(ubuf,buffer);
5052 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadAscent),ubuf);
5053 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadDescentIsOff),info.hheaddescent_add);
5054 GFI_AsDsLab(d,CID_HHeadDescentIsOff,true);
5055 sprintf( buffer, "%d", info.hhead_descent );
5056 uc_strcpy(ubuf,buffer);
5057 GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadDescent),ubuf);
5058 }
5059
5060 static char *mathparams[] = {
5061 /* GT: TeX parameters for math fonts. "Num" means numerator, "Denom" */
5062 /* GT: means denominator, "Sup" means superscript, "Sub" means subscript */
5063 N_("Num1:"),
5064 N_("Num2:"), N_("Num3:"), N_("Denom1:"),
5065 N_("Denom2:"), N_("Sup1:"), N_("Sup2:"), N_("Sup3:"), N_("Sub1:"), N_("Sub2:"),
5066 N_("SupDrop:"), N_("SubDrop:"), N_("Delim1:"), N_("Delim2:"), N_("Axis Ht:"),
5067 0 };
5068 static char *mathpopups[] = { N_("Amount to raise baseline for numerators in display styles"),
5069 N_("Amount to raise baseline for numerators in non-display styles"),
5070 N_("Amount to raise baseline for numerators in non-display atop styles"),
5071 N_("Amount to lower baseline for denominators in display styles"),
5072 N_("Amount to lower baseline for denominators in non-display styles"),
5073 N_("Amount to raise baseline for superscripts in display styles"),
5074 N_("Amount to raise baseline for superscripts in non-display styles"),
5075 N_("Amount to raise baseline for superscripts in modified styles"),
5076 N_("Amount to lower baseline for subscripts in display styles"),
5077 N_("Amount to lower baseline for subscripts in non-display styles"),
5078 N_("Amount above top of large box to place baseline of superscripts"),
5079 N_("Amount below bottom of large box to place baseline of subscripts"),
5080 N_("Size of comb delimiters in display styles"),
5081 N_("Size of comb delimiters in non-display styles"),
5082 N_("Height of fraction bar above base line"),
5083 0 };
5084 /* GT: Default Rule Thickness. A rule being a typographic term for a straight */
5085 /* GT: black line on a printed page. */
5086 static char *extparams[] = { N_("Def Rule Thick:"),
5087 /* GT: I don't really understand these "Big Op Space" things. They have */
5088 /* GT: something to do with TeX and are roughly defined a few strings down */
5089 N_("Big Op Space1:"),
5090 N_("Big Op Space2:"),
5091 N_("Big Op Space3:"),
5092 N_("Big Op Space4:"),
5093 N_("Big Op Space5:"), 0 };
5094 static char *extpopups[] = { N_("Default thickness of over and overline bars"),
5095 N_("The minimum glue space above a large displayed operator"),
5096 N_("The minimum glue space below a large displayed operator"),
5097 N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is above the operator"),
5098 N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is below the operator"),
5099 N_("The extra glue place above and below displayed limits"),
5100 0 };
5101
5102 static int mp_e_h(GWindow gw, GEvent *event) {
5103 int i;
5104
5105 if ( event->type==et_close ) {
5106 struct gfi_data *d = GDrawGetUserData(gw);
5107 d->mpdone = true;
5108 } else if ( event->type == et_char ) {
5109 return( false );
5110 } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
5111 struct gfi_data *d = GDrawGetUserData(gw);
5112 if ( GGadgetGetCid(event->u.control.g)) {
5113 int err=false;
5114 double em = (d->sf->ascent+d->sf->descent), val;
5115 char **params;
5116 if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
5117 params = mathparams;
5118 else
5119 params = extparams;
5120 for ( i=0; params[i]!=0 && !err; ++i ) {
5121 val = GetReal8(gw,CID_TeX+i,params[i],&err);
5122 if ( !err )
5123 d->texdata.params[i+7] = rint( val/em * (1<<20) );
5124 }
5125 if ( !err )
5126 d->mpdone = true;
5127 } else
5128 d->mpdone = true;
5129 }
5130 return( true );
5131 }
5132
5133 static int GFI_MoreParams(GGadget *g, GEvent *e) {
5134 int tot;
5135 GRect pos;
5136 GWindow gw;
5137 GWindowAttrs wattrs;
5138 GGadgetCreateData txgcd[35], boxes[3], *txarray[18][3], *barray[9];
5139 GTextInfo txlabel[35];
5140 int i,y,k,j;
5141 char **params, **popups;
5142 char values[20][20];
5143
5144 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5145 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5146 if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
5147 return( true );
5148 else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) ) {
5149 tot = 22-7;
5150 params = mathparams;
5151 popups = mathpopups;
5152 } else {
5153 tot = 13-7;
5154 params = extparams;
5155 popups = extpopups;
5156 }
5157
5158 memset(&wattrs,0,sizeof(wattrs));
5159 wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
5160 wattrs.event_masks = ~(1<<et_charup);
5161 wattrs.is_dlg = true;
5162 wattrs.restrict_input_to_me = 1;
5163 wattrs.undercursor = 1;
5164 wattrs.cursor = ct_pointer;
5165 /* GT: More Parameters */
5166 wattrs.utf8_window_title = _("More Params");
5167 pos.x = pos.y = 0;
5168 pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
5169 pos.height = GDrawPointsToPixels(NULL,tot*26+60);
5170 gw = GDrawCreateTopWindow(NULL,&pos,mp_e_h,d,&wattrs);
5171
5172 memset(&txlabel,0,sizeof(txlabel));
5173 memset(&txgcd,0,sizeof(txgcd));
5174
5175 k=j=0; y = 10;
5176 for ( i=0; params[i]!=0; ++i ) {
5177 txlabel[k].text = (unichar_t *) params[i];
5178 txlabel[k].text_is_1byte = true;
5179 txgcd[k].gd.label = &txlabel[k];
5180 txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = y+4;
5181 txgcd[k].gd.flags = gg_visible | gg_enabled;
5182 txgcd[k].gd.popup_msg = popups[i];
5183 txgcd[k++].creator = GLabelCreate;
5184 txarray[j][0] = &txgcd[k-1];
5185
5186 sprintf( values[i], "%g", d->texdata.params[i+7]*(double) (d->sf->ascent+d->sf->descent)/(double) (1<<20));
5187 txlabel[k].text = (unichar_t *) values[i];
5188 txlabel[k].text_is_1byte = true;
5189 txgcd[k].gd.label = &txlabel[k];
5190 txgcd[k].gd.pos.x = 85; txgcd[k].gd.pos.y = y;
5191 txgcd[k].gd.pos.width = 75;
5192 txgcd[k].gd.flags = gg_visible | gg_enabled;
5193 txgcd[k].gd.cid = CID_TeX + i;
5194 txgcd[k++].creator = GTextFieldCreate;
5195 txarray[j][1] = &txgcd[k-1]; txarray[j++][2] = NULL;
5196 y += 26;
5197 }
5198 txarray[j][0] = GCD_Glue; txarray[j][1] = GCD_Glue; txarray[j++][2] = NULL;
5199
5200 txgcd[k].gd.pos.x = 30-3; txgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
5201 txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
5202 txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
5203 txlabel[k].text = (unichar_t *) _("_OK");
5204 txlabel[k].text_is_1byte = true;
5205 txlabel[k].text_in_resource = true;
5206 txgcd[k].gd.label = &txlabel[k];
5207 txgcd[k].gd.cid = true;
5208 txgcd[k++].creator = GButtonCreate;
5209
5210 txgcd[k].gd.pos.x = -30; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+3;
5211 txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
5212 txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
5213 txlabel[k].text = (unichar_t *) _("_Cancel");
5214 txlabel[k].text_is_1byte = true;
5215 txlabel[k].text_in_resource = true;
5216 txgcd[k].gd.label = &txlabel[k];
5217 txgcd[k].gd.cid = false;
5218 txgcd[k++].creator = GButtonCreate;
5219
5220 barray[0] = barray[2] = barray[3] = barray[4] = barray[6] = GCD_Glue; barray[7] = NULL;
5221 barray[1] = &txgcd[k-2]; barray[5] = &txgcd[k-1];
5222 txarray[j][0] = &boxes[2]; txarray[j][1] = GCD_ColSpan; txarray[j++][2] = NULL;
5223 txarray[j][0] = NULL;
5224
5225 memset(boxes,0,sizeof(boxes));
5226 boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
5227 boxes[0].gd.flags = gg_enabled|gg_visible;
5228 boxes[0].gd.u.boxelements = txarray[0];
5229 boxes[0].creator = GHVGroupCreate;
5230
5231 boxes[2].gd.flags = gg_enabled|gg_visible;
5232 boxes[2].gd.u.boxelements = barray;
5233 boxes[2].creator = GHBoxCreate;
5234
5235 GGadgetsCreate(gw,boxes);
5236 GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
5237 GHVBoxSetExpandableRow(boxes[0].ret,gb_expandglue);
5238 GHVBoxFitWindow(boxes[0].ret);
5239 d->mpdone = false;
5240 GDrawSetVisible(gw,true);
5241
5242 while ( !d->mpdone )
5243 GDrawProcessOneEvent(NULL);
5244 GDrawDestroyWindow(gw);
5245 }
5246 return( true );
5247 }
5248
5249 static int GFI_TeXChanged(GGadget *g, GEvent *e) {
5250 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5251 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5252 GGadget *extrasp = GWidgetGetControl(d->gw,CID_TeXExtraSpLabel);
5253
5254 if ( GGadgetGetCid(g)==CID_TeXText ) {
5255 GGadgetSetTitle8(extrasp,
5256 /* GT: Extra Space */
5257 _("Extra Sp:"));
5258 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
5259 } else {
5260 GGadgetSetTitle8(extrasp, _("Math Sp:"));
5261 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),true);
5262 }
5263 /* In Polish we need to reflow the text after changing the label */
5264 GHVBoxReflow(GWidgetGetControl(d->gw,CID_TeXBox));
5265 }
5266 return( true );
5267 }
5268
5269 static void DefaultTeX(struct gfi_data *d) {
5270 char buffer[20];
5271 int i;
5272 SplineFont *sf = d->sf;
5273
5274 d->tex_set = true;
5275
5276 if ( sf->texdata.type==tex_unset ) {
5277 TeXDefaultParams(sf);
5278 d->texdata = sf->texdata;
5279 }
5280
5281 for ( i=0; i<7; ++i ) {
5282 sprintf( buffer,"%g", d->texdata.params[i]*(sf->ascent+sf->descent)/(double) (1<<20));
5283 GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeX+i),buffer);
5284 }
5285 if ( sf->texdata.type==tex_math )
5286 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathSym), true);
5287 else if ( sf->texdata.type == tex_mathext )
5288 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathExt), true);
5289 else {
5290 GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXText), true);
5291 GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
5292 /* GT: Extra Space */
5293 _("Extra Sp:"));
5294 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
5295 }
5296 }
5297
5298 static int GFI_MacAutomatic(GGadget *g, GEvent *e) {
5299 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5300 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5301 int autom = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic));
5302 GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MacStyles),!autom);
5303 }
5304 return( true );
5305 }
5306
5307 static void FigureUnicode(struct gfi_data *d) {
5308 int includeempties = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_UnicodeEmpties));
5309 GGadget *list = GWidgetGetControl(d->gw,CID_Unicode);
5310 struct rangeinfo *ri;
5311 int cnt, i;
5312 GTextInfo **ti;
5313 char buffer[200];
5314
5315 GGadgetClearList(list);
5316 ri = SFUnicodeRanges(d->sf,includeempties);
5317 if ( ri==NULL ) cnt=0;
5318 else
5319 for ( cnt=0; ri[cnt].range!=NULL; ++cnt );
5320
5321 ti = malloc((cnt+1) * sizeof( GTextInfo * ));
5322 for ( i=0; i<cnt; ++i ) {
5323 if ( ri[i].range->start==(unichar_t)-1 )
5324 snprintf( buffer, sizeof(buffer),
5325 "%s %d/0", _(ri[i].range->name), ri[i].cnt);
5326 else
5327 snprintf( buffer, sizeof(buffer),
5328 "%s U+%04X-U+%04X %d/%d",
5329 _(ri[i].range->name),
5330 (int) ri[i].range->start, (int) ri[i].range->end,
5331 ri[i].cnt, ri[i].range->num_assigned );
5332 ti[i] = calloc(1,sizeof(GTextInfo));
5333 ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
5334 ti[i]->text = utf82u_copy(buffer);
5335 ti[i]->userdata = (void*)ri[i].range;
5336 }
5337 ti[i] = calloc(1,sizeof(GTextInfo));
5338 GGadgetSetList(list,ti,false);
5339 free(ri);
5340 }
5341
5342 static int GFI_UnicodeRangeChange(GGadget *g, GEvent *e) {
5343 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5344 GTextInfo *ti = GGadgetGetListItemSelected(g);
5345 const struct unicode_range *r;
5346 int gid, first=-1;
5347 SplineFont *sf = d->sf;
5348 FontView *fv = (FontView *) (sf->fv);
5349 EncMap *map = fv->b.map;
5350 int i, enc;
5351
5352 if ( ti==NULL )
5353 return( true );
5354 if ( e->type!=et_controlevent ||
5355 (e->u.control.subtype != et_listselected &&e->u.control.subtype != et_listdoubleclick))
5356 return( true );
5357
5358 r = ti->userdata;
5359
5360 for ( i=0; i<map->enccount; ++i )
5361 fv->b.selected[i] = 0;
5362
5363 if ( e->u.control.subtype == et_listselected ) {
5364 for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
5365 enc = map->backmap[gid];
5366 if ( sf->glyphs[gid]->unicodeenc>=r->start && sf->glyphs[gid]->unicodeenc<=r->end &&
5367 enc!=-1 ) {
5368 if ( first==-1 || enc<first ) first = enc;
5369 fv->b.selected[enc] = true;
5370 }
5371 }
5372 } else if ( e->u.control.subtype == et_listdoubleclick && r->num_assigned>0 ) {
5373 char *found = calloc(r->end-r->start+1,1);
5374 for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
5375 int u = sf->glyphs[gid]->unicodeenc;
5376 if ( u>=r->start && u<=r->end ) {
5377 found[u-r->start] = true;
5378 }
5379 }
5380 for ( i=0; i<=r->end-r->start; ++i ) {
5381 if ( isunicodepointassigned(i+r->start) && !found[i] ) {
5382 enc = EncFromUni(i+r->start,map->enc);
5383 if ( enc!=-1 ) {
5384 if ( first==-1 || enc<first ) first = enc;
5385 fv->b.selected[enc] = true;
5386 }
5387 }
5388 }
5389 free(found);
5390 }
5391 if ( first==-1 ) {
5392 GDrawBeep(NULL);
5393 } else {
5394 FVScrollToChar(fv,first);
5395 }
5396 GDrawRequestExpose(fv->v,NULL,false);
5397 return( true );
5398 }
5399
5400 static int GFI_UnicodeEmptiesChange(GGadget *g, GEvent *e) {
5401 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5402 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5403 FigureUnicode(d);
5404 }
5405 return( true );
5406 }
5407
5408 static int GFI_AspectChange(GGadget *g, GEvent *e) {
5409 if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_radiochanged )) {
5410 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5411 int new_aspect = GTabSetGetSel(g);
5412 int rows;
5413
5414 if ( d->old_aspect == d->tn_aspect )
5415 GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
5416 if ( !d->ttf_set && new_aspect == d->ttfv_aspect )
5417 TTFSetup(d);
5418 else if ( !d->names_set && new_aspect == d->tn_aspect ) {
5419 TTFNames_Resort(d);
5420 d->names_set = true;
5421 } else if ( !d->tex_set && new_aspect == d->tx_aspect )
5422 DefaultTeX(d);
5423 else if ( new_aspect == d->unicode_aspect )
5424 FigureUnicode(d);
5425 d->old_aspect = new_aspect;
5426 }
5427 return( true );
5428 }
5429
5430 static int GFI_URangeAspectChange(GGadget *g, GEvent *e) {
5431 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5432 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5433 GTabSetSetSel(GWidgetGetControl(d->gw,CID_Tabs),d->ttfv_aspect);
5434 GFI_AspectChange(GWidgetGetControl(d->gw,CID_Tabs),NULL);
5435 GTabSetSetSel(GWidgetGetControl(d->gw,CID_TTFTabs),4);
5436 }
5437 return( true );
5438 }
5439
5440 static int e_h(GWindow gw, GEvent *event) {
5441 if ( event->type==et_close ) {
5442 struct gfi_data *d = GDrawGetUserData(gw);
5443 GFI_CancelClose(d);
5444 } else if ( event->type==et_destroy ) {
5445 struct gfi_data *d = GDrawGetUserData(gw);
5446 free(d);
5447 } else if ( event->type==et_char ) {
5448 return( GFI_Char(GDrawGetUserData(gw),event));
5449 }
5450 return( true );
5451 }
5452
5453 static int OS2_UnicodeChange(GGadget *g, GEvent *e) {
5454 int32_t flags[4];
5455 int len,i,bit,set;
5456
5457 if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_textchanged )) {
5458 const unichar_t *ret;
5459 unichar_t *end;
5460 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5461 GWindow gw = d->gw;
5462 GGadget *list;
5463
5464 ret = _GGadgetGetTitle(g);
5465 flags[3] = u_strtoul(ret,&end,16);
5466 while ( !ishexdigit(*end) && *end!='\0' ) ++end;
5467 flags[2] = u_strtoul(end,&end,16);
5468 while ( !ishexdigit(*end) && *end!='\0' ) ++end;
5469 flags[1] = u_strtoul(end,&end,16);
5470 while ( !ishexdigit(*end) && *end!='\0' ) ++end;
5471 flags[0] = u_strtoul(end,&end,16);
5472
5473 list = GWidgetGetControl(gw,CID_UnicodeList);
5474
5475 for ( i=0; unicoderangenames[i].text!=NULL; ++i ) {
5476 bit = (intptr_t) (unicoderangenames[i].userdata);
5477 set = (flags[bit>>5]&(1<<(bit&31)))?1 : 0;
5478 GGadgetSelectListItem(list,i,set);
5479 }
5480 } else if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
5481 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5482 GWindow gw = d->gw;
5483 char ranges[40];
5484 GTextInfo **list = GGadgetGetList(g,&len);
5485 GGadget *field = GWidgetGetControl(gw,CID_UnicodeRanges);
5486
5487 flags[0] = flags[1] = flags[2] = flags[3] = 0;
5488 for ( i=0; i<len; ++i )
5489 if ( list[i]->selected ) {
5490 bit = ((intptr_t) (list[i]->userdata));
5491 flags[bit>>5] |= (1<<(bit&31));
5492 }
5493
5494 sprintf( ranges, "%08x.%08x.%08x.%08x", flags[3], flags[2], flags[1], flags[0]);
5495 GGadgetSetTitle8(field,ranges);
5496 }
5497 return( true );
5498 }
5499
5500 static int OS2_URangesDefault(GGadget *g, GEvent *e) {
5501
5502 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5503 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5504 int def = GGadgetIsChecked(g);
5505 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),!def);
5506 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UnicodeList),!def);
5507 if ( def ) {
5508 SplineFont *sf = gfi->sf;
5509 char ranges[40];
5510 OS2FigureUnicodeRanges(sf,sf->pfminfo.unicoderanges);
5511 sprintf( ranges, "%08x.%08x.%08x.%08x",
5512 sf->pfminfo.unicoderanges[3], sf->pfminfo.unicoderanges[2],
5513 sf->pfminfo.unicoderanges[1], sf->pfminfo.unicoderanges[0]);
5514 GGadgetSetTitle8(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),ranges);
5515 OS2_UnicodeChange(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),NULL);
5516 }
5517 }
5518 return( true );
5519 }
5520
5521 static int OS2_CodePageChange(GGadget *g, GEvent *e) {
5522 int32_t flags[2];
5523 int len,i,bit,set;
5524
5525 if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_textchanged )) {
5526 const unichar_t *ret;
5527 unichar_t *end;
5528 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5529 GWindow gw = d->gw;
5530 GGadget *list;
5531
5532 ret = _GGadgetGetTitle(g);
5533 flags[1] = u_strtoul(ret,&end,16);
5534 while ( !ishexdigit(*end) && *end!='\0' ) ++end;
5535 flags[0] = u_strtoul(end,&end,16);
5536
5537 list = GWidgetGetControl(gw,CID_CodePageList);
5538
5539 for ( i=0; codepagenames[i].text!=NULL; ++i ) {
5540 bit = (intptr_t) (codepagenames[i].userdata);
5541 set = (flags[bit>>5]&(1<<(bit&31)))?1 : 0;
5542 GGadgetSelectListItem(list,i,set);
5543 }
5544 } else if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
5545 struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5546 GWindow gw = d->gw;
5547 char ranges[40];
5548 GTextInfo **list = GGadgetGetList(g,&len);
5549 GGadget *field = GWidgetGetControl(gw,CID_CodePageRanges);
5550
5551 flags[0] = flags[1] = 0;
5552 for ( i=0; i<len; ++i )
5553 if ( list[i]->selected ) {
5554 bit = ((intptr_t) (list[i]->userdata));
5555 flags[bit>>5] |= (1<<(bit&31));
5556 }
5557
5558 sprintf( ranges, "%08x.%08x", flags[1], flags[0]);
5559 GGadgetSetTitle8(field,ranges);
5560 }
5561 return( true );
5562 }
5563
5564 static int OS2_CPageDefault(GGadget *g, GEvent *e) {
5565
5566 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5567 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5568 int def = GGadgetIsChecked(g);
5569 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_CodePageRanges),!def);
5570 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_CodePageList),!def);
5571 if ( def ) {
5572 SplineFont *sf = gfi->sf;
5573 char codepages[40];
5574 OS2FigureCodePages(sf,sf->pfminfo.codepages);
5575 sprintf( codepages, "%08x.%08x",
5576 sf->pfminfo.codepages[1], sf->pfminfo.codepages[0]);
5577 GGadgetSetTitle8(GWidgetGetControl(gfi->gw,CID_CodePageRanges),codepages);
5578 OS2_CodePageChange(GWidgetGetControl(gfi->gw,CID_CodePageRanges),NULL);
5579 }
5580 }
5581 return( true );
5582 }
5583
5584 static int GFI_UseUniqueIDChanged(GGadget *g, GEvent *e) {
5585
5586 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5587 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5588 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UniqueID),
5589 GGadgetIsChecked(g));
5590 }
5591 return( true );
5592 }
5593
5594 static int GFI_UseXUIDChanged(GGadget *g, GEvent *e) {
5595
5596 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5597 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5598 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_XUID),
5599 GGadgetIsChecked(g));
5600 }
5601 return( true );
5602 }
5603
5604 static void LookupSetup(struct lkdata *lk,OTLookup *lookups) {
5605 int cnt, subcnt;
5606 OTLookup *otl;
5607 struct lookup_subtable *sub;
5608
5609 for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next );
5610 lk->cnt = cnt; lk->max = cnt+10;
5611 lk->all = calloc(lk->max,sizeof(struct lkinfo));
5612 for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next ) {
5613 lk->all[cnt].lookup = otl;
5614 for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next );
5615 lk->all[cnt].subtable_cnt = subcnt; lk->all[cnt].subtable_max = subcnt+10;
5616 lk->all[cnt].subtables = calloc(lk->all[cnt].subtable_max,sizeof(struct lksubinfo));
5617 for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next )
5618 lk->all[cnt].subtables[subcnt].subtable = sub;
5619 }
5620 }
5621
5622 static void LookupInfoFree(struct lkdata *lk) {
5623 int cnt;
5624
5625 for ( cnt=0; cnt<lk->cnt; ++cnt )
5626 free(lk->all[cnt].subtables);
5627 free(lk->all);
5628 }
5629
5630 #define LK_MARGIN 2
5631
5632 struct selection_bits {
5633 int lookup_cnt, sub_cnt; /* Number of selected lookups, and selected sub tables */
5634 int a_lookup, a_sub; /* The index of one of those lookups, or subtables */
5635 int a_sub_lookup; /* the index of the lookup containing a_sub */
5636 int any_first, any_last; /* Whether any of the selected items is first or last in its category */
5637 int sub_table_mergeable; /* Can we merge the selected subtables? */
5638 int lookup_mergeable; /* Can we merge the selected lookups? */
5639 };
5640
5641 static void LookupParseSelection(struct lkdata *lk, struct selection_bits *sel) {
5642 int lookup_cnt, sub_cnt, any_first, any_last, all_one_lookup;
5643 int a_lookup, a_sub, a_sub_lookup;
5644 int sub_mergeable, lookup_mergeable;
5645 int i,j;
5646
5647 lookup_cnt = sub_cnt = any_first = any_last = 0;
5648 all_one_lookup = a_lookup = a_sub = a_sub_lookup = -1;
5649 sub_mergeable = lookup_mergeable = true;
5650 for ( i=0; i<lk->cnt; ++i ) {
5651 if ( lk->all[i].deleted )
5652 continue;
5653 if ( lk->all[i].selected ) {
5654 ++lookup_cnt;
5655 if ( a_lookup==-1 )
5656 a_lookup = i;
5657 else if ( lk->all[i].lookup->lookup_type!=lk->all[a_lookup].lookup->lookup_type ||
5658 lk->all[i].lookup->lookup_flags!=lk->all[a_lookup].lookup->lookup_flags )
5659 lookup_mergeable = false;
5660 if ( i==0 ) any_first=true;
5661 if ( i==lk->cnt-1 ) any_last=true;
5662 }
5663 if ( lk->all[i].open ) {
5664 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5665 if ( lk->all[i].subtables[j].deleted )
5666 continue;
5667 if ( lk->all[i].subtables[j].selected ) {
5668 ++sub_cnt;
5669 if ( a_sub==-1 ) {
5670 a_sub = j; a_sub_lookup = i;
5671 }
5672 if ( j==0 ) any_first = true;
5673 if ( j==lk->all[i].subtable_cnt-1 ) any_last = true;
5674 if ( lk->all[i].subtables[j].subtable->kc!=NULL ||
5675 lk->all[i].subtables[j].subtable->fpst!=NULL ||
5676 lk->all[i].subtables[j].subtable->sm!=NULL )
5677 sub_mergeable = false;
5678 if ( all_one_lookup==-1 )
5679 all_one_lookup = i;
5680 else if ( all_one_lookup!=i )
5681 all_one_lookup = -2;
5682 }
5683 }
5684 }
5685 }
5686
5687 sel->lookup_cnt = lookup_cnt;
5688 sel->sub_cnt = sub_cnt;
5689 sel->a_lookup = a_lookup;
5690 sel->a_sub = a_sub;
5691 sel->a_sub_lookup = a_sub_lookup;
5692 sel->any_first = any_first;
5693 sel->any_last = any_last;
5694 sel->sub_table_mergeable = sub_mergeable && all_one_lookup>=0 && sub_cnt>=2 && lookup_cnt==0;
5695 sel->lookup_mergeable = lookup_mergeable && lookup_cnt>=2 && sub_cnt==0;
5696 }
5697
5698 static int LookupsImportable(SplineFont *sf,int isgpos) {
5699 FontView *ofv;
5700
5701 for ( ofv=fv_list; ofv!=NULL; ofv = (FontView *) (ofv->b.next) ) {
5702 SplineFont *osf = ofv->b.sf;
5703 if ( osf->cidmaster ) osf = osf->cidmaster;
5704 if ( osf==sf || sf->cidmaster==osf )
5705 continue;
5706 if ( (isgpos && osf->gpos_lookups!=NULL) || (!isgpos && osf->gsub_lookups!=NULL) )
5707 break;
5708 }
5709 return( ofv!=NULL );
5710 }
5711
5712 void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos) {
5713 struct lkdata *lk = &gfi->tables[isgpos];
5714 struct selection_bits sel;
5715
5716 LookupParseSelection(lk,&sel);
5717
5718 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupTop),!sel.any_first &&
5719 sel.lookup_cnt+sel.sub_cnt==1);
5720 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupUp),!sel.any_first &&
5721 sel.lookup_cnt+sel.sub_cnt!=0);
5722 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupDown),!sel.any_last &&
5723 sel.lookup_cnt+sel.sub_cnt!=0);
5724 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupBottom),!sel.any_last &&
5725 sel.lookup_cnt+sel.sub_cnt==1);
5726 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddLookup),
5727 (sel.lookup_cnt+sel.sub_cnt<=1));
5728 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddSubtable),
5729 (sel.lookup_cnt==1 && sel.sub_cnt<=1) || (sel.lookup_cnt==0 && sel.sub_cnt==1));
5730 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditMetadata),
5731 (sel.lookup_cnt==1 && sel.sub_cnt==0) ||
5732 (sel.lookup_cnt==0 && sel.sub_cnt==1));
5733 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditSubtable),sel.lookup_cnt==0 &&
5734 sel.sub_cnt==1);
5735 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_DeleteLookup),sel.lookup_cnt!=0 ||
5736 sel.sub_cnt!=0);
5737 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_MergeLookup),
5738 (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
5739 (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable));
5740 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_RevertLookups),true);
5741 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupSort),lk->cnt>1 );
5742
5743 GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_ImportLookups),
5744 LookupsImportable(gfi->sf,isgpos));
5745 }
5746
5747 void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh) {
5748 int lcnt, i,j;
5749 int width=0, wmax;
5750 GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
5751 struct lkdata *lk = &gfi->tables[isgpos];
5752 GGadget *vsb = GWidgetGetControl(gfi->gw,CID_LookupVSB+isgpos);
5753 GGadget *hsb = GWidgetGetControl(gfi->gw,CID_LookupHSB+isgpos);
5754 int off_top, off_left;
5755
5756 GDrawSetFont(gw,gfi->font);
5757 lcnt = 0;
5758 for ( i=0; i<lk->cnt; ++i ) {
5759 if ( lk->all[i].deleted )
5760 continue;
5761 ++lcnt;
5762 wmax = GDrawGetText8Width(gw,lk->all[i].lookup->lookup_name,-1);
5763 if ( wmax > width ) width = wmax;
5764 if ( lk->all[i].open ) {
5765 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5766 if ( lk->all[i].subtables[j].deleted )
5767 continue;
5768 ++lcnt;
5769 wmax = gfi->fh+GDrawGetText8Width(gw,lk->all[i].subtables[j].subtable->subtable_name,-1);
5770 if ( wmax > width ) width = wmax;
5771 }
5772 }
5773 }
5774 width += gfi->fh;
5775 GScrollBarSetBounds(vsb,0,lcnt,(gfi->lkheight-2*LK_MARGIN)/gfi->fh);
5776 GScrollBarSetBounds(hsb,0,width,gfi->lkwidth-2*LK_MARGIN);
5777 off_top = lk->off_top;
5778 if ( off_top+((gfi->lkheight-2*LK_MARGIN)/gfi->fh) > lcnt )
5779 off_top = lcnt - (gfi->lkheight-2*LK_MARGIN)/gfi->fh;
5780 if ( off_top<0 )
5781 off_top = 0;
5782 off_left = lk->off_left;
5783 if ( off_left+gfi->lkwidth-2*LK_MARGIN > width )
5784 off_left = width-(gfi->lkwidth-2*LK_MARGIN);
5785 if ( off_left<0 )
5786 off_left = 0;
5787 if ( off_top!=lk->off_top || off_left!=lk->off_left ) {
5788 lk->off_top = off_top; lk->off_left = off_left;
5789 GScrollBarSetPos(vsb,off_top);
5790 GScrollBarSetPos(hsb,off_left);
5791 refresh = true;
5792 }
5793 if ( refresh )
5794 GDrawRequestExpose(gw,NULL,false);
5795 }
5796
5797 static int LookupsHScroll(GGadget *g,GEvent *event) {
5798 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5799 int isgpos = GGadgetGetCid(g)-CID_LookupHSB;
5800 struct lkdata *lk = &gfi->tables[isgpos];
5801 int newpos = lk->off_left;
5802 int32_t sb_min, sb_max, sb_pagesize;
5803
5804 if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
5805 return( true );
5806
5807 GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
5808 switch( event->u.control.u.sb.type ) {
5809 case et_sb_top:
5810 newpos = 0;
5811 break;
5812 case et_sb_uppage:
5813 newpos -= 9*sb_pagesize/10;
5814 break;
5815 case et_sb_up:
5816 newpos -= sb_pagesize/15;
5817 break;
5818 case et_sb_down:
5819 newpos += sb_pagesize/15;
5820 break;
5821 case et_sb_downpage:
5822 newpos += 9*sb_pagesize/10;
5823 break;
5824 case et_sb_bottom:
5825 newpos = sb_max-sb_pagesize;
5826 break;
5827 case et_sb_thumb:
5828 case et_sb_thumbrelease:
5829 newpos = event->u.control.u.sb.pos;
5830 break;
5831 case et_sb_halfup:
5832 newpos -= sb_pagesize/30;
5833 break;
5834 case et_sb_halfdown:
5835 newpos += sb_pagesize/30;
5836 break;
5837 }
5838 if ( newpos>sb_max-sb_pagesize )
5839 newpos = sb_max-sb_pagesize;
5840 if ( newpos<0 ) newpos = 0;
5841 if ( newpos!=lk->off_left ) {
5842 lk->off_left = newpos;
5843 GScrollBarSetPos(event->u.control.g,newpos);
5844 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
5845 }
5846 return( true );
5847 }
5848
5849 static int LookupsVScroll(GGadget *g,GEvent *event) {
5850 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5851 int isgpos = GGadgetGetCid(g)-CID_LookupVSB;
5852 struct lkdata *lk = &gfi->tables[isgpos];
5853 int newpos = lk->off_top;
5854 int32_t sb_min, sb_max, sb_pagesize;
5855
5856 if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
5857 return( true );
5858
5859 GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
5860 switch( event->u.control.u.sb.type ) {
5861 case et_sb_top:
5862 newpos = 0;
5863 break;
5864 case et_sb_uppage:
5865 newpos -= 9*sb_pagesize/10;
5866 break;
5867 case et_sb_up:
5868 --newpos;
5869 break;
5870 case et_sb_down:
5871 ++newpos;
5872 break;
5873 case et_sb_downpage:
5874 newpos += 9*sb_pagesize/10;
5875 break;
5876 case et_sb_bottom:
5877 newpos = (sb_max-sb_pagesize);
5878 break;
5879 case et_sb_thumb:
5880 case et_sb_thumbrelease:
5881 newpos = event->u.control.u.sb.pos;
5882 break;
5883 case et_sb_halfup: case et_sb_halfdown: break;
5884 }
5885 if ( newpos>(sb_max-sb_pagesize) )
5886 newpos = (sb_max-sb_pagesize);
5887 if ( newpos<0 ) newpos = 0;
5888 if ( newpos!=lk->off_top ) {
5889 /*int diff = newpos-lk->off_top;*/
5890 lk->off_top = newpos;
5891 GScrollBarSetPos(event->u.control.g,newpos);
5892 /*GDrawScroll(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,0,diff*gfi->fh);*/
5893 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
5894 }
5895 return( true );
5896 }
5897
5898 static int GFI_LookupOrder(GGadget *g, GEvent *e) {
5899
5900 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5901 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5902 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
5903 struct lkdata *lk = &gfi->tables[isgpos];
5904 int i,j,k;
5905 struct lkinfo temp;
5906 struct lksubinfo temp2;
5907 int cid = GGadgetGetCid(g);
5908 GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
5909
5910 if ( cid==CID_LookupTop ) {
5911 for ( i=0; i<lk->cnt; ++i ) {
5912 if ( lk->all[i].deleted )
5913 continue;
5914 if ( lk->all[i].selected ) {
5915 temp = lk->all[i];
5916 for ( k=i-1; k>=0; --k )
5917 lk->all[k+1] = lk->all[k];
5918 lk->all[0] = temp;
5919 goto done;
5920 }
5921 if ( lk->all[i].open ) {
5922 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5923 if ( lk->all[i].subtables[j].deleted )
5924 continue;
5925 if ( lk->all[i].subtables[j].selected ) {
5926 temp2 = lk->all[i].subtables[j];
5927 for ( k=j-1; k>=0; --k )
5928 lk->all[i].subtables[k+1] = lk->all[i].subtables[k];
5929 lk->all[i].subtables[0] = temp2;
5930 goto done;
5931 }
5932 }
5933 }
5934 }
5935 } else if ( cid==CID_LookupBottom ) {
5936 for ( i=0; i<lk->cnt; ++i ) {
5937 if ( lk->all[i].deleted )
5938 continue;
5939 if ( lk->all[i].selected ) {
5940 temp = lk->all[i];
5941 for ( k=i; k<lk->cnt-1; ++k )
5942 lk->all[k] = lk->all[k+1];
5943 lk->all[lk->cnt-1] = temp;
5944 goto done;
5945 }
5946 if ( lk->all[i].open ) {
5947 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5948 if ( lk->all[i].subtables[j].deleted )
5949 continue;
5950 if ( lk->all[i].subtables[j].selected ) {
5951 temp2 = lk->all[i].subtables[j];
5952 for ( k=j; k<lk->all[i].subtable_cnt-1; ++k )
5953 lk->all[i].subtables[k] = lk->all[i].subtables[k+1];
5954 lk->all[i].subtables[lk->all[i].subtable_cnt-1] = temp2;
5955 goto done;
5956 }
5957 }
5958 }
5959 }
5960 } else if ( cid==CID_LookupUp ) {
5961 for ( i=0; i<lk->cnt; ++i ) {
5962 if ( lk->all[i].deleted )
5963 continue;
5964 if ( lk->all[i].selected && i!=0 ) {
5965 temp = lk->all[i];
5966 lk->all[i] = lk->all[i-1];
5967 lk->all[i-1] = temp;
5968 }
5969 if ( lk->all[i].open ) {
5970 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5971 if ( lk->all[i].subtables[j].deleted )
5972 continue;
5973 if ( lk->all[i].subtables[j].selected && j!=0 ) {
5974 temp2 = lk->all[i].subtables[j];
5975 lk->all[i].subtables[j] = lk->all[i].subtables[j-1];
5976 lk->all[i].subtables[j-1] = temp2;
5977 }
5978 }
5979 }
5980 }
5981 } else if ( cid==CID_LookupDown ) {
5982 for ( i=lk->cnt-1; i>=0; --i ) {
5983 if ( lk->all[i].deleted )
5984 continue;
5985 if ( lk->all[i].selected && i!=lk->cnt-1 ) {
5986 temp = lk->all[i];
5987 lk->all[i] = lk->all[i+1];
5988 lk->all[i+1] = temp;
5989 }
5990 if ( lk->all[i].open ) {
5991 for ( j=lk->all[i].subtable_cnt-1; j>=0; --j ) {
5992 if ( lk->all[i].subtables[j].deleted )
5993 continue;
5994 if ( lk->all[i].subtables[j].selected && j!=lk->all[i].subtable_cnt-1 ) {
5995 temp2 = lk->all[i].subtables[j];
5996 lk->all[i].subtables[j] = lk->all[i].subtables[j+1];
5997 lk->all[i].subtables[j+1] = temp2;
5998 }
5999 }
6000 }
6001 }
6002 }
6003 done:
6004 GFI_LookupEnableButtons(gfi,isgpos);
6005 GDrawRequestExpose(gw,NULL,false);
6006 }
6007 return( true );
6008 }
6009
6010 static int GFI_LookupSort(GGadget *g, GEvent *e) {
6011
6012 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6013 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6014 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6015 struct lkdata *lk = &gfi->tables[isgpos];
6016 struct lkinfo temp;
6017 int i,j;
6018
6019 for ( i=0; i<lk->cnt; ++i ) {
6020 int order = FeatureOrderId(isgpos,lk->all[i].lookup->features);
6021 for ( j=i+1; j<lk->cnt; ++j ) {
6022 int jorder = FeatureOrderId(isgpos,lk->all[j].lookup->features);
6023 if ( order>jorder) {
6024 temp = lk->all[i];
6025 lk->all[i] = lk->all[j];
6026 lk->all[j] = temp;
6027 order = jorder;
6028 }
6029 }
6030 }
6031 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
6032 GFI_LookupEnableButtons(gfi,isgpos);
6033 }
6034 return( true );
6035 }
6036
6037 /* ??? *//* How about a series of buttons to show only by lookup_type, feat-tag, script-tag */
6038
6039 void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success) {
6040 OTLookup *otl;
6041 struct lookup_subtable *sub, *prev;
6042 FPST *ftest, *fprev;
6043
6044 if ( !success ) {
6045 /* We can't allow incomplete FPSTs to float around */
6046 /* If they didn't fill it in, delete it */
6047 otl = fpst->subtable->lookup;
6048 prev = NULL;
6049 for ( sub=otl->subtables; sub!=NULL && sub!=fpst->subtable; prev = sub, sub=sub->next );
6050 if ( sub!=NULL ) {
6051 if ( prev==NULL )
6052 otl->subtables = sub->next;
6053 else
6054 prev->next = sub->next;
6055 free(sub->subtable_name);
6056 chunkfree(sub,sizeof(struct lookup_subtable));
6057 }
6058 fprev = NULL;
6059 for ( ftest=d->sf->possub; ftest!=NULL && ftest!=fpst; fprev = ftest, ftest=ftest->next );
6060 if ( ftest!=NULL ) {
6061 if ( fprev==NULL )
6062 d->sf->possub = fpst->next;
6063 else
6064 fprev->next = fpst->next;
6065 }
6066
6067 chunkfree(fpst,sizeof(FPST));
6068 }
6069 }
6070
6071 void GFI_FinishSMNew(struct gfi_data *d,ASM *sm, int success, int isnew) {
6072 OTLookup *otl;
6073 struct lookup_subtable *sub, *prev;
6074 ASM *smtest, *smprev;
6075
6076 if ( !success && isnew ) {
6077 /* We can't allow incomplete state machines floating around */
6078 /* If they didn't fill it in, delete it */
6079 otl = sm->subtable->lookup;
6080 prev = NULL;
6081 for ( sub=otl->subtables; sub!=NULL && sub!=sm->subtable; prev = sub, sub=sub->next );
6082 if ( sub!=NULL ) {
6083 if ( prev==NULL )
6084 otl->subtables = sub->next;
6085 else
6086 prev->next = sub->next;
6087 free(sub->subtable_name);
6088 chunkfree(sub,sizeof(struct lookup_subtable));
6089 }
6090 smprev = NULL;
6091 for ( smtest=d->sf->sm; smtest!=NULL && smtest!=sm; smprev = smtest, smtest=smtest->next );
6092 if ( smtest!=NULL ) {
6093 if ( smprev==NULL )
6094 d->sf->sm = sm->next;
6095 else
6096 smprev->next = sm->next;
6097 }
6098 chunkfree(sm,sizeof(ASM));
6099 }
6100 }
6101
6102 static void LookupSubtableContents(struct gfi_data *gfi,int isgpos) {
6103 struct lkdata *lk = &gfi->tables[isgpos];
6104 int i,j;
6105
6106 for ( i=0; i<lk->cnt; ++i ) {
6107 if ( lk->all[i].deleted )
6108 continue;
6109 if ( lk->all[i].open ) {
6110 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6111 if ( lk->all[i].subtables[j].deleted )
6112 continue;
6113 if ( lk->all[i].subtables[j].selected ) {
6114 _LookupSubtableContents(gfi->sf,lk->all[i].subtables[j].subtable,NULL,gfi->def_layer);
6115 return;
6116 }
6117 }
6118 }
6119 }
6120 }
6121
6122 static int GFI_LookupEditSubtableContents(GGadget *g, GEvent *e) {
6123
6124 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6125 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6126 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6127 LookupSubtableContents(gfi,isgpos);
6128 }
6129 return( true );
6130 }
6131
6132 static int GFI_LookupAddLookup(GGadget *g, GEvent *e) {
6133
6134 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6135 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6136 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6137 struct lkdata *lk = &gfi->tables[isgpos];
6138 int i,j,k,lcnt;
6139 OTLookup *otl = chunkalloc(sizeof(OTLookup)), *test;
6140
6141 k = 0;
6142 for ( test = isgpos ? gfi->sf->gpos_lookups : gfi->sf->gsub_lookups;
6143 test!=NULL; test = test->next )
6144 ++k;
6145 otl->lookup_index = k;
6146
6147 if ( !EditLookup(otl,isgpos,gfi->sf)) {
6148 chunkfree(otl,sizeof(OTLookup));
6149 return( true );
6150 }
6151 for ( i=lk->cnt-1; i>=0; --i ) {
6152 if ( !lk->all[i].deleted && lk->all[i].selected ) {
6153 lk->all[i].selected = false;
6154 break;
6155 }
6156 if ( !lk->all[i].deleted && lk->all[i].open ) {
6157 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6158 if ( !lk->all[i].subtables[j].deleted &&
6159 lk->all[i].subtables[j].selected ) {
6160 lk->all[i].subtables[j].selected = false;
6161 break;
6162 }
6163 if ( j<lk->all[i].subtable_cnt )
6164 break;
6165 }
6166 }
6167 if ( lk->cnt>=lk->max )
6168 lk->all = realloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
6169 for ( k=lk->cnt; k>i+1; --k )
6170 lk->all[k] = lk->all[k-1];
6171 memset(&lk->all[k],0,sizeof(struct lkinfo));
6172 lk->all[k].lookup = otl;
6173 lk->all[k].isnew = true;
6174 lk->all[k].selected = true;
6175 ++lk->cnt;
6176 if ( isgpos ) {
6177 otl->next = gfi->sf->gpos_lookups;
6178 gfi->sf->gpos_lookups = otl;
6179 } else {
6180 otl->next = gfi->sf->gsub_lookups;
6181 gfi->sf->gsub_lookups = otl;
6182 }
6183
6184 /* Make sure the window is scrolled to display the new lookup */
6185 lcnt=0;
6186 for ( i=0; i<lk->cnt; ++i ) {
6187 if ( lk->all[i].deleted )
6188 continue;
6189 if ( i==k )
6190 break;
6191 ++lcnt;
6192 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6193 if ( lk->all[i].subtables[j].deleted )
6194 continue;
6195 ++lcnt;
6196 }
6197 }
6198 if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
6199 lk->off_top = lcnt;
6200
6201 GFI_LookupScrollbars(gfi,isgpos, true);
6202 GFI_LookupEnableButtons(gfi,isgpos);
6203 }
6204 return( true );
6205 }
6206
6207 static int GFI_LookupAddSubtable(GGadget *g, GEvent *e) {
6208
6209 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6210 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6211 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6212 struct lkdata *lk = &gfi->tables[isgpos];
6213 int i,j,k,lcnt;
6214 struct lookup_subtable *sub;
6215
6216 lcnt = 0;
6217 for ( i=0; i<lk->cnt; ++i ) {
6218 if ( lk->all[i].deleted )
6219 continue;
6220 j = -1;
6221 ++lcnt;
6222 if ( lk->all[i].selected )
6223 break;
6224 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6225 if ( lk->all[i].subtables[j].deleted )
6226 continue;
6227 ++lcnt;
6228 if ( lk->all[i].subtables[j].selected )
6229 goto break_2_loops;
6230 }
6231 }
6232 break_2_loops:
6233 if ( i==lk->cnt )
6234 return( true );
6235
6236 sub = chunkalloc(sizeof(struct lookup_subtable));
6237 sub->lookup = lk->all[i].lookup;
6238 if ( !EditSubtable(sub,isgpos,gfi->sf,NULL,gfi->def_layer)) {
6239 chunkfree(sub,sizeof(struct lookup_subtable));
6240 return( true );
6241 }
6242 if ( lk->all[i].subtable_cnt>=lk->all[i].subtable_max )
6243 lk->all[i].subtables = realloc(lk->all[i].subtables,(lk->all[i].subtable_max+=10)*sizeof(struct lksubinfo));
6244 for ( k=lk->all[i].subtable_cnt; k>j+1; --k )
6245 lk->all[i].subtables[k] = lk->all[i].subtables[k-1];
6246 memset(&lk->all[i].subtables[k],0,sizeof(struct lksubinfo));
6247 lk->all[i].subtables[k].subtable = sub;
6248 lk->all[i].subtables[k].isnew = true;
6249 sub->next = lk->all[i].lookup->subtables;
6250 lk->all[i].lookup->subtables = sub;
6251 ++lk->all[i].subtable_cnt;
6252
6253 /* Make sure the window is scrolled to display the new subtable */
6254 if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
6255 lk->off_top = lcnt;
6256
6257 GFI_LookupScrollbars(gfi,isgpos, true);
6258 GFI_LookupEnableButtons(gfi,isgpos);
6259 }
6260 return( true );
6261 }
6262
6263 static int GFI_LookupEditMetadata(GGadget *g, GEvent *e) {
6264
6265 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6266 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6267 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6268 struct lkdata *lk = &gfi->tables[isgpos];
6269 int i,j;
6270
6271 for ( i=0; i<lk->cnt; ++i ) {
6272 if ( lk->all[i].deleted )
6273 continue;
6274 if ( lk->all[i].selected ) {
6275 EditLookup(lk->all[i].lookup,isgpos,gfi->sf);
6276 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
6277 return( true );
6278 } else if ( lk->all[i].open ) {
6279 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6280 if ( lk->all[i].subtables[j].deleted )
6281 continue;
6282 if ( lk->all[i].subtables[j].selected ) {
6283 EditSubtable(lk->all[i].subtables[j].subtable,isgpos,gfi->sf,NULL,gfi->def_layer);
6284 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
6285 return( true );
6286 }
6287 }
6288 }
6289 }
6290 }
6291 return( true );
6292 }
6293
6294 static int GFI_LookupMergeLookup(GGadget *g, GEvent *e) {
6295
6296 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6297 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6298 char *buts[3];
6299 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6300 struct lkdata *lk = &gfi->tables[isgpos];
6301 struct selection_bits sel;
6302 int i,j;
6303 struct lkinfo *lkfirst;
6304 struct lksubinfo *sbfirst;
6305 struct lookup_subtable *sub;
6306
6307 LookupParseSelection(lk,&sel);
6308 if ( !sel.sub_table_mergeable && !sel.lookup_mergeable )
6309 return( true );
6310
6311 buts[0] = _("Do it");
6312 buts[1] = _("_Cancel");
6313 buts[2] = NULL;
6314 if ( gwwv_ask(_("Cannot be Undone"),(const char **) buts,0,1,_("The Merge operation cannot be reverted.\nDo it anyway?"))==1 )
6315 return( true );
6316 if ( sel.lookup_mergeable ) {
6317 lkfirst = NULL;
6318 for ( i=0; i<lk->cnt; ++i ) {
6319 if ( lk->all[i].selected && !lk->all[i].deleted ) {
6320 if ( lkfirst==NULL )
6321 lkfirst = &lk->all[i];
6322 else {
6323 FLMerge(lkfirst->lookup,lk->all[i].lookup);
6324 if ( lkfirst->subtable_cnt+lk->all[i].subtable_cnt >= lkfirst->subtable_max )
6325 lkfirst->subtables = realloc(lkfirst->subtables,(lkfirst->subtable_max+=lk->all[i].subtable_cnt)*sizeof(struct lksubinfo));
6326 memcpy(lkfirst->subtables+lkfirst->subtable_cnt,
6327 lk->all[i].subtables,lk->all[i].subtable_cnt*sizeof(struct lksubinfo));
6328 lkfirst->subtable_cnt += lk->all[i].subtable_cnt;
6329 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6330 lk->all[i].subtables[j].subtable->lookup = lkfirst->lookup;
6331 if ( lk->all[i].lookup->subtables!=NULL ) {
6332 for ( sub = lk->all[i].lookup->subtables; sub->next!=NULL; sub = sub->next );
6333 sub->next = lkfirst->lookup->subtables;
6334 lkfirst->lookup->subtables = lk->all[i].lookup->subtables;
6335 lk->all[i].lookup->subtables = NULL;
6336 }
6337 lk->all[i].subtable_cnt = 0;
6338 lk->all[i].deleted = true;
6339 lk->all[i].open = false;
6340 lk->all[i].selected = false;
6341 }
6342 }
6343 }
6344 } else if ( sel.sub_table_mergeable ) {
6345 sbfirst = NULL;
6346 for ( i=0; i<lk->cnt; ++i ) if ( !lk->all[i].deleted && lk->all[i].open ) {
6347 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) if ( !lk->all[i].subtables[j].deleted ) {
6348 if ( lk->all[i].subtables[j].selected ) {
6349 if ( sbfirst == NULL )
6350 sbfirst = &lk->all[i].subtables[j];
6351 else {
6352 SFSubTablesMerge(gfi->sf,sbfirst->subtable,lk->all[i].subtables[j].subtable);
6353 lk->all[i].subtables[j].deleted = true;
6354 lk->all[i].subtables[j].selected = false;
6355 }
6356 }
6357 }
6358 if ( sbfirst!=NULL ) /* Can only merge subtables within a lookup, so if we found anything, in a lookup that's everything */
6359 break;
6360 }
6361 }
6362 GFI_LookupScrollbars(gfi,isgpos, true);
6363 GFI_LookupEnableButtons(gfi,isgpos);
6364 }
6365 return( true );
6366 }
6367
6368 static int GFI_LookupDeleteLookup(GGadget *g, GEvent *e) {
6369
6370 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6371 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6372 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6373 struct lkdata *lk = &gfi->tables[isgpos];
6374 int i,j;
6375
6376 for ( i=0; i<lk->cnt; ++i ) {
6377 if ( lk->all[i].deleted )
6378 continue;
6379 if ( lk->all[i].selected )
6380 lk->all[i].deleted = true;
6381 else if ( lk->all[i].open ) {
6382 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6383 if ( lk->all[i].subtables[j].deleted )
6384 continue;
6385 if ( lk->all[i].subtables[j].selected )
6386 lk->all[i].subtables[j].deleted = true;
6387 }
6388 }
6389 }
6390
6391 GFI_LookupScrollbars(gfi,isgpos, true);
6392 GFI_LookupEnableButtons(gfi,isgpos);
6393 }
6394
6395 return( true );
6396 }
6397
6398 static int GFI_LookupRevertLookup(GGadget *g, GEvent *e) {
6399
6400 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6401 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6402 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6403 struct lkdata *lk = &gfi->tables[isgpos];
6404 int i,j;
6405
6406 /* First remove any new lookups, subtables */
6407 for ( i=0; i<lk->cnt; ++i ) {
6408 if ( lk->all[i].isnew )
6409 SFRemoveLookup(gfi->sf,lk->all[i].lookup,0);
6410 else {
6411 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6412 if ( lk->all[i].subtables[j].isnew )
6413 SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable,0);
6414 }
6415 }
6416
6417 /* Now since we didn't actually delete anything we don't need to do */
6418 /* anything to resurrect them */
6419
6420 /* Finally we need to restore the original order. */
6421 /* But that just means regenerating the lk structure. So free it and */
6422 /* regenerate it */
6423
6424 LookupInfoFree(lk);
6425 LookupSetup(lk,isgpos?gfi->sf->gpos_lookups:gfi->sf->gsub_lookups);
6426
6427 GFI_LookupScrollbars(gfi,isgpos, true);
6428 GFI_LookupEnableButtons(gfi,isgpos);
6429 }
6430 return( true );
6431 }
6432
6433 static int import_e_h(GWindow gw, GEvent *event) {
6434 int *done = GDrawGetUserData(gw);
6435
6436 if ( event->type==et_close ) {
6437 *done = true;
6438 } else if ( event->type==et_char ) {
6439 if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
6440 help("ui/dialogs/fontinfo.html", "#fontinfo-lookups");
6441 return( true );
6442 }
6443 return( false );
6444 } else if ( event->type==et_controlevent ) {
6445 if ( event->u.control.subtype == et_buttonactivate ) {
6446 switch ( GGadgetGetCid(event->u.control.g)) {
6447 case CID_OK:
6448 *done = 2;
6449 break;
6450 case CID_Cancel:
6451 *done = true;
6452 break;
6453 }
6454 } else if ( event->u.control.subtype == et_listdoubleclick )
6455 *done = 2;
6456 }
6457 return( true );
6458 }
6459
6460 static int GFI_LookupImportLookup(GGadget *g, GEvent *e) {
6461
6462 if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6463 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6464 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6465 FontView *ofv;
6466 SplineFont *osf;
6467 OTLookup *otl;
6468 int i, j, cnt;
6469 GTextInfo *ti;
6470 GGadgetCreateData gcd[7], *varray[8], *harray[7];
6471 GTextInfo label[7];
6472 GWindowAttrs wattrs;
6473 GRect pos;
6474 GWindow gw;
6475 int done = 0;
6476
6477 /* Figure out what lookups can be imported from which (open) fonts */
6478 ti = NULL;
6479 for ( j=0; j<2; ++j ) {
6480 for ( ofv=fv_list; ofv!=NULL; ofv=(FontView *) (ofv->b.next) ) {
6481 osf = ofv->b.sf;
6482 if ( osf->cidmaster ) osf = osf->cidmaster;
6483 osf->ticked = false;
6484 }
6485 cnt = 0;
6486 for ( ofv=fv_list; ofv!=NULL; ofv=(FontView *) (ofv->b.next) ) {
6487 osf = ofv->b.sf;
6488 if ( osf->cidmaster ) osf = osf->cidmaster;
6489 if ( osf->ticked || osf==gfi->sf || osf==gfi->sf->cidmaster ||
6490 ( isgpos && osf->gpos_lookups==NULL) ||
6491 (!isgpos && osf->gsub_lookups==NULL) )
6492 continue;
6493 osf->ticked = true;
6494 if ( cnt!=0 ) {
6495 if ( ti )
6496 ti[cnt].line = true;
6497 ++cnt;
6498 }
6499 if ( ti ) {
6500 ti[cnt].text = (unichar_t *) copy( osf->fontname );
6501 ti[cnt].text_is_1byte = true;
6502 ti[cnt].disabled = true;
6503 ti[cnt].userdata = osf;
6504 }
6505 ++cnt;
6506 for ( otl = isgpos ? osf->gpos_lookups : osf->gsub_lookups; otl!=NULL; otl=otl->next ) {
6507 if ( ti ) {
6508 ti[cnt].text = (unichar_t *) strconcat( " ", otl->lookup_name );
6509 ti[cnt].text_is_1byte = true;
6510 ti[cnt].userdata = otl;
6511 }
6512 ++cnt;
6513 }
6514 }
6515 if ( ti==NULL )
6516 ti = calloc((cnt+1),sizeof(GTextInfo));
6517 }
6518
6519 memset(gcd,0,sizeof(gcd));
6520 memset(label,0,sizeof(label));
6521
6522 i = 0;
6523 label[i].text = (unichar_t *) _("Select lookups from other fonts");
6524 label[i].text_is_1byte = true;
6525 label[i].text_in_resource = true;
6526 gcd[i].gd.label = &label[i];
6527 gcd[i].gd.pos.x = 12; gcd[i].gd.pos.y = 6+6;
6528 gcd[i].gd.flags = gg_visible | gg_enabled;
6529 gcd[i].creator = GLabelCreate;
6530 varray[0] = &gcd[i++]; varray[1] = NULL;
6531
6532 gcd[i].gd.pos.height = 12*12+6;
6533 gcd[i].gd.flags = gg_enabled|gg_visible|gg_list_multiplesel;
6534 gcd[i].gd.u.list = ti;
6535 gcd[i].creator = GListCreate;
6536 varray[2] = &gcd[i++]; varray[3] = NULL;
6537
6538 gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
6539 label[i].text = (unichar_t *) _("_Import");
6540 label[i].text_is_1byte = true;
6541 label[i].text_in_resource = true;
6542 gcd[i].gd.label = &label[i];
6543 gcd[i].gd.cid = CID_OK;
6544 harray[0] = GCD_Glue; harray[1] = &gcd[i]; harray[2] = GCD_Glue;
6545 gcd[i++].creator = GButtonCreate;
6546
6547 gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
6548 label[i].text = (unichar_t *) _("_Cancel");
6549 label[i].text_is_1byte = true;
6550 label[i].text_in_resource = true;
6551 gcd[i].gd.label = &label[i];
6552 gcd[i].gd.cid = CID_Cancel;
6553 harray[3] = GCD_Glue; harray[4] = &gcd[i]; harray[5] = GCD_Glue; harray[6] = NULL;
6554 gcd[i++].creator = GButtonCreate;
6555
6556 gcd[i].gd.flags = gg_enabled|gg_visible;
6557 gcd[i].gd.u.boxelements = harray;
6558 gcd[i].creator = GHBoxCreate;
6559 varray[4] = &gcd[i++]; varray[5] = NULL; varray[6] = NULL;
6560
6561 gcd[i].gd.pos.x = gcd[i].gd.pos.y = 2;
6562 gcd[i].gd.flags = gg_enabled|gg_visible;
6563 gcd[i].gd.u.boxelements = varray;
6564 gcd[i].creator = GHVGroupCreate;
6565
6566 memset(&wattrs,0,sizeof(wattrs));
6567 wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
6568 wattrs.event_masks = ~(1<<et_charup);
6569 wattrs.restrict_input_to_me = 1;
6570 wattrs.undercursor = 1;
6571 wattrs.cursor = ct_pointer;
6572 wattrs.utf8_window_title = _("Import Lookup");
6573 wattrs.is_dlg = true;
6574 pos.x = pos.y = 0;
6575 pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
6576 pos.height = GDrawPointsToPixels(NULL,193);
6577 gw = GDrawCreateTopWindow(NULL,&pos,import_e_h,&done,&wattrs);
6578
6579 GGadgetsCreate(gw,&gcd[i]);
6580 GHVBoxSetExpandableRow(gcd[i].ret,1);
6581 GHVBoxSetExpandableCol(gcd[i-1].ret,gb_expandgluesame);
6582 GHVBoxFitWindow(gcd[i].ret);
6583 GTextInfoListFree(ti);
6584 GDrawSetVisible(gw,true);
6585
6586 while ( !done )
6587 GDrawProcessOneEvent(NULL);
6588 if ( done==2 ) {
6589 int32_t len;
6590 GTextInfo **ti = GGadgetGetList(gcd[1].ret,&len);
6591 OTLookup **list = malloc((len+1)*sizeof(OTLookup*));
6592 struct lkdata *lk = &gfi->tables[isgpos];
6593 OTLookup *before = NULL;
6594
6595 for ( i=0; i<lk->cnt; ++i ) {
6596 if ( lk->all[i].deleted )
6597 continue;
6598 if ( lk->all[i].selected ) {
6599 before = lk->all[i].lookup;
6600 break;
6601 }
6602 }
6603 osf = NULL;
6604 for ( i=0; i<len; ++i ) {
6605 if ( ti[i]->disabled )
6606 osf = ti[i]->userdata;
6607 else if ( ti[i]->selected && ti[i]->text!=NULL ) {
6608 for ( j=0; i+j<len && !ti[i+j]->disabled &&
6609 ti[i+j]->selected && ti[i+j]->text; ++j )
6610 list[j] = (OTLookup *) ti[i+j]->userdata;
6611 list[j] = NULL;
6612 OTLookupsCopyInto(gfi->sf,osf,list,before);
6613 i += j-1;
6614 }
6615 }
6616 free(list);
6617 }
6618 GDrawDestroyWindow(gw);
6619
6620 GFI_LookupScrollbars(gfi,isgpos, true);
6621 GFI_LookupEnableButtons(gfi,isgpos);
6622 }
6623 return( true );
6624 }
6625
6626 static int GFI_LookupAspectChange(GGadget *g, GEvent *e) {
6627
6628 if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
6629 struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6630 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6631 GFI_LookupEnableButtons(gfi,isgpos);
6632 }
6633 return( true );
6634 }
6635
6636 static void LookupExpose(GWindow pixmap, struct gfi_data *gfi, int isgpos) {
6637 int lcnt, i,j;
6638 struct lkdata *lk = &gfi->tables[isgpos];
6639 GRect r, old;
6640 extern GBox _ggadget_Default_Box;
6641
6642 r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6643 r.y = LK_MARGIN; r.height = gfi->lkheight-2*LK_MARGIN;
6644 GDrawPushClip(pixmap,&r,&old);
6645 GDrawSetFont(pixmap,gfi->font);
6646
6647 lcnt = 0;
6648 for ( i=0; i<lk->cnt; ++i ) {
6649 if ( lk->all[i].deleted )
6650 continue;
6651 if ( lcnt>=lk->off_top ) {
6652 if ( lk->all[i].selected ) {
6653 r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6654 r.y = (lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
6655 GDrawFillRect(pixmap,&r,ACTIVE_BORDER);
6656 }
6657 r.x = LK_MARGIN-lk->off_left; r.width = (gfi->as&~1);
6658 r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = r.width;
6659 GDrawDrawRect(pixmap,&r,MAIN_FOREGROUND);
6660 GDrawDrawLine(pixmap,r.x+2,r.y+(r.height/2), r.x+r.width-2,r.y+(r.height/2), MAIN_FOREGROUND);
6661 if ( !lk->all[i].open )
6662 GDrawDrawLine(pixmap,r.x+(r.width/2),r.y+2, r.x+(r.width/2),r.y+r.height-2, MAIN_FOREGROUND);
6663 GDrawDrawText8(pixmap,r.x+gfi->fh, r.y+gfi->as,
6664 lk->all[i].lookup->lookup_name,-1,MAIN_FOREGROUND);
6665 }
6666 ++lcnt;
6667 if ( lk->all[i].open ) {
6668 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6669 if ( lk->all[i].subtables[j].deleted )
6670 continue;
6671 if ( lcnt>=lk->off_top ) {
6672 if ( lk->all[i].subtables[j].selected ) {
6673 r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6674 r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
6675 GDrawFillRect(pixmap,&r,ACTIVE_BORDER);
6676 }
6677 r.x = LK_MARGIN+2*gfi->fh-lk->off_left;
6678 r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh;
6679 GDrawDrawText8(pixmap,r.x, r.y+gfi->as,
6680 lk->all[i].subtables[j].subtable->subtable_name,-1,MAIN_FOREGROUND);
6681 }
6682 ++lcnt;
6683 }
6684 }
6685 }
6686 GDrawPopClip(pixmap,&old);
6687 }
6688
6689 static void LookupDeselect(struct lkdata *lk) {
6690 int i,j;
6691
6692 for ( i=0; i<lk->cnt; ++i ) {
6693 lk->all[i].selected = false;
6694 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6695 lk->all[i].subtables[j].selected = false;
6696 }
6697 }
6698
6699 static void LookupPopup(GWindow gw,OTLookup *otl,struct lookup_subtable *sub,
6700 struct lkdata *lk) {
6701 static char popup_msg[600];
6702 int pos;
6703 char *lookuptype;
6704 FeatureScriptLangList *fl;
6705 struct scriptlanglist *sl;
6706 int l;
6707
6708 if ( (otl->lookup_type&0xff)>= 0xf0 ) {
6709 if ( otl->lookup_type==kern_statemachine )
6710 lookuptype = _("Kerning State Machine");
6711 else if ( otl->lookup_type==morx_indic )
6712 lookuptype = _("Indic State Machine");
6713 else if ( otl->lookup_type==morx_context )
6714 lookuptype = _("Contextual State Machine");
6715 else
6716 lookuptype = _("Contextual State Machine");
6717 } else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
6718 lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
6719 else
6720 lookuptype = S_("LookupType|Unknown");
6721 snprintf(popup_msg,sizeof(popup_msg), "%s\n", lookuptype);
6722 pos = strlen(popup_msg);
6723
6724 if ( sub!=NULL && otl->lookup_type==gpos_pair && sub->kc!=NULL ) {
6725 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%s",_("(kerning class)\n") );
6726 pos += strlen( popup_msg+pos );
6727 }
6728
6729 if ( otl->features==NULL )
6730 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%s",_("Not attached to a feature"));
6731 else {
6732 for ( fl=otl->features; fl!=NULL && pos<sizeof(popup_msg)-2; fl=fl->next ) {
6733 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c: ",
6734 fl->featuretag>>24, fl->featuretag>>16,
6735 fl->featuretag>>8, fl->featuretag&0xff );
6736 pos += strlen( popup_msg+pos );
6737 for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
6738 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c{",
6739 sl->script>>24, sl->script>>16,
6740 sl->script>>8, sl->script&0xff );
6741 pos += strlen( popup_msg+pos );
6742 for ( l=0; l<sl->lang_cnt; ++l ) {
6743 uint32_t lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
6744 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c,",
6745 lang>>24, lang>>16,
6746 lang>>8, lang&0xff );
6747 pos += strlen( popup_msg+pos );
6748 }
6749 if ( popup_msg[pos-1]==',' )
6750 popup_msg[pos-1] = '}';
6751 else if ( pos<sizeof(popup_msg)-2 )
6752 popup_msg[pos++] = '}';
6753 if ( pos<sizeof(popup_msg)-2 )
6754 popup_msg[pos++] = ' ';
6755 }
6756 if ( pos<sizeof(popup_msg)-2 )
6757 popup_msg[pos++] = '\n';
6758 }
6759 }
6760
6761 /* Find out if any other lookups invoke it (ie. a context lookup invokes */
6762 /* does it invoke ME?) */
6763 for ( l=0; l<lk->cnt; ++l ) {
6764 int j, r, used = false;
6765 if ( lk->all[l].deleted )
6766 continue;
6767 for ( j=0; j<lk->all[l].subtable_cnt && !used; ++j ) {
6768 struct lookup_subtable *sub = lk->all[l].subtables[j].subtable;
6769 if ( lk->all[l].subtables[j].deleted )
6770 continue;
6771 if ( sub->fpst!=NULL ) {
6772 for ( r=0; r<sub->fpst->rule_cnt && !used; ++r ) {
6773 struct fpst_rule *rule = &sub->fpst->rules[r];
6774 int ls;
6775 for ( ls = 0; ls<rule->lookup_cnt; ++ls ) {
6776 if ( rule->lookups[ls].lookup == otl ) {
6777 used = true;
6778 break;
6779 }
6780 }
6781 }
6782 }
6783 }
6784 if ( used ) {
6785 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_(" Used in %s\n"),
6786 lk->all[l].lookup->lookup_name );
6787 pos += strlen( popup_msg+pos );
6788 }
6789 }
6790
6791 if ( pos>=sizeof(popup_msg) )
6792 pos = sizeof(popup_msg)-1;
6793 popup_msg[pos]='\0';
6794 GGadgetPreparePopup8(gw,popup_msg);
6795 }
6796
6797 static void AddDFLT(OTLookup *otl) {
6798 FeatureScriptLangList *fl;
6799 struct scriptlanglist *sl;
6800 int l;
6801
6802 for ( fl = otl->features; fl!=NULL; fl=fl->next ) {
6803 int hasDFLT = false, hasdflt=false;
6804 for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
6805 if ( sl->script == DEFAULT_SCRIPT )
6806 hasDFLT = true;
6807 for ( l=0; l<sl->lang_cnt; ++l ) {
6808 uint32_t lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
6809 if ( lang==DEFAULT_LANG ) {
6810 hasdflt = true;
6811 break;
6812 }
6813 }
6814 if ( hasdflt && hasDFLT )
6815 break;
6816 }
6817 if ( hasDFLT /* Already there */ ||
6818 !hasdflt /* Shouldn't add it */ )
6819 continue;
6820 sl = chunkalloc(sizeof(struct scriptlanglist));
6821 sl->script = DEFAULT_SCRIPT;
6822 sl->lang_cnt = 1;
6823 sl->langs[0] = DEFAULT_LANG;
6824 sl->next = fl->scripts;
6825 fl->scripts = sl;
6826 }
6827 }
6828
6829 static void AALTRemoveOld(SplineFont *sf,struct lkdata *lk) {
6830 int i;
6831 FeatureScriptLangList *fl, *prev;
6832
6833 for ( i=0; i<lk->cnt; ++i ) {
6834 if ( lk->all[i].deleted )
6835 continue;
6836 prev = NULL;
6837 for ( fl = lk->all[i].lookup->features; fl!=NULL; prev=fl, fl=fl->next ) {
6838 if ( fl->featuretag==CHR('a','a','l','t') ) {
6839 if ( fl==lk->all[i].lookup->features && fl->next==NULL && !LookupUsedNested(sf,lk->all[i].lookup) )
6840 lk->all[i].deleted = true;
6841 else {
6842 if ( prev==NULL )
6843 lk->all[i].lookup->features = fl->next;
6844 else
6845 prev->next = fl->next;
6846 fl->next = NULL;
6847 FeatureScriptLangListFree(fl);
6848 }
6849 break;
6850 }
6851 }
6852 }
6853 }
6854
6855 static void AALTCreateNew(SplineFont *sf, struct lkdata *lk) {
6856 /* different script/lang combinations may need different 'aalt' lookups */
6857 /* well, let's just say different script combinations */
6858 /* for each script/lang combo find all single/alternate subs for each */
6859 /* glyph. Merge those choices and create new lookup with that info */
6860 struct sllk *sllk = NULL;
6861 int sllk_cnt=0, sllk_max = 0;
6862 int i,k;
6863 OTLookup *otl;
6864
6865 /* Find all scripts, and all the single/alternate lookups for each */
6866 /* and all the languages used for these in each script */
6867 for ( i=0; i<lk->cnt; ++i ) {
6868 if ( lk->all[i].deleted )
6869 continue;
6870 sllk = AddOTLToSllks( lk->all[i].lookup, sllk, &sllk_cnt, &sllk_max );
6871 }
6872 /* Each of these gets its own gsub_alternate lookup which gets inserted */
6873 /* at the head of the lookup list. Each lookup has one subtable */
6874 for ( i=0; i<sllk_cnt; ++i ) {
6875 if ( sllk[i].cnt==0 ) /* Script used, but provides no alternates */
6876 continue;
6877 otl = NewAALTLookup(sf,sllk,sllk_cnt,i);
6878 if ( lk->cnt>=lk->max )
6879 lk->all = realloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
6880 for ( k=lk->cnt; k>0; --k )
6881 lk->all[k] = lk->all[k-1];
6882 memset(&lk->all[0],0,sizeof(struct lkinfo));
6883 lk->all[0].lookup = otl;
6884 lk->all[0].isnew = true;
6885 ++lk->cnt;
6886
6887 /* Now add the new subtable */
6888 lk->all[0].subtables = calloc(1,sizeof(struct lksubinfo));
6889 lk->all[0].subtable_cnt = lk->all[0].subtable_max = 1;
6890 lk->all[0].subtables[0].subtable = otl->subtables;
6891 lk->all[0].subtables[0].isnew = true;
6892 }
6893
6894 SllkFree(sllk,sllk_cnt);
6895 }
6896
6897 static void lookupmenu_dispatch(GWindow v, GMenuItem *mi, GEvent *e) {
6898 GEvent dummy;
6899 struct gfi_data *gfi = GDrawGetUserData(v);
6900 int i;
6901 char *buts[4];
6902
6903 if ( mi->mid==CID_SaveFeat || mi->mid==CID_SaveLookup ) {
6904 char *filename, *defname;
6905 FILE *out;
6906 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6907 struct lkdata *lk = &gfi->tables[isgpos];
6908 OTLookup *otl = NULL;
6909
6910 if ( mi->mid==CID_SaveLookup ) {
6911 for ( i=0; i<lk->cnt && (!lk->all[i].selected || lk->all[i].deleted); ++i );
6912 if ( i==lk->cnt )
6913 return;
6914 otl = lk->all[i].lookup;
6915 SFFindUnusedLookups(gfi->sf);
6916 if ( otl->unused ) {
6917 ff_post_error(_("No data"), _("This lookup contains no data"));
6918 return;
6919 }
6920 }
6921 defname = strconcat(gfi->sf->fontname,".fea");
6922 filename = gwwv_save_filename(_("Feature file?"),defname,"*.fea");
6923 free(defname);
6924 if ( filename==NULL )
6925 return;
6926 /* Convert to def encoding !!! */
6927 out = fopen(filename,"w");
6928 if ( out==NULL ) {
6929 ff_post_error(_("Cannot open file"),_("Cannot open %s"), filename );
6930 free(filename);
6931 return;
6932 }
6933 if ( otl!=NULL )
6934 FeatDumpOneLookup( out,gfi->sf,otl );
6935 else
6936 FeatDumpFontLookups( out,gfi->sf );
6937 if ( ferror(out)) {
6938 ff_post_error(_("Output error"),_("An error occurred writing %s"), filename );
6939 free(filename);
6940 fclose(out);
6941 return;
6942 }
6943 free(filename);
6944 fclose(out);
6945 } else if ( mi->mid==CID_AddAllAlternates ) {
6946 /* First we want to remove any old aalt-only lookups */
6947 /* (and remove the 'aalt' tag from any lookups with multiple features) */
6948 /* Then add the new ones */
6949 struct lkdata *lk = &gfi->tables[0]; /* GSUB */
6950 int has_aalt_only=false, has_aalt_mixed = false;
6951 int i, ret;
6952 FeatureScriptLangList *fl;
6953
6954 for ( i=0; i<lk->cnt; ++i ) {
6955 if ( lk->all[i].deleted )
6956 continue;
6957 for ( fl = lk->all[i].lookup->features; fl!=NULL; fl=fl->next ) {
6958 if ( fl->featuretag==CHR('a','a','l','t') ) {
6959 if ( fl==lk->all[i].lookup->features && fl->next==NULL )
6960 has_aalt_only = true;
6961 else
6962 has_aalt_mixed = true;
6963 break;
6964 }
6965 }
6966 }
6967 if ( has_aalt_only || has_aalt_mixed ) {
6968 buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2] = NULL;
6969 ret = gwwv_ask(has_aalt_only?_("Lookups will be removed"):_("Feature tags will be removed"),
6970 (const char **) buts,0,1,
6971 !has_aalt_mixed ?
6972 _("Warning: There are already some 'aalt' lookups in\n"
6973 "the font. If you proceed with this command those\n"
6974 "lookups will be removed and new lookups will be\n"
6975 "generated. The old information will be LOST.\n"
6976 " Is that what you want?") :
6977 !has_aalt_only ?
6978 _("Warning: There are already some 'aalt' lookups in\n"
6979 "the font but there are other feature tags associated\n"
6980 "with these lookups. If you proceed with this command\n"
6981 "the 'aalt' tag will be removed from those lookups,\n"
6982 "and new lookups will be generate which will NOT be\n"
6983 "associated with the other feature tag(s).\n"
6984 " Is that what you want?") :
6985 _("Warning: There are already some 'aalt' lookups in\n"
6986 "the font, some have no other feature tags associated\n"
6987 "with them and these will be removed, others have other\n"
6988 "tags associated and these will remain while the 'aalt'\n"
6989 "tag will be removed from the lookup -- a new lookup\n"
6990 "will be generated which is not associated with any\n"
6991 "other feature tags.\n"
6992 " Is that what you want?") );
6993 if ( ret==1 )
6994 return;
6995 AALTRemoveOld(gfi->sf,lk);
6996 }
6997 AALTCreateNew(gfi->sf,lk);
6998 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+0)),NULL,false);
6999 } else if ( mi->mid==CID_AddDFLT ) {
7000 struct selection_bits sel;
7001 int toall, ret, i;
7002 char *buts[4];
7003 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
7004 struct lkdata *lk = &gfi->tables[isgpos];
7005
7006 LookupParseSelection(lk,&sel);
7007 if ( sel.lookup_cnt==0 ) {
7008 buts[0] = _("_Apply to All"); buts[1] = _("_Cancel"); buts[2]=NULL;
7009 } else {
7010 buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = _("_Cancel"); buts[3]=NULL;
7011 }
7012 ret = gwwv_ask(_("Apply to:"),(const char **) buts,0,sel.lookup_cnt==0?1:2,_("Apply change to which lookups?"));
7013 toall = false;
7014 if ( ret==0 )
7015 toall = true;
7016 else if ( (ret==1 && sel.lookup_cnt==0) || (ret==2 && sel.lookup_cnt!=0))
7017 return;
7018 for ( i=0; i<lk->cnt; ++i ) {
7019 if ( lk->all[i].deleted )
7020 continue;
7021 if ( lk->all[i].selected || toall ) {
7022 AddDFLT(lk->all[i].lookup);
7023 }
7024 }
7025 } else if ( mi->mid==CID_AddLanguage || mi->mid==CID_RmLanguage ) {
7026 int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
7027 struct lkdata *lk = &gfi->tables[isgpos];
7028
7029 AddRmLang(gfi->sf,lk,mi->mid==CID_AddLanguage);
7030 } else {
7031 memset(&dummy,0,sizeof(dummy));
7032 dummy.type = et_controlevent;
7033 dummy.u.control.subtype = et_buttonactivate;
7034 dummy.u.control.g = GWidgetGetControl(gfi->gw,mi->mid);
7035 dummy.w = GGadgetGetWindow(dummy.u.control.g);
7036 dummy.u.control.u.button.button = e->u.mouse.button;
7037 GGadgetDispatchEvent(dummy.u.control.g,&dummy);
7038 }
7039 }
7040
7041 static GMenuItem lookuppopupmenu[] = {
7042 { { (unichar_t *) N_("_Top"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupTop },
7043 { { (unichar_t *) N_("_Up"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupUp },
7044 { { (unichar_t *) N_("_Down"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupDown },
7045 { { (unichar_t *) N_("_Bottom"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupBottom },
7046 { { (unichar_t *) N_("_Sort"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupSort },
7047 { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
7048 { { (unichar_t *) N_("Add _Lookup"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddLookup },
7049 { { (unichar_t *) N_("Add Sub_table"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddSubtable },
7050 { { (unichar_t *) N_("Edit _Metadata"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_EditMetadata },
7051 { { (unichar_t *) N_("_Edit Data"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_EditSubtable },
7052 { { (unichar_t *) N_("De_lete"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_DeleteLookup },
7053 { { (unichar_t *) N_("_Merge"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_MergeLookup },
7054 { { (unichar_t *) N_("Sa_ve Lookup..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_SaveLookup },
7055 { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
7056 { { (unichar_t *) N_("Add Language to Script..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddLanguage },
7057 { { (unichar_t *) N_("Remove Language from Script..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_RmLanguage },
7058 { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
7059 { { (unichar_t *) N_("_Add 'aalt' features"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddAllAlternates },
7060 { { (unichar_t *) N_("Add 'D_FLT' script"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddDFLT },
7061 { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
7062 { { (unichar_t *) N_("_Revert All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_RevertLookups },
7063 { { (unichar_t *) N_("_Import..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_ImportLookups },
7064 { { (unichar_t *) N_("S_ave Feature File..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_SaveFeat },
7065 GMENUITEM_EMPTY
7066 };
7067
7068 static void LookupMenu(struct gfi_data *gfi,struct lkdata *lk,int isgpos, GEvent *event) {
7069 struct selection_bits sel;
7070 int i,j;
7071 static int initted = false;
7072
7073 if ( !initted ) {
7074 int i;
7075 initted = true;
7076
7077 for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i )
7078 if ( lookuppopupmenu[i].ti.text!=NULL )
7079 lookuppopupmenu[i].ti.text = (unichar_t *) _( (char *)lookuppopupmenu[i].ti.text);
7080 }
7081
7082 GGadgetEndPopup();
7083
7084 LookupParseSelection(lk,&sel);
7085 for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i ) {
7086 switch ( lookuppopupmenu[i].mid ) {
7087 case 0:
7088 /* Lines */;
7089 break;
7090 case CID_LookupTop:
7091 lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt!=1;
7092 break;
7093 case CID_LookupUp:
7094 lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt==0;
7095 break;
7096 case CID_LookupDown:
7097 lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt==0;
7098 break;
7099 case CID_LookupBottom:
7100 lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt!=1;
7101 break;
7102 case CID_LookupSort:
7103 lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
7104 break;
7105 case CID_AddLookup:
7106 lookuppopupmenu[i].ti.disabled = sel.lookup_cnt+sel.sub_cnt>1;
7107 break;
7108 case CID_AddSubtable:
7109 lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt>1) && (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
7110 break;
7111 case CID_EditMetadata:
7112 lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt!=0) &&
7113 (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
7114 break;
7115 case CID_EditSubtable:
7116 lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=0 || sel.sub_cnt!=1;
7117 break;
7118 case CID_DeleteLookup:
7119 lookuppopupmenu[i].ti.disabled = sel.lookup_cnt==0 && sel.sub_cnt==0;
7120 break;
7121 case CID_MergeLookup:
7122 lookuppopupmenu[i].ti.disabled = !(
7123 (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
7124 (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable) );
7125 break;
7126 case CID_ImportLookups:
7127 lookuppopupmenu[i].ti.disabled = !LookupsImportable(gfi->sf,isgpos);
7128 break;
7129 case CID_RevertLookups:
7130 lookuppopupmenu[i].ti.disabled = false;
7131 break;
7132 case CID_SaveLookup:
7133 lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=1 || sel.sub_cnt!=0;
7134 for ( j=0; j<lk->cnt; ++j ) if ( lk->all[j].selected ) {
7135 int type = lk->all[j].lookup->lookup_type;
7136 if ( type==kern_statemachine || type==morx_indic ||
7137 type==morx_context || type==morx_insert )
7138 lookuppopupmenu[i].ti.disabled = true;
7139 break;
7140 }
7141 break;
7142 case CID_AddDFLT:
7143 lookuppopupmenu[i].ti.disabled = lk->cnt==0;
7144 break;
7145 case CID_AddAllAlternates:
7146 lookuppopupmenu[i].ti.disabled = lk->cnt==0 || lk==&gfi->tables[1]/*Only applies to GSUB*/;
7147 break;
7148 case CID_SaveFeat:
7149 lookuppopupmenu[i].ti.disabled = lk->cnt<=0;
7150 break;
7151 }
7152 }
7153 GMenuCreatePopupMenu(event->w,event, lookuppopupmenu);
7154 }
7155
7156
7157 static int LookupIndex(struct gfi_data *othergfi, int isgpos, GWindow gw,
7158 GWindow othergw, GEvent *event, int *subindex) {
7159 GPoint pt;
7160 struct lkdata *otherlk = &othergfi->tables[isgpos];
7161 int l,i,j, lcnt;
7162
7163 pt.x = event->u.mouse.x; pt.y = event->u.mouse.y;
7164 if ( gw!=othergw )
7165 GDrawTranslateCoordinates(gw,othergw,&pt);
7166 l = (pt.y-LK_MARGIN)/othergfi->fh + otherlk->off_top;
7167
7168 if ( l<0 ) {
7169 *subindex = -1;
7170 return( -1 );
7171 }
7172
7173 lcnt = 0;
7174 for ( i=0; i<otherlk->cnt; ++i ) {
7175 if ( otherlk->all[i].deleted )
7176 continue;
7177 if ( l==lcnt ) {
7178 *subindex = -1;
7179 return( i );
7180 }
7181 ++lcnt;
7182 if ( otherlk->all[i].open ) {
7183 for ( j=0; j<otherlk->all[i].subtable_cnt; ++j ) {
7184 if ( otherlk->all[i].subtables[j].deleted )
7185 continue;
7186 if ( l==lcnt ) {
7187 *subindex = j;
7188 return( i );
7189 }
7190 ++lcnt;
7191 }
7192 }
7193 }
7194 /* drop after last lookup */
7195 *subindex = -1;
7196 return( i );
7197 }
7198
7199 static int LookupsDropable(struct gfi_data *gfi, struct gfi_data *othergfi,
7200 int isgpos, GWindow gw, GWindow othergw, GEvent *event) {
7201 int lookup, subtable;
7202 struct lkdata *lk = &gfi->tables[isgpos];
7203 struct lkdata *otherlk = &othergfi->tables[isgpos];
7204
7205 if ( gfi->first_sel_subtable==-1 )
7206 return( true ); /* Lookups can be dropped anywhere */
7207
7208 lookup = LookupIndex(othergfi,isgpos,gw,othergw,event,&subtable);
7209 if ( lookup<0 || lookup>=lk->cnt )
7210 return( false ); /* Subtables must be dropped in a lookup */
7211
7212 if ( gfi!=othergfi /* || lookup!=gfi->first_sel_lookup*/ )
7213 return( false ); /* Can't merge subtables from one lookup to another */
7214
7215 /* Subtables can only be dropped in a lookup with the same type */
7216 /* At the moment we don't need this test, as we only allow subtables to be dropped within their original lookup */
7217 return( otherlk->all[lookup].lookup->lookup_type ==
7218 lk->all[gfi->first_sel_lookup].lookup->lookup_type );
7219 }
7220
7221 static void LookupDragDrop(struct gfi_data *gfi, int isgpos, GEvent *event) {
7222 FontViewBase *fv;
7223 struct gfi_data *othergfi=NULL;
7224 GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
7225 GWindow othergw = NULL;
7226 int i,j;
7227
7228 othergw = GDrawGetPointerWindow(gfi->gw);
7229
7230 for ( fv = (FontViewBase *) fv_list; fv!=NULL; fv=fv->next ) if ( fv->sf->fontinfo!=NULL ) {
7231 int otherisgpos;
7232
7233 othergfi = fv->sf->fontinfo;
7234 otherisgpos = GTabSetGetSel(GWidgetGetControl(othergfi->gw,CID_Lookups));
7235 if ( otherisgpos!=isgpos )
7236 continue;
7237 if ( othergw == GDrawableGetWindow(GWidgetGetControl(othergfi->gw,CID_LookupWin+otherisgpos)))
7238 break;
7239 }
7240 if ( fv==NULL )
7241 othergw = NULL;
7242
7243 if ( fv==NULL || !LookupsDropable(gfi,othergfi,isgpos,gw,othergw,event)) {
7244 if ( event->type==et_mouseup ) {
7245 GDrawSetCursor(gw,ct_mypointer);
7246 gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
7247 return;
7248 } else {
7249 if ( gfi->lk_dropablecursor ) {
7250 gfi->lk_dropablecursor = false;
7251 GDrawSetCursor(gw,ct_prohibition);
7252 }
7253 return;
7254 }
7255 } else {
7256 if ( event->type==et_mousemove ) {
7257 if ( !gfi->lk_dropablecursor ) {
7258 gfi->lk_dropablecursor = true;
7259 GDrawSetCursor(gw,ct_features);
7260 }
7261 return;
7262 } else {
7263 struct lkdata *otherlk = &othergfi->tables[isgpos];
7264 struct lkdata *lk = &gfi->tables[isgpos];
7265 struct lkinfo temp;
7266 struct lksubinfo subtemp;
7267 int lookup, subtable;
7268
7269 lookup = LookupIndex(othergfi,isgpos,gw,othergw,event,&subtable);
7270
7271 if ( gfi==othergfi ) {
7272 /* dropping in the same window just moves things around */
7273 if ( gfi->first_sel_subtable == -1 ) {
7274 /* Moving lookups */
7275 if ( lookup<0 ) lookup=0;
7276 else if ( lookup>=lk->cnt ) lookup=lk->cnt;
7277 if ( lookup==gfi->first_sel_lookup )
7278 goto done_drop;
7279 for ( i=0; i<lk->cnt; ++i )
7280 lk->all[i].moved = false;
7281 for ( i=gfi->first_sel_lookup; i<lk->cnt; ++i ) {
7282 if ( lk->all[i].deleted || !lk->all[i].selected ||
7283 lk->all[i].moved || i==lookup )
7284 continue;
7285 temp = lk->all[i];
7286 temp.moved = true;
7287 if ( i<lookup ) {
7288 for ( j=i+1; j<lookup; ++j )
7289 lk->all[j-1] = lk->all[j];
7290 lk->all[j-1] = temp;
7291 } else {
7292 for ( j=i; j>lookup; --j )
7293 lk->all[j] = lk->all[j-1];
7294 lk->all[j] = temp;
7295 }
7296 --i;
7297 }
7298 } else if ( lookup==gfi->first_sel_lookup ) {
7299 if ( subtable< 0 ) subtable=0;
7300 if ( subtable==gfi->first_sel_subtable )
7301 goto done_drop;
7302 for ( i=0; i<lk->cnt; ++i )
7303 lk->all[lookup].subtables[i].moved = false;
7304 for ( i=gfi->first_sel_subtable; i<lk->all[lookup].subtable_cnt; ++i ) {
7305 if ( lk->all[lookup].subtables[i].deleted || !lk->all[lookup].subtables[i].selected ||
7306 lk->all[lookup].subtables[i].moved || i==subtable )
7307 continue;
7308 subtemp = lk->all[lookup].subtables[i];
7309 subtemp.moved = true;
7310 if ( i<subtable ) {
7311 for ( j=i+1; j<subtable; ++j )
7312 lk->all[lookup].subtables[j-1] = lk->all[lookup].subtables[j];
7313 lk->all[lookup].subtables[j-1] = subtemp;
7314 } else {
7315 for ( j=i; j>subtable; --j )
7316 lk->all[lookup].subtables[j] = lk->all[lookup].subtables[j-1];
7317 lk->all[lookup].subtables[j] = subtemp;
7318 }
7319 --i;
7320 }
7321 } else {
7322 int old_lk = gfi->first_sel_lookup;
7323 int sel_cnt=0, k;
7324 if ( subtable<0 ) /* dropped into lookup */
7325 subtable = 0;
7326 for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i )
7327 if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
7328 ++sel_cnt;
7329 if ( lk->all[lookup].subtable_cnt+sel_cnt >= lk->all[lookup].subtable_max )
7330 lk->all[lookup].subtables = realloc(lk->all[lookup].subtables,
7331 (lk->all[lookup].subtable_max += sel_cnt+3)*sizeof(struct lksubinfo));
7332 for ( i= lk->all[lookup].subtable_cnt+sel_cnt-1; i>=subtable; --i )
7333 lk->all[lookup].subtables[i] = lk->all[lookup].subtables[i-sel_cnt];
7334 k=0;
7335 for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i ) {
7336 if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
7337 lk->all[lookup].subtables[subtable+k++] = lk->all[old_lk].subtables[i];
7338 }
7339 lk->all[lookup].subtable_cnt += k;
7340 k=0;
7341 for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i ) {
7342 if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
7343 ++k;
7344 else if ( k!=0 )
7345 lk->all[old_lk].subtables[i-k] = lk->all[old_lk].subtables[i];
7346 }
7347 lk->all[old_lk].subtable_cnt -= k;
7348 }
7349 } else {
7350 if ( gfi->first_sel_subtable == -1 ) {
7351 /* Import lookups from one font to another */
7352 OTLookup **list, *before;
7353 int cnt=0;
7354 for ( i=0; i<lk->cnt; ++i ) {
7355 if ( lk->all[i].deleted )
7356 continue;
7357 if ( lk->all[i].selected )
7358 ++cnt;
7359 }
7360 list = malloc((cnt+1)*sizeof(OTLookup *));
7361 cnt=0;
7362 for ( i=0; i<lk->cnt; ++i ) {
7363 if ( lk->all[i].deleted )
7364 continue;
7365 if ( lk->all[i].selected )
7366 list[cnt++] = lk->all[i].lookup;
7367 }
7368 list[cnt] = NULL;
7369 if ( lookup<0 ) lookup=0;
7370 before = lookup>=otherlk->cnt ? NULL : otherlk->all[lookup].lookup;
7371 OTLookupsCopyInto(othergfi->sf,gfi->sf,list,before);
7372 free( list );
7373 } else
7374 IError("Attempt to merge subtables across fonts not permitted" );
7375 GDrawRequestExpose(othergw,NULL,false);
7376 }
7377 done_drop:
7378 GDrawSetCursor(gw,ct_mypointer);
7379 GDrawRequestExpose(gw,NULL,false);
7380 gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
7381 return;
7382 }
7383 }
7384 }
7385
7386 static int LookupDragDropable(struct gfi_data *gfi, struct lkdata *lk) {
7387 int i,j;
7388 int first_l= -1, first_s= -1;
7389
7390 for ( i=0; i<lk->cnt; ++i ) {
7391 if ( lk->all[i].deleted )
7392 continue;
7393 if ( lk->all[i].selected ) {
7394 if ( first_s!=-1 )
7395 return( false ); /* Can't have mixed lookups and subtables */
7396 if ( first_l==-1 )
7397 first_l = i;
7398 }
7399 if ( lk->all[i].open ) {
7400 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
7401 if ( lk->all[i].subtables[j].deleted )
7402 continue;
7403 if ( lk->all[i].subtables[j].selected ) {
7404 if ( first_l==i || first_l==-1 )
7405 first_l = i;
7406 else
7407 return( false ); /* Mixed lookups and subtables */
7408 if ( first_s==-1 )
7409 first_s = j;
7410 }
7411 }
7412 }
7413 }
7414 gfi->first_sel_lookup = first_l;
7415 gfi->first_sel_subtable = first_s;
7416 return( true );
7417 }
7418
7419 static void LookupMouse(struct gfi_data *gfi, int isgpos, GEvent *event) {
7420 struct lkdata *lk = &gfi->tables[isgpos];
7421 int l = (event->u.mouse.y-LK_MARGIN)/gfi->fh + lk->off_top;
7422 int inbox = event->u.mouse.x>=LK_MARGIN &&
7423 event->u.mouse.x>=LK_MARGIN-lk->off_left &&
7424 event->u.mouse.x<=LK_MARGIN-lk->off_left+gfi->as+1;
7425 GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
7426 int i,j,lcnt;
7427
7428 if ( event->type!=et_mousedown && gfi->lk_drag_and_drop ) {
7429 LookupDragDrop(gfi,isgpos,event);
7430 return;
7431 }
7432
7433 if ( l<0 || event->u.mouse.y>=(gfi->lkheight-2*LK_MARGIN) )
7434 return;
7435
7436 lcnt = 0;
7437 for ( i=0; i<lk->cnt; ++i ) {
7438 if ( lk->all[i].deleted )
7439 continue;
7440 if ( l==lcnt ) {
7441 if ( event->type==et_mouseup )
7442 return;
7443 else if ( event->type==et_mousemove ) {
7444 LookupPopup(gw,lk->all[i].lookup,NULL,lk);
7445 return;
7446 } else {
7447 if ( gfi->lk_drag_and_drop ) {
7448 GDrawSetCursor(gw,ct_mypointer);
7449 gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
7450 }
7451 if ( inbox || event->u.mouse.clicks>1 ) {
7452 lk->all[i].open = !lk->all[i].open;
7453 GFI_LookupScrollbars(gfi, isgpos, true);
7454 return;
7455 }
7456 if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
7457 /* If line is selected, and we're going to pop up a menu */
7458 /* then don't clear other selected lines */
7459 if ( !lk->all[i].selected ||
7460 (event->u.mouse.button!=3 && !LookupDragDropable(gfi,lk)))
7461 LookupDeselect(lk);
7462 else if ( event->u.mouse.button!=3 ) {
7463 gfi->lk_drag_and_drop = gfi->lk_dropablecursor = true;
7464 GDrawSetCursor(gw,ct_features);
7465 }
7466 lk->all[i].selected = true;
7467 } else if ( event->u.mouse.state&ksm_control ) {
7468 lk->all[i].selected = !lk->all[i].selected;
7469 } else if ( lk->all[i].selected ) {
7470 lk->all[i].selected = false;
7471 } else {
7472 for ( j=0; j<lk->cnt; ++j )
7473 if ( !lk->all[j].deleted && lk->all[j].selected )
7474 break;
7475 if ( j==lk->cnt )
7476 lk->all[i].selected = true;
7477 else if ( j<i ) {
7478 for ( ; j<=i ; ++j )
7479 if ( !lk->all[j].deleted )
7480 lk->all[j].selected = true;
7481 } else {
7482 for ( ; j>=i ; --j )
7483 if ( !lk->all[j].deleted )
7484 lk->all[j].selected = true;
7485 }
7486 }
7487 GFI_LookupEnableButtons(gfi,isgpos);
7488 GDrawRequestExpose(gw,NULL,false);
7489 if ( event->u.mouse.button==3 )
7490 LookupMenu(gfi,lk,isgpos,event);
7491 return;
7492 }
7493 }
7494 ++lcnt;
7495 if ( lk->all[i].open ) {
7496 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
7497 if ( lk->all[i].subtables[j].deleted )
7498 continue;
7499 if ( l==lcnt ) {
7500 if ( event->type==et_mouseup )
7501 return;
7502 else if ( event->type==et_mousemove ) {
7503 LookupPopup(gw,lk->all[i].lookup,lk->all[i].subtables[j].subtable,lk);
7504 return;
7505 } else {
7506 if ( inbox )
7507 return; /* Can't open this guy */
7508 if ( event->u.mouse.clicks>1 )
7509 LookupSubtableContents(gfi,isgpos);
7510 else {
7511 if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
7512 /* If line is selected, and we're going to pop up a menu */
7513 /* then don't clear other selected lines */
7514 if ( !lk->all[i].subtables[j].selected ||
7515 (event->u.mouse.button!=3 && !LookupDragDropable(gfi,lk)))
7516 LookupDeselect(lk);
7517 else if ( event->u.mouse.button!=3 ) {
7518 gfi->lk_drag_and_drop = gfi->lk_dropablecursor = true;
7519 GDrawSetCursor(gw,ct_features);
7520 }
7521 lk->all[i].subtables[j].selected = true;
7522 } else
7523 lk->all[i].subtables[j].selected = !lk->all[i].subtables[j].selected;
7524 GFI_LookupEnableButtons(gfi,isgpos);
7525 GDrawRequestExpose(gw,NULL,false);
7526 if ( event->u.mouse.button==3 )
7527 LookupMenu(gfi,lk,isgpos,event);
7528 }
7529 return;
7530 }
7531 }
7532 ++lcnt;
7533 }
7534 }
7535 }
7536 }
7537
7538 static int lookups_e_h(GWindow gw, GEvent *event, int isgpos) {
7539 struct gfi_data *gfi = GDrawGetUserData(gw);
7540
7541 if (( event->type==et_mouseup || event->type==et_mousedown ) &&
7542 (event->u.mouse.button>=4 && event->u.mouse.button<=7) ) {
7543 return( GGadgetDispatchEvent(GWidgetGetControl(gw,CID_LookupVSB+isgpos),event));
7544 }
7545
7546 switch ( event->type ) {
7547 case et_char:
7548 return( GFI_Char(gfi,event) );
7549 case et_expose:
7550 LookupExpose(gw,gfi,isgpos);
7551 break;
7552 case et_mousedown: case et_mousemove: case et_mouseup:
7553 LookupMouse(gfi,isgpos,event);
7554 break;
7555 case et_resize: {
7556 GRect r;
7557 GDrawGetSize(gw,&r);
7558 gfi->lkheight = r.height; gfi->lkwidth = r.width;
7559 GFI_LookupScrollbars(gfi,false,false);
7560 GFI_LookupScrollbars(gfi,true,false);
7561 }
7562 break;
7563 default: break;
7564 }
7565 return( true );
7566 }
7567
7568 static int gposlookups_e_h(GWindow gw, GEvent *event) {
7569 return( lookups_e_h(gw,event,true));
7570 }
7571
7572 static int gsublookups_e_h(GWindow gw, GEvent *event) {
7573 return( lookups_e_h(gw,event,false));
7574 }
7575
7576 void FontInfo(SplineFont *sf,int deflayer,int defaspect,int sync) {
7577 // This opens the Font Info box to the tab specified by defaspect,
7578 // which indexes the array aspects, populated below.
7579 GRect pos;
7580 GWindow gw;
7581 GWindowAttrs wattrs;
7582 GTabInfo aspects[26], vaspects[6], lkaspects[3];
7583 GGadgetCreateData mgcd[10], ngcd[19], psgcd[30], tngcd[8],
7584 pgcd[12], vgcd[21], pangcd[23], comgcd[4], txgcd[23], floggcd[4],
7585 mfgcd[8], mcgcd[8], szgcd[19], mkgcd[7], metgcd[33], vagcd[3], ssgcd[23],
7586 xugcd[8], dgcd[6], ugcd[6], gaspgcd[5], gaspgcd_def[2], lksubgcd[2][4],
7587 lkgcd[2], lkbuttonsgcd[15], cgcd[12], lgcd[20], msgcd[7], ssngcd[8],
7588 woffgcd[8], privategcd_def[4];
7589 GGadgetCreateData mb[2], mb2, nb[2], nb2, nb3, xub[2], psb[2], psb2[3], ppbox[4],
7590 vbox[4], metbox[2], ssbox[2], panbox[2], combox[2], mkbox[3],
7591 txbox[5], ubox[3], dbox[2], flogbox[2],
7592 mcbox[3], mfbox[3], szbox[6], tnboxes[4], gaspboxes[3],
7593 lkbox[7], cbox[6], lbox[8], msbox[3], ssboxes[4], woffbox[2];
7594 GGadgetCreateData *marray[7], *marray2[9], *narray[29], *narray2[7], *narray3[3],
7595 *xuarray[20], *psarray[10], *psarray2[21], *psarray4[10],
7596 *pparray[6], *vradio[5], *varray[41], *metarray[53],
7597 *ssarray[58], *panarray[40], *comarray[3], *flogarray[3],
7598 *mkarray[6], *msarray[6],
7599 *txarray[5], *txarray2[30],
7600 *txarray3[6], *txarray4[6], *uarray[5], *darray[10],
7601 *mcarray[13], *mcarray2[7],
7602 *mfarray[14], *szarray[7], *szarray2[5], *szarray3[7],
7603 *szarray4[4], *tnvarray[4], *tnharray[6], *tnharray2[5], *gaspharray[6],
7604 *gaspvarray[3], *lkarray[2][7], *lkbuttonsarray[17], *lkharray[3],
7605 *charray1[4], *charray2[4], *charray3[4], *cvarray[9], *cvarray2[4],
7606 *larray[16], *larray2[25], *larray3[6], *larray4[5], *uharray[4],
7607 *ssvarray[4], *woffarray[16];
7608 GTextInfo mlabel[10], nlabel[18], pslabel[30], tnlabel[7],
7609 plabel[12], vlabel[21], panlabel[22], comlabel[3], txlabel[23],
7610 mflabel[8], mclabel[8], szlabel[17], mklabel[7], metlabel[32],
7611 sslabel[23], xulabel[8], dlabel[5], ulabel[3], gasplabel[5],
7612 lkbuttonslabel[14], clabel[11], floglabel[3], llabel[20], mslabel[7],
7613 ssnlabel[7], wofflabel[8], privatelabel_def[3];
7614 GTextInfo *namelistnames;
7615 struct gfi_data *d;
7616 char iabuf[20], upbuf[20], uwbuf[20], asbuf[20], dsbuf[20],
7617 vbuf[20], uibuf[12], embuf[20];
7618 char dszbuf[20], dsbbuf[20], dstbuf[21], sibuf[20], swbuf[20], sfntrbuf[20];
7619 char ranges[40], codepages[40];
7620 char woffmajorbuf[20], woffminorbuf[20];
7621 int i,j,k,g, psrow;
7622 int mcs;
7623 char title[130];
7624 int as, ds, ld;
7625 char **nlnames;
7626 char createtime[200], modtime[200];
7627 unichar_t *tmpcreatetime, *tmpmodtime;
7628 time_t t;
7629 const struct tm *tm;
7630 struct matrixinit mi, gaspmi, layersmi, ssmi, sizemi, marks_mi, markc_mi, private_mi;
7631 struct matrix_data *marks_md, *markc_md;
7632 int ltype;
7633 static GBox small_blue_box;
7634 extern GBox _GGadget_button_box;
7635 char *copied_copyright;
7636
7637 FontInfoInit();
7638
7639 if ( sf->fontinfo!=NULL ) {
7640 GDrawSetVisible(((struct gfi_data *) (sf->fontinfo))->gw,true);
7641 GDrawRaise( ((struct gfi_data *) (sf->fontinfo))->gw );
7642 return;
7643 }
7644 if ( defaspect==-1 )
7645 defaspect = last_aspect;
7646
7647 d = calloc(1,sizeof(struct gfi_data));
7648 sf->fontinfo = d;
7649
7650 memset(&wattrs,0,sizeof(wattrs));
7651 wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg;
7652 wattrs.event_masks = ~(1<<et_charup);
7653 wattrs.is_dlg = true;
7654 if ( sync ) {
7655 wattrs.mask |= wam_restrict;
7656 wattrs.restrict_input_to_me = 1;
7657 }
7658 wattrs.undercursor = 1;
7659 wattrs.cursor = ct_pointer;
7660 snprintf(title,sizeof(title),_("Font Information for %.90s"),
7661 sf->fontname);
7662 wattrs.utf8_window_title = title;
7663 pos.x = pos.y = 0;
7664 pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268+85));
7665 pos.height = GDrawPointsToPixels(NULL,375);
7666 gw = GDrawCreateTopWindow(NULL,&pos,e_h,d,&wattrs);
7667
7668 d->sf = sf;
7669 d->def_layer = deflayer;
7670 d->gw = gw;
7671 d->old_sel = -2;
7672 d->texdata = sf->texdata;
7673
7674 memset(&nlabel,0,sizeof(nlabel));
7675 memset(&ngcd,0,sizeof(ngcd));
7676
7677 nlabel[0].text = (unichar_t *) _("Fo_ntname:");
7678 nlabel[0].text_is_1byte = true;
7679 nlabel[0].text_in_resource = true;
7680 ngcd[0].gd.label = &nlabel[0];
7681 ngcd[0].gd.pos.x = 12; ngcd[0].gd.pos.y = 6+6;
7682 ngcd[0].gd.flags = gg_visible | gg_enabled;
7683 ngcd[0].creator = GLabelCreate;
7684
7685 ngcd[1].gd.pos.x = 115; ngcd[1].gd.pos.y = ngcd[0].gd.pos.y-6; ngcd[1].gd.pos.width = 137;
7686 ngcd[1].gd.flags = gg_visible | gg_enabled;
7687 nlabel[1].text = (unichar_t *) sf->fontname;
7688 nlabel[1].text_is_1byte = true;
7689 ngcd[1].gd.label = &nlabel[1];
7690 ngcd[1].gd.cid = CID_Fontname;
7691 ngcd[1].gd.handle_controlevent = GFI_NameChange;
7692 ngcd[1].creator = GTextFieldCreate;
7693
7694 nlabel[2].text = (unichar_t *) _("_Family Name:");
7695 nlabel[2].text_is_1byte = true;
7696 nlabel[2].text_in_resource = true;
7697 ngcd[2].gd.label = &nlabel[2];
7698 ngcd[2].gd.pos.x = 12; ngcd[2].gd.pos.y = ngcd[0].gd.pos.y+26;
7699 ngcd[2].gd.flags = gg_visible | gg_enabled;
7700 ngcd[2].creator = GLabelCreate;
7701
7702 ngcd[3].gd.pos.x = ngcd[1].gd.pos.x; ngcd[3].gd.pos.y = ngcd[2].gd.pos.y-6; ngcd[3].gd.pos.width = 137;
7703 ngcd[3].gd.flags = gg_visible | gg_enabled;
7704 nlabel[3].text = (unichar_t *) (sf->familyname?sf->familyname:sf->fontname);
7705 nlabel[3].text_is_1byte = true;
7706 ngcd[3].gd.label = &nlabel[3];
7707 ngcd[3].gd.cid = CID_Family;
7708 ngcd[3].gd.handle_controlevent = GFI_FamilyChange;
7709 ngcd[3].creator = GTextFieldCreate;
7710 if ( sf->familyname==NULL || strstr(sf->familyname,"Untitled")==sf->familyname )
7711 d->family_untitled = true;
7712
7713 ngcd[4].gd.pos.x = 12; ngcd[4].gd.pos.y = ngcd[3].gd.pos.y+26+6;
7714 nlabel[4].text = (unichar_t *) _("Name For Human_s:");
7715 nlabel[4].text_is_1byte = true;
7716 nlabel[4].text_in_resource = true;
7717 ngcd[4].gd.label = &nlabel[4];
7718 ngcd[4].gd.flags = gg_visible | gg_enabled;
7719 ngcd[4].creator = GLabelCreate;
7720
7721 ngcd[5].gd.pos.x = 115; ngcd[5].gd.pos.y = ngcd[4].gd.pos.y-6; ngcd[5].gd.pos.width = 137;
7722 ngcd[5].gd.flags = gg_visible | gg_enabled;
7723 nlabel[5].text = (unichar_t *) (sf->fullname?sf->fullname:sf->fontname);
7724 nlabel[5].text_is_1byte = true;
7725 ngcd[5].gd.label = &nlabel[5];
7726 ngcd[5].gd.cid = CID_Human;
7727 ngcd[5].gd.handle_controlevent = GFI_HumanChange;
7728 ngcd[5].creator = GTextFieldCreate;
7729 if ( sf->fullname==NULL || strstr(sf->fullname,"Untitled")==sf->fullname )
7730 d->human_untitled = true;
7731
7732 nlabel[6].text = (unichar_t *) _("_Weight");
7733 nlabel[6].text_is_1byte = true;
7734 nlabel[6].text_in_resource = true;
7735 ngcd[6].gd.label = &nlabel[6];
7736 ngcd[6].gd.pos.x = ngcd[4].gd.pos.x; ngcd[6].gd.pos.y = ngcd[4].gd.pos.y+26;
7737 ngcd[6].gd.flags = gg_visible | gg_enabled;
7738 ngcd[6].creator = GLabelCreate;
7739
7740 ngcd[7].gd.pos.x = ngcd[1].gd.pos.x; ngcd[7].gd.pos.y = ngcd[6].gd.pos.y-6; ngcd[7].gd.pos.width = 137;
7741 ngcd[7].gd.flags = gg_visible | gg_enabled;
7742 nlabel[7].text = (unichar_t *) (sf->weight?sf->weight:"Regular");
7743 nlabel[7].text_is_1byte = true;
7744 ngcd[7].gd.label = &nlabel[7];
7745 ngcd[7].gd.cid = CID_Weight;
7746 ngcd[7].creator = GTextFieldCreate;
7747
7748 ngcd[8].gd.pos.x = 12; ngcd[8].gd.pos.y = ngcd[6].gd.pos.y+26;
7749 nlabel[8].text = (unichar_t *) _("_Version:");
7750 nlabel[8].text_is_1byte = true;
7751 nlabel[8].text_in_resource = true;
7752 ngcd[8].gd.label = &nlabel[8];
7753 ngcd[8].gd.flags = gg_visible | gg_enabled;
7754 ngcd[8].creator = GLabelCreate;
7755
7756 ngcd[9].gd.pos.x = 115; ngcd[9].gd.pos.y = ngcd[8].gd.pos.y-6; ngcd[9].gd.pos.width = 137;
7757 ngcd[9].gd.flags = gg_visible | gg_enabled;
7758 nlabel[9].text = (unichar_t *) (sf->version?sf->version:"");
7759 nlabel[9].text_is_1byte = true;
7760 if ( sf->subfontcnt!=0 ) {
7761 sprintf( vbuf,"%g", sf->cidversion );
7762 nlabel[9].text = (unichar_t *) vbuf;
7763 }
7764 ngcd[9].gd.label = &nlabel[9];
7765 ngcd[9].gd.cid = CID_Version;
7766 ngcd[9].creator = GTextFieldCreate;
7767
7768 nlabel[10].text = (unichar_t *) _("sfnt _Revision:");
7769 nlabel[10].text_is_1byte = true;
7770 nlabel[10].text_in_resource = true;
7771 ngcd[10].gd.label = &nlabel[10];
7772 ngcd[10].gd.flags = gg_visible | gg_enabled;
7773 ngcd[10].gd.popup_msg = _("If you leave this field blank FontForge will use a default based on\neither the version string above, or one in the 'name' table." );
7774 ngcd[10].creator = GLabelCreate;
7775
7776 sfntrbuf[0]='\0';
7777 if ( sf->sfntRevision!=sfntRevisionUnset )
7778 sprintf( sfntrbuf, "%g", sf->sfntRevision/65536.0 );
7779 ngcd[11].gd.flags = gg_visible | gg_enabled;
7780 nlabel[11].text = (unichar_t *) sfntrbuf;
7781 nlabel[11].text_is_1byte = true;
7782 ngcd[11].gd.label = &nlabel[11];
7783 ngcd[11].gd.cid = CID_Revision;
7784 ngcd[11].gd.popup_msg = _("If you leave this field blank FontForge will use a default based on\neither the version string above, or one in the 'name' table." );
7785 ngcd[11].creator = GTextFieldCreate;
7786
7787 nlabel[12].text = (unichar_t *) _("_Base Filename:");
7788 nlabel[12].text_is_1byte = true;
7789 nlabel[12].text_in_resource = true;
7790 ngcd[12].gd.label = &nlabel[12];
7791 ngcd[12].gd.popup_msg = _("Use this as the default base for the filename\nwhen generating a font." );
7792 ngcd[12].gd.flags = gg_visible | gg_enabled;
7793 ngcd[12].creator = GLabelCreate;
7794
7795 /* GT: The space in front of "Same" makes things line up better */
7796 nlabel[13].text = (unichar_t *) _(" Same as Fontname");
7797 nlabel[13].text_is_1byte = true;
7798 ngcd[13].gd.label = &nlabel[13];
7799 ngcd[13].gd.flags = sf->defbasefilename==NULL ? (gg_visible | gg_enabled | gg_cb_on ) : (gg_visible | gg_enabled);
7800 ngcd[13].gd.cid = CID_SameAsFontname;
7801 ngcd[13].creator = GRadioCreate;
7802
7803 nlabel[14].text = (unichar_t *) "";
7804 nlabel[14].text_is_1byte = true;
7805 ngcd[14].gd.label = &nlabel[14];
7806 ngcd[14].gd.flags = sf->defbasefilename!=NULL ?
7807 (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold ) :
7808 (gg_visible | gg_enabled | gg_rad_continueold);
7809 ngcd[14].gd.cid = CID_HasDefBase;
7810 ngcd[14].creator = GRadioCreate;
7811
7812 ngcd[15].gd.flags = gg_visible | gg_enabled|gg_text_xim;
7813 nlabel[15].text = (unichar_t *) (sf->defbasefilename?sf->defbasefilename:"");
7814 nlabel[15].text_is_1byte = true;
7815 ngcd[15].gd.label = &nlabel[15];
7816 ngcd[15].gd.cid = CID_DefBaseName;
7817 ngcd[15].gd.handle_controlevent = GFI_DefBaseChange;
7818 ngcd[15].creator = GTextFieldCreate;
7819
7820 ngcd[16].gd.flags = gg_visible | gg_enabled;
7821 nlabel[16].text = (unichar_t *) _("Copy_right:");
7822 nlabel[16].text_is_1byte = true;
7823 nlabel[16].text_in_resource = true;
7824 ngcd[16].gd.label = &nlabel[16];
7825 ngcd[16].creator = GLabelCreate;
7826
7827 ngcd[17].gd.pos.width = ngcd[5].gd.pos.x+ngcd[5].gd.pos.width-26;
7828 ngcd[17].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
7829 copied_copyright = NULL;
7830 if ( sf->copyright!=NULL ) {
7831 if ( !AllAscii(sf->copyright))
7832 nlabel[17].text = (unichar_t *) (copied_copyright = StripToASCII(sf->copyright));
7833 else
7834 nlabel[17].text = (unichar_t *) sf->copyright;
7835 nlabel[17].text_is_1byte = true;
7836 ngcd[17].gd.label = &nlabel[17];
7837 }
7838 ngcd[17].gd.cid = CID_Notice;
7839 ngcd[17].gd.popup_msg = _("This must be ASCII, so you may not use the copyright symbol (use (c) instead).");
7840 ngcd[17].creator = GTextAreaCreate;
7841
7842 memset(&nb,0,sizeof(nb)); memset(&nb2,0,sizeof(nb2)); memset(&nb3,0,sizeof(nb3));
7843
7844 narray3[0] = &ngcd[14]; narray3[1] = &ngcd[15]; narray3[2] = NULL;
7845
7846 narray2[0] = &ngcd[12]; narray2[1] = &ngcd[13]; narray2[2] = NULL;
7847 narray2[3] = GCD_RowSpan; narray2[4] = &nb3; narray2[5] = NULL;
7848 narray2[6] = NULL;
7849
7850 narray[0] = &ngcd[0]; narray[1] = &ngcd[1]; narray[2] = NULL;
7851 narray[3] = &ngcd[2]; narray[4] = &ngcd[3]; narray[5] = NULL;
7852 narray[6] = &ngcd[4]; narray[7] = &ngcd[5]; narray[8] = NULL;
7853 narray[9] = &ngcd[6]; narray[10] = &ngcd[7]; narray[11] = NULL;
7854 narray[12] = &ngcd[8]; narray[13] = &ngcd[9]; narray[14] = NULL;
7855 narray[15] = &ngcd[10]; narray[16] = &ngcd[11]; narray[17] = NULL;
7856 narray[18] = &nb2; narray[19] = GCD_ColSpan; narray[20] = NULL;
7857 narray[21] = &ngcd[16]; narray[22] = GCD_ColSpan; narray[23] = NULL;
7858 narray[24] = &ngcd[17]; narray[25] = GCD_ColSpan; narray[26] = NULL;
7859 narray[27] = NULL;
7860
7861 nb3.gd.flags = gg_enabled|gg_visible;
7862 nb3.gd.u.boxelements = narray3;
7863 nb3.creator = GHBoxCreate;
7864
7865 nb2.gd.flags = gg_enabled|gg_visible;
7866 nb2.gd.u.boxelements = narray2;
7867 nb2.creator = GHVBoxCreate;
7868
7869 nb[0].gd.flags = gg_enabled|gg_visible;
7870 nb[0].gd.u.boxelements = narray;
7871 nb[0].creator = GHVBoxCreate;
7872
7873 /******************************************************************************/
7874 memset(&xulabel,0,sizeof(xulabel));
7875 memset(&xugcd,0,sizeof(xugcd));
7876
7877 xulabel[0].text = (unichar_t *) _("(Adobe now considers XUID/UniqueID unnecessary)");
7878 xulabel[0].text_is_1byte = true;
7879 xulabel[0].text_in_resource = true;
7880 xugcd[0].gd.label = &xulabel[0];
7881 xugcd[0].gd.flags = gg_visible | gg_enabled;
7882 xugcd[0].creator = GLabelCreate;
7883
7884 xulabel[1].text = (unichar_t *) _("Use XUID");
7885 xulabel[1].text_is_1byte = true;
7886 xulabel[1].text_in_resource = true;
7887 xugcd[1].gd.label = &xulabel[1];
7888 xugcd[1].gd.flags = gg_visible | gg_enabled;
7889 if ( sf->use_xuid ) xugcd[1].gd.flags = gg_visible | gg_enabled | gg_cb_on;
7890 xugcd[1].gd.cid = CID_UseXUID;
7891 xugcd[1].gd.handle_controlevent = GFI_UseXUIDChanged;
7892 xugcd[1].creator = GCheckBoxCreate;
7893
7894 xugcd[2].gd.pos.x = 12; xugcd[2].gd.pos.y = 10+6;
7895 xugcd[2].gd.flags = gg_visible | gg_enabled;
7896 xulabel[2].text = (unichar_t *) _("_XUID:");
7897 xulabel[2].text_is_1byte = true;
7898 xulabel[2].text_in_resource = true;
7899 xugcd[2].gd.label = &xulabel[2];
7900 xugcd[2].creator = GLabelCreate;
7901
7902 xugcd[3].gd.flags = gg_visible;
7903 if ( sf->use_xuid ) xugcd[3].gd.flags = gg_visible | gg_enabled;
7904 if ( sf->xuid!=NULL ) {
7905 xulabel[3].text = (unichar_t *) sf->xuid;
7906 xulabel[3].text_is_1byte = true;
7907 xugcd[3].gd.label = &xulabel[3];
7908 }
7909 xugcd[3].gd.cid = CID_XUID;
7910 xugcd[3].creator = GTextFieldCreate;
7911
7912 xulabel[4].text = (unichar_t *) _("Use UniqueID");
7913 xulabel[4].text_is_1byte = true;
7914 xulabel[4].text_in_resource = true;
7915 xugcd[4].gd.label = &xulabel[4];
7916 xugcd[4].gd.flags = gg_visible | gg_enabled;
7917 if ( sf->use_uniqueid ) xugcd[4].gd.flags = gg_visible | gg_enabled | gg_cb_on;
7918 xugcd[4].gd.cid = CID_UseUniqueID;
7919 xugcd[4].gd.handle_controlevent = GFI_UseUniqueIDChanged;
7920 xugcd[4].creator = GCheckBoxCreate;
7921
7922 xulabel[5].text = (unichar_t *) _("_UniqueID:");
7923 xulabel[5].text_is_1byte = true;
7924 xulabel[5].text_in_resource = true;
7925 xugcd[5].gd.label = &xulabel[5];
7926 xugcd[5].gd.flags = gg_visible | gg_enabled;
7927 xugcd[5].creator = GLabelCreate;
7928
7929 xugcd[6].gd.flags = gg_visible;
7930 if ( sf->use_uniqueid ) xugcd[6].gd.flags = gg_visible | gg_enabled;
7931 xulabel[6].text = (unichar_t *) "";
7932 xulabel[6].text_is_1byte = true;
7933 if ( sf->uniqueid!=0 ) {
7934 sprintf( uibuf, "%d", sf->uniqueid );
7935 xulabel[6].text = (unichar_t *) uibuf;
7936 }
7937 xugcd[6].gd.label = &xulabel[6];
7938 xugcd[6].gd.cid = CID_UniqueID;
7939 xugcd[6].creator = GTextFieldCreate;
7940
7941 xuarray[0] = &xugcd[0]; xuarray[1] = GCD_ColSpan; xuarray[2] = NULL;
7942 xuarray[3] = &xugcd[1]; xuarray[4] = GCD_ColSpan; xuarray[5] = NULL;
7943 xuarray[6] = &xugcd[2]; xuarray[7] = &xugcd[3]; xuarray[8] = NULL;
7944 xuarray[9] = &xugcd[4]; xuarray[10] = GCD_ColSpan; xuarray[11] = NULL;
7945 xuarray[12] = &xugcd[5]; xuarray[13] = &xugcd[6]; xuarray[14] = NULL;
7946 xuarray[15] = GCD_Glue; xuarray[16] = GCD_Glue; xuarray[17] = NULL;
7947 xuarray[18] = NULL;
7948
7949 memset(xub,0,sizeof(xub));
7950 xub[0].gd.flags = gg_enabled|gg_visible;
7951 xub[0].gd.u.boxelements = xuarray;
7952 xub[0].creator = GHVBoxCreate;
7953
7954 /******************************************************************************/
7955 memset(&pslabel,0,sizeof(pslabel));
7956 memset(&psgcd,0,sizeof(psgcd));
7957
7958 psgcd[0].gd.pos.x = 12; psgcd[0].gd.pos.y = 12;
7959 psgcd[0].gd.flags = gg_visible | gg_enabled;
7960 pslabel[0].text = (unichar_t *) _("_Ascent:");
7961 pslabel[0].text_is_1byte = true;
7962 pslabel[0].text_in_resource = true;
7963 psgcd[0].gd.label = &pslabel[0];
7964 psgcd[0].creator = GLabelCreate;
7965
7966 psgcd[1].gd.pos.x = 103; psgcd[1].gd.pos.y = psgcd[0].gd.pos.y-6; psgcd[1].gd.pos.width = 47;
7967 psgcd[1].gd.flags = gg_visible | gg_enabled;
7968 sprintf( asbuf, "%d", sf->ascent );
7969 pslabel[1].text = (unichar_t *) asbuf;
7970 pslabel[1].text_is_1byte = true;
7971 psgcd[1].gd.label = &pslabel[1];
7972 psgcd[1].gd.cid = CID_Ascent;
7973 psgcd[1].gd.handle_controlevent = GFI_EmChanged;
7974 psgcd[1].creator = GTextFieldCreate;
7975
7976 psgcd[2].gd.pos.x = 155; psgcd[2].gd.pos.y = psgcd[0].gd.pos.y;
7977 psgcd[2].gd.flags = gg_visible | gg_enabled;
7978 pslabel[2].text = (unichar_t *) _("_Descent:");
7979 pslabel[2].text_is_1byte = true;
7980 pslabel[2].text_in_resource = true;
7981 psgcd[2].gd.label = &pslabel[2];
7982 psgcd[2].creator = GLabelCreate;
7983
7984 psgcd[3].gd.pos.x = 200; psgcd[3].gd.pos.y = psgcd[1].gd.pos.y; psgcd[3].gd.pos.width = 47;
7985 psgcd[3].gd.flags = gg_visible | gg_enabled;
7986 sprintf( dsbuf, "%d", sf->descent );
7987 pslabel[3].text = (unichar_t *) dsbuf;
7988 pslabel[3].text_is_1byte = true;
7989 psgcd[3].gd.label = &pslabel[3];
7990 psgcd[3].gd.cid = CID_Descent;
7991 psgcd[3].gd.handle_controlevent = GFI_EmChanged;
7992 psgcd[3].creator = GTextFieldCreate;
7993
7994 psgcd[4].gd.pos.x = psgcd[0].gd.pos.x+5; psgcd[4].gd.pos.y = psgcd[0].gd.pos.y+24;
7995 psgcd[4].gd.flags = gg_visible | gg_enabled;
7996 pslabel[4].text = (unichar_t *) _(" _Em Size:");
7997 pslabel[4].text_is_1byte = true;
7998 pslabel[4].text_in_resource = true;
7999 psgcd[4].gd.label = &pslabel[4];
8000 psgcd[4].creator = GLabelCreate;
8001
8002 psgcd[5].gd.pos.x = psgcd[1].gd.pos.x-20; psgcd[5].gd.pos.y = psgcd[1].gd.pos.y+24; psgcd[5].gd.pos.width = 67;
8003 psgcd[5].gd.flags = gg_visible | gg_enabled;
8004 sprintf( embuf, "%d", sf->descent+sf->ascent );
8005 pslabel[5].text = (unichar_t *) embuf;
8006 pslabel[5].text_is_1byte = true;
8007 psgcd[5].gd.label = &pslabel[5];
8008 psgcd[5].gd.cid = CID_Em;
8009 psgcd[5].gd.u.list = emsizes;
8010 psgcd[5].gd.handle_controlevent = GFI_EmChanged;
8011 psgcd[5].creator = GListFieldCreate;
8012
8013 psgcd[6].gd.pos.x = psgcd[2].gd.pos.x; psgcd[6].gd.pos.y = psgcd[4].gd.pos.y-4;
8014 psgcd[6].gd.flags = gg_visible | gg_enabled | gg_cb_on;
8015 pslabel[6].text = (unichar_t *) _("_Scale Outlines");
8016 pslabel[6].text_is_1byte = true;
8017 pslabel[6].text_in_resource = true;
8018 psgcd[6].gd.label = &pslabel[6];
8019 psgcd[6].gd.cid = CID_Scale;
8020 psgcd[6].creator = GCheckBoxCreate;
8021
8022 /* I've reversed the label, text field order in the gcd here because */
8023 /* that way the text field will be displayed on top of the label rather */
8024 /* than the reverse, and in Russian that's important translation of */
8025 /* "Italic Angle" is too long. Oops, no it's the next one, might as well leave in here though */
8026 psgcd[8].gd.pos.x = 12; psgcd[8].gd.pos.y = psgcd[5].gd.pos.y+26+6;
8027 psgcd[8].gd.flags = gg_visible | gg_enabled;
8028 pslabel[8].text = (unichar_t *) _("_Italic Angle:");
8029 pslabel[8].text_is_1byte = true;
8030 pslabel[8].text_in_resource = true;
8031 psgcd[8].gd.label = &pslabel[8];
8032 psgcd[8].creator = GLabelCreate;
8033
8034 psgcd[7].gd.pos.x = 103; psgcd[7].gd.pos.y = psgcd[8].gd.pos.y-6;
8035 psgcd[7].gd.pos.width = 47;
8036 psgcd[7].gd.flags = gg_visible | gg_enabled;
8037 sprintf( iabuf, "%g", (double) sf->italicangle );
8038 pslabel[7].text = (unichar_t *) iabuf;
8039 pslabel[7].text_is_1byte = true;
8040 psgcd[7].gd.label = &pslabel[7];
8041 psgcd[7].gd.cid = CID_ItalicAngle;
8042 psgcd[7].creator = GTextFieldCreate;
8043
8044 psgcd[9].gd.pos.y = psgcd[7].gd.pos.y;
8045 psgcd[9].gd.pos.width = -1; psgcd[9].gd.pos.height = 0;
8046 psgcd[9].gd.pos.x = psgcd[3].gd.pos.x+psgcd[3].gd.pos.width-
8047 GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
8048 /*if ( strstrmatch(sf->fontname,"Italic")!=NULL ||strstrmatch(sf->fontname,"Oblique")!=NULL )*/
8049 psgcd[9].gd.flags = gg_visible | gg_enabled;
8050 pslabel[9].text = (unichar_t *) _("_Guess");
8051 pslabel[9].text_is_1byte = true;
8052 pslabel[9].text_in_resource = true;
8053 psgcd[9].gd.label = &pslabel[9];
8054 psgcd[9].gd.handle_controlevent = GFI_GuessItalic;
8055 psgcd[9].creator = GButtonCreate;
8056
8057 /* I've reversed the label, text field order in the gcd here because */
8058 /* that way the text field will be displayed on top of the label rather */
8059 /* than the reverse, and in Russian that's important translation of */
8060 /* "Underline position" is too long. */
8061 psgcd[11].gd.pos.x = 12; psgcd[11].gd.pos.y = psgcd[7].gd.pos.y+26+6;
8062 psgcd[11].gd.flags = gg_visible | gg_enabled;
8063 pslabel[11].text = (unichar_t *) _("Underline _Position:");
8064 pslabel[11].text_is_1byte = true;
8065 pslabel[11].text_in_resource = true;
8066 psgcd[11].gd.label = &pslabel[11];
8067 psgcd[11].creator = GLabelCreate;
8068
8069 psgcd[10].gd.pos.x = 103; psgcd[10].gd.pos.y = psgcd[11].gd.pos.y-6; psgcd[10].gd.pos.width = 47;
8070 psgcd[10].gd.flags = gg_visible | gg_enabled;
8071 sprintf( upbuf, "%g", (double) sf->upos );
8072 pslabel[10].text = (unichar_t *) upbuf;
8073 pslabel[10].text_is_1byte = true;
8074 psgcd[10].gd.label = &pslabel[10];
8075 psgcd[10].gd.cid = CID_UPos;
8076 psgcd[10].creator = GTextFieldCreate;
8077
8078 psgcd[12].gd.pos.x = 155; psgcd[12].gd.pos.y = psgcd[11].gd.pos.y;
8079 psgcd[12].gd.flags = gg_visible | gg_enabled;
8080 pslabel[12].text = (unichar_t *) S_("Underline|_Height:");
8081 pslabel[12].text_is_1byte = true;
8082 pslabel[12].text_in_resource = true;
8083 psgcd[12].gd.label = &pslabel[12];
8084 psgcd[12].creator = GLabelCreate;
8085
8086 psgcd[13].gd.pos.x = 200; psgcd[13].gd.pos.y = psgcd[10].gd.pos.y; psgcd[13].gd.pos.width = 47;
8087 psgcd[13].gd.flags = gg_visible | gg_enabled;
8088 sprintf( uwbuf, "%g", (double) sf->uwidth );
8089 pslabel[13].text = (unichar_t *) uwbuf;
8090 pslabel[13].text_is_1byte = true;
8091 psgcd[13].gd.label = &pslabel[13];
8092 psgcd[13].gd.cid = CID_UWidth;
8093 psgcd[13].creator = GTextFieldCreate;
8094
8095 psgcd[14].gd.pos.x = 12; psgcd[14].gd.pos.y = psgcd[13].gd.pos.y+26;
8096 pslabel[14].text = (unichar_t *) _("Has _Vertical Metrics");
8097 pslabel[14].text_is_1byte = true;
8098 pslabel[14].text_in_resource = true;
8099 psgcd[14].gd.label = &pslabel[14];
8100 psgcd[14].gd.cid = CID_HasVerticalMetrics;
8101 psgcd[14].gd.flags = gg_visible | gg_enabled;
8102 if ( sf->hasvmetrics )
8103 psgcd[14].gd.flags |= gg_cb_on;
8104 psgcd[14].gd.handle_controlevent = GFI_VMetricsCheck;
8105 psgcd[14].creator = GCheckBoxCreate;
8106 k = 15;
8107
8108 psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
8109 psgcd[k].gd.flags = gg_visible | gg_enabled;
8110 pslabel[k].text = (unichar_t *) _("Interpretation:");
8111 pslabel[k].text_is_1byte = true;
8112 pslabel[k].text_in_resource = true;
8113 psgcd[k].gd.label = &pslabel[k];
8114 psgcd[k++].creator = GLabelCreate;
8115
8116 psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
8117 psgcd[k].gd.flags = gg_visible | gg_enabled;
8118 psgcd[k].gd.u.list = interpretations;
8119 psgcd[k].gd.cid = CID_Interpretation;
8120 psgcd[k].creator = GListButtonCreate;
8121 for ( i=0; interpretations[i].text!=NULL || interpretations[i].line; ++i ) {
8122 if ( (void *) (sf->uni_interp)==interpretations[i].userdata &&
8123 interpretations[i].text!=NULL ) {
8124 interpretations[i].selected = true;
8125 psgcd[k].gd.label = &interpretations[i];
8126 } else
8127 interpretations[i].selected = false;
8128 }
8129 ++k;
8130
8131 psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
8132 psgcd[k].gd.flags = gg_visible | gg_enabled;
8133 pslabel[k].text = (unichar_t *) _("Name List:");
8134 pslabel[k].text_is_1byte = true;
8135 pslabel[k].text_in_resource = true;
8136 psgcd[k].gd.label = &pslabel[k];
8137 psgcd[k++].creator = GLabelCreate;
8138
8139 psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
8140 psgcd[k].gd.flags = gg_visible | gg_enabled;
8141 psgcd[k].gd.cid = CID_Namelist;
8142 psgcd[k].creator = GListButtonCreate;
8143 nlnames = AllNamelistNames();
8144 for ( i=0; nlnames[i]!=NULL; ++i);
8145 namelistnames = calloc(i+1,sizeof(GTextInfo));
8146 for ( i=0; nlnames[i]!=NULL; ++i) {
8147 namelistnames[i].text = (unichar_t *) nlnames[i];
8148 namelistnames[i].text_is_1byte = true;
8149 if ( strcmp(_(sf->for_new_glyphs->title),nlnames[i])==0 ) {
8150 namelistnames[i].selected = true;
8151 psgcd[k].gd.label = &namelistnames[i];
8152 }
8153 }
8154 psgcd[k++].gd.u.list = namelistnames;
8155 free(nlnames);
8156
8157
8158 if ( sf->subfontcnt!=0 ) {
8159 for ( i=0; i<=13; ++i )
8160 psgcd[i].gd.flags &= ~gg_enabled;
8161 } else if ( sf->cidmaster!=NULL ) {
8162 for ( i=14; i<=16; ++i )
8163 psgcd[i].gd.flags &= ~gg_enabled;
8164 }
8165
8166 psarray[0] = &psb2[0];
8167 psarray[1] = &psgcd[14];
8168 j=2;
8169 psarray[j++] = &psb2[1];
8170 psrow = j;
8171 psarray[j++] = GCD_Glue;
8172 psarray[j++] = NULL;
8173
8174 psarray2[0] = &psgcd[0]; psarray2[1] = &psgcd[1]; psarray2[2] = &psgcd[2]; psarray2[3] = &psgcd[3]; psarray2[4] = NULL;
8175 psarray2[5] = &psgcd[4]; psarray2[6] = &psgcd[5]; psarray2[7] = &psgcd[6]; psarray2[8] = GCD_ColSpan; psarray2[9] = NULL;
8176 psarray2[10] = &psgcd[8]; psarray2[11] = &psgcd[7]; psarray2[12] = &psgcd[9]; psarray2[13] = GCD_ColSpan; psarray2[14] = NULL;
8177 psarray2[15] = &psgcd[11]; psarray2[16] = &psgcd[10]; psarray2[17] = &psgcd[12]; psarray2[18] = &psgcd[13]; psarray2[19] = NULL;
8178 psarray2[20] = NULL;
8179
8180 psarray4[0] = &psgcd[k-4]; psarray4[1] = &psgcd[k-3]; psarray4[2] = NULL;
8181 psarray4[3] = &psgcd[k-2]; psarray4[4] = &psgcd[k-1]; psarray4[5] = NULL;
8182 psarray4[6] = NULL;
8183
8184 memset(psb,0,sizeof(psb));
8185 psb[0].gd.flags = gg_enabled|gg_visible;
8186 psb[0].gd.u.boxelements = psarray;
8187 psb[0].creator = GVBoxCreate;
8188
8189 memset(psb2,0,sizeof(psb2));
8190 psb2[0].gd.flags = gg_enabled|gg_visible;
8191 psb2[0].gd.u.boxelements = psarray2;
8192 psb2[0].creator = GHVBoxCreate;
8193
8194 psb2[1].gd.flags = gg_enabled|gg_visible;
8195 psb2[1].gd.u.boxelements = psarray4;
8196 psb2[1].creator = GHVBoxCreate;
8197 /******************************************************************************/
8198
8199 memset(&llabel,0,sizeof(llabel));
8200 memset(&lgcd,0,sizeof(lgcd));
8201 memset(&lbox,0,sizeof(lbox));
8202
8203 ltype = -1;
8204 for ( j=0; j<sf->layer_cnt; ++j ) {
8205 if ( ltype==-1 )
8206 ltype = sf->layers[j].order2;
8207 else if ( ltype!=sf->layers[j].order2 )
8208 ltype = -2;
8209 }
8210
8211 k = j = 0;
8212
8213 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
8214 llabel[k].text = (unichar_t *) _("Font Type:");
8215 llabel[k].text_is_1byte = true;
8216 llabel[k].text_in_resource = true;
8217 lgcd[k].gd.label = &llabel[k];
8218 lgcd[k].gd.flags = (gg_visible | gg_enabled);
8219 lgcd[k++].creator = GLabelCreate;
8220 larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_ColSpan; larray2[j++] = GCD_Glue; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
8221
8222 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+k;
8223 llabel[k].text = (unichar_t *) _("_Outline Font");
8224 llabel[k].text_is_1byte = true;
8225 llabel[k].text_in_resource = true;
8226 lgcd[k].gd.label = &llabel[k];
8227 lgcd[k].gd.flags = (!sf->strokedfont && !sf->multilayer)?
8228 (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
8229 lgcd[k].gd.handle_controlevent = GFI_Type3Change;
8230 lgcd[k++].creator = GRadioCreate;
8231 larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_Glue; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
8232
8233 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+14;
8234 llabel[k].text = (unichar_t *) _("_Type3 Multi Layered Font");
8235 llabel[k].text_is_1byte = true;
8236 llabel[k].text_in_resource = true;
8237 lgcd[k].gd.label = &llabel[k];
8238 lgcd[k].gd.flags = ltype!=0 ? (gg_visible| gg_rad_continueold) :
8239 sf->multilayer ? (gg_visible | gg_enabled| gg_cb_on | gg_rad_continueold) :
8240 (gg_visible | gg_enabled| gg_rad_continueold);
8241 lgcd[k].gd.cid = CID_IsMultiLayer;
8242 lgcd[k].gd.handle_controlevent = GFI_Type3Change;
8243 lgcd[k].creator = GRadioCreate;
8244 lgcd[k++].gd.popup_msg = _("Allow editing of multiple colors and shades, fills and strokes.\nMulti layered fonts can only be output as type3 or svg fonts.");
8245 larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_ColSpan; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
8246
8247 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+14;
8248 llabel[k].text = (unichar_t *) _("_Stroked Font");
8249 llabel[k].text_is_1byte = true;
8250 llabel[k].text_in_resource = true;
8251 lgcd[k].gd.label = &llabel[k];
8252 lgcd[k].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled| gg_cb_on) : (gg_visible | gg_enabled);
8253 lgcd[k].gd.cid = CID_IsStrokedFont;
8254 lgcd[k].gd.handle_controlevent = GFI_Type3Change;
8255 lgcd[k].creator = GRadioCreate;
8256 lgcd[k++].gd.popup_msg = _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
8257 larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1];
8258
8259 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+20;
8260 llabel[k].text = (unichar_t *) _(" Stroke _Width:");
8261 llabel[k].text_is_1byte = true;
8262 llabel[k].text_in_resource = true;
8263 lgcd[k].gd.label = &llabel[k];
8264 lgcd[k].gd.flags = gg_visible | gg_enabled;
8265 lgcd[k++].creator = GLabelCreate;
8266 larray2[j++] = &lgcd[k-1];
8267
8268 sprintf( swbuf,"%g", (double) sf->strokewidth );
8269 lgcd[k].gd.pos.x = 115; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y-6; lgcd[k].gd.pos.width = 137;
8270 lgcd[k].gd.flags = gg_visible | gg_enabled;
8271 llabel[k].text = (unichar_t *) swbuf;
8272 llabel[k].text_is_1byte = true;
8273 lgcd[k].gd.label = &llabel[k];
8274 lgcd[k].gd.cid = CID_StrokeWidth;
8275 lgcd[k++].creator = GTextFieldCreate;
8276 larray2[j++] = &lgcd[k-1]; larray2[j++] = NULL; larray2[j++] = NULL;
8277
8278 lbox[2].gd.flags = gg_enabled|gg_visible;
8279 lbox[2].gd.u.boxelements = larray2;
8280 lbox[2].creator = GHVBoxCreate;
8281 larray[0] = &lbox[2]; larray[1] = NULL;
8282
8283 llabel[k].text = (unichar_t *) _("All layers _cubic");
8284 llabel[k].text_is_1byte = true;
8285 llabel[k].text_in_resource = true;
8286 lgcd[k].gd.label = &llabel[k];
8287 lgcd[k].gd.flags = ltype==0 || sf->multilayer ?
8288 (gg_visible | gg_enabled | gg_cb_on) :
8289 (gg_visible | gg_enabled);
8290 lgcd[k].gd.cid = CID_IsOrder3;
8291 lgcd[k].gd.handle_controlevent = GFI_OrderChange;
8292 lgcd[k].creator = GRadioCreate;
8293 lgcd[k++].gd.popup_msg = _(
8294 "Use cubic (that is postscript) splines to hold the outlines of all\n"
8295 "layers of this font. Cubic splines are generally easier to edit\n"
8296 "than quadratic (and you may still generate a truetype font from them).");
8297
8298 llabel[k].text = (unichar_t *) _("All layers _quadratic");
8299 llabel[k].text_is_1byte = true;
8300 llabel[k].text_in_resource = true;
8301 lgcd[k].gd.label = &llabel[k];
8302 lgcd[k].gd.flags = sf->multilayer ? (gg_visible) :
8303 ltype==1 ? (gg_visible | gg_enabled | gg_cb_on) :
8304 (gg_visible | gg_enabled);
8305 lgcd[k].gd.cid = CID_IsOrder2;
8306 lgcd[k].gd.handle_controlevent = GFI_OrderChange;
8307 lgcd[k].creator = GRadioCreate;
8308 lgcd[k++].gd.popup_msg = _(
8309 "Use quadratic (that is truetype) splines to hold the outlines of all\n"
8310 "layers of this font rather than cubic (postscript) splines.");
8311
8312 llabel[k].text = (unichar_t *) _("_Mixed");
8313 llabel[k].text_is_1byte = true;
8314 llabel[k].text_in_resource = true;
8315 lgcd[k].gd.label = &llabel[k];
8316 lgcd[k].gd.flags = sf->multilayer ? (gg_visible) :
8317 ltype<0 ? (gg_visible | gg_enabled | gg_cb_on) :
8318 (gg_visible | gg_enabled);
8319 lgcd[k].gd.handle_controlevent = GFI_OrderChange;
8320 lgcd[k].gd.cid = CID_IsMixed;
8321 lgcd[k].creator = GRadioCreate;
8322 lgcd[k++].gd.popup_msg = _(
8323 "The order of each layer of the font can be controlled\n"
8324 "individually. This might be useful if you wished to\n"
8325 "retain both quadratic and cubic versions of a font.");
8326 larray3[0] = &lgcd[k-3]; larray3[1] = &lgcd[k-2]; larray3[2] = &lgcd[k-1]; larray3[3] = GCD_Glue; larray3[4] = NULL;
8327
8328 lbox[3].gd.flags = gg_enabled|gg_visible;
8329 lbox[3].gd.u.boxelements = larray3;
8330 lbox[3].creator = GHBoxCreate;
8331 larray[2] = GCD_HPad10; larray[3] = NULL;
8332 larray[4] = &lbox[3]; larray[5] = NULL;
8333
8334 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
8335 llabel[k].text = (unichar_t *) _("Guidelines:");
8336 llabel[k].text_is_1byte = true;
8337 llabel[k].text_in_resource = true;
8338 lgcd[k].gd.label = &llabel[k];
8339 lgcd[k].gd.flags = (gg_visible | gg_enabled);
8340 lgcd[k++].creator = GLabelCreate;
8341 larray4[0] = &lgcd[k-1];
8342
8343 llabel[k].text = (unichar_t *) _("Quadratic");
8344 llabel[k].text_is_1byte = true;
8345 llabel[k].text_in_resource = true;
8346 lgcd[k].gd.label = &llabel[k];
8347 lgcd[k].gd.flags = sf->multilayer || ltype>=0 ? (gg_visible) :
8348 (gg_visible | gg_enabled);
8349 if ( sf->grid.order2 )
8350 lgcd[k].gd.flags |= gg_cb_on;
8351 lgcd[k].gd.cid = CID_GuideOrder2;
8352 lgcd[k].creator = GCheckBoxCreate;
8353 lgcd[k++].gd.popup_msg = _(
8354 "Use quadratic splines for the guidelines layer of the font");
8355 larray4[1] = &lgcd[k-1]; larray4[2] = GCD_Glue; larray4[3] = NULL;
8356
8357 lbox[4].gd.flags = gg_enabled|gg_visible;
8358 lbox[4].gd.u.boxelements = larray4;
8359 lbox[4].creator = GHBoxCreate;
8360 larray[6] = &lbox[4]; larray[7] = NULL;
8361
8362 lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
8363 llabel[k].text = (unichar_t *) _("\nLayers:");
8364 llabel[k].text_is_1byte = true;
8365 llabel[k].text_in_resource = true;
8366 lgcd[k].gd.label = &llabel[k];
8367 lgcd[k].gd.flags = (gg_visible | gg_enabled);
8368 lgcd[k++].creator = GLabelCreate;
8369 larray[8] = &lgcd[k-1]; larray[9] = NULL;
8370
8371 LayersMatrixInit(&layersmi,d);
8372
8373 lgcd[k].gd.pos.width = 300; lgcd[k].gd.pos.height = 180;
8374 lgcd[k].gd.flags = sf->multilayer ? gg_visible : (gg_enabled | gg_visible);
8375 lgcd[k].gd.cid = CID_Backgrounds;
8376 lgcd[k].gd.u.matrix = &layersmi;
8377 lgcd[k].data = d;
8378 lgcd[k++].creator = GMatrixEditCreate;
8379 larray[10] = &lgcd[k-1]; larray[11] = NULL; larray[12] = NULL;
8380
8381 lbox[0].gd.flags = gg_enabled|gg_visible;
8382 lbox[0].gd.u.boxelements = larray;
8383 lbox[0].creator = GHVGroupCreate;
8384
8385 /******************************************************************************/
8386
8387 memset(&plabel,0,sizeof(plabel));
8388 memset(&pgcd,0,sizeof(pgcd));
8389
8390 PSPrivate_MatrixInit(&private_mi,d);
8391
8392 i=0;
8393 pgcd[i].gd.pos.width = 300; pgcd[i].gd.pos.height = 200;
8394 pgcd[i].gd.flags = gg_enabled | gg_visible;
8395 pgcd[i].gd.cid = CID_Private;
8396 pgcd[i].gd.u.matrix = &private_mi;
8397 pgcd[i].gd.popup_msg = _(
8398 "The PostScript 'Private' dictionary gives you control over\n"
8399 "several font-wide versions of hinting.\n"
8400 "The 'Private' dictionary only applies to PostScript fonts.");
8401 pgcd[i].data = d;
8402 pgcd[i++].creator = GMatrixEditCreate;
8403 pparray[0] = &pgcd[0]; pparray[1] = NULL;
8404
8405 memset(ppbox,0,sizeof(ppbox));
8406 ppbox[0].gd.flags = gg_enabled|gg_visible;
8407 ppbox[0].gd.u.boxelements = pparray;
8408 ppbox[0].creator = GVBoxCreate;
8409
8410
8411 memset(&privatelabel_def,0,sizeof(privatelabel_def));
8412 memset(&privategcd_def,0,sizeof(privategcd_def));
8413 privategcd_def[0].gd.flags = gg_visible ;
8414 privatelabel_def[0].text = (unichar_t *) _("_Guess");
8415 privatelabel_def[0].text_is_1byte = true;
8416 privatelabel_def[0].text_in_resource = true;
8417 privategcd_def[0].gd.label = &privatelabel_def[0];
8418 privategcd_def[0].gd.handle_controlevent = PI_Guess;
8419 privategcd_def[0].gd.cid = CID_Guess;
8420 privategcd_def[0].creator = GButtonCreate;
8421
8422 privategcd_def[1].gd.flags = gg_visible;
8423 privatelabel_def[1].text = (unichar_t *) _("_Histogram");
8424 privatelabel_def[1].text_is_1byte = true;
8425 privatelabel_def[1].text_in_resource = true;
8426 privategcd_def[1].gd.label = &privatelabel_def[1];
8427 privategcd_def[1].gd.handle_controlevent = PI_Hist;
8428 privategcd_def[1].gd.cid = CID_Hist;
8429 privategcd_def[1].gd.popup_msg = _("Histogram Dialog");
8430 privategcd_def[1].creator = GButtonCreate;
8431
8432 /******************************************************************************/
8433 memset(&vlabel,0,sizeof(vlabel));
8434 memset(&vgcd,0,sizeof(vgcd));
8435
8436 vgcd[0].gd.pos.x = 10; vgcd[0].gd.pos.y = 12;
8437 vlabel[0].text = (unichar_t *) _("_Weight Class");
8438 vlabel[0].text_is_1byte = true;
8439 vlabel[0].text_in_resource = true;
8440 vgcd[0].gd.label = &vlabel[0];
8441 vgcd[0].gd.flags = gg_visible | gg_enabled;
8442 vgcd[0].creator = GLabelCreate;
8443
8444 vgcd[1].gd.pos.x = 90; vgcd[1].gd.pos.y = vgcd[0].gd.pos.y-6; vgcd[1].gd.pos.width = 140;
8445 vgcd[1].gd.flags = gg_visible | gg_enabled;
8446 vgcd[1].gd.cid = CID_WeightClass;
8447 vgcd[1].gd.u.list = weightclass;
8448 vgcd[1].creator = GListFieldCreate;
8449
8450 vgcd[2].gd.pos.x = 10; vgcd[2].gd.pos.y = vgcd[1].gd.pos.y+26+6;
8451 vlabel[2].text = (unichar_t *) _("Width _Class");
8452 vlabel[2].text_is_1byte = true;
8453 vlabel[2].text_in_resource = true;
8454 vgcd[2].gd.label = &vlabel[2];
8455 vgcd[2].gd.flags = gg_visible | gg_enabled;
8456 vgcd[2].creator = GLabelCreate;
8457
8458 vgcd[3].gd.pos.x = 90; vgcd[3].gd.pos.y = vgcd[2].gd.pos.y-6;
8459 vgcd[3].gd.flags = gg_visible | gg_enabled;
8460 vgcd[3].gd.cid = CID_WidthClass;
8461 vgcd[3].gd.u.list = widthclass;
8462 vgcd[3].creator = GListButtonCreate;
8463
8464 vgcd[4].gd.pos.x = 10; vgcd[4].gd.pos.y = vgcd[3].gd.pos.y+26+6;
8465 vlabel[4].text = (unichar_t *) _("P_FM Family");
8466 vlabel[4].text_is_1byte = true;
8467 vlabel[4].text_in_resource = true;
8468 vgcd[4].gd.label = &vlabel[4];
8469 vgcd[4].gd.flags = gg_visible | gg_enabled;
8470 vgcd[4].creator = GLabelCreate;
8471
8472 vgcd[5].gd.pos.x = 90; vgcd[5].gd.pos.y = vgcd[4].gd.pos.y-6; vgcd[5].gd.pos.width = 140;
8473 vgcd[5].gd.flags = gg_visible | gg_enabled;
8474 vgcd[5].gd.cid = CID_PFMFamily;
8475 vgcd[5].gd.u.list = pfmfamily;
8476 vgcd[5].creator = GListButtonCreate;
8477
8478 vgcd[6].gd.pos.x = 10; vgcd[6].gd.pos.y = vgcd[5].gd.pos.y+26+6;
8479 vlabel[6].text = (unichar_t *) _("_Embeddable");
8480 vlabel[6].text_is_1byte = true;
8481 vlabel[6].text_in_resource = true;
8482 vgcd[6].gd.label = &vlabel[6];
8483 vgcd[6].gd.flags = gg_visible | gg_enabled;
8484 vgcd[6].gd.popup_msg = _("Can this font be embedded in a downloadable (pdf)\ndocument, and if so, what behaviors are permitted on\nboth the document and the font.");
8485 vgcd[6].creator = GLabelCreate;
8486
8487 vgcd[7].gd.pos.x = 90; vgcd[7].gd.pos.y = vgcd[6].gd.pos.y-6;
8488 vgcd[7].gd.pos.width = 140;
8489 vgcd[7].gd.flags = gg_visible | gg_enabled;
8490 vgcd[7].gd.cid = CID_FSType;
8491 vgcd[7].gd.u.list = fstype;
8492 vgcd[7].gd.popup_msg = vgcd[6].gd.popup_msg;
8493 vgcd[7].creator = GListButtonCreate;
8494 fstype[0].selected = fstype[1].selected =
8495 fstype[2].selected = fstype[3].selected = false;
8496 if ( sf->pfminfo.fstype == -1 )
8497 i = 3;
8498 else if ( sf->pfminfo.fstype&0x8 )
8499 i = 2;
8500 else if ( sf->pfminfo.fstype&0x4 )
8501 i = 1;
8502 else if ( sf->pfminfo.fstype&0x2 )
8503 i = 0;
8504 else
8505 i = 3;
8506 fstype[i].selected = true;
8507 vgcd[7].gd.label = &fstype[i];
8508
8509 vgcd[8].gd.pos.x = 20; vgcd[8].gd.pos.y = vgcd[7].gd.pos.y+26;
8510 vlabel[8].text = (unichar_t *) _("No Subsetting");
8511 vlabel[8].text_is_1byte = true;
8512 vgcd[8].gd.label = &vlabel[8];
8513 vgcd[8].gd.flags = gg_visible | gg_enabled;
8514 if ( sf->pfminfo.fstype!=-1 && (sf->pfminfo.fstype&0x100) )
8515 vgcd[8].gd.flags |= gg_cb_on;
8516 vgcd[8].gd.popup_msg = _("If set then the entire font must be\nembedded in a document when any character is.\nOtherwise the document creator need\nonly include the characters it uses.");
8517 vgcd[8].gd.cid = CID_NoSubsetting;
8518 vgcd[8].creator = GCheckBoxCreate;
8519
8520 vgcd[9].gd.pos.x = 110; vgcd[9].gd.pos.y = vgcd[8].gd.pos.y;
8521 vlabel[9].text = (unichar_t *) _("Only Embed Bitmaps");
8522 vlabel[9].text_is_1byte = true;
8523 vgcd[9].gd.label = &vlabel[9];
8524 vgcd[9].gd.flags = gg_visible | gg_enabled;
8525 if ( sf->pfminfo.fstype!=-1 && ( sf->pfminfo.fstype&0x200 ))
8526 vgcd[9].gd.flags |= gg_cb_on;
8527 vgcd[9].gd.popup_msg = _("Only Bitmaps may be embedded.\nOutline descriptions may not be\n(if font file contains no bitmaps\nthen nothing may be embedded).");
8528 vgcd[9].gd.cid = CID_OnlyBitmaps;
8529 vgcd[9].creator = GCheckBoxCreate;
8530
8531 vgcd[10].gd.pos.x = 10; vgcd[10].gd.pos.y = vgcd[9].gd.pos.y+24;
8532 vlabel[10].text = (unichar_t *) _("Vendor ID:");
8533 vlabel[10].text_is_1byte = true;
8534 vgcd[10].gd.label = &vlabel[10];
8535 vgcd[10].gd.flags = gg_visible | gg_enabled;
8536 vgcd[10].creator = GLabelCreate;
8537
8538 vgcd[11].gd.pos.x = 90; vgcd[11].gd.pos.y = vgcd[11-1].gd.pos.y-4;
8539 vgcd[11].gd.pos.width = 50;
8540 vgcd[11].gd.flags = gg_visible | gg_enabled;
8541 /* value set later */
8542 vgcd[11].gd.cid = CID_Vendor;
8543 vgcd[11].creator = GTextFieldCreate;
8544
8545 vgcd[12].gd.pos.x = 10; vgcd[12].gd.pos.y = vgcd[11].gd.pos.y+24+6;
8546 vlabel[12].text = (unichar_t *) _("_IBM Family:");
8547 vlabel[12].text_is_1byte = true;
8548 vlabel[12].text_in_resource = true;
8549 vgcd[12].gd.label = &vlabel[12];
8550 vgcd[12].gd.flags = gg_visible | gg_enabled;
8551 vgcd[12].creator = GLabelCreate;
8552
8553 vgcd[13].gd.pos.x = 90; vgcd[13].gd.pos.y = vgcd[12].gd.pos.y-4; vgcd[13].gd.pos.width = vgcd[7].gd.pos.width;
8554 vgcd[13].gd.flags = gg_visible | gg_enabled;
8555 vgcd[13].gd.cid = CID_IBMFamily;
8556 vgcd[13].gd.u.list = ibmfamily;
8557 vgcd[13].creator = GListButtonCreate;
8558
8559 vgcd[15].gd.pos.x = 10; vgcd[15].gd.pos.y = vgcd[11].gd.pos.y+24+6;
8560 vlabel[15].text = (unichar_t *) _("_OS/2 Version");
8561 vlabel[15].text_is_1byte = true;
8562 vlabel[15].text_in_resource = true;
8563 vgcd[15].gd.label = &vlabel[15];
8564 vgcd[15].gd.popup_msg = _("The 'OS/2' table has changed slightly over the years.\nGenerally fields have been added, but occasionally their\nmeanings have been redefined." );
8565 vgcd[15].gd.flags = gg_visible | gg_enabled;
8566 vgcd[15].creator = GLabelCreate;
8567
8568 vgcd[16].gd.pos.x = 90; vgcd[16].gd.pos.y = vgcd[15].gd.pos.y-4; vgcd[16].gd.pos.width = vgcd[7].gd.pos.width;
8569 vgcd[16].gd.flags = gg_visible | gg_enabled;
8570 vgcd[16].gd.cid = CID_OS2Version;
8571 vgcd[16].gd.u.list = os2versions;
8572 vgcd[16].creator = GListFieldCreate;
8573
8574 vgcd[17].gd.pos.x = 10; vgcd[17].gd.pos.y = vgcd[13].gd.pos.y+26+6;
8575 vlabel[17].text = (unichar_t *) _("Style Map:");
8576 vlabel[17].text_is_1byte = true;
8577 vlabel[17].text_in_resource = true;
8578 vgcd[17].gd.label = &vlabel[17];
8579 vgcd[17].gd.flags = gg_visible | gg_enabled;
8580 vgcd[17].creator = GLabelCreate;
8581
8582 vgcd[18].gd.pos.x = 90; vgcd[18].gd.pos.y = vgcd[17].gd.pos.y-6; vgcd[18].gd.pos.width = vgcd[7].gd.pos.width;
8583 vgcd[18].gd.flags = gg_visible | gg_enabled;
8584 vgcd[18].gd.cid = CID_StyleMap;
8585 vgcd[18].gd.u.list = stylemap;
8586 vgcd[18].creator = GListButtonCreate;
8587 stylemap[0].selected = stylemap[1].selected =
8588 stylemap[2].selected = stylemap[3].selected =
8589 stylemap[4].selected = stylemap[5].selected = false;
8590 if ( sf->pfminfo.stylemap == 0x00 )
8591 i = 1;
8592 else if ( sf->pfminfo.stylemap == 0x40 )
8593 i = 2;
8594 else if ( sf->pfminfo.stylemap == 0x01 )
8595 i = 3;
8596 else if ( sf->pfminfo.stylemap == 0x20 )
8597 i = 4;
8598 else if ( sf->pfminfo.stylemap == 0x21 )
8599 i = 5;
8600 else
8601 i = 0;
8602 stylemap[i].selected = true;
8603 vgcd[18].gd.label = &stylemap[i];
8604
8605 vgcd[14].gd.pos.x = 10; vgcd[14].gd.pos.y = vgcd[18].gd.pos.y+24+6;
8606 vlabel[14].text = (unichar_t *) _("Weight, Width, Slope Only");
8607 vlabel[14].text_is_1byte = true;
8608 vlabel[14].text_in_resource = true;
8609 vgcd[14].gd.label = &vlabel[14];
8610 vgcd[14].gd.cid = CID_WeightWidthSlopeOnly;
8611 vgcd[14].gd.popup_msg = _("MS needs to know whether a font family's members differ\nonly in weight, width and slope (and not in other variables\nlike optical size)." );
8612 vgcd[14].gd.flags = gg_visible | gg_enabled;
8613 vgcd[14].creator = GCheckBoxCreate;
8614
8615 vradio[0] = GCD_Glue; vradio[1] = &vgcd[8]; vradio[2] = &vgcd[9]; vradio[3] = GCD_Glue; vradio[4] = NULL;
8616
8617 varray[0] = &vgcd[15]; varray[1] = &vgcd[16]; varray[2] = NULL;
8618 varray[3] = &vgcd[0]; varray[4] = &vgcd[1]; varray[5] = NULL;
8619 varray[6] = &vgcd[2]; varray[7] = &vgcd[3]; varray[8] = NULL;
8620 varray[9] = &vgcd[4]; varray[10] = &vgcd[5]; varray[11] = NULL;
8621 varray[12] = &vgcd[6]; varray[13] = &vgcd[7]; varray[14] = NULL;
8622 varray[15] = &vbox[2]; varray[16] = GCD_ColSpan; varray[17] = NULL;
8623 varray[18] = &vgcd[10]; varray[19] = &vgcd[11]; varray[20] = NULL;
8624 varray[21] = &vgcd[12]; varray[22] = &vgcd[13]; varray[23] = NULL;
8625 varray[24] = &vgcd[17]; varray[25] = &vgcd[18]; varray[26] = NULL;
8626 varray[27] = &vgcd[14]; varray[28] = GCD_ColSpan; varray[29] = NULL;
8627 varray[30] = GCD_Glue; varray[31] = GCD_Glue; varray[32] = NULL;
8628 varray[33] = GCD_Glue; varray[34] = GCD_Glue; varray[35] = NULL;
8629 varray[36] = varray[40] = NULL;
8630
8631 memset(vbox,0,sizeof(vbox));
8632 vbox[0].gd.flags = gg_enabled|gg_visible;
8633 vbox[0].gd.u.boxelements = varray;
8634 vbox[0].creator = GHVBoxCreate;
8635
8636 vbox[2].gd.flags = gg_enabled|gg_visible;
8637 vbox[2].gd.u.boxelements = vradio;
8638 vbox[2].creator = GHBoxCreate;
8639
8640 /******************************************************************************/
8641
8642 memset(&metgcd,0,sizeof(metgcd));
8643 memset(&metlabel,'\0',sizeof(metlabel));
8644 memset(&metarray,'\0',sizeof(metarray));
8645
8646 i = j = 0;
8647
8648 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = 9;
8649 metlabel[i].text = (unichar_t *) _("Win _Ascent Offset:");
8650 metlabel[i].text_is_1byte = true;
8651 metlabel[i].text_in_resource = true;
8652 metgcd[i].gd.label = &metlabel[i];
8653 metgcd[i].gd.flags = gg_visible | gg_enabled;
8654 metgcd[i].gd.popup_msg = _("Anything outside the OS/2 WinAscent &\nWinDescent fields will be clipped by windows.\nThis includes marks, etc. that have been repositioned by GPOS.\n(The descent field is usually positive.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in OS/2.\nIf set then any number you enter will be added to the\nfont's bounds. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.\n\nNote: WinDescent is a POSITIVE number for\nthings below the baseline");
8655 metgcd[i].gd.cid = CID_WinAscentLab;
8656 metarray[j++] = &metgcd[i];
8657 metgcd[i++].creator = GLabelCreate;
8658
8659 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8660 metgcd[i].gd.pos.width = 50;
8661 metgcd[i].gd.flags = gg_visible | gg_enabled;
8662 /* value set later */
8663 metgcd[i].gd.cid = CID_WinAscent;
8664 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8665 metarray[j++] = &metgcd[i];
8666 metgcd[i++].creator = GTextFieldCreate;
8667
8668 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8669 metlabel[i].text = (unichar_t *) _("Is Offset");
8670 metlabel[i].text_is_1byte = true;
8671 metgcd[i].gd.label = &metlabel[i];
8672 metgcd[i].gd.flags = gg_visible | gg_enabled;
8673 /* value set later */
8674 metgcd[i].gd.cid = CID_WinAscentIsOff;
8675 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8676 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8677 metarray[j++] = &metgcd[i];
8678 metgcd[i++].creator = GCheckBoxCreate;
8679 metarray[j++] = NULL;
8680
8681 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8682 metlabel[i].text = (unichar_t *) _("Win _Descent Offset:");
8683 metlabel[i].text_is_1byte = true;
8684 metlabel[i].text_in_resource = true;
8685 metgcd[i].gd.label = &metlabel[i];
8686 metgcd[i].gd.flags = gg_visible | gg_enabled;
8687 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8688 metgcd[i].gd.cid = CID_WinDescentLab;
8689 metarray[j++] = &metgcd[i];
8690 metgcd[i++].creator = GLabelCreate;
8691
8692 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8693 metgcd[i].gd.pos.width = 50;
8694 metgcd[i].gd.flags = gg_visible | gg_enabled;
8695 /* value set later */
8696 metgcd[i].gd.cid = CID_WinDescent;
8697 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8698 metarray[j++] = &metgcd[i];
8699 metgcd[i++].creator = GTextFieldCreate;
8700
8701 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8702 metlabel[i].text = (unichar_t *) _("Is Offset");
8703 metlabel[i].text_is_1byte = true;
8704 metgcd[i].gd.label = &metlabel[i];
8705 metgcd[i].gd.flags = gg_visible | gg_enabled;
8706 /* value set later */
8707 metgcd[i].gd.cid = CID_WinDescentIsOff;
8708 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8709 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8710 metarray[j++] = &metgcd[i];
8711 metgcd[i++].creator = GCheckBoxCreate;
8712 metarray[j++] = NULL;
8713
8714 metgcd[i].gd.pos.x = 5; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8715 metlabel[i].text = (unichar_t *) _("Really use Typo metrics");
8716 metlabel[i].text_is_1byte = true;
8717 metgcd[i].gd.label = &metlabel[i];
8718 metgcd[i].gd.flags = gg_visible | gg_enabled;
8719 /* value set later */
8720 metgcd[i].gd.cid = CID_UseTypoMetrics;
8721 metgcd[i].gd.popup_msg = _("The specification already says that the typo metrics should be\nused to determine line spacing. But so many\nprograms fail to follow the spec. that MS decided an additional\nbit was needed to remind them to do so.");
8722 metarray[j++] = &metgcd[i]; metarray[j++] = GCD_ColSpan; metarray[j++] = GCD_Glue;
8723 metgcd[i++].creator = GCheckBoxCreate;
8724 metarray[j++] = NULL;
8725
8726 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8727 metlabel[i].text = (unichar_t *) _("_Typo Ascent Offset:");
8728 metlabel[i].text_is_1byte = true;
8729 metlabel[i].text_in_resource = true;
8730 metgcd[i].gd.label = &metlabel[i];
8731 metgcd[i].gd.flags = gg_visible | gg_enabled;
8732 metgcd[i].gd.popup_msg = _("The typo ascent&descent fields are>supposed<\nto specify the line spacing on windows.\nIn fact usually the win ascent/descent fields do.\n(The descent field is usually negative.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in OS/2.\nIf set then any number you enter will be added to the\nEm-size. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.\n\nNOTE: Typo Descent is a NEGATIVE number for\nthings below the baseline");
8733 metgcd[i].gd.cid = CID_TypoAscentLab;
8734 metarray[j++] = &metgcd[i];
8735 metgcd[i++].creator = GLabelCreate;
8736
8737 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8738 metgcd[i].gd.pos.width = 50;
8739 metgcd[i].gd.flags = gg_visible | gg_enabled;
8740 /* value set later */
8741 metgcd[i].gd.cid = CID_TypoAscent;
8742 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8743 metarray[j++] = &metgcd[i];
8744 metgcd[i++].creator = GTextFieldCreate;
8745
8746 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8747 metlabel[i].text = (unichar_t *) _("Is Offset");
8748 metlabel[i].text_is_1byte = true;
8749 metgcd[i].gd.label = &metlabel[i];
8750 metgcd[i].gd.flags = gg_visible | gg_enabled;
8751 /* value set later */
8752 metgcd[i].gd.cid = CID_TypoAscentIsOff;
8753 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8754 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8755 metarray[j++] = &metgcd[i];
8756 metgcd[i++].creator = GCheckBoxCreate;
8757 metarray[j++] = NULL;
8758
8759 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8760 metlabel[i].text = (unichar_t *) _("T_ypo Descent Offset:");
8761 metlabel[i].text_is_1byte = true;
8762 metlabel[i].text_in_resource = true;
8763 metgcd[i].gd.label = &metlabel[i];
8764 metgcd[i].gd.flags = gg_visible | gg_enabled;
8765 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8766 metgcd[i].gd.cid = CID_TypoDescentLab;
8767 metarray[j++] = &metgcd[i];
8768 metgcd[i++].creator = GLabelCreate;
8769
8770 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8771 metgcd[i].gd.pos.width = 50;
8772 metgcd[i].gd.flags = gg_visible | gg_enabled;
8773 /* value set later */
8774 metgcd[i].gd.cid = CID_TypoDescent;
8775 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8776 metarray[j++] = &metgcd[i];
8777 metgcd[i++].creator = GTextFieldCreate;
8778
8779 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8780 metlabel[i].text = (unichar_t *) _("Is Offset");
8781 metlabel[i].text_is_1byte = true;
8782 metgcd[i].gd.label = &metlabel[i];
8783 metgcd[i].gd.flags = gg_visible | gg_enabled;
8784 /* value set later */
8785 metgcd[i].gd.cid = CID_TypoDescentIsOff;
8786 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8787 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8788 metarray[j++] = &metgcd[i];
8789 metgcd[i++].creator = GCheckBoxCreate;
8790 metarray[j++] = NULL;
8791
8792 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8793 metlabel[i].text = (unichar_t *) _("Typo Line _Gap:");
8794 metlabel[i].text_is_1byte = true;
8795 metlabel[i].text_in_resource = true;
8796 metgcd[i].gd.label = &metlabel[i];
8797 metgcd[i].gd.flags = gg_visible | gg_enabled;
8798 metgcd[i].gd.popup_msg = _("Sets the TypoLinegap field in the OS/2 table, used on MS Windows");
8799 metarray[j++] = &metgcd[i];
8800 metgcd[i++].creator = GLabelCreate;
8801
8802 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8803 metgcd[i].gd.pos.width = 50;
8804 metgcd[i].gd.flags = gg_visible | gg_enabled;
8805 /* Line gap value set later */
8806 metgcd[i].gd.cid = CID_TypoLineGap;
8807 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8808 metarray[j++] = &metgcd[i];
8809 metgcd[i++].creator = GTextFieldCreate;
8810 metarray[j++] = GCD_Glue;
8811 metarray[j++] = NULL;
8812
8813 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+4;
8814 metlabel[i].text = (unichar_t *) _("_HHead Ascent Offset:");
8815 metlabel[i].text_is_1byte = true;
8816 metlabel[i].text_in_resource = true;
8817 metgcd[i].gd.label = &metlabel[i];
8818 metgcd[i].gd.flags = gg_visible | gg_enabled;
8819 metgcd[i].gd.popup_msg = _("This specifies the line spacing on the mac.\n(The descent field is usually negative.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in hhea.\nIf set then any number you enter will be added to the\nfont's bounds. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.\n\nNOTE: hhea Descent is a NEGATIVE value for things\nbelow the baseline");
8820 metgcd[i].gd.cid = CID_HHeadAscentLab;
8821 metarray[j++] = &metgcd[i];
8822 metgcd[i++].creator = GLabelCreate;
8823
8824 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8825 metgcd[i].gd.pos.width = 50;
8826 metgcd[i].gd.flags = gg_visible | gg_enabled;
8827 /* value set later */
8828 metgcd[i].gd.cid = CID_HHeadAscent;
8829 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8830 metarray[j++] = &metgcd[i];
8831 metgcd[i++].creator = GTextFieldCreate;
8832
8833 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8834 metlabel[i].text = (unichar_t *) _("Is Offset");
8835 metlabel[i].text_is_1byte = true;
8836 metgcd[i].gd.label = &metlabel[i];
8837 metgcd[i].gd.flags = gg_visible | gg_enabled;
8838 /* value set later */
8839 metgcd[i].gd.cid = CID_HHeadAscentIsOff;
8840 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8841 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8842 metarray[j++] = &metgcd[i];
8843 metgcd[i++].creator = GCheckBoxCreate;
8844 metarray[j++] = NULL;
8845
8846 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8847 metlabel[i].text = (unichar_t *) _("HHead De_scent Offset:");
8848 metlabel[i].text_in_resource = true;
8849 metlabel[i].text_is_1byte = true;
8850 metgcd[i].gd.label = &metlabel[i];
8851 metgcd[i].gd.flags = gg_visible | gg_enabled;
8852 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8853 metgcd[i].gd.cid = CID_HHeadDescentLab;
8854 metarray[j++] = &metgcd[i];
8855 metgcd[i++].creator = GLabelCreate;
8856
8857 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8858 metgcd[i].gd.pos.width = 50;
8859 metgcd[i].gd.flags = gg_visible | gg_enabled;
8860 /* value set later */
8861 metgcd[i].gd.cid = CID_HHeadDescent;
8862 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8863 metarray[j++] = &metgcd[i];
8864 metgcd[i++].creator = GTextFieldCreate;
8865
8866 metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8867 metlabel[i].text = (unichar_t *) _("Is Offset");
8868 metlabel[i].text_is_1byte = true;
8869 metgcd[i].gd.label = &metlabel[i];
8870 metgcd[i].gd.flags = gg_visible | gg_enabled;
8871 /* value set later */
8872 metgcd[i].gd.cid = CID_HHeadDescentIsOff;
8873 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8874 metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8875 metarray[j++] = &metgcd[i];
8876 metgcd[i++].creator = GCheckBoxCreate;
8877 metarray[j++] = NULL;
8878
8879 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8880 metlabel[i].text = (unichar_t *) _("HHead _Line Gap:");
8881 metlabel[i].text_is_1byte = true;
8882 metlabel[i].text_in_resource = true;
8883 metgcd[i].gd.label = &metlabel[i];
8884 metgcd[i].gd.flags = gg_visible | gg_enabled;
8885 metgcd[i].gd.popup_msg = _("Sets the linegap field in the hhea table, used on the mac");
8886 metarray[j++] = &metgcd[i];
8887 metgcd[i++].creator = GLabelCreate;
8888
8889 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8890 metgcd[i].gd.pos.width = 50;
8891 metgcd[i].gd.flags = gg_visible | gg_enabled;
8892 /* Line gap value set later */
8893 metgcd[i].gd.cid = CID_LineGap;
8894 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8895 metarray[j++] = &metgcd[i];
8896 metgcd[i++].creator = GTextFieldCreate;
8897 metarray[j++] = GCD_Glue;
8898 metarray[j++] = NULL;
8899
8900 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+6;
8901 metlabel[i].text = (unichar_t *) _("VHead _Column Spacing:");
8902 metlabel[i].text_is_1byte = true;
8903 metlabel[i].text_in_resource = true;
8904 metgcd[i].gd.label = &metlabel[i];
8905 metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : (gg_visible);
8906 metgcd[i].gd.popup_msg = _("Sets the linegap field in the vhea table.\nThis is the horizontal spacing between rows\nof vertically set text.");
8907 metgcd[i].gd.cid = CID_VLineGapLab;
8908 metarray[j++] = &metgcd[i];
8909 metgcd[i++].creator = GLabelCreate;
8910
8911 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-6;
8912 metgcd[i].gd.pos.width = 50;
8913 metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : (gg_visible);
8914 /* V Line gap value set later */
8915 metgcd[i].gd.cid = CID_VLineGap;
8916 metgcd[i].gd.popup_msg = metgcd[17].gd.popup_msg;
8917 metarray[j++] = &metgcd[i];
8918 metgcd[i++].creator = GTextFieldCreate;
8919 metarray[j++] = GCD_Glue;
8920 metarray[j++] = NULL;
8921
8922 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+6;
8923 metlabel[i].text = (unichar_t *) _("Ca_pital Height:");
8924 metlabel[i].text_is_1byte = true;
8925 metlabel[i].text_in_resource = true;
8926 metgcd[i].gd.label = &metlabel[i];
8927 metgcd[i].gd.flags = gg_visible | gg_enabled;
8928 metgcd[i].gd.popup_msg = _("This denotes the height of X.");
8929 metgcd[i].gd.cid = CID_CapHeightLab;
8930 metarray[j++] = &metgcd[i];
8931 metgcd[i++].creator = GLabelCreate;
8932
8933 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8934 metgcd[i].gd.pos.width = 50;
8935 metgcd[i].gd.flags = gg_visible | gg_enabled;
8936 /* value set later */
8937 metgcd[i].gd.cid = CID_CapHeight;
8938 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8939 metarray[j++] = &metgcd[i];
8940 metgcd[i++].creator = GTextFieldCreate;
8941 metarray[j++] = GCD_Glue;
8942 metarray[j++] = NULL;
8943
8944 metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+6;
8945 metlabel[i].text = (unichar_t *) _("_X Height:");
8946 metlabel[i].text_is_1byte = true;
8947 metlabel[i].text_in_resource = true;
8948 metgcd[i].gd.label = &metlabel[i];
8949 metgcd[i].gd.flags = gg_visible | gg_enabled;
8950 metgcd[i].gd.popup_msg = _("This denotes the height of x.");
8951 metgcd[i].gd.cid = CID_XHeightLab;
8952 metarray[j++] = &metgcd[i];
8953 metgcd[i++].creator = GLabelCreate;
8954
8955 metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8956 metgcd[i].gd.pos.width = 50;
8957 metgcd[i].gd.flags = gg_visible | gg_enabled;
8958 /* value set later */
8959 metgcd[i].gd.cid = CID_XHeight;
8960 metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8961 metarray[j++] = &metgcd[i];
8962 metgcd[i++].creator = GTextFieldCreate;
8963 metarray[j++] = GCD_Glue;
8964 metarray[j++] = NULL;
8965
8966 metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue;
8967
8968 metarray[j++] = NULL; metarray[j++] = NULL;
8969
8970 memset(metbox,0,sizeof(metbox));
8971 metbox[0].gd.flags = gg_enabled|gg_visible;
8972 metbox[0].gd.u.boxelements = metarray;
8973 metbox[0].creator = GHVBoxCreate;
8974 /******************************************************************************/
8975
8976 memset(&ssgcd,0,sizeof(ssgcd));
8977 memset(&sslabel,'\0',sizeof(sslabel));
8978
8979 i = j = 0;
8980
8981 ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = 5;
8982 sslabel[i].text = (unichar_t *) S_("SubscriptSuperUse|Default");
8983 sslabel[i].text_is_1byte = true;
8984 ssgcd[i].gd.label = &sslabel[i];
8985 ssgcd[i].gd.flags = gg_visible | gg_enabled;
8986 /* value set later */
8987 ssgcd[i].gd.cid = CID_SubSuperDefault;
8988 ssgcd[i].gd.handle_controlevent = GFI_SubSuperDefault;
8989 ssarray[j++] = &ssgcd[i];
8990 ssgcd[i++].creator = GCheckBoxCreate;
8991 ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
8992 ssarray[j++] = NULL;
8993
8994 ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+16;
8995 sslabel[i].text = (unichar_t *) _("Subscript");
8996 sslabel[i].text_is_1byte = true;
8997 ssgcd[i].gd.label = &sslabel[i];
8998 ssgcd[i].gd.flags = gg_visible | gg_enabled;
8999 ssarray[j++] = &ssgcd[i];
9000 ssgcd[i++].creator = GLabelCreate;
9001
9002 ssgcd[i].gd.pos.x = 120; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-4;
9003 /* GT: X is a coordinate, the leading spaces help to align it */
9004 sslabel[i].text = (unichar_t *) _(" X");
9005 sslabel[i].text_is_1byte = true;
9006 ssgcd[i].gd.label = &sslabel[i];
9007 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9008 ssarray[j++] = &ssgcd[i];
9009 ssgcd[i++].creator = GLabelCreate;
9010
9011 ssgcd[i].gd.pos.x = 180; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
9012 /* GT: Y is a coordinate, the leading spaces help to align it */
9013 sslabel[i].text = (unichar_t *) _("Y");
9014 sslabel[i].text_is_1byte = true;
9015 ssgcd[i].gd.label = &sslabel[i];
9016 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9017 ssarray[j++] = &ssgcd[i];
9018 ssgcd[i++].creator = GLabelCreate;
9019 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9020
9021 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+14+4;
9022 sslabel[i].text = (unichar_t *) _("Size");
9023 sslabel[i].text_is_1byte = true;
9024 ssgcd[i].gd.label = &sslabel[i];
9025 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9026 ssarray[j++] = &ssgcd[i];
9027 ssgcd[i++].creator = GLabelCreate;
9028
9029 ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9030 ssgcd[i].gd.pos.width = 50;
9031 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9032 /* set later */
9033 ssgcd[i].gd.cid = CID_SubXSize;
9034 ssarray[j++] = &ssgcd[i];
9035 ssgcd[i++].creator = GTextFieldCreate;
9036
9037 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
9038 ssgcd[i].gd.pos.width = 50;
9039 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9040 /* set later */
9041 ssgcd[i].gd.cid = CID_SubYSize;
9042 ssarray[j++] = &ssgcd[i];
9043 ssgcd[i++].creator = GTextFieldCreate;
9044 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9045
9046 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
9047 sslabel[i].text = (unichar_t *) _("Offset");
9048 sslabel[i].text_is_1byte = true;
9049 ssgcd[i].gd.label = &sslabel[i];
9050 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9051 ssarray[j++] = &ssgcd[i];
9052 ssgcd[i++].creator = GLabelCreate;
9053
9054 ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9055 ssgcd[i].gd.pos.width = 50;
9056 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9057 /* set later */
9058 ssgcd[i].gd.cid = CID_SubXOffset;
9059 ssarray[j++] = &ssgcd[i];
9060 ssgcd[i++].creator = GTextFieldCreate;
9061
9062 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
9063 ssgcd[i].gd.pos.width = 50;
9064 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9065 /* set later */
9066 ssgcd[i].gd.cid = CID_SubYOffset;
9067 ssarray[j++] = &ssgcd[i];
9068 ssgcd[i++].creator = GTextFieldCreate;
9069 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9070
9071
9072 ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
9073 sslabel[i].text = (unichar_t *) _("Superscript");
9074 sslabel[i].text_is_1byte = true;
9075 ssgcd[i].gd.label = &sslabel[i];
9076 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9077 ssarray[j++] = &ssgcd[i];
9078 ssgcd[i++].creator = GLabelCreate;
9079 ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
9080 ssarray[j++] = NULL;
9081
9082 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
9083 sslabel[i].text = (unichar_t *) _("Size");
9084 sslabel[i].text_is_1byte = true;
9085 ssgcd[i].gd.label = &sslabel[i];
9086 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9087 ssarray[j++] = &ssgcd[i];
9088 ssgcd[i++].creator = GLabelCreate;
9089
9090 ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9091 ssgcd[i].gd.pos.width = 50;
9092 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9093 /* set later */
9094 ssgcd[i].gd.cid = CID_SuperXSize;
9095 ssarray[j++] = &ssgcd[i];
9096 ssgcd[i++].creator = GTextFieldCreate;
9097
9098 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
9099 ssgcd[i].gd.pos.width = 50;
9100 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9101 /* set later */
9102 ssgcd[i].gd.cid = CID_SuperYSize;
9103 ssarray[j++] = &ssgcd[i];
9104 ssgcd[i++].creator = GTextFieldCreate;
9105 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9106
9107 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
9108 sslabel[i].text = (unichar_t *) _("Offset");
9109 sslabel[i].text_is_1byte = true;
9110 ssgcd[i].gd.label = &sslabel[i];
9111 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9112 ssarray[j++] = &ssgcd[i];
9113 ssgcd[i++].creator = GLabelCreate;
9114
9115 ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9116 ssgcd[i].gd.pos.width = 50;
9117 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9118 /* set later */
9119 ssgcd[i].gd.cid = CID_SuperXOffset;
9120 ssarray[j++] = &ssgcd[i];
9121 ssgcd[i++].creator = GTextFieldCreate;
9122
9123 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
9124 ssgcd[i].gd.pos.width = 50;
9125 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9126 /* set later */
9127 ssgcd[i].gd.cid = CID_SuperYOffset;
9128 ssarray[j++] = &ssgcd[i];
9129 ssgcd[i++].creator = GTextFieldCreate;
9130 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9131
9132
9133 ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
9134 sslabel[i].text = (unichar_t *) _("Strikeout");
9135 sslabel[i].text_is_1byte = true;
9136 ssgcd[i].gd.label = &sslabel[i];
9137 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9138 ssarray[j++] = &ssgcd[i];
9139 ssgcd[i++].creator = GLabelCreate;
9140 ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
9141 ssarray[j++] = NULL;
9142
9143 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
9144 sslabel[i].text = (unichar_t *) _("Size");
9145 sslabel[i].text_is_1byte = true;
9146 ssgcd[i].gd.label = &sslabel[i];
9147 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9148 ssarray[j++] = &ssgcd[i];
9149 ssgcd[i++].creator = GLabelCreate;
9150 ssarray[j++] = GCD_Glue;
9151
9152 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9153 ssgcd[i].gd.pos.width = 50;
9154 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9155 /* set later */
9156 ssgcd[i].gd.cid = CID_StrikeoutSize;
9157 ssarray[j++] = &ssgcd[i];
9158 ssgcd[i++].creator = GTextFieldCreate;
9159 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9160
9161 ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-2].gd.pos.y+26;
9162 sslabel[i].text = (unichar_t *) _("Pos");
9163 sslabel[i].text_is_1byte = true;
9164 ssgcd[i].gd.label = &sslabel[i];
9165 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9166 ssarray[j++] = &ssgcd[i];
9167 ssgcd[i++].creator = GLabelCreate;
9168 ssarray[j++] = GCD_Glue;
9169
9170 ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
9171 ssgcd[i].gd.pos.width = 50;
9172 ssgcd[i].gd.flags = gg_visible | gg_enabled;
9173 /* set later */
9174 ssgcd[i].gd.cid = CID_StrikeoutPos;
9175 ssarray[j++] = &ssgcd[i];
9176 ssgcd[i++].creator = GTextFieldCreate;
9177 ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
9178
9179 ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
9180
9181 ssarray[j++] = NULL; ssarray[j++] = NULL;
9182
9183 memset(ssbox,0,sizeof(ssbox));
9184 ssbox[0].gd.flags = gg_enabled|gg_visible;
9185 ssbox[0].gd.u.boxelements = ssarray;
9186 ssbox[0].creator = GHVBoxCreate;
9187 /******************************************************************************/
9188 memset(&panlabel,0,sizeof(panlabel));
9189 memset(&pangcd,0,sizeof(pangcd));
9190
9191 if ( small_blue_box.main_foreground==0 ) {
9192 extern void _GButtonInit(void);
9193 _GButtonInit();
9194 small_blue_box = _GGadget_button_box;
9195 small_blue_box.border_type = bt_box;
9196 small_blue_box.border_shape = bs_rect;
9197 small_blue_box.border_width = 1;
9198 small_blue_box.flags = 0;
9199 small_blue_box.padding = 0;
9200 small_blue_box.main_foreground = 0x0000ff;
9201 small_blue_box.border_darker = small_blue_box.main_foreground;
9202 small_blue_box.border_darkest = small_blue_box.border_brighter =
9203 small_blue_box.border_brightest =
9204 small_blue_box.main_background = GDrawGetDefaultBackground(NULL);
9205 }
9206
9207 i = j = 0;
9208
9209 pangcd[i].gd.pos.x = 5; pangcd[i].gd.pos.y = 5;
9210 panlabel[i].text = (unichar_t *) S_("PanoseUse|Default");
9211 panlabel[i].text_is_1byte = true;
9212 pangcd[i].gd.label = &panlabel[i];
9213 pangcd[i].gd.flags = gg_visible | gg_enabled;
9214 /* value set later */
9215 pangcd[i].gd.cid = CID_PanDefault;
9216 /*pangcd[i].gd.popup_msg = pangcd[i-1].gd.popup_msg;*/
9217 pangcd[i].gd.handle_controlevent = GFI_PanoseDefault;
9218 panarray[j++] = &pangcd[i];
9219 pangcd[i++].creator = GCheckBoxCreate;
9220
9221 panlabel[i].text = (unichar_t *) _( "http://panose.com/");
9222 panlabel[i].text_is_1byte = true;
9223 pangcd[i].gd.label = &panlabel[i];
9224 pangcd[i].gd.pos.x = 12; ugcd[1].gd.pos.y = 10;
9225 pangcd[i].gd.flags = gg_visible | gg_enabled | gg_dontcopybox;
9226 pangcd[i].gd.box = &small_blue_box;
9227 pangcd[i].gd.handle_controlevent = GFI_ShowPanoseDocs;
9228 pangcd[i++].creator = GButtonCreate;
9229 panarray[j++] = &pangcd[i-1]; panarray[j++] = NULL;
9230
9231 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+14+4;
9232 panlabel[i].text = (unichar_t *) S_("Panose|_Family Kind");
9233 panlabel[i].text_is_1byte = true;
9234 panlabel[i].text_in_resource = true;
9235 pangcd[i].gd.label = &panlabel[i];
9236 pangcd[i].gd.cid = CID_PanFamilyLab;
9237 pangcd[i].gd.flags = gg_visible | gg_enabled;
9238 panarray[j++] = &pangcd[i];
9239 pangcd[i++].creator = GLabelCreate;
9240
9241 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9242 pangcd[i].gd.flags = gg_visible | gg_enabled;
9243 pangcd[i].gd.cid = CID_PanFamily;
9244 pangcd[i].gd.u.list = panfamily;
9245 panarray[j++] = &pangcd[i];
9246 pangcd[i].gd.handle_controlevent = GFI_ChangePanoseFamily;
9247 pangcd[i++].creator = GListButtonCreate;
9248 panarray[j++] = NULL;
9249
9250 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9251 panlabel[i].text = (unichar_t *) _("_Serifs");
9252 panlabel[i].text_is_1byte = true;
9253 panlabel[i].text_in_resource = true;
9254 pangcd[i].gd.label = &panlabel[i];
9255 pangcd[i].gd.cid = CID_PanSerifsLab;
9256 pangcd[i].gd.flags = gg_visible | gg_enabled;
9257 panarray[j++] = &pangcd[i];
9258 pangcd[i++].creator = GLabelCreate;
9259
9260 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9261 pangcd[i].gd.flags = gg_visible | gg_enabled;
9262 pangcd[i].gd.cid = CID_PanSerifs;
9263 pangcd[i].gd.u.list = panserifs;
9264 panarray[j++] = &pangcd[i];
9265 pangcd[i++].creator = GListButtonCreate;
9266 panarray[j++] = NULL;
9267
9268 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9269 panlabel[i].text = (unichar_t *) S_("Panose|_Weight");
9270 panlabel[i].text_is_1byte = true;
9271 panlabel[i].text_in_resource = true;
9272 pangcd[i].gd.label = &panlabel[i];
9273 pangcd[i].gd.cid = CID_PanWeightLab;
9274 pangcd[i].gd.flags = gg_visible | gg_enabled;
9275 panarray[j++] = &pangcd[i];
9276 pangcd[i++].creator = GLabelCreate;
9277
9278 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9279 pangcd[i].gd.flags = gg_visible | gg_enabled;
9280 pangcd[i].gd.cid = CID_PanWeight;
9281 pangcd[i].gd.u.list = panweight;
9282 panarray[j++] = &pangcd[i];
9283 pangcd[i++].creator = GListButtonCreate;
9284 panarray[j++] = NULL;
9285
9286 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9287 panlabel[i].text = (unichar_t *) _("_Proportion");
9288 panlabel[i].text_is_1byte = true;
9289 panlabel[i].text_in_resource = true;
9290 pangcd[i].gd.label = &panlabel[i];
9291 pangcd[i].gd.cid = CID_PanPropLab;
9292 pangcd[i].gd.flags = gg_visible | gg_enabled;
9293 panarray[j++] = &pangcd[i];
9294 pangcd[i++].creator = GLabelCreate;
9295
9296 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9297 pangcd[i].gd.flags = gg_visible | gg_enabled;
9298 pangcd[i].gd.cid = CID_PanProp;
9299 pangcd[i].gd.u.list = panprop;
9300 panarray[j++] = &pangcd[i];
9301 pangcd[i++].creator = GListButtonCreate;
9302 panarray[j++] = NULL;
9303
9304 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9305 panlabel[i].text = (unichar_t *) _("_Contrast");
9306 panlabel[i].text_is_1byte = true;
9307 panlabel[i].text_in_resource = true;
9308 pangcd[i].gd.label = &panlabel[i];
9309 pangcd[i].gd.cid = CID_PanContrastLab;
9310 pangcd[i].gd.flags = gg_visible | gg_enabled;
9311 panarray[j++] = &pangcd[i];
9312 pangcd[i++].creator = GLabelCreate;
9313
9314 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9315 pangcd[i].gd.flags = gg_visible | gg_enabled;
9316 pangcd[i].gd.cid = CID_PanContrast;
9317 pangcd[i].gd.u.list = pancontrast;
9318 panarray[j++] = &pangcd[i];
9319 pangcd[i++].creator = GListButtonCreate;
9320 panarray[j++] = NULL;
9321
9322 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9323 panlabel[i].text = (unichar_t *) _("Stroke _Variation");
9324 panlabel[i].text_is_1byte = true;
9325 panlabel[i].text_in_resource = true;
9326 pangcd[i].gd.label = &panlabel[i];
9327 pangcd[i].gd.cid = CID_PanStrokeVarLab;
9328 pangcd[i].gd.flags = gg_visible | gg_enabled;
9329 panarray[j++] = &pangcd[i];
9330 pangcd[i++].creator = GLabelCreate;
9331
9332 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9333 pangcd[i].gd.flags = gg_visible | gg_enabled;
9334 pangcd[i].gd.cid = CID_PanStrokeVar;
9335 pangcd[i].gd.u.list = panstrokevar;
9336 panarray[j++] = &pangcd[i];
9337 pangcd[i++].creator = GListButtonCreate;
9338 panarray[j++] = NULL;
9339
9340 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9341 panlabel[i].text = (unichar_t *) _("_Arm Style");
9342 panlabel[i].text_is_1byte = true;
9343 panlabel[i].text_in_resource = true;
9344 pangcd[i].gd.label = &panlabel[i];
9345 pangcd[i].gd.cid = CID_PanArmStyleLab;
9346 pangcd[i].gd.flags = gg_visible | gg_enabled;
9347 panarray[j++] = &pangcd[i];
9348 pangcd[i++].creator = GLabelCreate;
9349
9350 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9351 pangcd[i].gd.flags = gg_visible | gg_enabled;
9352 pangcd[i].gd.cid = CID_PanArmStyle;
9353 pangcd[i].gd.u.list = panarmstyle;
9354 panarray[j++] = &pangcd[i];
9355 pangcd[i++].creator = GListButtonCreate;
9356 panarray[j++] = NULL;
9357
9358 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9359 panlabel[i].text = (unichar_t *) _("_Letterform");
9360 panlabel[i].text_is_1byte = true;
9361 panlabel[i].text_in_resource = true;
9362 pangcd[i].gd.label = &panlabel[i];
9363 pangcd[i].gd.cid = CID_PanLetterformLab;
9364 pangcd[i].gd.flags = gg_visible | gg_enabled;
9365 panarray[j++] = &pangcd[i];
9366 pangcd[i++].creator = GLabelCreate;
9367
9368 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9369 pangcd[i].gd.flags = gg_visible | gg_enabled;
9370 pangcd[i].gd.cid = CID_PanLetterform;
9371 pangcd[i].gd.u.list = panletterform;
9372 panarray[j++] = &pangcd[i];
9373 pangcd[i++].creator = GListButtonCreate;
9374 panarray[j++] = NULL;
9375
9376 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9377 panlabel[i].text = (unichar_t *) _("_Midline");
9378 panlabel[i].text_is_1byte = true;
9379 panlabel[i].text_in_resource = true;
9380 pangcd[i].gd.label = &panlabel[i];
9381 pangcd[i].gd.cid = CID_PanMidLineLab;
9382 pangcd[i].gd.flags = gg_visible | gg_enabled;
9383 panarray[j++] = &pangcd[i];
9384 pangcd[i++].creator = GLabelCreate;
9385
9386 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9387 pangcd[i].gd.flags = gg_visible | gg_enabled;
9388 pangcd[i].gd.cid = CID_PanMidLine;
9389 pangcd[i].gd.u.list = panmidline;
9390 panarray[j++] = &pangcd[i];
9391 pangcd[i++].creator = GListButtonCreate;
9392 panarray[j++] = NULL;
9393
9394 pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
9395 panlabel[i].text = (unichar_t *) _("_X-Height");
9396 panlabel[i].text_is_1byte = true;
9397 panlabel[i].text_in_resource = true;
9398 pangcd[i].gd.label = &panlabel[i];
9399 pangcd[i].gd.cid = CID_PanXHeightLab;
9400 pangcd[i].gd.flags = gg_visible | gg_enabled;
9401 panarray[j++] = &pangcd[i];
9402 pangcd[i++].creator = GLabelCreate;
9403
9404 pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
9405 pangcd[i].gd.flags = gg_visible | gg_enabled;
9406 pangcd[i].gd.cid = CID_PanXHeight;
9407 pangcd[i].gd.u.list = panxheight;
9408 panarray[j++] = &pangcd[i];
9409 pangcd[i++].creator = GListButtonCreate;
9410 panarray[j++] = NULL;
9411
9412 panarray[j++] = GCD_Glue; panarray[j++] = GCD_Glue;
9413
9414 panarray[j++] = NULL; panarray[j++] = NULL;
9415
9416 memset(panbox,0,sizeof(panbox));
9417 panbox[0].gd.flags = gg_enabled|gg_visible;
9418 panbox[0].gd.u.boxelements = panarray;
9419 panbox[0].creator = GHVBoxCreate;
9420 /******************************************************************************/
9421 memset(cgcd,0,sizeof(cgcd));
9422 memset(clabel,0,sizeof(clabel));
9423 memset(cbox,0,sizeof(cbox));
9424
9425 i = j = 0;
9426 clabel[i].text = (unichar_t *) _("MS Unicode Ranges:");
9427 clabel[i].text_is_1byte = true;
9428 cgcd[i].gd.label = &clabel[i];
9429 cgcd[i].gd.flags = gg_visible | gg_enabled;
9430 cgcd[i++].creator = GLabelCreate;
9431 charray1[0] = &cgcd[i-1];
9432
9433 clabel[i].text = (unichar_t *) _("Default");
9434 clabel[i].text_is_1byte = true;
9435 cgcd[i].gd.label = &clabel[i];
9436 cgcd[i].gd.flags = gg_visible | gg_enabled;
9437 if ( !sf->pfminfo.hasunicoderanges ) {
9438 cgcd[i].gd.flags = gg_visible | gg_enabled | gg_cb_on;
9439 OS2FigureUnicodeRanges(sf,sf->pfminfo.unicoderanges);
9440 }
9441 cgcd[i].gd.cid = CID_URangesDefault;
9442 cgcd[i].gd.handle_controlevent = OS2_URangesDefault;
9443 cgcd[i++].creator = GCheckBoxCreate;
9444 charray1[1] = &cgcd[i-1]; charray1[2] = GCD_Glue; charray1[3] = NULL;
9445
9446 cbox[2].gd.flags = gg_enabled|gg_visible;
9447 cbox[2].gd.u.boxelements = charray1;
9448 cbox[2].creator = GHBoxCreate;
9449 cvarray[j++] = &cbox[2];
9450
9451 sprintf( ranges, "%08x.%08x.%08x.%08x",
9452 sf->pfminfo.unicoderanges[3], sf->pfminfo.unicoderanges[2],
9453 sf->pfminfo.unicoderanges[1], sf->pfminfo.unicoderanges[0]);
9454 clabel[i].text = (unichar_t *) ranges;
9455 clabel[i].text_is_1byte = true;
9456 cgcd[i].gd.label = &clabel[i];
9457 cgcd[i].gd.pos.width = 270;
9458 cgcd[i].gd.flags = /* gg_visible |*/ gg_enabled;
9459 if ( !sf->pfminfo.hasunicoderanges )
9460 cgcd[i].gd.flags = /* gg_visible*/ 0;
9461 cgcd[i].gd.cid = CID_UnicodeRanges;
9462 cgcd[i].gd.handle_controlevent = OS2_UnicodeChange;
9463 cgcd[i++].creator = GTextFieldCreate;
9464 cvarray[j++] = &cgcd[i-1];
9465
9466 cgcd[i].gd.pos.width = 220; cgcd[i].gd.pos.height = 6*12+10;
9467 cgcd[i].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
9468 if ( !sf->pfminfo.hasunicoderanges )
9469 cgcd[i].gd.flags = gg_visible | gg_list_multiplesel;
9470 cgcd[i].gd.cid = CID_UnicodeList;
9471 cgcd[i].gd.popup_msg = _("A subset of Unicode ranges explicitly recognized by Microsoft. Select the ranges which you consider functional.");
9472 cgcd[i].gd.u.list = unicoderangenames;
9473 cgcd[i].gd.handle_controlevent = OS2_UnicodeChange;
9474 cgcd[i++].creator = GListCreate;
9475 cvarray[j++] = &cgcd[i-1];
9476
9477 cgcd[i].gd.flags = gg_visible | gg_enabled ;
9478 cgcd[i++].creator = GLineCreate;
9479 cvarray[j++] = &cgcd[i-1];
9480
9481 clabel[i].text = (unichar_t *) _("MS Code Pages:");
9482 clabel[i].text_is_1byte = true;
9483 cgcd[i].gd.label = &clabel[i];
9484 cgcd[i].gd.flags = gg_visible | gg_enabled;
9485 cgcd[i++].creator = GLabelCreate;
9486 charray2[0] = &cgcd[i-1];
9487
9488 clabel[i].text = (unichar_t *) _("Default");
9489 clabel[i].text_is_1byte = true;
9490 cgcd[i].gd.label = &clabel[i];
9491 cgcd[i].gd.flags = gg_visible | gg_enabled;
9492 if ( !sf->pfminfo.hascodepages ) {
9493 cgcd[i].gd.flags = gg_visible | gg_enabled | gg_cb_on;
9494 OS2FigureCodePages(sf,sf->pfminfo.codepages);
9495 }
9496 cgcd[i].gd.cid = CID_CPageDefault;
9497 cgcd[i].gd.handle_controlevent = OS2_CPageDefault;
9498 cgcd[i++].creator = GCheckBoxCreate;
9499 charray2[1] = &cgcd[i-1]; charray2[2] = GCD_Glue; charray2[3] = NULL;
9500
9501 cbox[3].gd.flags = gg_enabled|gg_visible;
9502 cbox[3].gd.u.boxelements = charray2;
9503 cbox[3].creator = GHBoxCreate;
9504 cvarray[j++] = &cbox[3];
9505
9506 sprintf( codepages, "%08x.%08x",
9507 sf->pfminfo.codepages[1], sf->pfminfo.codepages[0]);
9508 clabel[i].text = (unichar_t *) codepages;
9509 clabel[i].text_is_1byte = true;
9510 cgcd[i].gd.label = &clabel[i];
9511 cgcd[i].gd.pos.width = 140;
9512 cgcd[i].gd.flags = /*gg_visible |*/ gg_enabled;
9513 if ( !sf->pfminfo.hascodepages )
9514 cgcd[i].gd.flags = /*gg_visible*/ 0;
9515 cgcd[i].gd.cid = CID_CodePageRanges;
9516 cgcd[i].gd.handle_controlevent = OS2_CodePageChange;
9517 cgcd[i++].creator = GTextFieldCreate;
9518 cvarray2[0] = &cgcd[i-1]; cvarray2[1] = GCD_Glue; cvarray2[2] = NULL;
9519
9520 cbox[4].gd.flags = gg_enabled|gg_visible;
9521 cbox[4].gd.u.boxelements = cvarray2;
9522 cbox[4].creator = GVBoxCreate;
9523 charray3[0] = &cbox[4];
9524
9525 cgcd[i].gd.pos.width = 200; cgcd[i].gd.pos.height = 6*12+10;
9526 cgcd[i].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
9527 if ( !sf->pfminfo.hascodepages )
9528 cgcd[i].gd.flags = gg_visible | gg_list_multiplesel;
9529 cgcd[i].gd.cid = CID_CodePageList;
9530 cgcd[i].gd.u.list = codepagenames;
9531 cgcd[i].gd.handle_controlevent = OS2_CodePageChange;
9532 cgcd[i++].creator = GListCreate;
9533 charray3[1] = &cgcd[i-1]; charray3[2] = NULL;
9534
9535 cbox[5].gd.flags = gg_enabled|gg_visible;
9536 cbox[5].gd.u.boxelements = charray3;
9537 cbox[5].creator = GHBoxCreate;
9538 cvarray[j++] = &cbox[5]; cvarray[j++] = GCD_Glue; cvarray[j++] = NULL;
9539
9540 cbox[0].gd.flags = gg_enabled|gg_visible;
9541 cbox[0].gd.u.boxelements = cvarray;
9542 cbox[0].creator = GVBoxCreate;
9543
9544 /******************************************************************************/
9545
9546 memset(&vagcd,0,sizeof(vagcd));
9547 memset(&vaspects,'\0',sizeof(vaspects));
9548
9549 i = 0;
9550 vaspects[i].text = (unichar_t *) _("Misc.");
9551 vaspects[i].text_is_1byte = true;
9552 vaspects[i++].gcd = vbox;
9553
9554 vaspects[i].text = (unichar_t *) _("Metrics");
9555 vaspects[i].text_is_1byte = true;
9556 vaspects[i++].gcd = metbox;
9557
9558 vaspects[i].text = (unichar_t *) _("Sub/Super");
9559 vaspects[i].text_is_1byte = true;
9560 vaspects[i++].gcd = ssbox;
9561
9562 vaspects[i].text = (unichar_t *) _("Panose");
9563 vaspects[i].text_is_1byte = true;
9564 vaspects[i++].gcd = panbox;
9565
9566 vaspects[i].text = (unichar_t *) _("Charsets");
9567 vaspects[i].text_is_1byte = true;
9568 vaspects[i++].gcd = cbox;
9569
9570 vagcd[0].gd.pos.x = 4; vagcd[0].gd.pos.y = 6;
9571 vagcd[0].gd.pos.width = 252;
9572 vagcd[0].gd.pos.height = 300;
9573 vagcd[0].gd.u.tabs = vaspects;
9574 vagcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_scroll;
9575 /*vagcd[0].gd.handle_controlevent = GFI_TTFAspectChange;*/
9576 vagcd[0].gd.cid = CID_TTFTabs;
9577 vagcd[0].creator = GTabSetCreate;
9578
9579 /******************************************************************************/
9580 memset(&gaspboxes,0,sizeof(gaspboxes));
9581 memset(&gaspgcd,0,sizeof(gaspgcd));
9582 memset(&gasplabel,0,sizeof(gasplabel));
9583 memset(&gaspgcd_def,0,sizeof(gaspgcd_def));
9584
9585 GaspMatrixInit(&gaspmi,d);
9586
9587 i = j = 0;
9588
9589 gasplabel[i].text = (unichar_t *) S_("Gasp|_Version");
9590 gasplabel[i].text_is_1byte = true;
9591 gasplabel[i].text_in_resource = true;
9592 gaspgcd[i].gd.label = &gasplabel[i];
9593 gaspgcd[i].gd.flags = gg_visible | gg_enabled;
9594 gaspharray[j++] = &gaspgcd[i];
9595 gaspgcd[i++].creator = GLabelCreate;
9596
9597 for ( g=0; gaspversions[g].text!=NULL; ++g )
9598 gaspversions[g].selected = false;
9599 g = ( sf->gasp_version>=0 && sf->gasp_version<g ) ? sf->gasp_version : 0;
9600
9601 gaspversions[g].selected = true;
9602 gaspgcd[i].gd.flags = gg_visible | gg_enabled;
9603 gaspgcd[i].gd.cid = CID_GaspVersion;
9604 gaspgcd[i].gd.label = &gaspversions[g];
9605 gaspgcd[i].gd.u.list = gaspversions;
9606 gaspharray[j++] = &gaspgcd[i];
9607 gaspgcd[i].gd.handle_controlevent = GFI_GaspVersion;
9608 gaspgcd[i++].creator = GListButtonCreate;
9609 gaspharray[j++] = GCD_HPad10;
9610
9611 gasplabel[i].text = (unichar_t *) _("Optimized For ClearType");
9612 gasplabel[i].text_is_1byte = true;
9613 gasplabel[i].text_in_resource = true;
9614 gaspgcd[i].gd.label = &gasplabel[i];
9615 gaspgcd[i].gd.flags = gg_visible | gg_enabled;
9616 gaspgcd[i].gd.cid = CID_HeadClearType;
9617 if ( sf->head_optimized_for_cleartype )
9618 gaspgcd[i].gd.flags |= gg_cb_on;
9619 gaspgcd[i].gd.popup_msg = _("Actually a bit in the 'head' table.\nIf unset then certain East Asian fonts will not be hinted");
9620 gaspharray[j++] = &gaspgcd[i];
9621 gaspgcd[i++].creator = GCheckBoxCreate;
9622 gaspharray[j++] = NULL;
9623
9624 gaspboxes[2].gd.flags = gg_enabled|gg_visible;
9625 gaspboxes[2].gd.u.boxelements = gaspharray;
9626 gaspboxes[2].creator = GHBoxCreate;
9627
9628 gaspvarray[0] = &gaspboxes[2];
9629
9630 gaspgcd[i].gd.pos.width = 300; gaspgcd[i].gd.pos.height = 200;
9631 gaspgcd[i].gd.flags = gg_enabled | gg_visible;
9632 gaspgcd[i].gd.cid = CID_Gasp;
9633 gaspgcd[i].gd.u.matrix = &gaspmi;
9634 gaspgcd[i].gd.popup_msg = _(
9635 "The 'gasp' table gives you control over when grid-fitting and\n"
9636 "anti-aliased rasterizing are done.\n"
9637 "The table consists of an (ordered) list of pixel sizes each with\n"
9638 "a set of flags. Those flags apply to all pixel sizes bigger than\n"
9639 "the previous table entry but less than or equal to the current.\n"
9640 "The list must be terminated with a pixel size of 65535.\n"
9641 "Version 1 of the table contains two additional flags that\n"
9642 "apply to MS's ClearType rasterizer.\n\n"
9643 "The 'gasp' table only applies to truetype fonts.");
9644 gaspgcd[i].data = d;
9645 gaspgcd[i].creator = GMatrixEditCreate;
9646 gaspvarray[1] = &gaspgcd[i];
9647 gaspvarray[2] = NULL;
9648
9649 gaspboxes[0].gd.flags = gg_enabled|gg_visible;
9650 gaspboxes[0].gd.u.boxelements = gaspvarray;
9651 gaspboxes[0].creator = GVBoxCreate;
9652
9653 gaspgcd_def[0].gd.flags = gg_visible | gg_enabled;
9654 gasplabel[4].text = (unichar_t *) S_("Gasp|_Default");
9655 gasplabel[4].text_is_1byte = true;
9656 gasplabel[4].text_in_resource = true;
9657 gaspgcd_def[0].gd.label = &gasplabel[4];
9658 gaspgcd_def[0].gd.handle_controlevent = Gasp_Default;
9659 gaspgcd_def[0].creator = GButtonCreate;
9660 /******************************************************************************/
9661 memset(&tnlabel,0,sizeof(tnlabel));
9662 memset(&tngcd,0,sizeof(tngcd));
9663 memset(&tnboxes,0,sizeof(tnboxes));
9664
9665 TNMatrixInit(&mi,d);
9666
9667 tngcd[0].gd.pos.x = 5; tngcd[0].gd.pos.y = 6;
9668 tngcd[0].gd.flags = gg_visible | gg_enabled;
9669 tnlabel[0].text = (unichar_t *) _("Sort By:");
9670 tnlabel[0].text_is_1byte = true;
9671 tngcd[0].gd.label = &tnlabel[0];
9672 tngcd[0].creator = GLabelCreate;
9673 tnharray[0] = &tngcd[0];
9674
9675 tngcd[1].gd.pos.x = 50; tngcd[1].gd.pos.y = tngcd[0].gd.pos.y-4;
9676 tngcd[1].gd.flags = gg_enabled | gg_visible;
9677 tngcd[1].gd.cid = CID_TNLangSort;
9678 tnlabel[1].text = (unichar_t *) _("_Language");
9679 tnlabel[1].text_is_1byte = true;
9680 tnlabel[1].text_in_resource = true;
9681 tngcd[1].gd.label = &tnlabel[1];
9682 tngcd[1].creator = GRadioCreate;
9683 tngcd[1].gd.handle_controlevent = GFI_SortBy;
9684 tnharray[1] = &tngcd[1];
9685
9686 tngcd[2].gd.pos.x = 120; tngcd[2].gd.pos.y = tngcd[1].gd.pos.y;
9687 tngcd[2].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
9688 tngcd[2].gd.cid = CID_TNStringSort;
9689 tnlabel[2].text = (unichar_t *) _("_String Type");
9690 tnlabel[2].text_is_1byte = true;
9691 tnlabel[2].text_in_resource = true;
9692 tngcd[2].gd.label = &tnlabel[2];
9693 tngcd[2].creator = GRadioCreate;
9694 tngcd[2].gd.handle_controlevent = GFI_SortBy;
9695 tnharray[2] = &tngcd[2];
9696
9697 tngcd[3].gd.pos.x = 195; tngcd[3].gd.pos.y = tngcd[1].gd.pos.y;
9698 tngcd[3].gd.flags = gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold;
9699 tnlabel[3].text = (unichar_t *) S_("SortingScheme|Default");
9700 tnlabel[3].text_is_1byte = true;
9701 tngcd[3].gd.label = &tnlabel[3];
9702 tngcd[3].creator = GRadioCreate;
9703 tngcd[3].gd.handle_controlevent = GFI_SortBy;
9704 tnharray[3] = &tngcd[3]; tnharray[4] = GCD_Glue; tnharray[5] = NULL;
9705
9706 tngcd[4].gd.pos.x = 10; tngcd[4].gd.pos.y = tngcd[1].gd.pos.y+14;
9707 tngcd[4].gd.pos.width = 300; tngcd[4].gd.pos.height = 200;
9708 tngcd[4].gd.flags = gg_enabled | gg_visible;
9709 tngcd[4].gd.cid = CID_TNames;
9710 tngcd[4].gd.u.matrix = &mi;
9711 tngcd[4].gd.popup_msg = _(
9712 "To create a new name, left click on the <New> button, and select a locale.\n"
9713 "To change the locale, left click on it.\n"
9714 "To change the string type, left click on it.\n"
9715 "To change the text, left click in it and then type.\n"
9716 "To delete a name, right click on the name & select Delete from the menu.\n"
9717 "To associate or disassociate a truetype name to its postscript equivalent\n"
9718 "right click and select the appropriate menu item." );
9719 tngcd[4].data = d;
9720 tngcd[4].creator = GMatrixEditCreate;
9721
9722 tngcd[5].gd.flags = gg_visible | gg_enabled;
9723 /* GT: when translating this please leave the "SIL Open Font License" in */
9724 /* GT: English (possibly translating it in parentheses). I believe there */
9725 /* GT: are legal reasons for this. */
9726 /* GT: So "Añadir SIL Open Font License (licencia de fuentes libres)" */
9727 tnlabel[5].text = (unichar_t *) S_("Add OFL");
9728 tnlabel[5].image_precedes = false;
9729 tnlabel[5].image = &OFL_logo;
9730 tnlabel[5].text_is_1byte = true;
9731 tnlabel[5].text_in_resource = true;
9732 tngcd[5].gd.label = &tnlabel[5];
9733 tngcd[5].gd.handle_controlevent = GFI_AddOFL;
9734 tngcd[5].gd.popup_msg = _(
9735 "Click here to add the OFL metadata to your own font in the License and License URL fields. \n"
9736 "Then click on the License field to fill in the placeholders in sync with OFL.txt. \n");
9737 tngcd[5].creator = GButtonCreate;
9738
9739 tngcd[6].gd.flags = gg_visible | gg_enabled;
9740 tnlabel[6].text = (unichar_t *) S_("scripts.sil.org/OFL");
9741 tnlabel[6].text_is_1byte = true;
9742 tnlabel[6].text_in_resource = true;
9743 tngcd[6].gd.label = &tnlabel[6];
9744 tngcd[6].gd.handle_controlevent = GFI_HelpOFL;
9745 tngcd[6].gd.popup_msg = _(
9746 "Click here for more information about the OFL (SIL Open Font License) \n"
9747 "including the corresponding FAQ. \n");
9748 tngcd[6].creator = GButtonCreate;
9749 tnharray2[0] = &tngcd[5]; tnharray2[1] = &tngcd[6]; tnharray2[2] = GCD_Glue; tnharray2[3] = NULL;
9750 tnvarray[0] = &tnboxes[2]; tnvarray[1] = &tngcd[4]; tnvarray[2] = &tnboxes[3]; tnvarray[3] = NULL;
9751
9752 tnboxes[0].gd.flags = gg_enabled|gg_visible;
9753 tnboxes[0].gd.u.boxelements = tnvarray;
9754 tnboxes[0].creator = GVBoxCreate;
9755
9756 tnboxes[2].gd.flags = gg_enabled|gg_visible;
9757 tnboxes[2].gd.u.boxelements = tnharray;
9758 tnboxes[2].creator = GHBoxCreate;
9759
9760 tnboxes[3].gd.flags = gg_enabled|gg_visible;
9761 tnboxes[3].gd.u.boxelements = tnharray2;
9762 tnboxes[3].creator = GHBoxCreate;
9763 /******************************************************************************/
9764 memset(&ssnlabel,0,sizeof(ssnlabel));
9765 memset(&ssngcd,0,sizeof(ssngcd));
9766 memset(&ssboxes,0,sizeof(ssboxes));
9767
9768 SSMatrixInit(&ssmi,d);
9769
9770 ssngcd[0].gd.flags = gg_visible | gg_enabled;
9771 ssnlabel[0].text = (unichar_t *) _(
9772 "The OpenType Style Set ('ss01'-'ss20') and Character Variant ('cv01'-'cv99')\n"
9773 "features may be assigned human readable names here.");
9774 ssnlabel[0].text_is_1byte = true;
9775 ssngcd[0].gd.label = &ssnlabel[0];
9776 ssngcd[0].creator = GLabelCreate;
9777 ssvarray[0] = &ssngcd[0];
9778
9779 ssngcd[1].gd.pos.width = 300; ssngcd[1].gd.pos.height = 200;
9780 ssngcd[1].gd.flags = gg_enabled | gg_visible;
9781 ssngcd[1].gd.cid = CID_SSNames;
9782 ssngcd[1].gd.u.matrix = &ssmi;
9783 ssngcd[1].gd.popup_msg = _(
9784 "To create a new name, left click on the <New> button, and select a locale (language).\n"
9785 "To change the locale, left click on it.\n"
9786 "To change the feature, left click on it.\n"
9787 "To change the text, left click in it and then type.\n"
9788 );
9789 ssngcd[1].data = d;
9790 ssngcd[1].creator = GMatrixEditCreate;
9791 ssvarray[1] = &ssngcd[1]; ssvarray[2] = NULL;
9792
9793 ssboxes[0].gd.flags = gg_enabled|gg_visible;
9794 ssboxes[0].gd.u.boxelements = ssvarray;
9795 ssboxes[0].creator = GVBoxCreate;
9796 /******************************************************************************/
9797 memset(&comlabel,0,sizeof(comlabel));
9798 memset(&comgcd,0,sizeof(comgcd));
9799
9800 comgcd[0].gd.flags = gg_visible | gg_enabled;
9801 comlabel[0].text = (unichar_t *) _("The font comment can contain whatever you feel it should");
9802 comlabel[0].text_is_1byte = true;
9803 comgcd[0].gd.label = &comlabel[0];
9804 comgcd[0].creator = GLabelCreate;
9805
9806 comgcd[1].gd.pos.x = 10; comgcd[1].gd.pos.y = 10;
9807 comgcd[1].gd.pos.width = ngcd[11].gd.pos.width; comgcd[1].gd.pos.height = 230;
9808 comgcd[1].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap | gg_text_xim;
9809 comgcd[1].gd.cid = CID_Comment;
9810 comlabel[1].text = (unichar_t *) sf->comments;
9811 comlabel[1].text_is_1byte = true;
9812 if ( comlabel[1].text==NULL ) comlabel[1].text = (unichar_t *) "";
9813 comgcd[1].gd.label = &comlabel[1];
9814 comgcd[1].creator = GTextAreaCreate;
9815
9816 comarray[0] = &comgcd[0]; comarray[1] = &comgcd[1]; comarray[2] = NULL;
9817 memset(combox,0,sizeof(combox));
9818 combox[0].gd.flags = gg_enabled|gg_visible;
9819 combox[0].gd.u.boxelements = comarray;
9820 combox[0].creator = GVBoxCreate;
9821
9822 /******************************************************************************/
9823 memset(&floglabel,0,sizeof(floglabel));
9824 memset(&floggcd,0,sizeof(floggcd));
9825
9826 floggcd[0].gd.flags = gg_visible | gg_enabled;
9827 floglabel[0].text = (unichar_t *) _("The FONTLOG contains some description of the \n font project, a detailed changelog, and a list of contributors");
9828 floglabel[0].text_is_1byte = true;
9829 floggcd[0].gd.label = &floglabel[0];
9830 floggcd[0].creator = GLabelCreate;
9831
9832 floggcd[1].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap | gg_text_xim;
9833 floggcd[1].gd.cid = CID_FontLog;
9834 floglabel[1].text = (unichar_t *) sf->fontlog;
9835 floglabel[1].text_is_1byte = true;
9836 if ( floglabel[1].text==NULL ) floglabel[1].text = (unichar_t *) "";
9837 floggcd[1].gd.label = &floglabel[1];
9838 floggcd[1].creator = GTextAreaCreate;
9839
9840 flogarray[0] = &floggcd[0]; flogarray[1] = &floggcd[1]; flogarray[2] = NULL;
9841 memset(flogbox,0,sizeof(flogbox));
9842 flogbox[0].gd.flags = gg_enabled|gg_visible;
9843 flogbox[0].gd.u.boxelements = flogarray;
9844 flogbox[0].creator = GVBoxCreate;
9845
9846 /******************************************************************************/
9847 memset(&mklabel,0,sizeof(mklabel));
9848 memset(&mkgcd,0,sizeof(mkgcd));
9849
9850 mklabel[0].text = (unichar_t *) _(
9851 "These are not Anchor Classes. For them see the \"Lookups\" pane.\n"
9852 "(Mark Classes can control when lookups are active, they do NOT\n"
9853 " position glyphs.)");
9854 mklabel[0].text_is_1byte = true;
9855 mkgcd[0].gd.label = &mklabel[0];
9856 mkgcd[0].gd.flags = gg_visible | gg_enabled;
9857 mkgcd[0].creator = GLabelCreate;
9858
9859 memset(&markc_mi,0,sizeof(markc_mi));
9860 markc_mi.col_cnt = 2;
9861 markc_mi.col_init = markc_ci;
9862
9863 /* Class 0 is unused */
9864 markc_md = calloc(sf->mark_class_cnt+1,2*sizeof(struct matrix_data));
9865 for ( i=1; i<sf->mark_class_cnt; ++i ) {
9866 markc_md[2*(i-1)+0].u.md_str = copy(sf->mark_class_names[i]);
9867 markc_md[2*(i-1)+1].u.md_str = SFNameList2NameUni(sf,sf->mark_classes[i]);
9868 }
9869 markc_mi.matrix_data = markc_md;
9870 markc_mi.initial_row_cnt = sf->mark_class_cnt>0?sf->mark_class_cnt-1:0;
9871 markc_mi.finishedit = GFI_Mark_FinishEdit;
9872
9873 mkgcd[1].gd.pos.x = 10; mkgcd[1].gd.pos.y = 10;
9874 mkgcd[1].gd.pos.width = ngcd[15].gd.pos.width; mkgcd[1].gd.pos.height = 200;
9875 mkgcd[1].gd.flags = gg_visible | gg_enabled;
9876 mkgcd[1].gd.cid = CID_MarkClasses;
9877 mkgcd[1].gd.u.matrix = &markc_mi;
9878 mkgcd[1].creator = GMatrixEditCreate;
9879
9880 mkgcd[2].gd.pos.x = 10; mkgcd[2].gd.pos.y = mkgcd[1].gd.pos.y+mkgcd[1].gd.pos.height+4;
9881 mkgcd[2].gd.pos.width = -1;
9882 mkgcd[2].gd.flags = gg_visible | gg_enabled;
9883
9884 mkarray[0] = &mkgcd[0]; mkarray[1] = &mkgcd[1];
9885 mkarray[2] = NULL;
9886 memset(mkbox,0,sizeof(mkbox));
9887 mkbox[0].gd.flags = gg_enabled|gg_visible;
9888 mkbox[0].gd.u.boxelements = mkarray;
9889 mkbox[0].creator = GVBoxCreate;
9890 /******************************************************************************/
9891 memset(&mslabel,0,sizeof(mslabel));
9892 memset(&msgcd,0,sizeof(msgcd));
9893
9894 mslabel[0].text = (unichar_t *) _(
9895 "These are not Anchor Classes. For them see the \"Lookups\" pane.\n"
9896 "(Mark Sets, like Mark Classes can control when lookups are active,\n"
9897 " they do NOT position glyphs.)");
9898 mslabel[0].text_is_1byte = true;
9899 msgcd[0].gd.label = &mslabel[0];
9900 msgcd[0].gd.flags = gg_visible | gg_enabled;
9901 msgcd[0].creator = GLabelCreate;
9902
9903 memset(&marks_mi,0,sizeof(marks_mi));
9904 marks_mi.col_cnt = 2;
9905 marks_mi.col_init = marks_ci;
9906
9907 /* Set 0 is used */
9908 marks_md = calloc(sf->mark_set_cnt+1,2*sizeof(struct matrix_data));
9909 for ( i=0; i<sf->mark_set_cnt; ++i ) {
9910 marks_md[2*i+0].u.md_str = copy(sf->mark_set_names[i]);
9911 marks_md[2*i+1].u.md_str = SFNameList2NameUni(sf,sf->mark_sets[i]);
9912 }
9913 marks_mi.matrix_data = marks_md;
9914 marks_mi.initial_row_cnt = sf->mark_set_cnt;
9915 marks_mi.finishedit = GFI_Mark_FinishEdit;
9916
9917 msgcd[1].gd.pos.x = 10; msgcd[1].gd.pos.y = 10;
9918 msgcd[1].gd.pos.width = ngcd[15].gd.pos.width; msgcd[1].gd.pos.height = 200;
9919 msgcd[1].gd.flags = gg_visible | gg_enabled;
9920 msgcd[1].gd.cid = CID_MarkSets;
9921 msgcd[1].gd.u.matrix = &marks_mi;
9922 msgcd[1].creator = GMatrixEditCreate;
9923
9924 msarray[0] = &msgcd[0]; msarray[1] = &msgcd[1];
9925 msarray[2] = NULL;
9926 memset(msbox,0,sizeof(msbox));
9927 msbox[0].gd.flags = gg_enabled|gg_visible;
9928 msbox[0].gd.u.boxelements = msarray;
9929 msbox[0].creator = GVBoxCreate;
9930 /******************************************************************************/
9931 memset(&wofflabel,0,sizeof(wofflabel));
9932 memset(&woffgcd,0,sizeof(woffgcd));
9933
9934 wofflabel[0].text = (unichar_t *) _("Version, Major:");
9935 wofflabel[0].text_is_1byte = true;
9936 woffgcd[0].gd.label = &wofflabel[0];
9937 woffgcd[0].gd.flags = gg_visible | gg_enabled;
9938 woffgcd[0].creator = GLabelCreate;
9939
9940 woffmajorbuf[0]='\0';
9941 woffminorbuf[0]='\0';
9942 if ( sf->woffMajor!=woffUnset ) {
9943 sprintf( woffmajorbuf, "%d", sf->woffMajor );
9944 sprintf( woffminorbuf, "%d", sf->woffMinor );
9945 }
9946 woffgcd[1].gd.flags = gg_visible | gg_enabled;
9947 wofflabel[1].text = (unichar_t *) woffmajorbuf;
9948 wofflabel[1].text_is_1byte = true;
9949 woffgcd[1].gd.label = &wofflabel[1];
9950 woffgcd[1].gd.cid = CID_WoffMajor;
9951 woffgcd[1].gd.popup_msg = _("If you leave this field blank FontForge will use a default based on\neither the version string, or one in the 'name' table." );
9952 woffgcd[1].creator = GTextFieldCreate;
9953
9954 wofflabel[2].text = (unichar_t *) _("Minor:");
9955 wofflabel[2].text_is_1byte = true;
9956 woffgcd[2].gd.label = &wofflabel[2];
9957 woffgcd[2].gd.flags = gg_visible | gg_enabled;
9958 woffgcd[2].creator = GLabelCreate;
9959
9960 woffgcd[3].gd.flags = gg_visible | gg_enabled;
9961 wofflabel[3].text = (unichar_t *) woffminorbuf;
9962 wofflabel[3].text_is_1byte = true;
9963 woffgcd[3].gd.label = &wofflabel[3];
9964 woffgcd[3].gd.cid = CID_WoffMinor;
9965 woffgcd[3].gd.popup_msg = _("If you leave this field blank FontForge will use a default based on\neither the version string, or one in the 'name' table." );
9966 woffgcd[3].creator = GTextFieldCreate;
9967
9968 woffarray[0] = &woffgcd[0];
9969 woffarray[1] = &woffgcd[1];
9970 woffarray[2] = &woffgcd[2];
9971 woffarray[3] = &woffgcd[3];
9972 woffarray[4] = NULL;
9973
9974 wofflabel[4].text = (unichar_t *) _("Metadata (xml):");
9975 wofflabel[4].text_is_1byte = true;
9976 woffgcd[4].gd.label = &wofflabel[4];
9977 woffgcd[4].gd.flags = gg_visible | gg_enabled;
9978 woffgcd[4].creator = GLabelCreate;
9979
9980 woffarray[5] = &woffgcd[4];
9981 woffarray[6] = GCD_ColSpan;
9982 woffarray[7] = GCD_ColSpan;
9983 woffarray[8] = GCD_ColSpan;
9984 woffarray[9] = NULL;
9985
9986 woffgcd[5].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
9987 if ( sf->woffMetadata!=NULL ) {
9988 wofflabel[5].text = (unichar_t *) sf->woffMetadata;
9989 wofflabel[5].text_is_1byte = true;
9990 woffgcd[5].gd.label = &wofflabel[5];
9991 }
9992 woffgcd[5].gd.cid = CID_WoffMetadata;
9993 woffgcd[5].creator = GTextAreaCreate;
9994
9995 woffarray[10] = &woffgcd[5];
9996 woffarray[11] = GCD_ColSpan;
9997 woffarray[12] = GCD_ColSpan;
9998 woffarray[13] = GCD_ColSpan;
9999 woffarray[14] = NULL;
10000 woffarray[15] = NULL;
10001
10002 memset(woffbox,0,sizeof(woffbox));
10003 woffbox[0].gd.flags = gg_enabled|gg_visible;
10004 woffbox[0].gd.u.boxelements = woffarray;
10005 woffbox[0].creator = GHVBoxCreate;
10006 /******************************************************************************/
10007 memset(&txlabel,0,sizeof(txlabel));
10008 memset(&txgcd,0,sizeof(txgcd));
10009
10010 k=0;
10011 txlabel[k].text = (unichar_t *) U_("΀ΔΧ General");
10012 txlabel[k].text_is_1byte = true;
10013 txgcd[k].gd.label = &txlabel[k];
10014 txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = 10;
10015 txgcd[k].gd.flags = gg_visible | gg_enabled;
10016 txgcd[k].gd.cid = CID_TeXText;
10017 txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
10018 txgcd[k++].creator = GRadioCreate;
10019
10020 txlabel[k].text = (unichar_t *) U_("΀ΔΧ Math Symbol");
10021 txlabel[k].text_is_1byte = true;
10022 txgcd[k].gd.label = &txlabel[k];
10023 txgcd[k].gd.pos.x = 80; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
10024 txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
10025 txgcd[k].gd.cid = CID_TeXMathSym;
10026 txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
10027 txgcd[k++].creator = GRadioCreate;
10028
10029 txlabel[k].text = (unichar_t *) U_("΀ΔΧ Math Extension");
10030 txlabel[k].text_is_1byte = true;
10031 txgcd[k].gd.label = &txlabel[k];
10032 txgcd[k].gd.pos.x = 155; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
10033 txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
10034 txgcd[k].gd.cid = CID_TeXMathExt;
10035 txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
10036 txgcd[k++].creator = GRadioCreate;
10037
10038 for ( i=j=0; texparams[i]!=0; ++i ) {
10039 txlabel[k].text = (unichar_t *) texparams[i];
10040 txlabel[k].text_is_1byte = true;
10041 txgcd[k].gd.label = &txlabel[k];
10042 txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = txgcd[k-2].gd.pos.y+26;
10043 txgcd[k].gd.flags = gg_visible | gg_enabled;
10044 txgcd[k].gd.popup_msg = texpopups[i];
10045 txarray2[j++] = &txgcd[k];
10046 txgcd[k++].creator = GLabelCreate;
10047
10048 txgcd[k].gd.pos.x = 70; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y-4;
10049 txgcd[k].gd.flags = gg_visible | gg_enabled;
10050 txgcd[k].gd.cid = CID_TeX + i;
10051 txarray2[j++] = &txgcd[k];
10052 txgcd[k++].creator = GTextFieldCreate;
10053 txarray2[j++] = GCD_Glue;
10054 txarray2[j++] = NULL;
10055 }
10056 txgcd[k-2].gd.cid = CID_TeXExtraSpLabel;
10057 txarray2[j++] = NULL;
10058
10059 /* GT: More Parameters */
10060 txlabel[k].text = (unichar_t *) _("More Params");
10061 txlabel[k].text_is_1byte = true;
10062 txgcd[k].gd.label = &txlabel[k];
10063 txgcd[k].gd.pos.x = 20; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+26;
10064 txgcd[k].gd.flags = gg_visible | gg_enabled;
10065 txgcd[k].gd.handle_controlevent = GFI_MoreParams;
10066 txgcd[k].gd.cid = CID_MoreParams;
10067 txgcd[k++].creator = GButtonCreate;
10068
10069 txarray[0] = &txbox[2]; txarray[1] = &txbox[3]; txarray[2] = &txbox[4]; txarray[3] = GCD_Glue; txarray[4] = NULL;
10070 txarray3[0] = &txgcd[0]; txarray3[1] = GCD_Glue; txarray3[2] = &txgcd[1];
10071 txarray3[3] = GCD_Glue; txarray3[4] = &txgcd[2]; txarray3[5] = NULL;
10072 txarray4[0] = GCD_Glue; txarray4[1] = &txgcd[k-1];
10073 txarray4[2] = txarray4[3] = txarray4[4] = GCD_Glue; txarray4[5] = NULL;
10074 memset(txbox,0,sizeof(txbox));
10075 txbox[0].gd.flags = gg_enabled|gg_visible;
10076 txbox[0].gd.u.boxelements = txarray;
10077 txbox[0].creator = GVBoxCreate;
10078
10079 txbox[2].gd.flags = gg_enabled|gg_visible;
10080 txbox[2].gd.u.boxelements = txarray3;
10081 txbox[2].creator = GHBoxCreate;
10082
10083 txbox[3].gd.flags = gg_enabled|gg_visible;
10084 txbox[3].gd.u.boxelements = txarray2;
10085 txbox[3].gd.cid = CID_TeXBox;
10086 txbox[3].creator = GHVBoxCreate;
10087
10088 txbox[4].gd.flags = gg_enabled|gg_visible;
10089 txbox[4].gd.u.boxelements = txarray4;
10090 txbox[4].creator = GHBoxCreate;
10091 /******************************************************************************/
10092 memset(&szlabel,0,sizeof(szlabel));
10093 memset(&szgcd,0,sizeof(szgcd));
10094 SizeMatrixInit(&sizemi,d);
10095
10096 k=0;
10097
10098 szlabel[k].text = (unichar_t *) _("De_sign Size:");
10099 szlabel[k].text_is_1byte = true;
10100 szlabel[k].text_in_resource = true;
10101 szgcd[k].gd.label = &szlabel[k];
10102 szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = 9;
10103 szgcd[k].gd.flags = gg_visible | gg_enabled;
10104 szgcd[k].gd.popup_msg = _("The size (in points) for which this face was designed");
10105 szgcd[k++].creator = GLabelCreate;
10106
10107 sprintf(dszbuf, "%.1f", sf->design_size/10.0);
10108 szlabel[k].text = (unichar_t *) dszbuf;
10109 szlabel[k].text_is_1byte = true;
10110 szgcd[k].gd.label = &szlabel[k];
10111 szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
10112 szgcd[k].gd.pos.width = 60;
10113 szgcd[k].gd.flags = gg_visible | gg_enabled;
10114 szgcd[k].gd.cid = CID_DesignSize;
10115 szgcd[k++].creator = GTextFieldCreate;
10116
10117 szlabel[k].text = (unichar_t *) S_("Size|Points");
10118 szlabel[k].text_is_1byte = true;
10119 szgcd[k].gd.label = &szlabel[k];
10120 szgcd[k].gd.pos.x = 134; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
10121 szgcd[k].gd.flags = gg_visible | gg_enabled;
10122 szgcd[k].gd.popup_msg = _("The size (in points) for which this face was designed");
10123 szgcd[k++].creator = GLabelCreate;
10124
10125 szlabel[k].text = (unichar_t *) _("Design Range");
10126 szlabel[k].text_is_1byte = true;
10127 szgcd[k].gd.label = &szlabel[k];
10128 szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+24;
10129 szgcd[k].gd.flags = gg_visible | gg_enabled;
10130 szgcd[k].gd.popup_msg = _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
10131 szgcd[k++].creator = GLabelCreate;
10132
10133 szgcd[k].gd.pos.x = 8; szgcd[k].gd.pos.y = GDrawPointsToPixels(NULL,szgcd[k-1].gd.pos.y+6);
10134 szgcd[k].gd.pos.width = pos.width-32; szgcd[k].gd.pos.height = GDrawPointsToPixels(NULL,36);
10135 szgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
10136 szgcd[k++].creator = GGroupCreate;
10137
10138 szlabel[k].text = (unichar_t *) _("_Bottom:");
10139 szlabel[k].text_is_1byte = true;
10140 szlabel[k].text_in_resource = true;
10141 szgcd[k].gd.label = &szlabel[k];
10142 szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+18;
10143 szgcd[k].gd.flags = gg_visible | gg_enabled;
10144 szgcd[k].gd.popup_msg = _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
10145 szgcd[k++].creator = GLabelCreate;
10146
10147 sprintf(dsbbuf, "%.1f", sf->design_range_bottom/10.0);
10148 szlabel[k].text = (unichar_t *) dsbbuf;
10149 szlabel[k].text_is_1byte = true;
10150 szgcd[k].gd.label = &szlabel[k];
10151 szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
10152 szgcd[k].gd.pos.width = 60;
10153 szgcd[k].gd.flags = gg_visible | gg_enabled;
10154 szgcd[k].gd.cid = CID_DesignBottom;
10155 szgcd[k++].creator = GTextFieldCreate;
10156
10157 szlabel[k].text = (unichar_t *) _("_Top:");
10158 szlabel[k].text_is_1byte = true;
10159 szlabel[k].text_in_resource = true;
10160 szgcd[k].gd.label = &szlabel[k];
10161 szgcd[k].gd.pos.x = 140; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
10162 szgcd[k].gd.flags = gg_visible | gg_enabled;
10163 szgcd[k].gd.popup_msg = _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
10164 szgcd[k++].creator = GLabelCreate;
10165
10166 sprintf(dstbuf, "%.1f", sf->design_range_top/10.0);
10167 szlabel[k].text = (unichar_t *) dstbuf;
10168 szlabel[k].text_is_1byte = true;
10169 szgcd[k].gd.label = &szlabel[k];
10170 szgcd[k].gd.pos.x = 180; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
10171 szgcd[k].gd.pos.width = 60;
10172 szgcd[k].gd.flags = gg_visible | gg_enabled;
10173 szgcd[k].gd.cid = CID_DesignTop;
10174 szgcd[k++].creator = GTextFieldCreate;
10175
10176 szlabel[k].text = (unichar_t *) _("Style _ID:");
10177 szlabel[k].text_is_1byte = true;
10178 szlabel[k].text_in_resource = true;
10179 szgcd[k].gd.label = &szlabel[k];
10180 szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,szgcd[k-5].gd.pos.y+szgcd[k-5].gd.pos.height)+10;
10181 szgcd[k].gd.flags = gg_visible | gg_enabled;
10182 szgcd[k].gd.popup_msg = _("This is an identifying number shared by all members of\nthis font family with the same style (I.e. 10pt Bold and\n24pt Bold would have the same id, but 10pt Italic would not");
10183 szgcd[k++].creator = GLabelCreate;
10184
10185 sprintf(sibuf, "%d", sf->fontstyle_id);
10186 szlabel[k].text = (unichar_t *) sibuf;
10187 szlabel[k].text_is_1byte = true;
10188 szgcd[k].gd.label = &szlabel[k];
10189 szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
10190 szgcd[k].gd.pos.width = 60;
10191 szgcd[k].gd.flags = gg_visible | gg_enabled;
10192 szgcd[k].gd.cid = CID_StyleID;
10193 szgcd[k++].creator = GTextFieldCreate;
10194
10195 szlabel[k].text = (unichar_t *) _("Style Name:");
10196 szlabel[k].text_is_1byte = true;
10197 szgcd[k].gd.label = &szlabel[k];
10198 szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+22;
10199 szgcd[k].gd.flags = gg_visible | gg_enabled;
10200 szgcd[k].gd.popup_msg = _("This provides a set of names used to identify the\nstyle of this font. Names may be translated into multiple\nlanguages (English is required, others are optional)\nAll fonts with the same Style ID should share this name.");
10201 szgcd[k++].creator = GLabelCreate;
10202
10203 szgcd[k].gd.pos.width = 300; szgcd[k].gd.pos.height = 200;
10204 szgcd[k].gd.flags = gg_enabled | gg_visible;
10205 szgcd[k].gd.cid = CID_StyleName;
10206 szgcd[k].gd.u.matrix = &sizemi;
10207 szgcd[k].gd.popup_msg = _(
10208 "To create a new name, left click on the <New> button, and select a locale (language).\n"
10209 "To change the locale, left click on it.\n"
10210 "To change the text, left click in it and then type.\n"
10211 );
10212 szgcd[k].data = d;
10213 szgcd[k].creator = GMatrixEditCreate;
10214
10215 szarray[0] = &szbox[2];
10216 szarray[1] = &szbox[3];
10217 szarray[2] = &szbox[4];
10218 szarray[3] = &szgcd[11];
10219 szarray[4] = &szgcd[12];
10220 szarray[5] = NULL;
10221
10222 szarray2[0] = &szgcd[0]; szarray2[1] = &szgcd[1]; szarray2[2] = &szgcd[2]; szarray2[3] = GCD_Glue; szarray2[4] = NULL;
10223 szarray3[0] = &szgcd[5]; szarray3[1] = &szgcd[6]; szarray3[2] = &szgcd[7]; szarray3[3] = &szgcd[8]; szarray3[4] = GCD_Glue; szarray3[5] = NULL;
10224 szarray3[6] = NULL;
10225 szarray4[0] = &szgcd[9]; szarray4[1] = &szgcd[10]; szarray4[2] = GCD_Glue; szarray4[3] = NULL;
10226
10227 memset(szbox,0,sizeof(szbox));
10228 szbox[0].gd.flags = gg_enabled|gg_visible;
10229 szbox[0].gd.u.boxelements = szarray;
10230 szbox[0].creator = GVBoxCreate;
10231
10232 szbox[2].gd.flags = gg_enabled|gg_visible;
10233 szbox[2].gd.u.boxelements = szarray2;
10234 szbox[2].creator = GHBoxCreate;
10235
10236 szbox[3].gd.flags = gg_enabled|gg_visible;
10237 szbox[3].gd.label = (GTextInfo *) &szgcd[3];
10238 szbox[3].gd.u.boxelements = szarray3;
10239 szbox[3].creator = GHVGroupCreate;
10240
10241 szbox[4].gd.flags = gg_enabled|gg_visible;
10242 szbox[4].gd.u.boxelements = szarray4;
10243 szbox[4].creator = GHBoxCreate;
10244
10245 /******************************************************************************/
10246 memset(&mcgcd,0,sizeof(mcgcd));
10247 memset(&mclabel,'\0',sizeof(mclabel));
10248
10249 k=0;
10250 mclabel[k].text = (unichar_t *) _("Mac Style Set:");
10251 mclabel[k].text_is_1byte = true;
10252 mcgcd[k].gd.label = &mclabel[k];
10253 mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 7;
10254 mcgcd[k].gd.flags = gg_visible | gg_enabled;
10255 mcgcd[k++].creator = GLabelCreate;
10256
10257 mclabel[k].text = (unichar_t *) _("Automatic");
10258 mclabel[k].text_is_1byte = true;
10259 mcgcd[k].gd.label = &mclabel[k];
10260 mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 20;
10261 mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
10262 mcgcd[k].gd.cid = CID_MacAutomatic;
10263 mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
10264 mcgcd[k++].creator = GRadioCreate;
10265
10266 mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = 20;
10267 mcgcd[k].gd.flags = (sf->macstyle!=-1) ? (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_rad_continueold);
10268 mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
10269 mcgcd[k++].creator = GRadioCreate;
10270
10271 mcgcd[k].gd.pos.x = 110; mcgcd[k].gd.pos.y = 20;
10272 mcgcd[k].gd.pos.width = 120; mcgcd[k].gd.pos.height = 7*12+10;
10273 mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_list_multiplesel) : (gg_visible | gg_enabled | gg_list_multiplesel);
10274 mcgcd[k].gd.cid = CID_MacStyles;
10275 mcgcd[k].gd.u.list = macstyles;
10276 mcgcd[k++].creator = GListCreate;
10277
10278 mclabel[k].text = (unichar_t *) _("FOND Name:");
10279 mclabel[k].text_is_1byte = true;
10280 mcgcd[k].gd.label = &mclabel[k];
10281 mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y + mcgcd[k-1].gd.pos.height+8;
10282 mcgcd[k].gd.flags = gg_visible | gg_enabled;
10283 mcgcd[k++].creator = GLabelCreate;
10284
10285 mclabel[k].text = (unichar_t *) sf->fondname;
10286 mclabel[k].text_is_1byte = true;
10287 mcgcd[k].gd.label = sf->fondname==NULL ? NULL : &mclabel[k];
10288 mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y - 4;
10289 mcgcd[k].gd.flags = gg_visible | gg_enabled;
10290 mcgcd[k].gd.cid = CID_MacFOND;
10291 mcgcd[k++].creator = GTextFieldCreate;
10292
10293
10294 mcs = MacStyleCode(sf,NULL);
10295 for ( i=0; macstyles[i].text!=NULL; ++i )
10296 macstyles[i].selected = (mcs&(int) (intptr_t) macstyles[i].userdata)? 1 : 0;
10297
10298 mcarray[0] = &mcgcd[0]; mcarray[1] = GCD_Glue; mcarray[2] = NULL;
10299 mcarray[3] = &mcbox[2]; mcarray[4] = &mcgcd[3]; mcarray[5] = NULL;
10300 mcarray[6] = &mcgcd[4]; mcarray[7] = &mcgcd[5]; mcarray[8] = NULL;
10301 mcarray[9] = GCD_Glue; mcarray[10] = GCD_Glue; mcarray[11] = NULL;
10302 mcarray[12] = NULL;
10303 mcarray2[0] = &mcgcd[1]; mcarray2[1] = &mcgcd[2]; mcarray2[2] = NULL;
10304 mcarray2[3] = GCD_Glue; mcarray2[4] = GCD_Glue; mcarray2[5] = NULL;
10305 mcarray2[6] = NULL;
10306
10307 memset(mcbox,0,sizeof(mcbox));
10308 mcbox[0].gd.flags = gg_enabled|gg_visible;
10309 mcbox[0].gd.u.boxelements = mcarray;
10310 mcbox[0].creator = GHVBoxCreate;
10311
10312 mcbox[2].gd.flags = gg_enabled|gg_visible;
10313 mcbox[2].gd.u.boxelements = mcarray2;
10314 mcbox[2].creator = GHVBoxCreate;
10315
10316 /******************************************************************************/
10317 memset(&lksubgcd,0,sizeof(lksubgcd));
10318 memset(&lkgcd,0,sizeof(lkgcd));
10319 memset(&lkaspects,'\0',sizeof(lkaspects));
10320 memset(&lkbox,'\0',sizeof(lkbox));
10321 memset(&lkbuttonsgcd,'\0',sizeof(lkbuttonsgcd));
10322 memset(&lkbuttonslabel,'\0',sizeof(lkbuttonslabel));
10323
10324 LookupSetup(&d->tables[0],sf->gsub_lookups);
10325 LookupSetup(&d->tables[1],sf->gpos_lookups);
10326
10327 i=0;
10328 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10329 lkbuttonsgcd[i].gd.flags = gg_visible;
10330 lkbuttonsgcd[i].gd.popup_msg = _("Moves the currently selected lookup to be first in the lookup ordering\nor moves the currently selected subtable to be first in its lookup.");
10331 lkbuttonslabel[i].text = (unichar_t *) _("_Top");
10332 lkbuttonslabel[i].text_is_1byte = true;
10333 lkbuttonslabel[i].text_in_resource = true;
10334 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10335 lkbuttonsgcd[i].gd.cid = CID_LookupTop;
10336 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
10337 lkbuttonsgcd[i++].creator = GButtonCreate;
10338
10339 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10340 lkbuttonsgcd[i].gd.flags = gg_visible;
10341 lkbuttonsgcd[i].gd.popup_msg = _("Moves the currently selected lookup before the previous lookup\nor moves the currently selected subtable before the previous subtable.");
10342 lkbuttonslabel[i].text = (unichar_t *) _("_Up");
10343 lkbuttonslabel[i].text_is_1byte = true;
10344 lkbuttonslabel[i].text_in_resource = true;
10345 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10346 lkbuttonsgcd[i].gd.cid = CID_LookupUp;
10347 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
10348 lkbuttonsgcd[i++].creator = GButtonCreate;
10349
10350 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10351 lkbuttonsgcd[i].gd.flags = gg_visible;
10352 lkbuttonsgcd[i].gd.popup_msg = _("Moves the currently selected lookup after the next lookup\nor moves the currently selected subtable after the next subtable.");
10353 lkbuttonslabel[i].text = (unichar_t *) _("_Down");
10354 lkbuttonslabel[i].text_is_1byte = true;
10355 lkbuttonslabel[i].text_in_resource = true;
10356 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10357 lkbuttonsgcd[i].gd.cid = CID_LookupDown;
10358 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
10359 lkbuttonsgcd[i++].creator = GButtonCreate;
10360
10361 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10362 lkbuttonsgcd[i].gd.flags = gg_visible;
10363 lkbuttonsgcd[i].gd.popup_msg = _("Moves the currently selected lookup to the end of the lookup chain\nor moves the currently selected subtable to be the last subtable in the lookup");
10364 lkbuttonslabel[i].text = (unichar_t *) _("_Bottom");
10365 lkbuttonslabel[i].text_is_1byte = true;
10366 lkbuttonslabel[i].text_in_resource = true;
10367 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10368 lkbuttonsgcd[i].gd.cid = CID_LookupBottom;
10369 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
10370 lkbuttonsgcd[i++].creator = GButtonCreate;
10371
10372 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10373 lkbuttonsgcd[i].gd.flags = gg_visible;
10374 lkbuttonsgcd[i].gd.popup_msg = _("Sorts the lookups in a default ordering based on feature tags");
10375 lkbuttonslabel[i].text = (unichar_t *) _("_Sort");
10376 lkbuttonslabel[i].text_is_1byte = true;
10377 lkbuttonslabel[i].text_in_resource = true;
10378 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10379 lkbuttonsgcd[i].gd.cid = CID_LookupSort;
10380 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupSort;
10381 lkbuttonsgcd[i++].creator = GButtonCreate;
10382
10383 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10384 lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled ;
10385 lkbuttonsgcd[i++].creator = GLineCreate;
10386
10387 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10388 lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled;
10389 lkbuttonsgcd[i].gd.popup_msg = _("Adds a new lookup after the selected lookup\nor at the start of the lookup list if nothing is selected.");
10390 lkbuttonslabel[i].text = (unichar_t *) _("Add _Lookup");
10391 lkbuttonslabel[i].text_is_1byte = true;
10392 lkbuttonslabel[i].text_in_resource = true;
10393 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10394 lkbuttonsgcd[i].gd.cid = CID_AddLookup;
10395 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddLookup;
10396 lkbuttonsgcd[i++].creator = GButtonCreate;
10397
10398 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10399 lkbuttonsgcd[i].gd.flags = gg_visible;
10400 lkbuttonsgcd[i].gd.popup_msg = _("Adds a new lookup subtable after the selected subtable\nor at the start of the lookup if nothing is selected.");
10401 lkbuttonslabel[i].text = (unichar_t *) _("Add Sub_table");
10402 lkbuttonslabel[i].text_is_1byte = true;
10403 lkbuttonslabel[i].text_in_resource = true;
10404 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10405 lkbuttonsgcd[i].gd.cid = CID_AddSubtable;
10406 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddSubtable;
10407 lkbuttonsgcd[i++].creator = GButtonCreate;
10408
10409 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10410 lkbuttonsgcd[i].gd.flags = gg_visible;
10411 lkbuttonsgcd[i].gd.popup_msg = _("Edits a lookup or lookup subtable.");
10412 lkbuttonslabel[i].text = (unichar_t *) _("Edit _Metadata");
10413 lkbuttonslabel[i].text_is_1byte = true;
10414 lkbuttonslabel[i].text_in_resource = true;
10415 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10416 lkbuttonsgcd[i].gd.cid = CID_EditMetadata;
10417 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditMetadata;
10418 lkbuttonsgcd[i++].creator = GButtonCreate;
10419
10420 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10421 lkbuttonsgcd[i].gd.flags = gg_visible;
10422 lkbuttonsgcd[i].gd.popup_msg = _("Edits the transformations in a lookup subtable.");
10423 lkbuttonslabel[i].text = (unichar_t *) _("_Edit Data");
10424 lkbuttonslabel[i].text_is_1byte = true;
10425 lkbuttonslabel[i].text_in_resource = true;
10426 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10427 lkbuttonsgcd[i].gd.cid = CID_EditSubtable;
10428 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditSubtableContents;
10429 lkbuttonsgcd[i++].creator = GButtonCreate;
10430
10431 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10432 lkbuttonsgcd[i].gd.flags = gg_visible;
10433 lkbuttonsgcd[i].gd.popup_msg = _("Deletes any selected lookups and their subtables, or deletes any selected subtables.\nThis will also delete any transformations associated with those subtables.");
10434 lkbuttonslabel[i].text = (unichar_t *) _("De_lete");
10435 lkbuttonslabel[i].text_is_1byte = true;
10436 lkbuttonslabel[i].text_in_resource = true;
10437 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10438 lkbuttonsgcd[i].gd.cid = CID_DeleteLookup;
10439 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupDeleteLookup;
10440 lkbuttonsgcd[i++].creator = GButtonCreate;
10441
10442 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10443 lkbuttonsgcd[i].gd.flags = gg_visible;
10444 lkbuttonsgcd[i].gd.popup_msg = _("Merges two selected (and compatible) lookups into one,\nor merges two selected subtables of a lookup into one");
10445 lkbuttonslabel[i].text = (unichar_t *) _("_Merge");
10446 lkbuttonslabel[i].text_is_1byte = true;
10447 lkbuttonslabel[i].text_in_resource = true;
10448 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10449 lkbuttonsgcd[i].gd.cid = CID_MergeLookup;
10450 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupMergeLookup;
10451 lkbuttonsgcd[i++].creator = GButtonCreate;
10452
10453 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10454 lkbuttonsgcd[i].gd.flags = gg_visible;
10455 lkbuttonsgcd[i].gd.popup_msg = _("Reverts the lookup list to its original condition.\nBut any changes to subtable data will remain.");
10456 lkbuttonslabel[i].text = (unichar_t *) _("_Revert");
10457 lkbuttonslabel[i].text_is_1byte = true;
10458 lkbuttonslabel[i].text_in_resource = true;
10459 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10460 lkbuttonsgcd[i].gd.cid = CID_RevertLookups;
10461 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupRevertLookup;
10462 lkbuttonsgcd[i++].creator = GButtonCreate;
10463
10464 lkbuttonsarray[i] = &lkbuttonsgcd[i];
10465 lkbuttonsgcd[i].gd.flags = gg_visible;
10466 lkbuttonsgcd[i].gd.popup_msg = _("Imports a lookup (and all its subtables) from another font.");
10467 lkbuttonslabel[i].text = (unichar_t *) _("_Import");
10468 lkbuttonslabel[i].text_is_1byte = true;
10469 lkbuttonslabel[i].text_in_resource = true;
10470 lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
10471 lkbuttonsgcd[i].gd.cid = CID_ImportLookups;
10472 lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupImportLookup;
10473 lkbuttonsgcd[i++].creator = GButtonCreate;
10474 lkbuttonsarray[i] = GCD_Glue;
10475 lkbuttonsarray[i+1] = NULL;
10476
10477 for ( i=0; i<2; ++i ) {
10478 lkaspects[i].text = (unichar_t *) (i?"GPOS":"GSUB");
10479 lkaspects[i].text_is_1byte = true;
10480 lkaspects[i].gcd = &lkbox[2*i];
10481
10482 lksubgcd[i][0].gd.pos.x = 10; lksubgcd[i][0].gd.pos.y = 10;
10483 lksubgcd[i][0].gd.pos.width = ngcd[15].gd.pos.width;
10484 lksubgcd[i][0].gd.pos.height = 150;
10485 lksubgcd[i][0].gd.flags = gg_visible | gg_enabled;
10486 lksubgcd[i][0].gd.u.drawable_e_h = i ? gposlookups_e_h : gsublookups_e_h;
10487 lksubgcd[i][0].gd.cid = CID_LookupWin+i;
10488 lksubgcd[i][0].creator = GDrawableCreate;
10489
10490 lksubgcd[i][1].gd.pos.x = 10; lksubgcd[i][1].gd.pos.y = 10;
10491 lksubgcd[i][1].gd.pos.height = 150;
10492 lksubgcd[i][1].gd.flags = gg_visible | gg_enabled | gg_sb_vert;
10493 lksubgcd[i][1].gd.cid = CID_LookupVSB+i;
10494 lksubgcd[i][1].gd.handle_controlevent = LookupsVScroll;
10495 lksubgcd[i][1].creator = GScrollBarCreate;
10496
10497 lksubgcd[i][2].gd.pos.x = 10; lksubgcd[i][2].gd.pos.y = 10;
10498 lksubgcd[i][2].gd.pos.width = 150;
10499 lksubgcd[i][2].gd.flags = gg_visible | gg_enabled;
10500 lksubgcd[i][2].gd.cid = CID_LookupHSB+i;
10501 lksubgcd[i][2].gd.handle_controlevent = LookupsHScroll;
10502 lksubgcd[i][2].creator = GScrollBarCreate;
10503
10504 lksubgcd[i][3].gd.pos.x = 10; lksubgcd[i][3].gd.pos.y = 10;
10505 lksubgcd[i][3].gd.pos.width = lksubgcd[i][3].gd.pos.height = _GScrollBar_Width;
10506 lksubgcd[i][3].gd.flags = gg_visible | gg_enabled | gg_tabset_nowindow;
10507 lksubgcd[i][3].creator = GDrawableCreate;
10508
10509 lkarray[i][0] = &lksubgcd[i][0]; lkarray[i][1] = &lksubgcd[i][1]; lkarray[i][2] = NULL;
10510 lkarray[i][3] = &lksubgcd[i][2]; lkarray[i][4] = &lksubgcd[i][3]; lkarray[i][5] = NULL;
10511 lkarray[i][6] = NULL;
10512
10513 lkbox[2*i].gd.flags = gg_enabled|gg_visible;
10514 lkbox[2*i].gd.u.boxelements = lkarray[i];
10515 lkbox[2*i].creator = GHVBoxCreate;
10516 }
10517
10518 lkaspects[0].selected = true;
10519
10520 lkgcd[0].gd.pos.x = 4; lkgcd[0].gd.pos.y = 10;
10521 lkgcd[0].gd.pos.width = 250;
10522 lkgcd[0].gd.pos.height = 260;
10523 lkgcd[0].gd.u.tabs = lkaspects;
10524 lkgcd[0].gd.flags = gg_visible | gg_enabled;
10525 lkgcd[0].gd.cid = CID_Lookups;
10526 lkgcd[0].gd.handle_controlevent = GFI_LookupAspectChange;
10527 lkgcd[0].creator = GTabSetCreate;
10528
10529 lkharray[0] = &lkgcd[0]; lkharray[1] = &lkbox[4]; lkharray[2] = NULL;
10530
10531 lkbox[4].gd.flags = gg_enabled|gg_visible;
10532 lkbox[4].gd.u.boxelements = lkbuttonsarray;
10533 lkbox[4].creator = GVBoxCreate;
10534
10535 lkbox[5].gd.flags = gg_enabled|gg_visible;
10536 lkbox[5].gd.u.boxelements = lkharray;
10537 lkbox[5].creator = GHBoxCreate;
10538
10539
10540 /******************************************************************************/
10541 memset(&mfgcd,0,sizeof(mfgcd));
10542 memset(&mflabel,'\0',sizeof(mflabel));
10543 memset(mfbox,0,sizeof(mfbox));
10544
10545 GCDFillMacFeat(mfgcd,mflabel,250,sf->features, false, mfbox, mfarray);
10546 /******************************************************************************/
10547
10548 memset(&dlabel,0,sizeof(dlabel));
10549 memset(&dgcd,0,sizeof(dgcd));
10550
10551 dlabel[0].text = (unichar_t *) _("Creation Date:");
10552 dlabel[0].text_is_1byte = true;
10553 dlabel[0].text_in_resource = true;
10554 dgcd[0].gd.label = &dlabel[0];
10555 dgcd[0].gd.pos.x = 12; dgcd[0].gd.pos.y = 6+6;
10556 dgcd[0].gd.flags = gg_visible | gg_enabled;
10557 dgcd[0].creator = GLabelCreate;
10558
10559 t = sf->creationtime;
10560 tm = localtime(&t);
10561 if(!tm) strcpy(createtime, "error");
10562 else strftime(createtime,sizeof(createtime),"%c",tm);
10563 tmpcreatetime = def2u_copy(createtime);
10564 dgcd[1].gd.pos.x = 115; dgcd[1].gd.pos.y = dgcd[0].gd.pos.y;
10565 dgcd[1].gd.flags = gg_visible | gg_enabled;
10566 dlabel[1].text = tmpcreatetime;
10567 dgcd[1].gd.label = &dlabel[1];
10568 dgcd[1].creator = GLabelCreate;
10569
10570 dlabel[2].text = (unichar_t *) _("Modification Date:");
10571 dlabel[2].text_is_1byte = true;
10572 dlabel[2].text_in_resource = true;
10573 dgcd[2].gd.label = &dlabel[2];
10574 dgcd[2].gd.pos.x = 12; dgcd[2].gd.pos.y = dgcd[0].gd.pos.y+14;
10575 dgcd[2].gd.flags = gg_visible | gg_enabled;
10576 dgcd[2].creator = GLabelCreate;
10577
10578 t = sf->modificationtime;
10579 tm = localtime(&t);
10580 if(!tm) strcpy(modtime, "error");
10581 else strftime(modtime,sizeof(modtime),"%c",tm);
10582 tmpmodtime = def2u_copy(modtime);
10583 dgcd[3].gd.pos.x = 115; dgcd[3].gd.pos.y = dgcd[2].gd.pos.y;
10584 dgcd[3].gd.flags = gg_visible | gg_enabled;
10585 dlabel[3].text = tmpmodtime;
10586 dgcd[3].gd.label = &dlabel[3];
10587 dgcd[3].creator = GLabelCreate;
10588
10589 darray[0] = &dgcd[0]; darray[1] = &dgcd[1]; darray[2] = NULL;
10590 darray[3] = &dgcd[2]; darray[4] = &dgcd[3]; darray[5] = NULL;
10591 darray[6] = GCD_Glue; darray[7] = GCD_Glue; darray[8] = NULL;
10592 darray[9] = NULL;
10593
10594 memset(dbox,0,sizeof(dbox));
10595 dbox[0].gd.flags = gg_enabled|gg_visible;
10596 dbox[0].gd.u.boxelements = darray;
10597 dbox[0].creator = GHVBoxCreate;
10598 /******************************************************************************/
10599
10600 memset(&ulabel,0,sizeof(ulabel));
10601 memset(&ugcd,0,sizeof(ugcd));
10602 memset(ubox,0,sizeof(ubox));
10603
10604 ulabel[0].text = (unichar_t *) _(
10605 "This pane is informative only and shows the characters\n"
10606 "actually in the font. If you wish to set the OS/2 Unicode\n"
10607 "Range field, change the pane to");
10608 ulabel[0].text_is_1byte = true;
10609 ugcd[0].gd.label = &ulabel[0];
10610 ugcd[0].gd.pos.x = 12; ugcd[0].gd.pos.y = 10;
10611 ugcd[0].gd.flags = gg_visible | gg_enabled;
10612 ugcd[0].creator = GLabelCreate;
10613
10614 ulabel[1].text = (unichar_t *) _( "OS/2 -> Charsets");
10615 ulabel[1].text_is_1byte = true;
10616 ugcd[1].gd.label = &ulabel[1];
10617 ugcd[1].gd.pos.x = 12; ugcd[1].gd.pos.y = 10;
10618 ugcd[1].gd.flags = gg_visible | gg_enabled | gg_dontcopybox;
10619 ugcd[1].gd.box = &small_blue_box;
10620 ugcd[1].gd.handle_controlevent = GFI_URangeAspectChange;
10621 ugcd[1].creator = GButtonCreate;
10622 uharray[0] = GCD_Glue; uharray[1] = &ugcd[1]; uharray[2] = GCD_Glue; uharray[3] = NULL;
10623
10624 ubox[2].gd.flags = gg_enabled|gg_visible;
10625 ubox[2].gd.u.boxelements = uharray;
10626 ubox[2].creator = GHBoxCreate;
10627
10628 ulabel[2].text = (unichar_t *) _("Include Empty Blocks");
10629 ulabel[2].text_is_1byte = true;
10630 ulabel[2].text_in_resource = true;
10631 ugcd[2].gd.label = &ulabel[2];
10632 ugcd[2].gd.pos.x = 12; ugcd[2].gd.pos.y = 10;
10633 ugcd[2].gd.flags = gg_visible | gg_enabled;
10634 ugcd[2].gd.handle_controlevent = GFI_UnicodeEmptiesChange;
10635 ugcd[2].gd.cid = CID_UnicodeEmpties;
10636 ugcd[2].creator = GCheckBoxCreate;
10637
10638 ugcd[3].gd.pos.x = 12; ugcd[3].gd.pos.y = 30;
10639 ugcd[3].gd.pos.width = ngcd[15].gd.pos.width;
10640 ugcd[3].gd.pos.height = 200;
10641 ugcd[3].gd.flags = gg_visible | gg_enabled;
10642 ugcd[3].gd.cid = CID_Unicode;
10643 ugcd[3].gd.handle_controlevent = GFI_UnicodeRangeChange;
10644 ugcd[3].gd.popup_msg = _("Click on a range to select characters in that range.\nDouble click on a range to see characters that should be\nin the range but aren't.");
10645 ugcd[3].creator = GListCreate;
10646
10647 uarray[0] = &ugcd[0]; uarray[1] = &ubox[2]; uarray[2] = &ugcd[2]; uarray[3] = &ugcd[3]; uarray[4] = NULL;
10648
10649 ubox[0].gd.flags = gg_enabled|gg_visible;
10650 ubox[0].gd.u.boxelements = uarray;
10651 ubox[0].creator = GVBoxCreate;
10652
10653 /******************************************************************************/
10654
10655 // This is where the indices for the different tabs get set as referenced by defaspect.
10656 // If you change something here, it's probably a good idea to grep for calls to FontInfo
10657 // in order to confirm/adjust the defaspect arguments.
10658
10659 memset(&mlabel,0,sizeof(mlabel));
10660 memset(&mgcd,0,sizeof(mgcd));
10661 memset(&aspects,'\0',sizeof(aspects));
10662
10663 i = 0;
10664
10665 aspects[i].text = (unichar_t *) _("PS Names");
10666 d->old_aspect = 0;
10667 aspects[i].text_is_1byte = true;
10668 aspects[i++].gcd = nb;
10669
10670 aspects[i].text = (unichar_t *) _("General");
10671 aspects[i].text_is_1byte = true;
10672 aspects[i++].gcd = psb;
10673
10674 aspects[i].text = (unichar_t *) _("Layers");
10675 aspects[i].text_is_1byte = true;
10676 aspects[i++].gcd = lbox;
10677
10678 aspects[i].text = (unichar_t *) _("PS UID");
10679 aspects[i].text_is_1byte = true;
10680 aspects[i++].gcd = xub;
10681
10682 d->private_aspect = i;
10683 aspects[i].text = (unichar_t *) _("PS Private");
10684 aspects[i].text_is_1byte = true;
10685 aspects[i++].gcd = ppbox;
10686
10687 d->ttfv_aspect = i;
10688 aspects[i].text = (unichar_t *) _("OS/2");
10689 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10690 aspects[i].text_is_1byte = true;
10691 aspects[i++].gcd = vagcd;
10692
10693 d->tn_aspect = i;
10694 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10695 aspects[i].text = (unichar_t *) _("TTF Names");
10696 aspects[i].text_is_1byte = true;
10697 aspects[i++].gcd = tnboxes;
10698
10699 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10700 aspects[i].text = (unichar_t *) _("StyleSet Names");
10701 aspects[i].text_is_1byte = true;
10702 aspects[i++].gcd = ssboxes;
10703
10704 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10705 aspects[i].text = (unichar_t *) _("Grid Fitting");
10706 aspects[i].text_is_1byte = true;
10707 aspects[i++].gcd = gaspboxes;
10708
10709 d->tx_aspect = i;
10710 /* xgettext won't use non-ASCII messages */
10711 aspects[i].text = (unichar_t *) U_("΀ΔΧ"); /* Tau epsilon Chi, in greek */
10712 aspects[i].text_is_1byte = true;
10713 aspects[i++].gcd = txbox;
10714
10715 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10716 aspects[i].text = (unichar_t *) _("Size");
10717 aspects[i].text_is_1byte = true;
10718 aspects[i++].gcd = szbox;
10719
10720 aspects[i].text = (unichar_t *) _("Comment");
10721 aspects[i].text_is_1byte = true;
10722 aspects[i++].gcd = combox;
10723
10724 aspects[i].text = (unichar_t *) _("FONTLOG");
10725 aspects[i].text_is_1byte = true;
10726 aspects[i++].gcd = flogbox;
10727
10728 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10729 aspects[i].text = (unichar_t *) _("Mark Classes");
10730 aspects[i].text_is_1byte = true;
10731 aspects[i++].gcd = mkbox;
10732
10733 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10734 aspects[i].text = (unichar_t *) _("Mark Sets");
10735 aspects[i].text_is_1byte = true;
10736 aspects[i++].gcd = msbox;
10737
10738 /* GT: OpenType GPOS/GSUB lookups */
10739 if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
10740 aspects[i].text = (unichar_t *) S_("OpenType|Lookups");
10741 aspects[i].text_is_1byte = true;
10742 aspects[i++].gcd = &lkbox[5];
10743 /* On my system the "lookups line appears indented. That seems to be because */
10744 /* the letter "L" has more of a left-side bearing than it should. It is not */
10745 /* a bug in the nesting level. Remember this next time it bugs me */
10746
10747 aspects[i].text = (unichar_t *) _("WOFF");
10748 aspects[i].text_is_1byte = true;
10749 aspects[i++].gcd = woffbox;
10750
10751 aspects[i].text = (unichar_t *) _("Mac");
10752 aspects[i].text_is_1byte = true;
10753 aspects[i++].gcd = mcbox;
10754
10755 aspects[i].text = (unichar_t *) _("Mac Features");
10756 aspects[i].text_is_1byte = true;
10757 aspects[i++].gcd = mfbox;
10758
10759 aspects[i].text = (unichar_t *) _("Dates");
10760 aspects[i].text_is_1byte = true;
10761 aspects[i++].gcd = dbox;
10762
10763 d->unicode_aspect = i;
10764 aspects[i].text = (unichar_t *) _("Unicode Ranges");
10765 aspects[i].text_is_1byte = true;
10766 aspects[i++].gcd = ubox;
10767
10768 aspects[defaspect].selected = true;
10769
10770 mgcd[0].gd.pos.x = 4; mgcd[0].gd.pos.y = 6;
10771 mgcd[0].gd.u.tabs = aspects;
10772 mgcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_vert;
10773 // We adjusted the following two values so as to make the GPOS and GSUB scrollbars visible.
10774 mgcd[0].gd.pos.width = 500; // 260+85;
10775 mgcd[0].gd.pos.height = 380; // 325;
10776 mgcd[0].gd.handle_controlevent = GFI_AspectChange;
10777 mgcd[0].gd.cid = CID_Tabs;
10778 mgcd[0].creator = GTabSetCreate;
10779
10780 mgcd[1].gd.pos.x = 30-3; mgcd[1].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
10781 mgcd[1].gd.pos.width = -1; mgcd[1].gd.pos.height = 0;
10782 mgcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
10783 mlabel[1].text = (unichar_t *) _("_OK");
10784 mlabel[1].text_is_1byte = true;
10785 mlabel[1].text_in_resource = true;
10786 mgcd[1].gd.label = &mlabel[1];
10787 mgcd[1].gd.handle_controlevent = GFI_OK;
10788 mgcd[1].gd.cid = CID_OK;
10789 mgcd[1].creator = GButtonCreate;
10790
10791 mgcd[2].gd.pos.x = -30; mgcd[2].gd.pos.y = mgcd[1].gd.pos.y+3;
10792 mgcd[2].gd.pos.width = -1; mgcd[2].gd.pos.height = 0;
10793 mgcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
10794 mlabel[2].text = (unichar_t *) _("_Cancel");
10795 mlabel[2].text_is_1byte = true;
10796 mlabel[2].text_in_resource = true;
10797 mgcd[2].gd.label = &mlabel[2];
10798 mgcd[2].gd.handle_controlevent = GFI_Cancel;
10799 mgcd[2].gd.cid = CID_Cancel;
10800 mgcd[2].creator = GButtonCreate;
10801
10802 mgcd[3].gd.pos.x = 2; mgcd[3].gd.pos.y = 2;
10803 mgcd[3].gd.pos.width = pos.width-4; mgcd[3].gd.pos.height = pos.height-4;
10804 mgcd[3].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
10805 mgcd[3].gd.cid = CID_MainGroup;
10806 mgcd[3].creator = GGroupCreate;
10807
10808 marray2[0] = marray2[2] = marray2[3] = marray2[4] = marray2[6] = GCD_Glue; marray2[7] = NULL;
10809 marray2[1] = &mgcd[1]; marray2[5] = &mgcd[2];
10810
10811 marray[0] = &mgcd[0]; marray[1] = NULL;
10812 marray[2] = &mb2; marray[3] = NULL;
10813 marray[4] = GCD_Glue; marray[5] = NULL;
10814 marray[6] = NULL;
10815
10816 memset(mb,0,sizeof(mb));
10817 mb[0].gd.pos.x = mb[0].gd.pos.y = 2;
10818 mb[0].gd.flags = gg_enabled|gg_visible;
10819 mb[0].gd.u.boxelements = marray;
10820 mb[0].gd.cid = CID_TopBox;
10821 mb[0].creator = GHVGroupCreate;
10822
10823 memset(&mb2,0,sizeof(mb2));
10824 mb2.gd.flags = gg_enabled|gg_visible;
10825 mb2.gd.u.boxelements = marray2;
10826 mb2.creator = GHBoxCreate;
10827
10828 GGadgetsCreate(gw,mb);
10829 GMatrixEditSetNewText(tngcd[4].ret,S_("TrueTypeName|New"));
10830 GGadgetSelectOneListItem(gaspgcd[0].ret,sf->gasp_version);
10831 GMatrixEditSetNewText(gaspgcd[3].ret,S_("gaspTableEntry|New"));
10832 GMatrixEditAddButtons(gaspgcd[3].ret,gaspgcd_def);
10833 if ( sf->gasp_version==0 ) {
10834 GMatrixEditShowColumn(gaspgcd[3].ret,3,false);
10835 GMatrixEditShowColumn(gaspgcd[3].ret,4,false);
10836 }
10837 GHVBoxSetExpandableCol(gaspboxes[2].ret,2);
10838 GHVBoxSetExpandableRow(gaspboxes[0].ret,1);
10839
10840 GMatrixEditAddButtons(pgcd[0].ret,privategcd_def);
10841 GMatrixEditSetUpDownVisible(pgcd[0].ret, true);
10842 GMatrixEditSetOtherButtonEnable(pgcd[0].ret, PSPrivate_EnableButtons);
10843 GMatrixEditSetNewText(pgcd[0].ret,S_("PSPrivateDictKey|New"));
10844
10845 GHVBoxSetExpandableCol(lbox[2].ret,3);
10846 GHVBoxSetExpandableCol(lbox[3].ret,gb_expandglue);
10847 GHVBoxSetExpandableCol(lbox[4].ret,gb_expandglue);
10848 GHVBoxSetExpandableRow(lbox[0].ret,5);
10849 GMatrixEditEnableColumn(GWidgetGetControl(gw,CID_Backgrounds),1,ltype<0);
10850 GMatrixEditShowColumn(GWidgetGetControl(gw,CID_Backgrounds),3,false);
10851 /* This column contains internal state information which the user */
10852 /* should not see, ever */
10853
10854 GHVBoxSetExpandableRow(combox[0].ret,1);
10855 GHVBoxSetExpandableRow(flogbox[0].ret,1);
10856
10857 GHVBoxSetExpandableRow(mb[0].ret,0);
10858 GHVBoxSetExpandableCol(mb2.ret,gb_expandgluesame);
10859
10860 GHVBoxSetExpandableCol(nb[0].ret,1);
10861 GHVBoxSetExpandableRow(nb[0].ret,8);
10862 GHVBoxSetExpandableCol(nb2.ret,1);
10863 GHVBoxSetExpandableCol(nb3.ret,1);
10864
10865 GHVBoxSetExpandableCol(xub[0].ret,1);
10866 GHVBoxSetExpandableRow(xub[0].ret,5);
10867
10868 GHVBoxSetExpandableRow(psb[0].ret,psrow);
10869 GHVBoxSetExpandableCol(psb2[0].ret,3);
10870 GHVBoxSetExpandableCol(psb2[1].ret,1);
10871
10872 GHVBoxSetExpandableRow(vbox[0].ret,gb_expandglue);
10873 GHVBoxSetExpandableCol(vbox[0].ret,1);
10874 GHVBoxSetExpandableCol(vbox[2].ret,gb_expandglue);
10875
10876 GHVBoxSetExpandableRow(metbox[0].ret,10);
10877 GHVBoxSetExpandableCol(metbox[0].ret,1);
10878
10879 GHVBoxSetExpandableRow(ssbox[0].ret,gb_expandglue);
10880 GHVBoxSetExpandableCol(ssbox[0].ret,gb_expandglue);
10881
10882 GHVBoxSetExpandableRow(panbox[0].ret,gb_expandglue);
10883 GHVBoxSetExpandableCol(panbox[0].ret,1);
10884
10885 GHVBoxSetExpandableRow(cbox[0].ret,2);
10886 GHVBoxSetExpandableCol(cbox[2].ret,gb_expandglue);
10887 GHVBoxSetExpandableCol(cbox[3].ret,gb_expandglue);
10888 GHVBoxSetExpandableRow(cbox[4].ret,gb_expandglue);
10889
10890 GHVBoxSetExpandableRow(woffbox[0].ret,2);
10891
10892 GHVBoxSetExpandableRow(mkbox[0].ret,1);
10893 GMatrixEditSetBeforeDelete(mkgcd[1].ret, GFI_Mark_DeleteClass);
10894 GMatrixEditSetColumnCompletion(mkgcd[1].ret,1,GFI_GlyphListCompletion);
10895
10896 GHVBoxSetExpandableRow(msbox[0].ret,1);
10897 GMatrixEditSetBeforeDelete(msgcd[1].ret, GFI_Mark_DeleteClass);
10898 GMatrixEditSetColumnCompletion(msgcd[1].ret,1,GFI_GlyphListCompletion);
10899
10900 GHVBoxSetExpandableRow(txbox[0].ret,gb_expandglue);
10901 GHVBoxSetExpandableCol(txbox[2].ret,gb_expandglue);
10902 GHVBoxSetExpandableCol(txbox[3].ret,gb_expandglue);
10903 GHVBoxSetExpandableCol(txbox[4].ret,gb_expandglue);
10904
10905 GHVBoxSetExpandableRow(szbox[0].ret,4);
10906 GHVBoxSetPadding(szbox[2].ret,6,2);
10907 GHVBoxSetExpandableCol(szbox[2].ret,gb_expandglue);
10908 GHVBoxSetPadding(szbox[3].ret,6,2);
10909 GHVBoxSetExpandableCol(szbox[3].ret,gb_expandglue);
10910 GHVBoxSetPadding(szbox[4].ret,6,2);
10911 GHVBoxSetExpandableCol(szbox[4].ret,gb_expandglue);
10912
10913 GHVBoxSetExpandableRow(tnboxes[0].ret,1);
10914 GHVBoxSetExpandableCol(tnboxes[2].ret,gb_expandglue);
10915 GHVBoxSetExpandableCol(tnboxes[3].ret,gb_expandglue);
10916
10917 GHVBoxSetExpandableRow(ssboxes[0].ret,1);
10918
10919 GHVBoxSetExpandableRow(mcbox[0].ret,gb_expandglue);
10920 GHVBoxSetExpandableCol(mcbox[0].ret,1);
10921 GHVBoxSetExpandableRow(mcbox[2].ret,gb_expandglue);
10922
10923 GHVBoxSetExpandableRow(mfbox[0].ret,0);
10924 GHVBoxSetExpandableRow(mfbox[2].ret,gb_expandglue);
10925
10926 GHVBoxSetExpandableRow(dbox[0].ret,gb_expandglue);
10927 GHVBoxSetExpandableCol(dbox[0].ret,1);
10928
10929 GHVBoxSetExpandableRow(ubox[0].ret,3);
10930 GHVBoxSetExpandableCol(ubox[2].ret,gb_expandglue);
10931
10932 GHVBoxSetExpandableCol(lkbox[0].ret,0);
10933 GHVBoxSetExpandableRow(lkbox[0].ret,0);
10934 GHVBoxSetPadding(lkbox[0].ret,0,0);
10935 GHVBoxSetExpandableCol(lkbox[2].ret,0);
10936 GHVBoxSetExpandableRow(lkbox[2].ret,0);
10937 GHVBoxSetPadding(lkbox[2].ret,0,0);
10938 GHVBoxSetExpandableRow(lkbox[4].ret,gb_expandglue);
10939 GHVBoxSetExpandableCol(lkbox[5].ret,0);
10940
10941 GFI_LookupEnableButtons(d,true);
10942 GFI_LookupEnableButtons(d,false);
10943
10944 OS2_UnicodeChange(GWidgetGetControl(gw,CID_UnicodeRanges),NULL);
10945 OS2_CodePageChange(GWidgetGetControl(gw,CID_CodePageRanges),NULL);
10946
10947 d->font = fontinfo_font.fi;
10948 GDrawWindowFontMetrics(gw,d->font,&as,&ds,&ld);
10949 d->as = as; d->fh = as+ds;
10950
10951 GTextInfoListFree(namelistnames);
10952
10953 for ( i=0; i<mi.initial_row_cnt; ++i )
10954 free( mi.matrix_data[3*i+2].u.md_str );
10955 free( mi.matrix_data );
10956
10957 free(tmpcreatetime);
10958 free(tmpmodtime);
10959
10960 free(copied_copyright);
10961
10962 GWidgetIndicateFocusGadget(ngcd[1].ret);
10963 PSPrivate_EnableButtons(GWidgetGetControl(d->gw,CID_Private),-1,-1);
10964 GFI_AspectChange(mgcd[0].ret,NULL);
10965
10966 GHVBoxFitWindow(mb[0].ret);
10967
10968 GDrawSetVisible(gw,true);
10969
10970 if ( sync ) {
10971 while ( !d->done )
10972 GDrawProcessOneEvent(NULL);
10973 }
10974 }
10975
10976 void FontMenuFontInfo(void *_fv) {
10977 FontInfo( ((FontViewBase *) _fv)->sf,((FontViewBase *) _fv)->active_layer,-1,false);
10978 }
10979
10980 void FontInfoDestroy(SplineFont *sf) {
10981 if ( sf->fontinfo )
10982 GFI_CancelClose( (struct gfi_data *) (sf->fontinfo) );
10983 }
10984
10985 void FontInfoInit(void) {
10986 static int done = false;
10987 int i, j, k;
10988 static GTextInfo *needswork[] = {
10989 macstyles, widthclass, weightclass, fstype, pfmfamily, ibmfamily,
10990 panfamily, panserifs, panweight, panprop, pancontrast, panstrokevar,
10991 panarmstyle, panletterform, panmidline, panxheight,
10992 pantool, panspacing, panasprat, pancontrast2, pantopology, panform,
10993 panfinials, panxascent,
10994 panclass, panaspect, panserifvar, pantreatment, panlining,
10995 pantopology2, pancharrange, pancontrast3,
10996 pankind, panasprat2,
10997 mslanguages,
10998 ttfnameids, interpretations, gridfit, antialias, os2versions,
10999 codepagenames, unicoderangenames, symsmooth, gfsymsmooth, splineorder,
11000 NULL
11001 };
11002 struct titlelist *tl;
11003 static char **needswork2[] = { texparams, texpopups,
11004 mathparams, mathpopups, extparams, extpopups,
11005 NULL };
11006 static struct {
11007 int size;
11008 struct col_init *ci;
11009 } needswork3[] = {{ sizeof(ci)/sizeof(ci[0]), ci},
11010 { sizeof(gaspci)/sizeof(gaspci[0]), gaspci },
11011 { sizeof(layersci)/sizeof(layersci[0]), layersci },
11012 { sizeof(ssci)/sizeof(ssci[0]), ssci },
11013 { sizeof(sizeci)/sizeof(sizeci[0]), sizeci },
11014 { sizeof(marks_ci)/sizeof(marks_ci[0]), marks_ci },
11015 { sizeof(markc_ci)/sizeof(markc_ci[0]), markc_ci },
11016 { 0, NULL }};
11017
11018 if ( done )
11019 return;
11020 done = true;
11021 for ( j=0; needswork[j]!=NULL; ++j ) {
11022 for ( i=0; needswork[j][i].text!=NULL; ++i )
11023 needswork[j][i].text = (unichar_t *) S_((char *) needswork[j][i].text);
11024 }
11025 for ( j=0; needswork2[j]!=NULL; ++j ) {
11026 for ( i=0; needswork2[j][i]!=NULL; ++i )
11027 needswork2[j][i] = S_(needswork2[j][i]);
11028 }
11029
11030 for ( j=0; needswork3[j].ci!=NULL; ++j ) {
11031 for ( i=0; i<needswork3[j].size; ++i ) {
11032 needswork3[j].ci[i].title = S_(needswork3[j].ci[i].title);
11033 if ( needswork3[j].ci[i].enum_vals!=NULL ) {
11034 for ( k=0; needswork3[j].ci[i].enum_vals[k].text!=NULL; ++k )
11035 needswork3[j].ci[i].enum_vals[k].text = (unichar_t *) S_((char *) needswork3[j].ci[i].enum_vals[k].text);
11036 }
11037 }
11038 }
11039
11040 for ( tl=&panoses[0][0]; tl->name!=NULL; ++tl )
11041 tl->name = S_(tl->name);
11042
11043 LookupUIInit();
11044 LookupInit();
11045 }