1
/* Copyright (C) 2000-2007 by George Williams */
3
* Redistribution and use in source and binary forms, with or without
4
* modification, are permitted provided that the following conditions are met:
6
* Redistributions of source code must retain the above copyright notice, this
7
* list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright notice,
10
* this list of conditions and the following disclaimer in the documentation
11
* and/or other materials provided with the distribution.
13
* The name of the author may not be used to endorse or promote products
14
* derived from this software without specific prior written permission.
16
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#include "pfaeditui.h"
32
#include "unicoderange.h"
33
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
34
extern int _GScrollBar_Width;
42
#define Isspace(a) (a==' ')
44
#define Isspace isspace
48
static int last_aspect=0;
51
GTextInfo emsizes[] = {
52
{ (unichar_t *) "1000", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
53
{ (unichar_t *) "1024", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
54
{ (unichar_t *) "2048", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
55
{ (unichar_t *) "4096", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
59
GTextInfo interpretations[] = {
60
/* GT: See the long comment at "Property|New" */
61
/* GT: The msgstr should contain a translation of "None", ignore "Interpretation|" */
62
/* GT: In french this could be "Aucun" or "Aucune" depending on the gender */
63
/* GT: of "Interpretation" */
64
{ (unichar_t *) N_("Interpretation|None"), NULL, 0, 0, (void *) ui_none, NULL, 0, 0, 0, 0, 0, 0, 1},
65
/* { (unichar_t *) N_("Adobe Public Use Defs."), NULL, 0, 0, (void *) ui_adobe, NULL, 0, 0, 0, 0, 0, 0, 1}, */
66
/* { (unichar_t *) N_("Greek"), NULL, 0, 0, (void *) ui_greek, NULL, 0, 0, 0, 0, 0, 0, 1}, */
67
{ (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) ui_japanese, NULL, 0, 0, 0, 0, 0, 0, 1},
68
{ (unichar_t *) N_("Traditional Chinese"), NULL, 0, 0, (void *) ui_trad_chinese, NULL, 0, 0, 0, 0, 0, 0, 1},
69
{ (unichar_t *) N_("Simplified Chinese"), NULL, 0, 0, (void *) ui_simp_chinese, NULL, 0, 0, 0, 0, 0, 0, 1},
70
{ (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) ui_korean, NULL, 0, 0, 0, 0, 0, 0, 1},
71
/* { (unichar_t *) N_("AMS Public Use"), NULL, 0, 0, (void *) ui_ams, NULL, 0, 0, 0, 0, 0, 0, 1}, */
73
GTextInfo macstyles[] = {
74
{ (unichar_t *) N_("MacStyles|Bold"), NULL, 0, 0, (void *) sf_bold, NULL, 0, 0, 0, 0, 0, 0, 1},
75
{ (unichar_t *) N_("MacStyles|Italic"), NULL, 0, 0, (void *) sf_italic, NULL, 0, 0, 0, 0, 0, 0, 1},
76
{ (unichar_t *) N_("MacStyles|Condense"), NULL, 0, 0, (void *) sf_condense, NULL, 0, 0, 0, 0, 0, 0, 1},
77
{ (unichar_t *) N_("MacStyles|Expand"), NULL, 0, 0, (void *) sf_extend, NULL, 0, 0, 0, 0, 0, 0, 1},
78
{ (unichar_t *) N_("MacStyles|Underline"), NULL, 0, 0, (void *) sf_underline, NULL, 0, 0, 0, 0, 0, 0, 1},
79
{ (unichar_t *) N_("MacStyles|Outline"), NULL, 0, 0, (void *) sf_outline, NULL, 0, 0, 0, 0, 0, 0, 1},
80
{ (unichar_t *) N_("MacStyles|Shadow"), NULL, 0, 0, (void *) sf_shadow, NULL, 0, 0, 0, 0, 0, 0, 1},
82
static GTextInfo widthclass[] = {
83
{ (unichar_t *) N_("Ultra-Condensed (50%)"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
84
{ (unichar_t *) N_("Extra-Condensed (62.5%)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
85
{ (unichar_t *) N_("Condensed (75%)"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
86
{ (unichar_t *) N_("Semi-Condensed (87.5%)"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
87
{ (unichar_t *) N_("Medium (100%)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
88
{ (unichar_t *) N_("Semi-Expanded (112.5%)"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
89
{ (unichar_t *) N_("Expanded (125%)"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
90
{ (unichar_t *) N_("Extra-Expanded (150%)"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
91
{ (unichar_t *) N_("Ultra-Expanded (200%)"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
93
static GTextInfo weightclass[] = {
94
{ (unichar_t *) N_("100 Thin"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
95
{ (unichar_t *) N_("200 Extra-Light"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
96
{ (unichar_t *) N_("300 Light"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
97
{ (unichar_t *) N_("400 Book"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
98
{ (unichar_t *) N_("500 Medium"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
99
{ (unichar_t *) N_("600 Demi-Bold"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
100
{ (unichar_t *) N_("700 Bold"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
101
{ (unichar_t *) N_("800 Heavy"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
102
{ (unichar_t *) N_("900 Black"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
104
static GTextInfo fstype[] = {
105
{ (unichar_t *) N_("Never Embed/No Editing"), NULL, 0, 0, (void *) 0x02, NULL, 0, 0, 0, 0, 0, 0, 1},
106
{ (unichar_t *) N_("Printable Document"), NULL, 0, 0, (void *) 0x04, NULL, 0, 0, 0, 0, 0, 0, 1},
107
{ (unichar_t *) N_("Editable Document"), NULL, 0, 0, (void *) 0x08, NULL, 0, 0, 0, 0, 0, 0, 1},
108
{ (unichar_t *) N_("Installable Font"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1},
110
static GTextInfo pfmfamily[] = {
111
{ (unichar_t *) N_("Serif"), NULL, 0, 0, (void *) 0x11, NULL, 0, 0, 0, 0, 0, 0, 1},
112
{ (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1},
113
{ (unichar_t *) N_("Monospace"), NULL, 0, 0, (void *) 0x31, NULL, 0, 0, 0, 0, 0, 0, 1},
114
/* GT: See the long comment at "Property|New" */
115
/* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
116
/* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
117
/* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
118
{ (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 0x41, NULL, 0, 0, 0, 0, 0, 0, 1},
119
{ (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 0x51, NULL, 0, 0, 0, 0, 0, 0, 1},
121
static GTextInfo ibmfamily[] = {
122
{ (unichar_t *) N_("No Classification"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
123
{ (unichar_t *) N_("Old Style Serifs"), NULL, 0, 0, (void *) 0x100, NULL, 0, 0, 0, 0, 0, 0, 1},
124
{ (unichar_t *) N_("OSS Rounded Legibility"), NULL, 0, 0, (void *) 0x101, NULL, 0, 0, 0, 0, 0, 0, 1},
125
{ (unichar_t *) N_("OSS Geralde"), NULL, 0, 0, (void *) 0x102, NULL, 0, 0, 0, 0, 0, 0, 1},
126
{ (unichar_t *) N_("OSS Venetian"), NULL, 0, 0, (void *) 0x103, NULL, 0, 0, 0, 0, 0, 0, 1},
127
{ (unichar_t *) N_("OSS Modified Venetian"), NULL, 0, 0, (void *) 0x104, NULL, 0, 0, 0, 0, 0, 0, 1},
128
{ (unichar_t *) N_("OSS Dutch Modern"), NULL, 0, 0, (void *) 0x105, NULL, 0, 0, 0, 0, 0, 0, 1},
129
{ (unichar_t *) N_("OSS Dutch Trad"), NULL, 0, 0, (void *) 0x106, NULL, 0, 0, 0, 0, 0, 0, 1},
130
{ (unichar_t *) N_("OSS Contemporary"), NULL, 0, 0, (void *) 0x107, NULL, 0, 0, 0, 0, 0, 0, 1},
131
{ (unichar_t *) N_("OSS Calligraphic"), NULL, 0, 0, (void *) 0x108, NULL, 0, 0, 0, 0, 0, 0, 1},
132
{ (unichar_t *) N_("OSS Miscellaneous"), NULL, 0, 0, (void *) 0x10f, NULL, 0, 0, 0, 0, 0, 0, 1},
133
{ (unichar_t *) N_("Transitional Serifs"), NULL, 0, 0, (void *) 0x200, NULL, 0, 0, 0, 0, 0, 0, 1},
134
{ (unichar_t *) N_("TS Direct Line"), NULL, 0, 0, (void *) 0x201, NULL, 0, 0, 0, 0, 0, 0, 1},
135
{ (unichar_t *) N_("TS Script"), NULL, 0, 0, (void *) 0x202, NULL, 0, 0, 0, 0, 0, 0, 1},
136
{ (unichar_t *) N_("TS Miscellaneous"), NULL, 0, 0, (void *) 0x20f, NULL, 0, 0, 0, 0, 0, 0, 1},
137
{ (unichar_t *) N_("Modern Serifs"), NULL, 0, 0, (void *) 0x300, NULL, 0, 0, 0, 0, 0, 0, 1},
138
{ (unichar_t *) N_("MS Italian"), NULL, 0, 0, (void *) 0x301, NULL, 0, 0, 0, 0, 0, 0, 1},
139
{ (unichar_t *) N_("MS Script"), NULL, 0, 0, (void *) 0x302, NULL, 0, 0, 0, 0, 0, 0, 1},
140
{ (unichar_t *) N_("MS Miscellaneous"), NULL, 0, 0, (void *) 0x30f, NULL, 0, 0, 0, 0, 0, 0, 1},
141
{ (unichar_t *) N_("Clarendon Serifs"), NULL, 0, 0, (void *) 0x400, NULL, 0, 0, 0, 0, 0, 0, 1},
142
{ (unichar_t *) N_("CS Clarendon"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1},
143
{ (unichar_t *) N_("CS Modern"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1},
144
{ (unichar_t *) N_("CS Traditional"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1},
145
{ (unichar_t *) N_("CS Newspaper"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1},
146
{ (unichar_t *) N_("CS Stub Serif"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1},
147
{ (unichar_t *) N_("CS Monotone"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1},
148
{ (unichar_t *) N_("CS Typewriter"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1},
149
{ (unichar_t *) N_("CS Miscellaneous"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1},
150
{ (unichar_t *) N_("Slab Serifs"), NULL, 0, 0, (void *) 0x500, NULL, 0, 0, 0, 0, 0, 0, 1},
151
{ (unichar_t *) N_("Slab Serifs|SS Monotone"), NULL, 0, 0, (void *) 0x501, NULL, 0, 0, 0, 0, 0, 0, 1},
152
{ (unichar_t *) N_("Slab Serifs|SS Humanist"), NULL, 0, 0, (void *) 0x502, NULL, 0, 0, 0, 0, 0, 0, 1},
153
{ (unichar_t *) N_("Slab Serifs|SS Geometric"), NULL, 0, 0, (void *) 0x503, NULL, 0, 0, 0, 0, 0, 0, 1},
154
{ (unichar_t *) N_("Slab Serifs|SS Swiss"), NULL, 0, 0, (void *) 0x504, NULL, 0, 0, 0, 0, 0, 0, 1},
155
{ (unichar_t *) N_("Slab Serifs|SS Typewriter"), NULL, 0, 0, (void *) 0x505, NULL, 0, 0, 0, 0, 0, 0, 1},
156
{ (unichar_t *) N_("Slab Serifs|SS Miscellaneous"), NULL, 0, 0, (void *) 0x50f, NULL, 0, 0, 0, 0, 0, 0, 1},
157
{ (unichar_t *) N_("Freeform Serifs"), NULL, 0, 0, (void *) 0x700, NULL, 0, 0, 0, 0, 0, 0, 1},
158
{ (unichar_t *) N_("FS Modern"), NULL, 0, 0, (void *) 0x701, NULL, 0, 0, 0, 0, 0, 0, 1},
159
{ (unichar_t *) N_("FS Miscellaneous"), NULL, 0, 0, (void *) 0x70f, NULL, 0, 0, 0, 0, 0, 0, 1},
160
{ (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x800, NULL, 0, 0, 0, 0, 0, 0, 1},
161
{ (unichar_t *) N_("Sans-Serif|SS IBM NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1},
162
{ (unichar_t *) N_("Sans-Serif|SS Humanist"), NULL, 0, 0, (void *) 0x802, NULL, 0, 0, 0, 0, 0, 0, 1},
163
{ (unichar_t *) N_("Sans-Serif|SS Low-x Round Geometric"), NULL, 0, 0, (void *) 0x803, NULL, 0, 0, 0, 0, 0, 0, 1},
164
{ (unichar_t *) N_("Sans-Serif|SS High-x Round Geometric"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1},
165
{ (unichar_t *) N_("Sans-Serif|SS NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x805, NULL, 0, 0, 0, 0, 0, 0, 1},
166
{ (unichar_t *) N_("Sans-Serif|SS Modified Grotesque Gothic"), NULL, 0, 0, (void *) 0x806, NULL, 0, 0, 0, 0, 0, 0, 1},
167
{ (unichar_t *) N_("Sans-Serif|SS Typewriter Gothic"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1},
168
{ (unichar_t *) N_("Sans-Serif|SS Matrix"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1},
169
{ (unichar_t *) N_("Sans-Serif|SS Miscellaneous"), NULL, 0, 0, (void *) 0x80f, NULL, 0, 0, 0, 0, 0, 0, 1},
170
{ (unichar_t *) N_("Ornamentals"), NULL, 0, 0, (void *) 0x900, NULL, 0, 0, 0, 0, 0, 0, 1},
171
{ (unichar_t *) N_("O Engraver"), NULL, 0, 0, (void *) 0x901, NULL, 0, 0, 0, 0, 0, 0, 1},
172
{ (unichar_t *) N_("O Black Letter"), NULL, 0, 0, (void *) 0x902, NULL, 0, 0, 0, 0, 0, 0, 1},
173
{ (unichar_t *) N_("O Decorative"), NULL, 0, 0, (void *) 0x903, NULL, 0, 0, 0, 0, 0, 0, 1},
174
{ (unichar_t *) N_("O Three Dimensional"), NULL, 0, 0, (void *) 0x904, NULL, 0, 0, 0, 0, 0, 0, 1},
175
{ (unichar_t *) N_("O Miscellaneous"), NULL, 0, 0, (void *) 0x90f, NULL, 0, 0, 0, 0, 0, 0, 1},
176
{ (unichar_t *) N_("Scripts"), NULL, 0, 0, (void *) 0xa00, NULL, 0, 0, 0, 0, 0, 0, 1},
177
{ (unichar_t *) N_("S Uncial"), NULL, 0, 0, (void *) 0xa01, NULL, 0, 0, 0, 0, 0, 0, 1},
178
{ (unichar_t *) N_("S Brush Joined"), NULL, 0, 0, (void *) 0xa02, NULL, 0, 0, 0, 0, 0, 0, 1},
179
{ (unichar_t *) N_("S Formal Joined"), NULL, 0, 0, (void *) 0xa03, NULL, 0, 0, 0, 0, 0, 0, 1},
180
{ (unichar_t *) N_("S Monotone Joined"), NULL, 0, 0, (void *) 0xa04, NULL, 0, 0, 0, 0, 0, 0, 1},
181
{ (unichar_t *) N_("S Calligraphic"), NULL, 0, 0, (void *) 0xa05, NULL, 0, 0, 0, 0, 0, 0, 1},
182
{ (unichar_t *) N_("S Brush Unjoined"), NULL, 0, 0, (void *) 0xa06, NULL, 0, 0, 0, 0, 0, 0, 1},
183
{ (unichar_t *) N_("S Formal Unjoined"), NULL, 0, 0, (void *) 0xa07, NULL, 0, 0, 0, 0, 0, 0, 1},
184
{ (unichar_t *) N_("S Monotone Unjoined"), NULL, 0, 0, (void *) 0xa08, NULL, 0, 0, 0, 0, 0, 0, 1},
185
{ (unichar_t *) N_("S Miscellaneous"), NULL, 0, 0, (void *) 0xa0f, NULL, 0, 0, 0, 0, 0, 0, 1},
186
{ (unichar_t *) N_("Symbolic"), NULL, 0, 0, (void *) 0xc00, NULL, 0, 0, 0, 0, 0, 0, 1},
187
{ (unichar_t *) N_("Sy Mixed Serif"), NULL, 0, 0, (void *) 0xc03, NULL, 0, 0, 0, 0, 0, 0, 1},
188
{ (unichar_t *) N_("Sy Old Style Serif"), NULL, 0, 0, (void *) 0xc06, NULL, 0, 0, 0, 0, 0, 0, 1},
189
{ (unichar_t *) N_("Sy Neo-grotesque Sans Serif"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1},
190
{ (unichar_t *) N_("Sy Miscellaneous"), NULL, 0, 0, (void *) 0xc0f, NULL, 0, 0, 0, 0, 0, 0, 1},
192
static GTextInfo os2versions[] = {
193
{ (unichar_t *) N_("OS2Version|Automatic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
194
{ (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
195
{ (unichar_t *) N_("2"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
196
{ (unichar_t *) N_("3"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
197
{ (unichar_t *) N_("4"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
200
static GTextInfo gaspversions[] = {
201
{ (unichar_t *) N_("0"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
202
{ (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
205
static GTextInfo panfamily[] = {
206
{ (unichar_t *) N_("PanoseFamily|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
207
{ (unichar_t *) N_("PanoseFamily|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
208
{ (unichar_t *) N_("Text & Display"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
209
/* GT: See the long comment at "Property|New" */
210
/* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
211
/* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
212
/* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
213
{ (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
214
{ (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
215
{ (unichar_t *) N_("Pictorial"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
216
{ (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
217
{ (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
218
{ (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
219
{ (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
220
{ (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
221
{ (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
222
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
223
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
224
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
225
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
227
static GTextInfo panserifs[] = {
228
{ (unichar_t *) N_("PanoseSerifs|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
229
{ (unichar_t *) N_("PanoseSerifs|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
230
{ (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
231
{ (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
232
{ (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
233
{ (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
234
{ (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
235
{ (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
236
{ (unichar_t *) N_("Bone"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
237
{ (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
238
{ (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
239
{ (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
240
{ (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
241
{ (unichar_t *) N_("Perp Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
242
{ (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
243
{ (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
245
static GTextInfo panweight[] = {
246
{ (unichar_t *) N_("PanoseWeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
247
{ (unichar_t *) N_("PanoseWeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
248
{ (unichar_t *) N_("Very Light"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
249
{ (unichar_t *) N_("Light"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
250
{ (unichar_t *) N_("PanoseWeight|Thin"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
251
{ (unichar_t *) N_("Book"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
252
{ (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
253
{ (unichar_t *) N_("Demi"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
254
{ (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
255
{ (unichar_t *) N_("Heavy"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
256
{ (unichar_t *) N_("Black"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
257
{ (unichar_t *) N_("Nord"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
258
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
259
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
260
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
261
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
263
static GTextInfo panprop[] = {
264
{ (unichar_t *) N_("PanoseProportion|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
265
{ (unichar_t *) N_("PanoseProportion|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
266
{ (unichar_t *) N_("Old Style"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
267
{ (unichar_t *) N_("Modern"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
268
{ (unichar_t *) N_("Even Width"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
269
{ (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
270
{ (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
271
{ (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
272
{ (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
273
{ (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
274
{ (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
275
{ (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
276
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
277
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
278
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
279
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
281
static GTextInfo pancontrast[] = {
282
{ (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
283
{ (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
284
{ (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
285
{ (unichar_t *) N_("PanoseContrast|Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
286
{ (unichar_t *) N_("PanoseContrast|Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
287
{ (unichar_t *) N_("PanoseContrast|Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
288
{ (unichar_t *) N_("PanoseContrast|Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
289
{ (unichar_t *) N_("PanoseContrast|Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
290
{ (unichar_t *) N_("PanoseContrast|High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
291
{ (unichar_t *) N_("PanoseContrast|Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
292
{ (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
293
{ (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
294
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
295
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
296
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
297
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
299
static GTextInfo panstrokevar[] = {
300
{ (unichar_t *) N_("PanoseStrokeVariation|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
301
{ (unichar_t *) N_("PanoseStrokeVariation|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
302
{ (unichar_t *) N_("Gradual/Diagonal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
303
{ (unichar_t *) N_("Gradual/Transitional"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
304
{ (unichar_t *) N_("Gradual/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
305
{ (unichar_t *) N_("Gradual/Horizontal"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
306
{ (unichar_t *) N_("Rapid/Vertical"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
307
{ (unichar_t *) N_("Rapid/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
308
{ (unichar_t *) N_("Instant/Vertical"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
309
{ (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
310
{ (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
311
{ (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
312
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
313
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
314
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
315
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
317
static GTextInfo panarmstyle[] = {
318
{ (unichar_t *) N_("PanoseArmStyle|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
319
{ (unichar_t *) N_("PanoseArmStyle|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
320
{ (unichar_t *) N_("Straight Arms/Horizontal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
321
{ (unichar_t *) N_("Straight Arms/Wedge"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
322
{ (unichar_t *) N_("Straight Arms/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
323
{ (unichar_t *) N_("Straight Arms/Single Serif"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
324
{ (unichar_t *) N_("Straight Arms/Double Serif"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
325
{ (unichar_t *) N_("Non-Straight Arms/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
326
{ (unichar_t *) N_("Non-Straight Arms/Wedge"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
327
{ (unichar_t *) N_("Non-Straight Arms/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
328
{ (unichar_t *) N_("Non-Straight Arms/Single Serif"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
329
{ (unichar_t *) N_("Non-Straight Arms/Double Serif"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
330
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
331
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
332
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
333
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
335
static GTextInfo panletterform[] = {
336
{ (unichar_t *) N_("PanoseLetterform|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
337
{ (unichar_t *) N_("PanoseLetterform|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
338
{ (unichar_t *) N_("Normal/Contact"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
339
{ (unichar_t *) N_("Normal/Weighted"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
340
{ (unichar_t *) N_("Normal/Boxed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
341
{ (unichar_t *) N_("Normal/Flattened"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
342
{ (unichar_t *) N_("Normal/Rounded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
343
{ (unichar_t *) N_("Normal/Off-Center"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
344
{ (unichar_t *) N_("Normal/Square"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
345
{ (unichar_t *) N_("Oblique/Contact"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
346
{ (unichar_t *) N_("Oblique/Weighted"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
347
{ (unichar_t *) N_("Oblique/Boxed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
348
{ (unichar_t *) N_("Oblique/Rounded"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
349
{ (unichar_t *) N_("Oblique/Off-Center"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
350
{ (unichar_t *) N_("Oblique/Square"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
351
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
353
static GTextInfo panmidline[] = {
354
{ (unichar_t *) N_("PanoseMidline|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
355
{ (unichar_t *) N_("PanoseMidline|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
356
{ (unichar_t *) N_("PanoseMidline|Standard/Trimmed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
357
{ (unichar_t *) N_("PanoseMidline|Standard/Pointed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
358
{ (unichar_t *) N_("PanoseMidline|Standard/Serifed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
359
{ (unichar_t *) N_("PanoseMidline|High/Trimmed"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
360
{ (unichar_t *) N_("PanoseMidline|High/Pointed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
361
{ (unichar_t *) N_("PanoseMidline|High/Serifed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
362
{ (unichar_t *) N_("PanoseMidline|Constant/Trimmed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
363
{ (unichar_t *) N_("PanoseMidline|Constant/Pointed"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
364
{ (unichar_t *) N_("PanoseMidline|Constant/Serifed"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
365
{ (unichar_t *) N_("PanoseMidline|Low/Trimmed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
366
{ (unichar_t *) N_("PanoseMidline|Low/Pointed"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
367
{ (unichar_t *) N_("PanoseMidline|Low/Serifed"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
368
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
369
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
371
static GTextInfo panxheight[] = {
372
{ (unichar_t *) N_("PanoseXHeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
373
{ (unichar_t *) N_("PanoseXHeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
374
{ (unichar_t *) N_("PanoseXHeight|Constant/Small"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
375
{ (unichar_t *) N_("PanoseXHeight|Constant/Standard"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
376
{ (unichar_t *) N_("PanoseXHeight|Constant/Large"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
377
{ (unichar_t *) N_("PanoseXHeight|Ducking/Small"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
378
{ (unichar_t *) N_("PanoseXHeight|Ducking/Standard"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
379
{ (unichar_t *) N_("PanoseXHeight|Ducking/Large"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
380
{ (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
381
{ (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
382
{ (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
383
{ (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
384
{ (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
385
{ (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
386
{ (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
387
{ (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
391
static struct ms_2_locales { char *loc_name; int local_id; } ms_2_locals[] = {
423
{ "zh_TW", 0x404 }, /* Trad */
424
{ "zh_CN", 0x804 }, /* Simp */
425
{ "zh_HK", 0xc04 }, /* Trad */
426
{ "zh_SG", 0x1004 }, /* Simp */
427
{ "zh_MO", 0x1404 }, /* Trad */
454
/* No language code for filipino */
463
{ "fr", 0x1c0c }, /* West Indes */
472
{ "fr_DZ", 0xe40c }, /* North African is most likely to be Algeria, possibly Tunisia */
488
{ "iw", 0x40d }, /* Obsolete name for Hebrew */
493
{ "in", 0x421 }, /* Obsolete name for Indonesean */
505
{ "ko", 0x812 }, /*Johab */
510
{ "lt", 0x827 }, /* Classic */
520
{ "no_NO", 0x414 }, /* Bokmal */
521
{ "no_NO", 0x814 }, /* Nynorsk */
540
/* No language code for Sepedi */
541
{ "sr", 0xc1a }, /* Cyrillic */
542
{ "sr", 0x81a }, /* Latin */
549
{ "es_ES", 0x40a }, /* traditional spanish */
551
{ "es_ES", 0xc0a }, /* Modern spanish */
592
{ "uz", 0x443 }, /* Latin */
593
{ "uz", 0x843 }, /* Cyrillic */
599
{ "ji", 0x43d }, /* Obsolete Yiddish */
605
static GTextInfo mslanguages[] = {
606
{ (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) 0x436, NULL, 0, 0, 0, 0, 0, 0, 1},
607
{ (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) 0x41c, NULL, 0, 0, 0, 0, 0, 0, 1},
608
/* GT: See the long comment at "Property|New" */
609
/* GT: The msgstr should contain a translation of "Malayalam", ignore "Lang|" */
610
{ (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) 0x45e, NULL, 0, 0, 0, 0, 0, 0, 1},
611
{ (unichar_t *) N_("Arabic (Saudi Arabia)"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1},
612
{ (unichar_t *) N_("Arabic (Iraq)"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1},
613
{ (unichar_t *) N_("Arabic (Egypt)"), NULL, 0, 0, (void *) 0xc01, NULL, 0, 0, 0, 0, 0, 0, 1},
614
{ (unichar_t *) N_("Arabic (Libya)"), NULL, 0, 0, (void *) 0x1001, NULL, 0, 0, 0, 0, 0, 0, 1},
615
{ (unichar_t *) N_("Arabic (Algeria)"), NULL, 0, 0, (void *) 0x1401, NULL, 0, 0, 0, 0, 0, 0, 1},
616
{ (unichar_t *) N_("Arabic (Morocco)"), NULL, 0, 0, (void *) 0x1801, NULL, 0, 0, 0, 0, 0, 0, 1},
617
{ (unichar_t *) N_("Arabic (Tunisia)"), NULL, 0, 0, (void *) 0x1C01, NULL, 0, 0, 0, 0, 0, 0, 1},
618
{ (unichar_t *) N_("Arabic (Oman)"), NULL, 0, 0, (void *) 0x2001, NULL, 0, 0, 0, 0, 0, 0, 1},
619
{ (unichar_t *) N_("Arabic (Yemen)"), NULL, 0, 0, (void *) 0x2401, NULL, 0, 0, 0, 0, 0, 0, 1},
620
{ (unichar_t *) N_("Arabic (Syria)"), NULL, 0, 0, (void *) 0x2801, NULL, 0, 0, 0, 0, 0, 0, 1},
621
{ (unichar_t *) N_("Arabic (Jordan)"), NULL, 0, 0, (void *) 0x2c01, NULL, 0, 0, 0, 0, 0, 0, 1},
622
{ (unichar_t *) N_("Arabic (Lebanon)"), NULL, 0, 0, (void *) 0x3001, NULL, 0, 0, 0, 0, 0, 0, 1},
623
{ (unichar_t *) N_("Arabic (Kuwait)"), NULL, 0, 0, (void *) 0x3401, NULL, 0, 0, 0, 0, 0, 0, 1},
624
{ (unichar_t *) N_("Arabic (U.A.E.)"), NULL, 0, 0, (void *) 0x3801, NULL, 0, 0, 0, 0, 0, 0, 1},
625
{ (unichar_t *) N_("Arabic (Bahrain)"), NULL, 0, 0, (void *) 0x3c01, NULL, 0, 0, 0, 0, 0, 0, 1},
626
{ (unichar_t *) N_("Arabic (Qatar)"), NULL, 0, 0, (void *) 0x4001, NULL, 0, 0, 0, 0, 0, 0, 1},
627
{ (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) 0x42b, NULL, 0, 0, 0, 0, 0, 0, 1},
628
{ (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) 0x44d, NULL, 0, 0, 0, 0, 0, 0, 1},
629
{ (unichar_t *) N_("Azeri (Latin)"), NULL, 0, 0, (void *) 0x42c, NULL, 0, 0, 0, 0, 0, 0, 1},
630
{ (unichar_t *) N_("Azeri (Cyrillic)"), NULL, 0, 0, (void *) 0x82c, NULL, 0, 0, 0, 0, 0, 0, 1},
631
{ (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) 0x42d, NULL, 0, 0, 0, 0, 0, 0, 1},
632
{ (unichar_t *) N_("Byelorussian"), NULL, 0, 0, (void *) 0x423, NULL, 0, 0, 0, 0, 0, 0, 1},
633
{ (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) 0x445, NULL, 0, 0, 0, 0, 0, 0, 1},
634
{ (unichar_t *) N_("Bengali Bangladesh"), NULL, 0, 0, (void *) 0x845, NULL, 0, 0, 0, 0, 0, 0, 1},
635
{ (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1},
636
{ (unichar_t *) N_("Burmese"), NULL, 0, 0, (void *) 0x455, NULL, 0, 0, 0, 0, 0, 0, 1},
637
{ (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1},
638
{ (unichar_t *) N_("Cambodian"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1},
639
{ (unichar_t *) N_("Lang|Cherokee"), NULL, 0, 0, (void *) 0x45c, NULL, 0, 0, 0, 0, 0, 0, 1},
640
{ (unichar_t *) N_("Chinese (Taiwan)"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1},
641
{ (unichar_t *) N_("Chinese (PRC)"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1},
642
{ (unichar_t *) N_("Chinese (Hong Kong)"), NULL, 0, 0, (void *) 0xc04, NULL, 0, 0, 0, 0, 0, 0, 1},
643
{ (unichar_t *) N_("Chinese (Singapore)"), NULL, 0, 0, (void *) 0x1004, NULL, 0, 0, 0, 0, 0, 0, 1},
644
{ (unichar_t *) N_("Chinese (Macau)"), NULL, 0, 0, (void *) 0x1404, NULL, 0, 0, 0, 0, 0, 0, 1},
645
{ (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) 0x41a, NULL, 0, 0, 0, 0, 0, 0, 1},
646
{ (unichar_t *) N_("Croatian Bosnia/Herzegovina"), NULL, 0, 0, (void *) 0x101a, NULL, 0, 0, 0, 0, 0, 0, 1},
647
{ (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1},
648
{ (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1},
649
{ (unichar_t *) N_("Divehi"), NULL, 0, 0, (void *) 0x465, NULL, 0, 0, 0, 0, 0, 0, 1},
650
{ (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) 0x413, NULL, 0, 0, 0, 0, 0, 0, 1},
651
{ (unichar_t *) N_("Flemish (Belgian Dutch)"), NULL, 0, 0, (void *) 0x813, NULL, 0, 0, 0, 0, 0, 0, 1},
652
{ (unichar_t *) N_("Edo"), NULL, 0, 0, (void *) 0x466, NULL, 0, 0, 0, 0, 0, 0, 1},
653
{ (unichar_t *) N_("English (British)"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1},
654
{ (unichar_t *) N_("English (US)"), NULL, 0, 0, (void *) 0x409, NULL, 0, 0, 0, 0, 0, 0, 1},
655
{ (unichar_t *) N_("English (Canada)"), NULL, 0, 0, (void *) 0x1009, NULL, 0, 0, 0, 0, 0, 0, 1},
656
{ (unichar_t *) N_("English (Australian)"), NULL, 0, 0, (void *) 0xc09, NULL, 0, 0, 0, 0, 0, 0, 1},
657
{ (unichar_t *) N_("English (New Zealand)"), NULL, 0, 0, (void *) 0x1409, NULL, 0, 0, 0, 0, 0, 0, 1},
658
{ (unichar_t *) N_("English (Irish)"), NULL, 0, 0, (void *) 0x1809, NULL, 0, 0, 0, 0, 0, 0, 1},
659
{ (unichar_t *) N_("English (South Africa)"), NULL, 0, 0, (void *) 0x1c09, NULL, 0, 0, 0, 0, 0, 0, 1},
660
{ (unichar_t *) N_("English (Jamaica)"), NULL, 0, 0, (void *) 0x2009, NULL, 0, 0, 0, 0, 0, 0, 1},
661
{ (unichar_t *) N_("English (Caribbean)"), NULL, 0, 0, (void *) 0x2409, NULL, 0, 0, 0, 0, 0, 0, 1},
662
{ (unichar_t *) N_("English (Belize)"), NULL, 0, 0, (void *) 0x2809, NULL, 0, 0, 0, 0, 0, 0, 1},
663
{ (unichar_t *) N_("English (Trinidad)"), NULL, 0, 0, (void *) 0x2c09, NULL, 0, 0, 0, 0, 0, 0, 1},
664
{ (unichar_t *) N_("English (Zimbabwe)"), NULL, 0, 0, (void *) 0x3009, NULL, 0, 0, 0, 0, 0, 0, 1},
665
{ (unichar_t *) N_("English (Philippines)"), NULL, 0, 0, (void *) 0x3409, NULL, 0, 0, 0, 0, 0, 0, 1},
666
{ (unichar_t *) N_("English (Indonesia)"), NULL, 0, 0, (void *) 0x3809, NULL, 0, 0, 0, 0, 0, 0, 1},
667
{ (unichar_t *) N_("English (Hong Kong)"), NULL, 0, 0, (void *) 0x3c09, NULL, 0, 0, 0, 0, 0, 0, 1},
668
{ (unichar_t *) N_("English (India)"), NULL, 0, 0, (void *) 0x4009, NULL, 0, 0, 0, 0, 0, 0, 1},
669
{ (unichar_t *) N_("English (Malaysia)"), NULL, 0, 0, (void *) 0x4409, NULL, 0, 0, 0, 0, 0, 0, 1},
670
{ (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) 0x425, NULL, 0, 0, 0, 0, 0, 0, 1},
671
{ (unichar_t *) N_("Faeroese"), NULL, 0, 0, (void *) 0x438, NULL, 0, 0, 0, 0, 0, 0, 1},
672
{ (unichar_t *) N_("Lang|Farsi"), NULL, 0, 0, (void *) 0x429, NULL, 0, 0, 0, 0, 0, 0, 1},
673
{ (unichar_t *) N_("Filipino"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1},
674
{ (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) 0x40b, NULL, 0, 0, 0, 0, 0, 0, 1},
675
{ (unichar_t *) N_("French French"), NULL, 0, 0, (void *) 0x40c, NULL, 0, 0, 0, 0, 0, 0, 1},
676
{ (unichar_t *) N_("French Belgium"), NULL, 0, 0, (void *) 0x80c, NULL, 0, 0, 0, 0, 0, 0, 1},
677
{ (unichar_t *) N_("French Canadian"), NULL, 0, 0, (void *) 0xc0c, NULL, 0, 0, 0, 0, 0, 0, 1},
678
{ (unichar_t *) N_("French Swiss"), NULL, 0, 0, (void *) 0x100c, NULL, 0, 0, 0, 0, 0, 0, 1},
679
{ (unichar_t *) N_("French Luxembourg"), NULL, 0, 0, (void *) 0x140c, NULL, 0, 0, 0, 0, 0, 0, 1},
680
{ (unichar_t *) N_("French Monaco"), NULL, 0, 0, (void *) 0x180c, NULL, 0, 0, 0, 0, 0, 0, 1},
681
{ (unichar_t *) N_("French West Indies"), NULL, 0, 0, (void *) 0x1c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
682
{ (unichar_t *) NU_("French R\303\251union"), NULL, 0, 0, (void *) 0x200c, NULL, 0, 0, 0, 0, 0, 0, 1},
683
{ (unichar_t *) N_("French D.R. Congo"), NULL, 0, 0, (void *) 0x240c, NULL, 0, 0, 0, 0, 0, 0, 1},
684
{ (unichar_t *) N_("French Senegal"), NULL, 0, 0, (void *) 0x280c, NULL, 0, 0, 0, 0, 0, 0, 1},
685
{ (unichar_t *) N_("French Camaroon"), NULL, 0, 0, (void *) 0x2c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
686
{ (unichar_t *) NU_("French C\303\264te d'Ivoire"), NULL, 0, 0, (void *) 0x300c, NULL, 0, 0, 0, 0, 0, 0, 1},
687
{ (unichar_t *) N_("French Mali"), NULL, 0, 0, (void *) 0x340c, NULL, 0, 0, 0, 0, 0, 0, 1},
688
{ (unichar_t *) N_("French Morocco"), NULL, 0, 0, (void *) 0x380c, NULL, 0, 0, 0, 0, 0, 0, 1},
689
{ (unichar_t *) N_("French Haiti"), NULL, 0, 0, (void *) 0x3c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
690
{ (unichar_t *) N_("French North Africa"), NULL, 0, 0, (void *) 0xe40c, NULL, 0, 0, 0, 0, 0, 0, 1},
691
{ (unichar_t *) N_("Frisian"), NULL, 0, 0, (void *) 0x462, NULL, 0, 0, 0, 0, 0, 0, 1},
692
{ (unichar_t *) N_("Fulfulde"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1},
693
{ (unichar_t *) N_("Gaelic (Scottish)"), NULL, 0, 0, (void *) 0x43c, NULL, 0, 0, 0, 0, 0, 0, 1},
694
{ (unichar_t *) N_("Gaelic (Irish)"), NULL, 0, 0, (void *) 0x83c, NULL, 0, 0, 0, 0, 0, 0, 1},
695
{ (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1},
696
{ (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) 0x437, NULL, 0, 0, 0, 0, 0, 0, 1},
697
{ (unichar_t *) N_("German German"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1},
698
{ (unichar_t *) N_("German Swiss"), NULL, 0, 0, (void *) 0x807, NULL, 0, 0, 0, 0, 0, 0, 1},
699
{ (unichar_t *) N_("German Austrian"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1},
700
{ (unichar_t *) N_("German Luxembourg"), NULL, 0, 0, (void *) 0x1007, NULL, 0, 0, 0, 0, 0, 0, 1},
701
{ (unichar_t *) N_("German Liechtenstein"), NULL, 0, 0, (void *) 0x1407, NULL, 0, 0, 0, 0, 0, 0, 1},
702
{ (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) 0x408, NULL, 0, 0, 0, 0, 0, 0, 1},
703
{ (unichar_t *) N_("Guarani"), NULL, 0, 0, (void *) 0x474, NULL, 0, 0, 0, 0, 0, 0, 1},
704
{ (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) 0x447, NULL, 0, 0, 0, 0, 0, 0, 1},
705
{ (unichar_t *) N_("Hausa"), NULL, 0, 0, (void *) 0x468, NULL, 0, 0, 0, 0, 0, 0, 1},
706
{ (unichar_t *) N_("Hawaiian"), NULL, 0, 0, (void *) 0x475, NULL, 0, 0, 0, 0, 0, 0, 1},
707
{ (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) 0x40d, NULL, 0, 0, 0, 0, 0, 0, 1},
708
{ (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) 0x439, NULL, 0, 0, 0, 0, 0, 0, 1},
709
{ (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) 0x40e, NULL, 0, 0, 0, 0, 0, 0, 1},
710
{ (unichar_t *) N_("Ibibio"), NULL, 0, 0, (void *) 0x469, NULL, 0, 0, 0, 0, 0, 0, 1},
711
{ (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1},
712
{ (unichar_t *) N_("Igbo"), NULL, 0, 0, (void *) 0x470, NULL, 0, 0, 0, 0, 0, 0, 1},
713
{ (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) 0x421, NULL, 0, 0, 0, 0, 0, 0, 1},
714
{ (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) 0x45d, NULL, 0, 0, 0, 0, 0, 0, 1},
715
{ (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) 0x410, NULL, 0, 0, 0, 0, 0, 0, 1},
716
{ (unichar_t *) N_("Italian Swiss"), NULL, 0, 0, (void *) 0x810, NULL, 0, 0, 0, 0, 0, 0, 1},
717
{ (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) 0x411, NULL, 0, 0, 0, 0, 0, 0, 1},
718
{ (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) 0x44b, NULL, 0, 0, 0, 0, 0, 0, 1},
719
{ (unichar_t *) N_("Kanuri"), NULL, 0, 0, (void *) 0x471, NULL, 0, 0, 0, 0, 0, 0, 1},
720
{ (unichar_t *) N_("Kashmiri (India)"), NULL, 0, 0, (void *) 0x860, NULL, 0, 0, 0, 0, 0, 0, 1},
721
{ (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) 0x43f, NULL, 0, 0, 0, 0, 0, 0, 1},
722
{ (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1},
723
{ (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) 0x440, NULL, 0, 0, 0, 0, 0, 0, 1},
724
{ (unichar_t *) N_("Konkani"), NULL, 0, 0, (void *) 0x457, NULL, 0, 0, 0, 0, 0, 0, 1},
725
{ (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) 0x412, NULL, 0, 0, 0, 0, 0, 0, 1},
726
{ (unichar_t *) N_("Korean (Johab)"), NULL, 0, 0, (void *) 0x812, NULL, 0, 0, 0, 0, 0, 0, 1},
727
{ (unichar_t *) N_("Lao"), NULL, 0, 0, (void *) 0x454, NULL, 0, 0, 0, 0, 0, 0, 1},
728
{ (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) 0x426, NULL, 0, 0, 0, 0, 0, 0, 1},
729
{ (unichar_t *) N_("Lang|Latin"), NULL, 0, 0, (void *) 0x476, NULL, 0, 0, 0, 0, 0, 0, 1},
730
{ (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) 0x427, NULL, 0, 0, 0, 0, 0, 0, 1},
731
{ (unichar_t *) N_("Lithuanian (Classic)"), NULL, 0, 0, (void *) 0x827, NULL, 0, 0, 0, 0, 0, 0, 1},
732
{ (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) 0x42f, NULL, 0, 0, 0, 0, 0, 0, 1},
733
{ (unichar_t *) N_("Malay"), NULL, 0, 0, (void *) 0x43e, NULL, 0, 0, 0, 0, 0, 0, 1},
734
{ (unichar_t *) N_("Malay (Brunei)"), NULL, 0, 0, (void *) 0x83e, NULL, 0, 0, 0, 0, 0, 0, 1},
735
{ (unichar_t *) N_("Lang|Malayalam"), NULL, 0, 0, (void *) 0x44c, NULL, 0, 0, 0, 0, 0, 0, 1},
736
{ (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) 0x43a, NULL, 0, 0, 0, 0, 0, 0, 1},
737
{ (unichar_t *) N_("Manipuri"), NULL, 0, 0, (void *) 0x458, NULL, 0, 0, 0, 0, 0, 0, 1},
738
{ (unichar_t *) N_("Maori"), NULL, 0, 0, (void *) 0x481, NULL, 0, 0, 0, 0, 0, 0, 1},
739
{ (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) 0x44e, NULL, 0, 0, 0, 0, 0, 0, 1},
740
{ (unichar_t *) N_("Mongolian (Cyrillic)"), NULL, 0, 0, (void *) 0x450, NULL, 0, 0, 0, 0, 0, 0, 1},
741
{ (unichar_t *) N_("Mongolian (Mongolian)"), NULL, 0, 0, (void *) 0x850, NULL, 0, 0, 0, 0, 0, 0, 1},
742
{ (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) 0x461, NULL, 0, 0, 0, 0, 0, 0, 1},
743
{ (unichar_t *) N_("Nepali (India)"), NULL, 0, 0, (void *) 0x861, NULL, 0, 0, 0, 0, 0, 0, 1},
744
{ (unichar_t *) N_("Norwegian (Bokmal)"), NULL, 0, 0, (void *) 0x414, NULL, 0, 0, 0, 0, 0, 0, 1},
745
{ (unichar_t *) N_("Norwegian (Nynorsk)"), NULL, 0, 0, (void *) 0x814, NULL, 0, 0, 0, 0, 0, 0, 1},
746
{ (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) 0x448, NULL, 0, 0, 0, 0, 0, 0, 1},
747
{ (unichar_t *) N_("Oromo"), NULL, 0, 0, (void *) 0x472, NULL, 0, 0, 0, 0, 0, 0, 1},
748
{ (unichar_t *) N_("Papiamentu"), NULL, 0, 0, (void *) 0x479, NULL, 0, 0, 0, 0, 0, 0, 1},
749
{ (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) 0x463, NULL, 0, 0, 0, 0, 0, 0, 1},
750
{ (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) 0x415, NULL, 0, 0, 0, 0, 0, 0, 1},
751
{ (unichar_t *) N_("Portugese (Portugal)"), NULL, 0, 0, (void *) 0x416, NULL, 0, 0, 0, 0, 0, 0, 1},
752
{ (unichar_t *) N_("Portuguese (Brasil)"), NULL, 0, 0, (void *) 0x816, NULL, 0, 0, 0, 0, 0, 0, 1},
753
{ (unichar_t *) N_("Punjabi (India)"), NULL, 0, 0, (void *) 0x446, NULL, 0, 0, 0, 0, 0, 0, 1},
754
{ (unichar_t *) N_("Punjabi (Pakistan)"), NULL, 0, 0, (void *) 0x846, NULL, 0, 0, 0, 0, 0, 0, 1},
755
{ (unichar_t *) N_("Quecha (Bolivia)"), NULL, 0, 0, (void *) 0x46b, NULL, 0, 0, 0, 0, 0, 0, 1},
756
{ (unichar_t *) N_("Quecha (Ecuador)"), NULL, 0, 0, (void *) 0x86b, NULL, 0, 0, 0, 0, 0, 0, 1},
757
{ (unichar_t *) N_("Quecha (Peru)"), NULL, 0, 0, (void *) 0xc6b, NULL, 0, 0, 0, 0, 0, 0, 1},
758
{ (unichar_t *) N_("Rhaeto-Romanic"), NULL, 0, 0, (void *) 0x417, NULL, 0, 0, 0, 0, 0, 0, 1},
759
{ (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) 0x418, NULL, 0, 0, 0, 0, 0, 0, 1},
760
{ (unichar_t *) N_("Romanian (Moldova)"), NULL, 0, 0, (void *) 0x818, NULL, 0, 0, 0, 0, 0, 0, 1},
761
{ (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) 0x419, NULL, 0, 0, 0, 0, 0, 0, 1},
762
{ (unichar_t *) N_("Russian (Moldova)"), NULL, 0, 0, (void *) 0x819, NULL, 0, 0, 0, 0, 0, 0, 1},
763
{ (unichar_t *) N_("Sami (Lappish)"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1},
764
{ (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1},
765
{ (unichar_t *) N_("Sepedi"), NULL, 0, 0, (void *) 0x46c, NULL, 0, 0, 0, 0, 0, 0, 1},
766
{ (unichar_t *) N_("Serbian (Cyrillic)"), NULL, 0, 0, (void *) 0xc1a, NULL, 0, 0, 0, 0, 0, 0, 1},
767
{ (unichar_t *) N_("Serbian (Latin)"), NULL, 0, 0, (void *) 0x81a, NULL, 0, 0, 0, 0, 0, 0, 1},
768
{ (unichar_t *) N_("Sindhi India"), NULL, 0, 0, (void *) 0x459, NULL, 0, 0, 0, 0, 0, 0, 1},
769
{ (unichar_t *) N_("Sindhi Pakistan"), NULL, 0, 0, (void *) 0x859, NULL, 0, 0, 0, 0, 0, 0, 1},
770
{ (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) 0x45b, NULL, 0, 0, 0, 0, 0, 0, 1},
771
{ (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) 0x41b, NULL, 0, 0, 0, 0, 0, 0, 1},
772
{ (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) 0x424, NULL, 0, 0, 0, 0, 0, 0, 1},
773
{ (unichar_t *) N_("Sorbian"), NULL, 0, 0, (void *) 0x42e, NULL, 0, 0, 0, 0, 0, 0, 1},
774
{ (unichar_t *) N_("Spanish (Traditional)"), NULL, 0, 0, (void *) 0x40a, NULL, 0, 0, 0, 0, 0, 0, 1},
775
{ (unichar_t *) N_("Spanish Mexico"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1},
776
{ (unichar_t *) N_("Spanish (Modern)"), NULL, 0, 0, (void *) 0xc0a, NULL, 0, 0, 0, 0, 0, 0, 1},
777
{ (unichar_t *) N_("Spanish (Guatemala)"), NULL, 0, 0, (void *) 0x100a, NULL, 0, 0, 0, 0, 0, 0, 1},
778
{ (unichar_t *) N_("Spanish (Costa Rica)"), NULL, 0, 0, (void *) 0x140a, NULL, 0, 0, 0, 0, 0, 0, 1},
779
{ (unichar_t *) N_("Spanish (Panama)"), NULL, 0, 0, (void *) 0x180a, NULL, 0, 0, 0, 0, 0, 0, 1},
780
{ (unichar_t *) N_("Spanish (Dominican Republic)"), NULL, 0, 0, (void *) 0x1c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
781
{ (unichar_t *) N_("Spanish (Venezuela)"), NULL, 0, 0, (void *) 0x200a, NULL, 0, 0, 0, 0, 0, 0, 1},
782
{ (unichar_t *) N_("Spanish (Colombia)"), NULL, 0, 0, (void *) 0x240a, NULL, 0, 0, 0, 0, 0, 0, 1},
783
{ (unichar_t *) N_("Spanish (Peru)"), NULL, 0, 0, (void *) 0x280a, NULL, 0, 0, 0, 0, 0, 0, 1},
784
{ (unichar_t *) N_("Spanish (Argentina)"), NULL, 0, 0, (void *) 0x2c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
785
{ (unichar_t *) N_("Spanish (Ecuador)"), NULL, 0, 0, (void *) 0x300a, NULL, 0, 0, 0, 0, 0, 0, 1},
786
{ (unichar_t *) N_("Spanish (Chile)"), NULL, 0, 0, (void *) 0x340a, NULL, 0, 0, 0, 0, 0, 0, 1},
787
{ (unichar_t *) N_("Spanish (Uruguay)"), NULL, 0, 0, (void *) 0x380a, NULL, 0, 0, 0, 0, 0, 0, 1},
788
{ (unichar_t *) N_("Spanish (Paraguay)"), NULL, 0, 0, (void *) 0x3c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
789
{ (unichar_t *) N_("Spanish (Bolivia)"), NULL, 0, 0, (void *) 0x400a, NULL, 0, 0, 0, 0, 0, 0, 1},
790
{ (unichar_t *) N_("Spanish (El Salvador)"), NULL, 0, 0, (void *) 0x440a, NULL, 0, 0, 0, 0, 0, 0, 1},
791
{ (unichar_t *) N_("Spanish (Honduras)"), NULL, 0, 0, (void *) 0x480a, NULL, 0, 0, 0, 0, 0, 0, 1},
792
{ (unichar_t *) N_("Spanish (Nicaragua)"), NULL, 0, 0, (void *) 0x4c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
793
{ (unichar_t *) N_("Spanish (Puerto Rico)"), NULL, 0, 0, (void *) 0x500a, NULL, 0, 0, 0, 0, 0, 0, 1},
794
{ (unichar_t *) N_("Spanish (United States)"), NULL, 0, 0, (void *) 0x540a, NULL, 0, 0, 0, 0, 0, 0, 1},
795
{ (unichar_t *) N_("Spanish (Latin America)"), NULL, 0, 0, (void *) 0xe40a, NULL, 0, 0, 0, 0, 0, 0, 1},
796
{ (unichar_t *) N_("Sutu"), NULL, 0, 0, (void *) 0x430, NULL, 0, 0, 0, 0, 0, 0, 1},
797
{ (unichar_t *) N_("Swahili (Kenyan)"), NULL, 0, 0, (void *) 0x441, NULL, 0, 0, 0, 0, 0, 0, 1},
798
{ (unichar_t *) N_("Swedish (Sweden)"), NULL, 0, 0, (void *) 0x41d, NULL, 0, 0, 0, 0, 0, 0, 1},
799
{ (unichar_t *) N_("Swedish (Finland)"), NULL, 0, 0, (void *) 0x81d, NULL, 0, 0, 0, 0, 0, 0, 1},
800
{ (unichar_t *) N_("Lang|Syriac"), NULL, 0, 0, (void *) 0x45a, NULL, 0, 0, 0, 0, 0, 0, 1},
801
{ (unichar_t *) N_("Lang|Tagalog"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1},
802
{ (unichar_t *) N_("Tajik"), NULL, 0, 0, (void *) 0x428, NULL, 0, 0, 0, 0, 0, 0, 1},
803
{ (unichar_t *) N_("Tamazight (Arabic)"), NULL, 0, 0, (void *) 0x45f, NULL, 0, 0, 0, 0, 0, 0, 1},
804
{ (unichar_t *) N_("Tamazight (Latin)"), NULL, 0, 0, (void *) 0x85f, NULL, 0, 0, 0, 0, 0, 0, 1},
805
{ (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) 0x449, NULL, 0, 0, 0, 0, 0, 0, 1},
806
{ (unichar_t *) N_("Tatar (Tatarstan)"), NULL, 0, 0, (void *) 0x444, NULL, 0, 0, 0, 0, 0, 0, 1},
807
{ (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) 0x44a, NULL, 0, 0, 0, 0, 0, 0, 1},
808
{ (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) 0x41e, NULL, 0, 0, 0, 0, 0, 0, 1},
809
{ (unichar_t *) N_("Tibetan (PRC)"), NULL, 0, 0, (void *) 0x451, NULL, 0, 0, 0, 0, 0, 0, 1},
810
{ (unichar_t *) N_("Tibetan Bhutan"), NULL, 0, 0, (void *) 0x851, NULL, 0, 0, 0, 0, 0, 0, 1},
811
{ (unichar_t *) N_("Tigrinya Ethiopia"), NULL, 0, 0, (void *) 0x473, NULL, 0, 0, 0, 0, 0, 0, 1},
812
{ (unichar_t *) N_("Tigrinyan Eritrea"), NULL, 0, 0, (void *) 0x873, NULL, 0, 0, 0, 0, 0, 0, 1},
813
{ (unichar_t *) N_("Tsonga"), NULL, 0, 0, (void *) 0x431, NULL, 0, 0, 0, 0, 0, 0, 1},
814
{ (unichar_t *) N_("Tswana"), NULL, 0, 0, (void *) 0x432, NULL, 0, 0, 0, 0, 0, 0, 1},
815
{ (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) 0x41f, NULL, 0, 0, 0, 0, 0, 0, 1},
816
{ (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) 0x442, NULL, 0, 0, 0, 0, 0, 0, 1},
817
{ (unichar_t *) N_("Lang|Uighur"), NULL, 0, 0, (void *) 0x480, NULL, 0, 0, 0, 0, 0, 0, 1},
818
{ (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) 0x422, NULL, 0, 0, 0, 0, 0, 0, 1},
819
{ (unichar_t *) N_("Urdu (Pakistan)"), NULL, 0, 0, (void *) 0x420, NULL, 0, 0, 0, 0, 0, 0, 1},
820
{ (unichar_t *) N_("Urdu (India)"), NULL, 0, 0, (void *) 0x820, NULL, 0, 0, 0, 0, 0, 0, 1},
821
{ (unichar_t *) N_("Uzbek (Latin)"), NULL, 0, 0, (void *) 0x443, NULL, 0, 0, 0, 0, 0, 0, 1},
822
{ (unichar_t *) N_("Uzbek (Cyrillic)"), NULL, 0, 0, (void *) 0x843, NULL, 0, 0, 0, 0, 0, 0, 1},
823
{ (unichar_t *) N_("Venda"), NULL, 0, 0, (void *) 0x433, NULL, 0, 0, 0, 0, 0, 0, 1},
824
{ (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) 0x42a, NULL, 0, 0, 0, 0, 0, 0, 1},
825
{ (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) 0x452, NULL, 0, 0, 0, 0, 0, 0, 1},
826
{ (unichar_t *) N_("Xhosa"), NULL, 0, 0, (void *) 0x434, NULL, 0, 0, 0, 0, 0, 0, 1},
827
{ (unichar_t *) N_("Lang|Yi"), NULL, 0, 0, (void *) 0x478, NULL, 0, 0, 0, 0, 0, 0, 1},
828
{ (unichar_t *) N_("Yiddish"), NULL, 0, 0, (void *) 0x43d, NULL, 0, 0, 0, 0, 0, 0, 1},
829
{ (unichar_t *) N_("Yoruba"), NULL, 0, 0, (void *) 0x46a, NULL, 0, 0, 0, 0, 0, 0, 1},
830
{ (unichar_t *) N_("Zulu"), NULL, 0, 0, (void *) 0x435, NULL, 0, 0, 0, 0, 0, 0, 1},
832
static GTextInfo ttfnameids[] = {
833
/* Put styles (docs call it subfamily) first because it is most likely to change */
834
{ (unichar_t *) N_("Styles (SubFamily)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 1, 0, 1},
835
{ (unichar_t *) N_("Copyright"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
836
{ (unichar_t *) N_("Family"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
837
{ (unichar_t *) N_("Fullname"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
838
{ (unichar_t *) N_("UniqueID"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
839
{ (unichar_t *) N_("Version"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
840
/* Don't give user access to PostscriptName, we set that elsewhere */
841
{ (unichar_t *) N_("Trademark"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
842
{ (unichar_t *) N_("Manufacturer"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
843
{ (unichar_t *) N_("Designer"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
844
{ (unichar_t *) N_("Descriptor"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
845
{ (unichar_t *) N_("Vendor URL"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
846
{ (unichar_t *) N_("Designer URL"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
847
{ (unichar_t *) N_("License"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
848
{ (unichar_t *) N_("License URL"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
849
/* slot 15 is reserved */
850
{ (unichar_t *) N_("Preferred Family"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1},
851
{ (unichar_t *) N_("Preferred Styles"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1},
852
{ (unichar_t *) N_("Compatible Full"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1},
853
{ (unichar_t *) N_("Sample Text"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1},
854
{ (unichar_t *) N_("CID findfont Name"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1},
856
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
857
static char *TN_DefaultName(GGadget *g, int r, int c);
858
static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c);
859
static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c);
860
static struct col_init ci[3] = {
861
{ me_enum, NULL, mslanguages, TN_LangEnable, N_("Language") },
862
{ me_enum, NULL, ttfnameids, TN_StrIDEnable, N_("String ID") },
863
{ me_func, TN_DefaultName, NULL, NULL, N_("String") }
866
static GTextInfo gridfit[] = {
867
{ (unichar_t *) N_("No Grid Fit"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
868
{ (unichar_t *) N_("Grid Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
870
static GTextInfo antialias[] = {
871
{ (unichar_t *) N_("No Anti-Alias"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
872
{ (unichar_t *) N_("Anti-Alias"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
874
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
875
static GTextInfo symsmooth[] = {
876
{ (unichar_t *) N_("No Symmetric-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
877
{ (unichar_t *) N_("Symmetric-Smoothing"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
879
static GTextInfo gfsymsmooth[] = {
880
{ (unichar_t *) N_("No Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
881
{ (unichar_t *) N_("Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
883
static struct col_init gaspci[5] = {
884
{ me_int , NULL, NULL, NULL, N_("Gasp|Pixels Per EM") },
885
{ me_enum, NULL, gridfit, NULL, N_("Gasp|Grid Fit") },
886
{ me_enum, NULL, antialias, NULL, N_("Gasp|Anti-Alias") },
887
{ me_enum, NULL, symsmooth, NULL, N_("Gasp|Symmetric Smoothing") },
888
{ me_enum, NULL, gfsymsmooth, NULL, N_("Gasp|Grid Fit w/ Sym Smooth") }
892
struct langstyle { int lang; const char *str; };
893
static const char regulareng[] = "Regular";
894
static const char demiboldeng[] = "DemiBold";
895
static const char demiboldeng3[] = "Demi";
896
static const char demiboldeng5[] = "SemiBold";
897
static const char boldeng[] = "Bold";
898
static const char thineng[] = "Thin";
899
static const char lighteng[] = "Light";
900
static const char extralighteng[] = "ExtraLight";
901
static const char extralighteng2[] = "VeryLight";
902
static const char mediumeng[] = "Medium";
903
static const char bookeng[] = "Book";
904
static const char heavyeng[] = "Heavy";
905
static const char blackeng[] = "Black";
906
static const char italiceng[] = "Italic";
907
static const char obliqueeng[] = "Oblique";
908
static const char condensedeng[] = "Condensed";
909
static const char expandedeng[] = "Expanded";
910
static const char outlineeng[] = "Outline";
912
static const char regularfren[] = "Normal";
913
static const char boldfren[] = "Gras";
914
static const char demiboldfren[] = "DemiGras";
915
static const char demiboldfren2[] = "Demi";
916
static const char mediumfren[] = "Normal";
917
static const char lightfren[] = "Maigre";
918
static const char blackfren[] = "ExtraGras";
919
static const char italicfren[] = "Italique";
920
static const char obliquefren[] = "Oblique";
921
static const char condensedfren[] = "Etroite";
922
static const char expandedfren[] = "Elargi";
923
static const char outlinefren[] = "Contour";
925
static const char regulargerm[] = "Standard";
926
static const char demiboldgerm[] = "Halbfett";
927
static const char demiboldgerm2[] = "Schmallfett";
928
static const char boldgerm[] = "Fett";
929
static const char boldgerm2[] = "Dick";
930
static const char blackgerm[] = "Schwarz";
931
static const char lightgerm[] = "Mager";
932
static const char mediumgerm[] = "Mittel";
933
static const char bookgerm[] = "Buchschrift";
934
static const char italicgerm[] = "Kursiv";
935
static const char obliquegerm[] = "Schr\303\244g";
936
static const char condensedgerm[] = "Schmal";
937
static const char expandedgerm[] = "Breit";
938
static const char outlinegerm[] = "Konturert";
940
static const char regularspan[] = "Normal";
941
static const char boldspan[] = "Negrita";
942
static const char lightspan[] = "Fina";
943
static const char blackspan[] = "Supernegra";
944
static const char italicspan[] = "Cursiva";
945
static const char condensedspan[] = "Condensada";
946
static const char expandedspan[] = "Amplida";
948
static const char regulardutch[] = "Normaal";
949
static const char mediumdutch[] = "Normaal";
950
static const char bookdutch[] = "Normaal";
951
static const char bolddutch[] = "Vet";
952
static const char demibolddutch[] = "Halfvet";
953
static const char lightdutch[] = "Licht mager";
954
static const char blackdutch[] = "Extra vet";
955
static const char italicdutch[] = "Cursief";
956
static const char italicdutch2[] = "italiek";
957
static const char obliquedutch[] = "oblique";
958
static const char obliquedutch2[] = "schuin";
959
static const char condenseddutch[] = "Smal";
960
static const char expandeddutch[] = "Breed";
961
static const char outlinedutch[] = "Contour";
963
static const char regularswed[] = "Mager";
964
static const char boldswed[] = "Fet";
965
static const char lightswed[] = "Extrafin";
966
static const char blackswed[] = "Extrafet";
967
static const char italicswed[] = "Kursiv";
968
static const char condensedswed[] = "Smal";
969
static const char expandedswed[] = "Bred";
971
static const char regulardanish[] = "Normal";
972
static const char bolddanish[] = "Fed";
973
static const char demibolddanish[] = "Halvfed";
974
static const char lightdanish[] = "Fin";
975
static const char mediumdanish[] = "Medium";
976
static const char blackdanish[] = "Extrafed";
977
static const char italicdanish[] = "Kursiv";
978
static const char condenseddanish[] = "Smal";
979
static const char expandeddanish[] = "Bred";
980
static const char outlinedanish[] = "Kontour";
982
static const char regularnor[] = "Vanlig";
983
static const char boldnor[] = "Halvfet";
984
static const char lightnor[] = "Mager";
985
static const char blacknor[] = "Fet";
986
static const char italicnor[] = "Kursiv";
987
static const char condensednor[] = "Smal";
988
static const char expandednor[] = "Sperret";
990
static const char regularital[] = "Normale";
991
static const char demiboldital[] = "Nerretto";
992
static const char boldital[] = "Nero";
993
static const char thinital[] = "Fine";
994
static const char lightital[] = "Chiaro";
995
static const char mediumital[] = "Medio";
996
static const char bookital[] = "Libro";
997
static const char heavyital[] = "Nerissimo";
998
static const char blackital[] = "ExtraNero";
999
static const char italicital[] = "Cursivo";
1000
static const char obliqueital[] = "Obliquo";
1001
static const char condensedital[] = "Condensato";
1002
static const char expandedital[] = "Allargato";
1004
static const char regularru[] = "\320\236\320\261\321\213\321\207\320\275\321\213\320\271";
1005
static const char demiboldru[] = "\320\237\320\276\320\273\321\203\320\266\320\270\321\200\320\275\321\213\320\271";
1006
static const char boldru[] = "\320\236\320\261\321\213\321\207\320\275\321\213\320\271";
1007
static const char heavyru[] = "\320\241\320\262\320\265\321\200\321\205\320\266\320\270\321\200\320\275\321\213\320\271";
1008
static const char blackru[] = "\320\247\321\221\321\200\320\275\321\213\320\271";
1009
static const char thinru[] = "\320\242\320\276\320\275\320\272\320\270\320\271";
1010
static const char lightru[] = "\320\241\320\262\320\265\321\202\320\273\321\213\320\271";
1011
static const char italicru[] = "\320\232\321\203\321\200\321\201\320\270\320\262";
1012
static const char obliqueru[] = "\320\235\320\260\320\272\320\273\320\276\320\275";
1013
static const char condensedru[] = "\320\243\320\267\320\272\320\270\320\271";
1014
static const char expandedru[] = "\320\250\320\270\321\200\320\276\320\272\320\270\320\271";
1016
static const char regularhu[] = "Norm\303\241l";
1017
static const char demiboldhu[] = "Negyedk\303\266v\303\251r";
1018
static const char demiboldhu2[] = "F\303\251lk\303\266v\303\251r";
1019
static const char boldhu[] = "F\303\251lk\303\266v\303\251r";
1020
static const char boldhu2[] = "H\303\241romnegyedk\303\266v\303\251r";
1021
static const char thinhu[] = "Sov\303\241ny";
1022
static const char lighthu[] = "Vil\303\241gos";
1023
static const char mediumhu[] = "K\303\266zepes";
1024
static const char bookhu[] = "Halv\303\241ny";
1025
static const char bookhu2[] = "K\303\266nyv";
1026
static const char heavyhu[] = "K\303\266v\303\251r";
1027
static const char heavyhu2[] = "Extrak\303\266v\303\251r";
1028
static const char blackhu[] = "Fekete";
1029
static const char blackhu2[] = "S\303\266t\303\251t";
1030
static const char italichu[] = "D\305\221lt";
1031
static const char obliquehu[] = "D\303\266nt\303\266tt";
1032
static const char obliquehu2[] = "Ferde";
1033
static const char condensedhu[] = "Keskeny";
1034
static const char expandedhu[] = "Sz\303\251les";
1035
static const char outlinehu[] = "Kont\303\272ros";
1037
static const char regularpl[] = "podstawowa";
1038
static const char demiboldpl[] = "p\303\263\305\202gruba";
1039
static const char boldpl[] = "pogrubiona";
1040
static const char thinpl[] = "cienka";
1041
static const char lightpl[] = "bardzo cienka";
1042
static const char heavypl[] = "bardzo gruba";
1043
static const char italicpl[] = "pochy\305\202a";
1044
static const char obliquepl[] = "pochy\305\202a";
1045
static const char condensedpl[] = "w\304\205ska";
1046
static const char expandedpl[] = "szeroka";
1047
static const char outlinepl[] = "konturowa";
1048
static const char mediumpl[] = "zwyk\305\202a";
1049
static const char bookpl[] = "zwyk\305\202a";
1054
static struct langstyle regs[] = { {0x409, regulareng}, { 0x40c, regularfren }, { 0x410, regularital }, { 0x407, regulargerm }, { 0x40a, regularspan }, { 0x419, regularru }, { 0x40e, regularhu },
1055
{ 0x413, regulardutch}, { 0x41d, regularswed }, { 0x414, regularnor },
1056
{ 0x406, regulardanish}, {0x415, regularpl }, { 0x804, "\346\255\243\345\270\270"},
1057
{ 0x408, "\316\272\316\261\316\275\316\277\316\275\316\271\316\272\316\256"}, { 0x42a, "Chu\341\272\251n"}, { 0 }};
1058
static struct langstyle meds[] = { {0x409, mediumeng}, { 0x410, mediumital },
1059
{ 0x40c, mediumfren }, { 0x407, mediumgerm }, { 0x40e, mediumhu },
1060
{ 0x406, mediumdanish}, {0x415, mediumpl }, { 0x804, "\344\270\255\347\255\211"},
1061
{ 0x408, "\302\265\316\265\317\203\316\261\316\257\316\261"}, { 0x42a, "V\341\273\253a"}, { 0x413, mediumdutch}, { 0 }};
1062
static struct langstyle books[] = { {0x409, bookeng}, { 0x410, bookital },
1063
{ 0x407, bookgerm }, { 0x40e, bookhu }, { 0x40e, bookhu2 },
1064
{ 0x415, bookpl}, { 0x804, "\344\271\246\344\275\223"}, { 0x408, "\303\237\316\271\303\237\316\273\316\257\316\277\317\205"},
1065
{ 0x42a, "S\303\241ch"}, { 0x413, bookdutch}, { 0 }};
1066
static struct langstyle bolds[] = { {0x409, boldeng}, { 0x410, boldital }, { 0x40c, boldfren }, { 0x407, boldgerm }, { 0x407, boldgerm2 }, { 0x40a, boldspan}, { 0x419, boldru }, { 0x40e, boldhu }, { 0x40e, boldhu2 },
1067
{ 0x413, bolddutch}, { 0x41d, boldswed }, { 0x414, boldnor },
1068
{ 0x406, bolddanish}, { 0x415, boldpl}, { 0x804, "\347\262\227\344\275\223"},
1069
{ 0x408, "\316\255\316\275\317\204\316\277\316\275\316\267"}, { 0x42a, "\304\220\341\272\255m"}, { 0 }};
1070
static struct langstyle italics[] = { {0x409, italiceng}, { 0x410, italicital }, { 0x40c, italicfren }, { 0x407, italicgerm }, { 0x40a, italicspan}, { 0x419, italicru }, { 0x40e, italichu },
1071
{ 0x413, italicdutch}, { 0x413, italicdutch2}, { 0x41d, italicswed }, { 0x414, italicnor },
1072
{ 0x406, italicdanish}, { 0x415, italicpl}, { 0x804, "\346\226\234\344\275\223"},
1073
{ 0x408, "\316\233\316\265\316\271\317\210\316\257\316\261\317\202"}, { 0x42a, "Nghi\303\252ng" }, { 0 }};
1074
static struct langstyle obliques[] = { {0x409, obliqueeng}, { 0x410, obliqueital },
1075
{ 0x40c, obliquefren }, { 0x407, obliquegerm }, { 0x419, obliqueru },
1076
{ 0x40e, obliquehu }, { 0x40e, obliquehu2 }, {0x415, obliquepl},
1077
{ 0x804, "\346\226\234\344\275\223"}, { 0x408, "\317\200\316\273\316\254\316\263\316\271\316\261"},
1078
{ 0x42a, "Xi\303\252n" }, { 0x413, obliquedutch}, { 0x413, obliquedutch2}, { 0 }};
1079
static struct langstyle demibolds[] = { {0x409, demiboldeng}, {0x409, demiboldeng3}, {0x409, demiboldeng5},
1080
{ 0x410, demiboldital }, { 0x40c, demiboldfren }, { 0x40c, demiboldfren2 }, { 0x407, demiboldgerm }, { 0x407, demiboldgerm2 },
1081
{ 0x419, demiboldru }, { 0x40e, demiboldhu }, { 0x40e, demiboldhu2 },
1082
{ 0x406, demibolddanish}, { 0x415, demiboldpl },
1083
{ 0x804, "\347\225\245\347\262\227"}, { 0x408, "\316\267\302\265\316\271\316\255\316\275\317\204\316\277\316\275\316\267"},
1084
{ 0x42a, "N\341\273\255a \304\221\341\272\255m"}, { 0x413, demibolddutch}, { 0 }};
1085
static struct langstyle heavys[] = { {0x409, heavyeng}, { 0x410, heavyital },
1086
{ 0x419, heavyru }, { 0x40e, heavyhu }, { 0x40e, heavyhu2 },
1087
{ 0x415, heavypl }, { 0x804, "\347\262\227"}, { 0 }};
1088
static struct langstyle blacks[] = { {0x409, blackeng}, { 0x410, blackital }, { 0x40c, blackfren }, { 0x407, blackgerm }, { 0x419, blackru }, { 0x40e, blackhu }, { 0x40e, blackhu2 }, { 0x40a, blackspan },
1089
{ 0x413, blackdutch}, { 0x41d, blackswed }, { 0x414, blacknor }, { 0x406, blackdanish},
1090
{ 0x415, heavypl }, { 0x804, "\351\273\221"}, { 0x408, "\302\265\316\261\317\215\317\201\316\261"},
1091
{ 0x42a, "\304\220en"}, {0} };
1092
static struct langstyle thins[] = { {0x409, thineng}, { 0x410, thinital },
1093
{ 0x419, thinru }, { 0x40e, thinhu }, { 0x415, thinpl},
1094
{ 0x804, "\347\273\206"}, { 0 }};
1095
static struct langstyle extralights[] = { {0x409, extralighteng}, {0x409, extralighteng2},
1096
{ 0x804, "\346\236\201\347\273\206"}, {0}};
1097
static struct langstyle lights[] = { {0x409, lighteng}, {0x410, lightital}, {0x40c, lightfren}, {0x407, lightgerm}, { 0x419, lightru }, { 0x40e, lighthu }, { 0x40a, lightspan },
1098
{ 0x413, lightdutch}, { 0x41d, lightswed }, { 0x414, lightnor },
1099
{ 0x406, lightdanish}, { 0x415, lightpl}, { 0x804, "\347\273\206"},
1100
{ 0x408, "\316\273\316\265\317\200\317\204\316\256"}, { 0x42a, "Nh\341\272\271" }, { 0 }};
1101
static struct langstyle condenseds[] = { {0x409, condensedeng}, {0x410, condensedital}, {0x40c, condensedfren}, {0x407, condensedgerm}, { 0x419, condensedru }, { 0x40e, condensedhu }, { 0x40a, condensedspan },
1102
{ 0x413, condenseddutch}, { 0x41d, condensedswed },
1103
{ 0x414, condensednor }, { 0x406, condenseddanish},
1104
{ 0x415, condensedpl }, { 0x804, "\345\216\213\347\274\251"},
1105
{ 0x408, "\317\200\317\205\316\272\316\275\316\256"}, { 0x42a, "H\341\272\271p" }, { 0 }};
1106
static struct langstyle expandeds[] = { {0x409, expandedeng}, {0x410, expandedital}, {0x40c, expandedfren}, {0x407, expandedgerm}, { 0x419, expandedru }, { 0x40e, expandedhu }, { 0x40a, expandedspan },
1107
{ 0x413, expandeddutch}, { 0x41d, expandedswed }, { 0x414, expandednor },
1108
{ 0x406, expandeddanish}, { 0x415, expandedpl }, { 0x804, "\345\212\240\345\256\275"},
1109
{ 0x408, "\316\261\317\201\316\261\316\271\316\256"}, { 0x42a, "R\341\273\231ng" }, { 0 }};
1110
static struct langstyle outlines[] = { {0x409, outlineeng}, {0x40c, outlinefren},
1111
{0x407, outlinegerm}, {0x40e, outlinehu}, { 0x406, outlinedanish},
1112
{0x415, outlinepl}, { 0x804, "\350\275\256\345\273\223"}, { 0x408, "\317\200\316\265\317\201\316\271\316\263\317\201\316\254\316\274\316\274\316\261\317\204\316\277\317\202"},
1113
{0x42a, "N\303\251t ngo\303\240i" }, { 0x413, outlinedutch}, { 0 }};
1114
static struct langstyle *stylelist[] = {regs, meds, books, demibolds, bolds, heavys, blacks,
1115
extralights, lights, thins, italics, obliques, condenseds, expandeds, outlines, NULL };
1118
#define CID_Features 101 /* Mac stuff */
1119
#define CID_FeatureDel 103
1120
#define CID_FeatureEdit 105
1122
#define CID_Family 1002
1123
#define CID_Weight 1003
1124
#define CID_ItalicAngle 1004
1125
#define CID_UPos 1005
1126
#define CID_UWidth 1006
1127
#define CID_Ascent 1007
1128
#define CID_Descent 1008
1129
#define CID_Notice 1010
1130
#define CID_Version 1011
1131
#define CID_UniqueID 1012
1132
#define CID_HasVerticalMetrics 1013
1133
#define CID_VOriginLab 1014
1134
#define CID_VOrigin 1015
1135
#define CID_Fontname 1016
1137
#define CID_Scale 1018
1138
#define CID_IsOrder2 1019
1139
#define CID_IsMultiLayer 1020
1140
#define CID_Interpretation 1021
1141
#define CID_IsStrokedFont 1022
1142
#define CID_StrokeWidth 1023
1143
#define CID_Namelist 1024
1144
#define CID_XUID 1113
1145
#define CID_Human 1114
1146
#define CID_SameAsFontname 1115
1147
#define CID_HasDefBase 1116
1148
#define CID_DefBaseName 1117
1150
#define CID_PrivateEntries 2001
1151
#define CID_PrivateValues 2002
1152
#define CID_Add 2003
1153
#define CID_Guess 2004
1154
#define CID_Remove 2005
1155
#define CID_Hist 2006
1157
#define CID_TTFTabs 3000
1158
#define CID_WeightClass 3001
1159
#define CID_WidthClass 3002
1160
#define CID_PFMFamily 3003
1161
#define CID_FSType 3004
1162
#define CID_NoSubsetting 3005
1163
#define CID_OnlyBitmaps 3006
1164
#define CID_LineGap 3007
1165
#define CID_VLineGap 3008
1166
#define CID_VLineGapLab 3009
1167
#define CID_WinAscent 3010
1168
#define CID_WinAscentLab 3011
1169
#define CID_WinAscentIsOff 3012
1170
#define CID_WinDescent 3013
1171
#define CID_WinDescentLab 3014
1172
#define CID_WinDescentIsOff 3015
1173
#define CID_TypoAscent 3016
1174
#define CID_TypoAscentLab 3017
1175
#define CID_TypoAscentIsOff 3018
1176
#define CID_TypoDescent 3019
1177
#define CID_TypoDescentLab 3020
1178
#define CID_TypoDescentIsOff 3021
1179
#define CID_TypoLineGap 3022
1180
#define CID_HHeadAscent 3023
1181
#define CID_HHeadAscentLab 3024
1182
#define CID_HHeadAscentIsOff 3025
1183
#define CID_HHeadDescent 3026
1184
#define CID_HHeadDescentLab 3027
1185
#define CID_HHeadDescentIsOff 3028
1186
#define CID_Vendor 3029
1187
#define CID_IBMFamily 3030
1188
#define CID_OS2Version 3031
1189
#define CID_UseTypoMetrics 3032
1190
#define CID_WeightWidthSlopeOnly 3033
1192
#define CID_SubSuperDefault 3100
1193
#define CID_SubXSize 3101
1194
#define CID_SubYSize 3102
1195
#define CID_SubXOffset 3103
1196
#define CID_SubYOffset 3104
1197
#define CID_SuperXSize 3105
1198
#define CID_SuperYSize 3106
1199
#define CID_SuperXOffset 3107
1200
#define CID_SuperYOffset 3108
1201
#define CID_StrikeoutSize 3109
1202
#define CID_StrikeoutPos 3110
1204
#define CID_PanFamily 4001
1205
#define CID_PanSerifs 4002
1206
#define CID_PanWeight 4003
1207
#define CID_PanProp 4004
1208
#define CID_PanContrast 4005
1209
#define CID_PanStrokeVar 4006
1210
#define CID_PanArmStyle 4007
1211
#define CID_PanLetterform 4008
1212
#define CID_PanMidLine 4009
1213
#define CID_PanXHeight 4010
1214
#define CID_PanDefault 4011
1215
#define CID_PanFamilyLab 4021
1216
#define CID_PanSerifsLab 4022
1217
#define CID_PanWeightLab 4023
1218
#define CID_PanPropLab 4024
1219
#define CID_PanContrastLab 4025
1220
#define CID_PanStrokeVarLab 4026
1221
#define CID_PanArmStyleLab 4027
1222
#define CID_PanLetterformLab 4028
1223
#define CID_PanMidLineLab 4029
1224
#define CID_PanXHeightLab 4030
1226
#define CID_TNLangSort 5001
1227
#define CID_TNStringSort 5002
1228
#define CID_TNVScroll 5003
1229
#define CID_TNHScroll 5004
1230
#define CID_TNames 5005
1232
#define CID_Language 5006 /* Used by AskForLangNames */
1234
#define CID_Gasp 5100
1235
#define CID_GaspVersion 5101
1236
#define CID_HeadClearType 5102
1238
#define CID_Comment 6001
1240
#define CID_MarkClasses 7101
1241
#define CID_MarkNew 7102
1242
#define CID_MarkEdit 7103
1244
#define CID_TeXText 8001
1245
#define CID_TeXMathSym 8002
1246
#define CID_TeXMathExt 8003
1247
#define CID_MoreParams 8005
1248
#define CID_TeXExtraSpLabel 8006
1249
#define CID_TeX 8007 /* through 8014 */
1251
#define CID_DesignSize 8301
1252
#define CID_DesignBottom 8302
1253
#define CID_DesignTop 8303
1254
#define CID_StyleID 8304
1255
#define CID_StyleName 8305
1256
#define CID_StyleNameNew 8306
1257
#define CID_StyleNameDel 8307
1258
#define CID_StyleNameRename 8308
1260
#define CID_Tabs 10001
1261
#define CID_OK 10002
1262
#define CID_Cancel 10003
1263
#define CID_MainGroup 10004
1265
#define CID_Lookups 11000
1266
#define CID_LookupTop 11001
1267
#define CID_LookupUp 11002
1268
#define CID_LookupDown 11003
1269
#define CID_LookupBottom 11004
1270
#define CID_AddLookup 11005
1271
#define CID_AddSubtable 11006
1272
#define CID_EditMetadata 11007
1273
#define CID_EditSubtable 11008
1274
#define CID_DeleteLookup 11009
1275
#define CID_MergeLookup 11010
1276
#define CID_RevertLookups 11011
1277
#define CID_LookupSort 11012
1278
#define CID_ImportLookups 11013
1279
#define CID_LookupWin 11020 /* (GSUB, add 1 for GPOS) */
1280
#define CID_LookupVSB 11022 /* (GSUB, add 1 for GPOS) */
1281
#define CID_LookupHSB 11024 /* (GSUB, add 1 for GPOS) */
1282
#define CID_SaveLookup 11026
1283
#define CID_SaveFeat 11027
1284
#define CID_AddAllAlternates 11028
1285
#define CID_AddDFLT 11029
1287
#define CID_MacAutomatic 16000
1288
#define CID_MacStyles 16001
1289
#define CID_MacFOND 16002
1291
#define CID_Unicode 16100
1292
#define CID_UnicodeEmpties 16101
1294
const char *TTFNameIds(int id) {
1298
for ( i=0; ttfnameids[i].text!=NULL; ++i )
1299
if ( ttfnameids[i].userdata == (void *) (intpt) id )
1300
return( (char *) ttfnameids[i].text );
1303
return( "Postscript" );
1305
return( _("Unknown") );
1308
const char *MSLangString(int language) {
1312
for ( i=0; mslanguages[i].text!=NULL; ++i )
1313
if ( mslanguages[i].userdata == (void *) (intpt) language )
1314
return( (char *) mslanguages[i].text );
1317
for ( i=0; mslanguages[i].text!=NULL; ++i )
1318
if ( ((intpt) mslanguages[i].userdata & 0xff) == language )
1319
return( (char *) mslanguages[i].text );
1321
return( _("Unknown") );
1325
struct psdict *PSDictCopy(struct psdict *dict) {
1332
ret = gcalloc(1,sizeof(struct psdict));
1333
ret->cnt = dict->cnt; ret->next = dict->next;
1334
ret->keys = gcalloc(ret->cnt,sizeof(char *));
1335
ret->values = gcalloc(ret->cnt,sizeof(char *));
1336
for ( i=0; i<dict->next; ++i ) {
1337
ret->keys[i] = copy(dict->keys[i]);
1338
ret->values[i] = copy(dict->values[i]);
1344
int PSDictFindEntry(struct psdict *dict, char *key) {
1350
for ( i=0; i<dict->next; ++i )
1351
if ( strcmp(dict->keys[i],key)==0 )
1357
char *PSDictHasEntry(struct psdict *dict, char *key) {
1363
for ( i=0; i<dict->next; ++i )
1364
if ( strcmp(dict->keys[i],key)==0 )
1365
return( dict->values[i] );
1370
int PSDictRemoveEntry(struct psdict *dict, char *key) {
1376
for ( i=0; i<dict->next; ++i )
1377
if ( strcmp(dict->keys[i],key)==0 )
1379
if ( i==dict->next )
1381
free( dict->keys[i]);
1382
free( dict->values[i] );
1384
while ( i<dict->next ) {
1385
dict->keys[i] = dict->keys[i+1];
1386
dict->values[i] = dict->values[i+1];
1393
int PSDictChangeEntry(struct psdict *dict, char *key, char *newval) {
1399
for ( i=0; i<dict->next; ++i )
1400
if ( strcmp(dict->keys[i],key)==0 )
1402
if ( i==dict->next ) {
1403
if ( dict->next>=dict->cnt ) {
1405
dict->keys = grealloc(dict->keys,dict->cnt*sizeof(char *));
1406
dict->values = grealloc(dict->values,dict->cnt*sizeof(char *));
1408
dict->keys[dict->next] = copy(key);
1409
dict->values[dict->next] = NULL;
1412
free(dict->values[i]);
1413
dict->values[i] = copy(newval);
1417
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
1418
/* These are Postscript names, and as such should not be translated */
1419
enum { pt_number, pt_boolean, pt_array, pt_code };
1420
static struct { const char *name; short type, arr_size, present; } KnownPrivates[] = {
1421
{ "BlueValues", pt_array, 14 },
1422
{ "OtherBlues", pt_array, 10 },
1423
{ "BlueFuzz", pt_number },
1424
{ "FamilyBlues", pt_array, 14 },
1425
{ "FamilyOtherBlues", pt_array, 10 },
1426
{ "BlueScale", pt_number },
1427
{ "BlueShift", pt_number },
1428
{ "StdHW", pt_array, 1 },
1429
{ "StdVW", pt_array, 1 },
1430
{ "StemSnapH", pt_array, 12 },
1431
{ "StemSnapV", pt_array, 12 },
1432
{ "ForceBold", pt_boolean },
1433
{ "LanguageGroup", pt_number },
1434
{ "RndStemUp", pt_number },
1435
{ "lenIV", pt_number },
1436
{ "ExpansionFactor", pt_number },
1437
{ "Erode", pt_code },
1438
/* I am deliberately not including Subrs and OtherSubrs */
1439
/* The first could not be entered (because it's a set of binary strings) */
1440
/* And the second has special meaning to us and must be handled with care */
1449
static int Ask_Cancel(GGadget *g, GEvent *e) {
1453
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1454
gw = GGadgetGetWindow(g);
1455
d = GDrawGetUserData(gw);
1461
static int Ask_OK(GGadget *g, GEvent *e) {
1465
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1466
gw = GGadgetGetWindow(g);
1467
d = GDrawGetUserData(gw);
1468
d->done = d->ret = true;
1473
static int ask_e_h(GWindow gw, GEvent *event) {
1474
if ( event->type==et_close ) {
1475
struct ask_data *d = GDrawGetUserData(gw);
1477
} else if ( event->type == et_char ) {
1483
static char *AskKey(SplineFont *sf) {
1488
GWindowAttrs wattrs;
1489
GGadgetCreateData gcd[8], boxes[3], *varray[9], *harray[7];
1495
if ( sf->private==NULL )
1496
for ( i=0; KnownPrivates[i].name!=NULL; ++i ) {
1497
KnownPrivates[i].present = 0;
1501
for ( i=0; KnownPrivates[i].name!=NULL; ++i ) {
1502
for ( j=0; j<sf->private->next; ++j )
1503
if ( strcmp(KnownPrivates[i].name,sf->private->keys[j])==0 )
1505
if ( !(KnownPrivates[i].present = (j<sf->private->next)) )
1512
ti = gcalloc(cnt+1,sizeof(GTextInfo));
1513
for ( i=cnt=0; KnownPrivates[i].name!=NULL; ++i )
1514
if ( !KnownPrivates[i].present )
1515
ti[cnt++].text = uc_copy(KnownPrivates[i].name);
1518
memset(&d,'\0',sizeof(d));
1520
memset(&wattrs,0,sizeof(wattrs));
1521
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
1522
wattrs.event_masks = ~(1<<et_charup);
1523
wattrs.restrict_input_to_me = 1;
1524
wattrs.undercursor = 1;
1525
wattrs.cursor = ct_pointer;
1526
wattrs.utf8_window_title = _("Private Key");
1528
ptwidth = 2*GIntGetResource(_NUM_Buttonsize)+GGadgetScale(60);
1529
pos.width =GDrawPointsToPixels(NULL,ptwidth);
1530
pos.height = GDrawPointsToPixels(NULL,90);
1531
gw = GDrawCreateTopWindow(NULL,&pos,ask_e_h,&d,&wattrs);
1533
memset(&label,0,sizeof(label));
1534
memset(&gcd,0,sizeof(gcd));
1536
label[0].text = (unichar_t *) _("Key (in Private dictionary)");
1537
label[0].text_is_1byte = true;
1538
gcd[0].gd.label = &label[0];
1539
gcd[0].gd.pos.x = 10; gcd[0].gd.pos.y = 6;
1540
gcd[0].gd.flags = gg_visible | gg_enabled;
1541
gcd[0].creator = GLabelCreate;
1542
varray[0] = &gcd[0]; varray[1] = NULL;
1544
gcd[1].gd.pos.x = 10; gcd[1].gd.pos.y = 18; gcd[1].gd.pos.width = ptwidth-20;
1545
gcd[1].gd.flags = gg_visible | gg_enabled;
1546
gcd[1].creator = GTextFieldCreate;
1548
gcd[1].gd.u.list = ti;
1549
gcd[1].creator = GListFieldCreate;
1551
varray[2] = &gcd[1]; varray[3] = NULL;
1552
varray[4] = GCD_Glue; varray[5] = NULL;
1554
gcd[2].gd.pos.x = 20-3; gcd[2].gd.pos.y = 90-35-3;
1555
gcd[2].gd.pos.width = -1; gcd[2].gd.pos.height = 0;
1556
gcd[2].gd.flags = gg_visible | gg_enabled | gg_but_default;
1557
label[2].text = (unichar_t *) _("_OK");
1558
label[2].text_is_1byte = true;
1559
label[2].text_in_resource = true;
1560
gcd[2].gd.label = &label[2];
1561
gcd[2].gd.handle_controlevent = Ask_OK;
1562
gcd[2].creator = GButtonCreate;
1563
harray[0] = GCD_Glue; harray[1] = &gcd[2]; harray[2] = GCD_Glue;
1565
gcd[3].gd.pos.x = -20; gcd[3].gd.pos.y = 90-35;
1566
gcd[3].gd.pos.width = -1; gcd[3].gd.pos.height = 0;
1567
gcd[3].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
1568
label[3].text = (unichar_t *) _("_Cancel");
1569
label[3].text_is_1byte = true;
1570
label[3].text_in_resource = true;
1571
gcd[3].gd.label = &label[3];
1572
gcd[3].gd.handle_controlevent = Ask_Cancel;
1573
gcd[3].creator = GButtonCreate;
1574
harray[3] = GCD_Glue; harray[4] = &gcd[3]; harray[5] = GCD_Glue;
1576
varray[6] = &boxes[2]; varray[7] = NULL;
1579
gcd[4].gd.pos.x = 2; gcd[4].gd.pos.y = 2;
1580
gcd[4].gd.pos.width = pos.width-4; gcd[4].gd.pos.height = pos.height-2;
1581
gcd[4].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
1582
gcd[4].creator = GGroupCreate;
1584
memset(boxes,0,sizeof(boxes));
1585
boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
1586
boxes[0].gd.flags = gg_enabled|gg_visible;
1587
boxes[0].gd.u.boxelements = varray;
1588
boxes[0].creator = GHVGroupCreate;
1590
boxes[2].gd.flags = gg_enabled|gg_visible;
1591
boxes[2].gd.u.boxelements = harray;
1592
boxes[2].creator = GHBoxCreate;
1594
GGadgetsCreate(gw,boxes);
1595
GHVBoxSetExpandableRow(boxes[0].ret,gb_expandglue);
1596
GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
1597
GHVBoxFitWindow(boxes[0].ret);
1598
GWidgetHidePalettes();
1599
GDrawSetVisible(gw,true);
1601
GDrawProcessOneEvent(NULL);
1604
ret = cu_copy(_GGadgetGetTitle(gcd[1].ret));
1605
GTextInfoListFree(ti);
1606
GDrawDestroyWindow(gw);
1610
static GTextInfo *PI_ListSet(SplineFont *sf) {
1611
GTextInfo *ti = gcalloc((sf->private==NULL?0:sf->private->next)+1,sizeof( GTextInfo ));
1614
if ( sf->private!=NULL ) {
1615
for ( i=0; i<sf->private->next; ++i ) {
1616
ti[i].text = uc_copy(sf->private->keys[i]);
1620
ti[0].selected = true;
1624
static GTextInfo **PI_ListArray(struct psdict *private) {
1625
GTextInfo **ti = gcalloc((private==NULL?0:private->next)+1,sizeof( GTextInfo *));
1628
if ( private!=NULL ) {
1629
for ( i=0; i<private->next; ++i ) {
1630
ti[i] = gcalloc(1,sizeof(GTextInfo));
1631
ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
1632
ti[i]->text = uc_copy(private->keys[i]);
1635
ti[i] = gcalloc(1,sizeof(GTextInfo));
1637
ti[0]->selected = true;
1641
static void PIPrivateCheck(struct gfi_data *d) {
1642
if ( d->private==NULL ) {
1643
if ( d->sf->private==NULL ) {
1644
d->private = gcalloc(1,sizeof(struct psdict));
1645
d->private->cnt = 10;
1646
d->private->keys = gcalloc(10,sizeof(char *));
1647
d->private->values = gcalloc(10,sizeof(char *));
1649
d->private = PSDictCopy(d->sf->private);
1653
static int PIFinishFormer(struct gfi_data *d) {
1655
#if defined(FONTFORGE_CONFIG_GDRAW)
1657
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
1658
#elif defined(FONTFORGE_CONFIG_GTK)
1659
static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
1662
if ( d->old_sel < 0 )
1664
if ( d->private==NULL && d->sf->private!=NULL ) {
1665
const unichar_t *val = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_PrivateValues));
1666
if ( uc_strcmp(val,d->sf->private->values[d->old_sel])==0 )
1667
return( true ); /* Didn't change */
1670
if ( d->private!=NULL && d->old_sel>=0 && d->old_sel!=d->private->next ) {
1671
const unichar_t *val = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_PrivateValues));
1672
const unichar_t *pt = val;
1675
/* does the type appear reasonable? */
1676
while ( isspace(*pt)) ++pt;
1677
for ( i=0; KnownPrivates[i].name!=NULL; ++i )
1678
if ( strcmp(KnownPrivates[i].name,d->private->keys[d->old_sel])==0 )
1680
if ( KnownPrivates[i].name!=NULL ) {
1681
if ( KnownPrivates[i].type==pt_array ) {
1682
if ( *pt!='[' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected array.\nProceed anyway?"))==1 )
1684
} else if ( KnownPrivates[i].type==pt_boolean ) {
1685
if ( uc_strcmp(pt,"true")!=0 && uc_strcmp(pt,"false")!=0 &&
1686
gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected boolean.\nProceed anyway?"))==1 )
1688
} else if ( KnownPrivates[i].type==pt_code ) {
1689
if ( *pt!='{' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected code.\nProceed anyway?"))==1 )
1691
} else if ( KnownPrivates[i].type==pt_number ) {
1693
while ( isspace(*end)) ++end;
1694
if ( *end!='\0' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected number.\nProceed anyway?"))==1 )
1699
/* Ok then set it */
1700
free(d->private->values[d->old_sel]);
1701
d->private->values[d->old_sel] = cu_copy(val);
1707
static void ProcessListSel(struct gfi_data *d) {
1708
GGadget *list = GWidgetGetControl(d->gw,CID_PrivateEntries);
1709
int sel = GGadgetGetFirstListSelectedItem(list);
1711
static const unichar_t nullstr[] = { 0 };
1712
SplineFont *sf = d->sf;
1713
struct psdict *private;
1715
if ( d->old_sel==sel )
1718
if ( !PIFinishFormer(d)) {
1719
/*GGadgetSelectListItem(list,sel,false);*/
1720
GGadgetSelectListItem(list,d->old_sel,true);
1723
private = d->private ? d->private : sf->private;
1725
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Remove),false);
1726
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),false);
1727
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),false);
1728
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PrivateValues),false);
1729
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),nullstr);
1731
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Remove),true);
1732
if ( strcmp(private->keys[sel],"BlueValues")==0 ||
1733
strcmp(private->keys[sel],"OtherBlues")==0 ||
1734
strcmp(private->keys[sel],"StdHW")==0 ||
1735
strcmp(private->keys[sel],"StemSnapH")==0 ||
1736
strcmp(private->keys[sel],"StdVW")==0 ||
1737
strcmp(private->keys[sel],"StemSnapV")==0 ) {
1738
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),true);
1739
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),true);
1741
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),false);
1742
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),false);
1744
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PrivateValues),true);
1745
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
1746
temp = uc_copy( private->values[sel]));
1748
GTextFieldShow(GWidgetGetControl(d->gw,CID_PrivateValues),0);
1753
static int PI_Add(GGadget *g, GEvent *e) {
1761
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1762
gw = GGadgetGetWindow(g);
1763
d = GDrawGetUserData(gw);
1764
if ( !PIFinishFormer(d))
1766
newkey = AskKey(d->sf);
1770
if (( i = PSDictFindEntry(d->private,newkey))==-1 )
1771
i = PSDictChangeEntry(d->private,newkey,"");
1772
list = GWidgetGetControl(d->gw,CID_PrivateEntries);
1773
ti = PI_ListArray(d->private);
1775
ti[0]->selected = false;
1776
ti[i]->selected = true;
1778
GGadgetSetList(list,ti,false);
1786
static void arraystring(char *buffer,real *array,int cnt) {
1789
for ( ei=cnt; ei>1 && array[ei-1]==0; --ei );
1791
for ( i=0; i<ei; ++i ) {
1792
sprintf(buffer, "%d ", (int) array[i]);
1793
buffer += strlen(buffer);
1795
if ( buffer[-1] ==' ' ) --buffer;
1796
*buffer++ = ']'; *buffer='\0';
1799
static void SnapSet(struct psdict *private,real stemsnap[12], real snapcnt[12],
1800
char *name1, char *name2 ) {
1805
for ( i=0; stemsnap[i]!=0 && i<12; ++i )
1806
if ( mi==-1 ) mi = i;
1807
else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
1810
sprintf( buffer, "[%d]", (int) stemsnap[mi]);
1811
PSDictChangeEntry(private,name1,buffer);
1812
arraystring(buffer,stemsnap,12);
1813
PSDictChangeEntry(private,name2,buffer);
1816
static int PI_Guess(GGadget *g, GEvent *e) {
1822
real bluevalues[14], otherblues[10];
1827
struct psdict *private;
1828
#if defined(FONTFORGE_CONFIG_GDRAW)
1830
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
1831
#elif defined(FONTFORGE_CONFIG_GTK)
1832
static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
1835
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1836
gw = GGadgetGetWindow(g);
1837
d = GDrawGetUserData(gw);
1839
private = d->private ? d->private : sf->private;
1840
list = GWidgetGetControl(d->gw,CID_PrivateEntries);
1841
sel = GGadgetGetFirstListSelectedItem(list);
1842
if ( strcmp(private->keys[sel],"BlueValues")==0 ||
1843
strcmp(private->keys[sel],"OtherBlues")==0 ) {
1844
if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both BlueValues and OtherBlues.\nDo you want to continue?"))==1 )
1847
private = d->private;
1848
FindBlues(sf,bluevalues,otherblues);
1849
arraystring(buffer,bluevalues,14);
1850
PSDictChangeEntry(private,"BlueValues",buffer);
1851
if ( otherblues[0]!=0 || otherblues[1]!=0 ) {
1852
arraystring(buffer,otherblues,10);
1853
PSDictChangeEntry(private,"OtherBlues",buffer);
1855
} else if ( strcmp(private->keys[sel],"StdHW")==0 ||
1856
strcmp(private->keys[sel],"StemSnapH")==0 ) {
1857
if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both StdHW and StemSnapH.\nDo you want to continue?"))==1 )
1859
FindHStems(sf,stemsnap,snapcnt);
1861
SnapSet(d->private,stemsnap,snapcnt,"StdHW","StemSnapH");
1862
} else if ( strcmp(private->keys[sel],"StdVW")==0 ||
1863
strcmp(private->keys[sel],"StemSnapV")==0 ) {
1864
if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both StdVW and StemSnapV.\nDo you want to continue?"))==1 )
1866
FindVStems(sf,stemsnap,snapcnt);
1868
SnapSet(d->private,stemsnap,snapcnt,"StdVW","StemSnapV");
1870
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
1871
temp = uc_copy( d->private->values[sel]));
1877
static int PI_Hist(GGadget *g, GEvent *e) {
1883
struct psdict *private;
1887
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1888
gw = GGadgetGetWindow(g);
1889
d = GDrawGetUserData(gw);
1892
private = d->private ? d->private : sf->private;
1893
list = GWidgetGetControl(d->gw,CID_PrivateEntries);
1894
sel = GGadgetGetFirstListSelectedItem(list);
1895
if ( strcmp(private->keys[sel],"BlueValues")==0 ||
1896
strcmp(private->keys[sel],"OtherBlues")==0 )
1898
else if ( strcmp(private->keys[sel],"StdHW")==0 ||
1899
strcmp(private->keys[sel],"StemSnapH")==0 )
1901
else if ( strcmp(private->keys[sel],"StdVW")==0 ||
1902
strcmp(private->keys[sel],"StemSnapV")==0 )
1905
return( true ); /* can't happen */
1906
SFHistogram(sf,private,NULL,NULL,h);
1907
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
1908
temp = uc_copy( d->private->values[sel]));
1914
static int PI_Delete(GGadget *g, GEvent *e) {
1922
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
1923
gw = GGadgetGetWindow(g);
1924
d = GDrawGetUserData(gw);
1927
list = GWidgetGetControl(d->gw,CID_PrivateEntries);
1928
sel = GGadgetGetFirstListSelectedItem(list);
1929
PSDictRemoveEntry(d->private, d->private->keys[sel]);
1931
ti = PI_ListArray(d->private);
1933
if ( d->private!=NULL && sel>=d->private->next )
1934
sel = d->private->next-1;
1936
ti[0]->selected = false;
1937
ti[sel]->selected = true;
1939
GGadgetSetList(list,ti,false);
1946
static int PI_ListSel(GGadget *g, GEvent *e) {
1948
if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
1949
ProcessListSel(GDrawGetUserData(GGadgetGetWindow(g)));
1953
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
1955
/* Use URW 4 letter abbreviations */
1956
static char *knownweights[] = { "Demi", "Bold", "Regu", "Medi", "Book", "Thin",
1957
"Ligh", "Heav", "Blac", "Ultr", "Nord", "Norm", "Gras", "Stan", "Halb",
1958
"Fett", "Mage", "Mitt", "Buch", NULL };
1959
static char *realweights[] = { "Demi", "Bold", "Regular", "Medium", "Book", "Thin",
1960
"Light", "Heavy", "Black", "Ultra", "Nord", "Normal", "Gras", "Standard", "Halbfett",
1961
"Fett", "Mager", "Mittel", "Buchschrift", NULL};
1963
static char *moreweights[] = { "ExtraLight", "VeryLight", NULL };
1964
static char **noticeweights[] = { moreweights, realweights, knownweights, NULL };
1967
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
1968
static int GFI_NameChange(GGadget *g, GEvent *e) {
1969
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
1970
GWindow gw = GGadgetGetWindow(g);
1971
struct gfi_data *gfi = GDrawGetUserData(gw);
1972
const unichar_t *uname = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
1975
for ( j=0; noticeweights[j]!=NULL; ++j ) {
1976
for ( i=0; noticeweights[j][i]!=NULL; ++i ) {
1977
if ( uc_strstrmatch(uname,noticeweights[j][i])!=NULL ) {
1978
uc_strcpy(ubuf, noticeweights[j]==knownweights ?
1979
realweights[i] : noticeweights[j][i]);
1980
GGadgetSetTitle(GWidgetGetControl(gw,CID_Weight),ubuf);
1984
if ( noticeweights[j][i]!=NULL )
1987
if ( gfi->human_untitled )
1988
GGadgetSetTitle(GWidgetGetControl(gw,CID_Human),uname);
1989
if ( gfi->family_untitled ) {
1990
const unichar_t *ept = uname+u_strlen(uname); unichar_t *temp;
1991
for ( i=0; knownweights[i]!=NULL; ++i ) {
1992
if (( temp = uc_strstrmatch(uname,knownweights[i]))!=NULL && temp<ept && temp!=uname )
1995
if (( temp = uc_strstrmatch(uname,"ital"))!=NULL && temp<ept && temp!=uname )
1997
if (( temp = uc_strstrmatch(uname,"obli"))!=NULL && temp<ept && temp!=uname )
1999
if (( temp = uc_strstrmatch(uname,"kurs"))!=NULL && temp<ept && temp!=uname )
2001
if (( temp = uc_strstrmatch(uname,"slanted"))!=NULL && temp<ept && temp!=uname )
2003
if (( temp = u_strchr(uname,'-'))!=NULL && temp!=uname )
2005
temp = u_copyn(uname,ept-uname);
2006
GGadgetSetTitle(GWidgetGetControl(gw,CID_Family),temp);
2012
static int GFI_FamilyChange(GGadget *g, GEvent *e) {
2013
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2014
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2015
gfi->family_untitled = false;
2020
static int GFI_DefBaseChange(GGadget *g, GEvent *e) {
2021
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2022
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2023
GGadgetSetChecked(GWidgetGetControl(gfi->gw,*_GGadgetGetTitle(g)!='\0'?CID_HasDefBase:CID_SameAsFontname),
2029
static int GFI_HumanChange(GGadget *g, GEvent *e) {
2030
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2031
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
2032
gfi->human_untitled = false;
2037
static int GFI_VMetricsCheck(GGadget *g, GEvent *e) {
2038
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
2039
GWindow gw = GGadgetGetWindow(g);
2040
const unichar_t *vo = _GGadgetGetTitle(GWidgetGetControl(gw,CID_VOrigin));
2041
int checked = GGadgetIsChecked(g);
2042
if ( checked && *vo=='\0' ) {
2043
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2044
char space[10]; unichar_t uspace[10];
2045
sprintf( space, "%d", d->sf->ascent );
2046
uc_strcpy(uspace,space);
2047
GGadgetSetTitle(GWidgetGetControl(gw,CID_VOrigin),uspace);
2049
GGadgetSetEnabled(GWidgetGetControl(gw,CID_VOrigin),checked);
2050
GGadgetSetEnabled(GWidgetGetControl(gw,CID_VOriginLab),checked);
2051
GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGap),checked);
2052
GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGapLab),checked);
2057
static int GFI_EmChanged(GGadget *g, GEvent *e) {
2058
if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
2059
char buf[20]; unichar_t ubuf[20];
2060
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2061
const unichar_t *ret = _GGadgetGetTitle(g); unichar_t *end;
2062
int val = u_strtol(ret,&end,10), ascent, descent;
2065
switch ( GGadgetGetCid(g)) {
2067
ascent = rint( ((double) val)*d->sf->ascent/(d->sf->ascent+d->sf->descent) );
2068
descent = val - ascent;
2072
ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
2073
descent = u_strtol(ret,&end,10);
2079
ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
2080
ascent = u_strtol(ret,&end,10);
2085
sprintf( buf, "%d", ascent ); if ( ascent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2086
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Ascent),ubuf);
2087
sprintf( buf, "%d", descent ); if ( descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2088
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Descent),ubuf);
2089
sprintf( buf, "%d", ascent+descent ); if ( ascent+descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
2090
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Em),ubuf);
2095
static int GFI_GuessItalic(GGadget *g, GEvent *e) {
2096
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2097
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2098
double val = SFGuessItalicAngle(d->sf);
2099
char buf[30]; unichar_t ubuf[30];
2100
sprintf( buf, "%.1f", val);
2101
uc_strcpy(ubuf,buf);
2102
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_ItalicAngle),ubuf);
2107
static void MCD_Close(struct markclassdlg *mcd);
2109
static void GFI_Close(struct gfi_data *d) {
2111
SplineFont *sf = d->sf;
2120
PSDictFree(d->private);
2122
GDrawDestroyWindow(d->gw);
2123
if ( d->sf->fontinfo == d )
2124
d->sf->fontinfo = NULL;
2125
for ( fvs = d->sf->fv; fvs!=NULL; fvs = fvs->nextsame ) {
2126
GDrawRequestExpose(sf->fv->v,NULL,false);
2129
/* d will be freed by destroy event */;
2132
static void GFI_CancelClose(struct gfi_data *d) {
2135
MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(
2136
d->gw,CID_Features))));
2137
MarkClassFree(d->mark_class_cnt,d->mark_classes,d->mark_class_names);
2138
for ( isgpos=0; isgpos<2; ++isgpos ) {
2139
struct lkdata *lk = &d->tables[isgpos];
2140
for ( i=0; i<lk->cnt; ++i ) {
2141
if ( lk->all[i].new )
2142
SFRemoveLookup(d->sf,lk->all[i].lookup);
2143
else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
2144
if ( lk->all[i].subtables[j].new )
2145
SFRemoveLookupSubTable(d->sf,lk->all[i].subtables[j].subtable);
2147
free(lk->all[i].subtables);
2154
static GTextInfo *MarkClassesList(SplineFont *sf) {
2158
if ( sf->mark_class_cnt==0 )
2161
ti = gcalloc(sf->mark_class_cnt+1,sizeof(GTextInfo));
2162
for ( cnt=1; cnt<sf->mark_class_cnt; ++cnt ) {
2163
ti[cnt-1].text = uc_copy(sf->mark_class_names[cnt]);
2164
ti[cnt-1].fg = ti[cnt-1].bg = COLOR_DEFAULT;
2169
#define CID_MCD_Name 1001
2170
#define CID_MCD_Set 1002
2171
#define CID_MCD_Select 1003
2172
#define CID_MCD_GlyphList 1004
2174
#define MCD_Width 250
2175
#define MCD_Height 210
2177
typedef struct markclassdlg {
2184
static void MCD_Close(MarkClassDlg *mcd) {
2186
GDrawDestroyWindow(mcd->gw);
2190
static void MCD_DoCancel(MarkClassDlg *mcd) {
2194
static int MCD_Cancel(GGadget *g, GEvent *e) {
2195
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2196
MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
2202
static int MCD_InvalidClassList(const char *ret,char **classes, char **names,
2203
int nclass, int which) {
2204
const char *pt, *end;
2208
for ( pt = ret; *pt; pt = end ) {
2209
while ( *pt==' ' ) ++pt;
2212
end = strchr(pt,' ');
2213
if ( end==NULL ) end = pt+strlen(pt);
2214
for ( i=1; (i < nclass) && (classes[i]!=NULL); ++i ) {
2217
for ( tpt=classes[i]; *tpt; tpt = tend ) {
2218
while ( *tpt==' ' ) ++tpt;
2219
tend = strchr(tpt,' ');
2220
if ( tend==NULL ) tend = tpt+strlen(tpt);
2221
if ( tend-tpt==end-pt && strncmp(pt,tpt,end-pt)==0 ) {
2222
char *dupname = copyn(pt,end-pt);
2223
gwwv_post_error(_("Bad Class"),_("No glyphs from another class may appear here, but %.30s appears here and in class %.30s"), dupname, names[i]);
2233
static int MCD_OK(GGadget *g, GEvent *e) {
2238
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2239
MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
2240
newname = GGadgetGetTitle8(GWidgetGetControl(mcd->gw,CID_MCD_Name));
2241
glyphs = GGadgetGetTitle8(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList));
2244
if ( !CCD_NameListCheck(d->sf,glyphs,true,_("Bad Class")) ||
2245
MCD_InvalidClassList(glyphs,d->mark_classes,d->mark_class_names,
2246
d->mark_class_cnt,mcd->which )) {
2247
free(newname); free(glyphs);
2251
if ( mcd->which==-1 ) { /* New */
2253
if ( d->mark_class_cnt==0 ) {
2254
d->mark_class_cnt = 2; /* Class 0 is magic */
2255
d->mark_classes = gcalloc(2,sizeof(char *));
2256
d->mark_class_names = gcalloc(2,sizeof(unichar_t *));
2258
++d->mark_class_cnt;
2259
d->mark_classes = grealloc(d->mark_classes,d->mark_class_cnt*sizeof(char*));
2260
d->mark_class_names = grealloc(d->mark_class_names,d->mark_class_cnt*sizeof(unichar_t*));
2262
d->mark_classes[d->mark_class_cnt-1] = copy(glyphs);
2263
d->mark_class_names[d->mark_class_cnt-1] = copy(newname);
2264
GListAppendLine8(mcd->list,newname,false);
2266
free(d->mark_classes[mcd->which]); d->mark_classes[mcd->which] = copy(glyphs);
2267
free(d->mark_class_names[mcd->which]); d->mark_class_names[mcd->which] = copy(newname);
2268
GListChangeLine8(mcd->list,mcd->which,newname);
2271
free(newname); free(glyphs);
2276
static int MCD_ToSelection(GGadget *g, GEvent *e) {
2277
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2278
MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
2279
const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList));
2280
SplineFont *sf = mcd->d->sf;
2281
FontView *fv = sf->fv;
2282
const unichar_t *end;
2286
GDrawSetVisible(fv->gw,true);
2288
memset(fv->selected,0,fv->map->enccount);
2290
end = u_strchr(ret,' ');
2291
if ( end==NULL ) end = ret+u_strlen(ret);
2292
nm = cu_copybetween(ret,end);
2293
for ( ret = end; isspace(*ret); ++ret);
2294
if (( pos = SFFindSlot(sf,fv->map,-1,nm))!=-1 ) {
2295
if ( found==-1 ) found = pos;
2297
fv->selected[pos] = true;
2303
FVScrollToChar(fv,found);
2304
GDrawRequestExpose(fv->v,NULL,false);
2309
static int MCD_FromSelection(GGadget *g, GEvent *e) {
2310
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2311
MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
2312
SplineFont *sf = mcd->d->sf;
2313
FontView *fv = sf->fv;
2314
unichar_t *vals, *pt;
2315
int i, len, max, gid;
2316
SplineChar *sc, dummy;
2318
for ( i=len=max=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
2319
gid = fv->map->map[i];
2320
if ( gid!=-1 && sf->glyphs[gid]!=NULL )
2321
sc = sf->glyphs[gid];
2323
sc = SCBuildDummy(&dummy,sf,fv->map,i);
2324
len += strlen(sc->name)+1;
2325
if ( fv->selected[i]>max ) max = fv->selected[i];
2327
pt = vals = galloc((len+1)*sizeof(unichar_t));
2329
/* in a class the order of selection is irrelevant */
2330
for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
2331
gid = fv->map->map[i];
2332
if ( gid!=-1 && sf->glyphs[gid]!=NULL )
2333
sc = sf->glyphs[gid];
2335
sc = SCBuildDummy(&dummy,sf,fv->map,i);
2336
uc_strcpy(pt,sc->name);
2340
if ( pt>vals ) pt[-1]='\0';
2342
GGadgetSetTitle(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList),vals);
2348
void DropChars2Text(GWindow gw, GGadget *glyphs,GEvent *event) {
2350
const unichar_t *old;
2354
if ( !GDrawSelectionHasType(gw,sn_drag_and_drop,"STRING"))
2356
cnames = GDrawRequestSelection(gw,sn_drag_and_drop,"STRING",&len);
2360
old = _GGadgetGetTitle(glyphs);
2361
if ( old==NULL || *old=='\0' ) {
2362
new = uc_copy(cnames);
2364
new = galloc(strlen(cnames)+u_strlen(old)+5);
2366
if ( new[u_strlen(new)-1]!=' ' )
2368
uc_strcat(new,cnames);
2370
GGadgetSetTitle(glyphs,new);
2375
static void MCD_Drop(MarkClassDlg *mcd,GEvent *event) {
2376
DropChars2Text(mcd->gw,GWidgetGetControl(mcd->gw,CID_MCD_GlyphList),event);
2379
static int mcd_e_h(GWindow gw, GEvent *event) {
2380
MarkClassDlg *mcd = GDrawGetUserData(gw);
2382
switch ( event->type ) {
2387
if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
2388
help("fontinfo.html#MarkClass");
2394
MCD_Drop(mcd,event);
2400
static void CreateMarkClassDlg(struct gfi_data *d, GGadget *list, int which) {
2404
GWindowAttrs wattrs;
2405
GGadgetCreateData gcd[10];
2406
GTextInfo label[10];
2408
unichar_t *freeme = NULL;
2410
if ( d->mcd!=NULL ) {
2411
GDrawSetVisible(d->mcd->gw,true);
2412
GDrawRaise(d->mcd->gw);
2416
memset(&wattrs,0,sizeof(wattrs));
2417
memset(&gcd,0,sizeof(gcd));
2418
memset(&label,0,sizeof(label));
2420
mcd = gcalloc(1,sizeof(MarkClassDlg));
2421
mcd->d = d; mcd->list = list; mcd->which = which;
2423
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
2424
wattrs.event_masks = ~(1<<et_charup);
2425
wattrs.restrict_input_to_me = false;
2426
wattrs.undercursor = 1;
2427
wattrs.cursor = ct_pointer;
2428
wattrs.utf8_window_title = _("Mark Classes");
2429
wattrs.is_dlg = false;
2431
pos.width = GGadgetScale(GDrawPointsToPixels(NULL,MCD_Width));
2432
pos.height = GDrawPointsToPixels(NULL,MCD_Height);
2433
mcd->gw = gw = GDrawCreateTopWindow(NULL,&pos,mcd_e_h,mcd,&wattrs);
2437
label[k].text = (unichar_t *) _("Class Name:");
2438
label[k].text_is_1byte = true;
2439
gcd[k].gd.label = &label[k];
2440
gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = 10;
2441
gcd[k].gd.flags = gg_visible | gg_enabled;
2442
gcd[k++].creator = GLabelCreate;
2445
gcd[k].gd.label = &label[k];
2446
label[k].text = (unichar_t *) d->mark_class_names[which];
2447
label[k].text_is_1byte = true;
2449
gcd[k].gd.pos.x = 70; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
2450
gcd[k].gd.flags = gg_visible | gg_enabled;
2451
gcd[k].gd.cid = CID_MCD_Name;
2452
gcd[k++].creator = GTextFieldCreate;
2454
label[k].text = (unichar_t *) _("Set From Font");
2455
label[k].text_is_1byte = true;
2456
gcd[k].gd.label = &label[k];
2457
gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+28;
2458
gcd[k].gd.popup_msg = (unichar_t *) _("Set this glyph list to be the glyphs selected in the fontview");
2459
gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
2460
gcd[k].gd.handle_controlevent = MCD_FromSelection;
2461
gcd[k].gd.cid = CID_MCD_Set;
2462
gcd[k++].creator = GButtonCreate;
2464
label[k].text = (unichar_t *) _("Select In Font");
2465
label[k].text_is_1byte = true;
2466
gcd[k].gd.label = &label[k];
2467
gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
2468
gcd[k].gd.popup_msg = (unichar_t *) _("Set the fontview's selection to be the glyphs named here");
2469
gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
2470
gcd[k].gd.handle_controlevent = MCD_ToSelection;
2471
gcd[k].gd.cid = CID_MCD_Select;
2472
gcd[k++].creator = GButtonCreate;
2475
gcd[k].gd.label = &label[k];
2476
label[k].text = freeme = uc_copy(d->mark_classes[which]);
2478
gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
2479
gcd[k].gd.pos.width = MCD_Width-20; gcd[k].gd.pos.height = 8*13+4;
2480
gcd[k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap; /* Just ASCII text for glyph names, no need for xim */
2481
gcd[k].gd.cid = CID_MCD_GlyphList;
2482
gcd[k++].creator = GTextAreaCreate;
2484
label[k].text = (unichar_t *) _("_OK");
2485
label[k].text_is_1byte = true;
2486
label[k].text_in_resource = true;
2487
gcd[k].gd.label = &label[k];
2488
gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = MCD_Height-30-3;
2489
gcd[k].gd.pos.width = -1;
2490
gcd[k].gd.flags = gg_visible|gg_enabled | gg_but_default;
2491
gcd[k].gd.handle_controlevent = MCD_OK;
2492
gcd[k++].creator = GButtonCreate;
2494
label[k].text = (unichar_t *) _("_Cancel");
2495
label[k].text_is_1byte = true;
2496
label[k].text_in_resource = true;
2497
gcd[k].gd.label = &label[k];
2498
gcd[k].gd.pos.x = -30+3; gcd[k].gd.pos.y = MCD_Height-30;
2499
gcd[k].gd.pos.width = -1;
2500
gcd[k].gd.flags = gg_visible|gg_enabled | gg_but_cancel;
2501
gcd[k].gd.handle_controlevent = MCD_Cancel;
2502
gcd[k++].creator = GButtonCreate;
2504
gcd[k].gd.pos.x = 2; gcd[k].gd.pos.y = 2;
2505
gcd[k].gd.pos.width = pos.width-4;
2506
gcd[k].gd.pos.height = pos.height-4;
2507
gcd[k].gd.flags = gg_visible | gg_enabled | gg_pos_in_pixels;
2508
gcd[k++].creator = GGroupCreate;
2510
GGadgetsCreate(mcd->gw,gcd);
2511
GDrawSetVisible(mcd->gw,true);
2516
static int GFI_MarkNew(GGadget *g, GEvent *e) {
2518
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2519
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2520
CreateMarkClassDlg(d, GWidgetGetControl(GGadgetGetWindow(g),CID_MarkClasses), -1);
2525
static int GFI_MarkEdit(GGadget *g, GEvent *e) {
2529
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2530
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2531
list = GWidgetGetControl(GGadgetGetWindow(g),CID_MarkClasses);
2532
if ( (i = GGadgetGetFirstListSelectedItem(list))==-1 && i+1 < d->mark_class_cnt )
2534
CreateMarkClassDlg(d, list, i+1);
2539
static int GFI_MarkSelChanged(GGadget *g, GEvent *e) {
2540
if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
2541
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2542
int sel = GGadgetGetFirstListSelectedItem(g);
2543
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MarkEdit),sel!=-1);
2544
} else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
2545
e->u.control.subtype = et_buttonactivate;
2551
static char *OtfNameToText(int lang, const char *name) {
2552
const char *langname;
2556
for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
2557
if ( mslanguages[i].userdata == (void *) (intpt) lang )
2560
for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
2561
if ( ((intpt) mslanguages[i].userdata&0xff) == (lang&0xff) )
2566
langname = (char*) (mslanguages[i].text);
2568
text = galloc((strlen(langname)+strlen(name)+4));
2571
strcat(text,langname);
2575
static GTextInfo **StyleNames(struct otfname *otfn) {
2581
for ( cnt=0, on=otfn; on!=NULL; on=on->next )
2583
tis = galloc((cnt+1)*sizeof(GTextInfo *));
2584
for ( cnt=0, on=otfn; on!=NULL; on=on->next, ++cnt ) {
2585
tis[cnt] = gcalloc(1,sizeof(GTextInfo));
2586
tis[cnt]->fg = tis[cnt]->bg = COLOR_DEFAULT;
2587
tis[cnt]->userdata = (void *) (intpt) otfn->lang;
2588
cname = OtfNameToText(on->lang,on->name);
2589
tis[cnt]->text = utf82u_copy(cname);
2592
tis[cnt] = gcalloc(1,sizeof(GTextInfo));
2596
static struct otfname *OtfNameFromStyleNames(GGadget *list) {
2598
GTextInfo **old = GGadgetGetList(list,&len);
2599
struct otfname *head=NULL, *last, *cur;
2600
unichar_t *pt, *temp;
2602
for ( i=0; i<len; ++i ) {
2603
cur = chunkalloc(sizeof(struct otfname));
2604
cur->lang = (intpt) old[i]->userdata;
2605
pt = uc_strstr(old[i]->text," | ");
2606
temp = u_copyn(old[i]->text,pt-old[i]->text);
2607
cur->name = u2utf8_copy(temp);
2618
static int sn_e_h(GWindow gw, GEvent *event) {
2620
if ( event->type==et_close ) {
2621
int *d = GDrawGetUserData(gw);
2623
} else if ( event->type == et_char ) {
2625
} else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
2626
int *d = GDrawGetUserData(gw);
2627
*d = GGadgetGetCid(event->u.control.g)+1;
2632
static void AskForLangName(GGadget *list,int sel) {
2634
GTextInfo **old = GGadgetGetList(list,&len);
2635
unichar_t *name, *pt;
2638
GGadgetCreateData gcd[7];
2642
GWindowAttrs wattrs;
2648
for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
2649
mslanguages[i].fg = mslanguages[i].bg = COLOR_DEFAULT;
2651
for ( i=0; i<len; ++i )
2652
if ( old[i]->userdata == (void *) 0x409 )
2655
for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
2656
if ( mslanguages[i].userdata == (void *) 0x409 )
2660
for ( lang_index=sizeof(mslanguages)/sizeof(mslanguages[0])-1; lang_index>=0 ; --lang_index ) {
2661
for ( i=0; i<len; ++i )
2662
if ( mslanguages[lang_index].userdata == old[i]->userdata )
2668
if ( lang_index < 0 )
2672
for ( lang_index=sizeof(mslanguages)/sizeof(mslanguages[0])-1; lang_index>=0 ; --lang_index )
2673
if ( mslanguages[lang_index].userdata == old[sel]->userdata )
2675
if ( lang_index < 0 )
2677
pt = uc_strstr(old[sel]->text," | ");
2678
name = u_copyn(old[sel]->text,pt-old[sel]->text);
2681
memset(gcd,0,sizeof(gcd));
2682
memset(label,0,sizeof(label));
2684
gcd[0].gd.pos.x = 7; gcd[0].gd.pos.y = 7;
2685
gcd[0].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic;
2686
gcd[0].gd.cid = CID_Language;
2687
gcd[0].gd.u.list = mslanguages;
2688
gcd[0].creator = GListButtonCreate;
2689
for ( i=0; mslanguages[i].text!=NULL; ++i )
2690
mslanguages[i].selected = false;
2691
mslanguages[lang_index].selected = true;
2694
label[k].text = (unichar_t *) _("_Name:");
2695
label[k].text_is_1byte = true;
2696
label[k].text_in_resource = true;
2697
gcd[k].gd.label = &label[k];
2698
gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
2699
gcd[k].gd.flags = gg_visible | gg_enabled;
2700
gcd[k++].creator = GLabelCreate;
2702
label[k].text = name;
2703
gcd[k].gd.label = &label[k];
2704
gcd[k].gd.pos.x = 50; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
2705
gcd[k].gd.pos.width = 122;
2706
gcd[k].gd.flags = gg_visible | gg_enabled;
2707
gcd[k].gd.cid = CID_StyleName;
2708
gcd[k++].creator = GTextFieldCreate;
2710
gcd[k].gd.pos.x = 25-3; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
2711
gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
2712
gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
2713
label[k].text = (unichar_t *) _("_OK");
2714
label[k].text_is_1byte = true;
2715
label[k].text_in_resource = true;
2716
gcd[k].gd.label = &label[k];
2717
gcd[k].gd.cid = true;
2718
gcd[k++].creator = GButtonCreate;
2720
gcd[k].gd.pos.x = -25; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+3;
2721
gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
2722
gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
2723
label[k].text = (unichar_t *) _("_Cancel");
2724
label[k].text_is_1byte = true;
2725
label[k].text_in_resource = true;
2726
gcd[k].gd.label = &label[k];
2727
gcd[k].gd.cid = false;
2728
gcd[k++].creator = GButtonCreate;
2730
memset(&wattrs,0,sizeof(wattrs));
2731
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
2732
wattrs.event_masks = ~(1<<et_charup);
2733
wattrs.is_dlg = true;
2734
wattrs.restrict_input_to_me = 1;
2735
wattrs.undercursor = 1;
2736
wattrs.cursor = ct_pointer;
2737
wattrs.utf8_window_title = _("Style Name:");
2739
pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
2740
pos.height = GDrawPointsToPixels(NULL,2*26+45);
2741
gw = GDrawCreateTopWindow(NULL,&pos,sn_e_h,&done,&wattrs);
2743
GGadgetsCreate(gw,gcd);
2745
ti = GGadgetGetList(gcd[0].ret,&len);
2746
for ( i=0; i<len; ++i )
2747
if ( ti[i]->userdata == mslanguages[lang_index].userdata ) {
2748
GGadgetSelectOneListItem(gcd[0].ret,i);
2751
GDrawSetVisible(gw,true);
2754
GDrawProcessOneEvent(NULL);
2757
lang_index = GGadgetGetFirstListSelectedItem(gcd[0].ret);
2758
cname = OtfNameToText((intpt) ti[lang_index]->userdata,
2759
(temp = GGadgetGetTitle8(GWidgetGetControl(gw,CID_StyleName))));
2762
GListAppendLine8(list,cname,false)->userdata =
2763
ti[lang_index]->userdata;
2765
GListChangeLine8(list,sel,cname)->userdata =
2766
ti[lang_index]->userdata;
2770
GDrawDestroyWindow(gw);
2773
static int GFI_StyleNameNew(GGadget *g, GEvent *e) {
2776
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2777
list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
2778
AskForLangName(list,-1);
2783
static int GFI_StyleNameDel(GGadget *g, GEvent *e) {
2785
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2786
list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
2787
GListDelSelected(list);
2788
GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_StyleNameDel),false);
2789
GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_StyleNameRename),false);
2794
static int GFI_StyleNameRename(GGadget *g, GEvent *e) {
2798
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2799
list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
2800
if ( (sel=GGadgetGetFirstListSelectedItem(list))==-1 )
2802
AskForLangName(list,sel);
2807
static int GFI_StyleNameSelChanged(GGadget *g, GEvent *e) {
2808
if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
2809
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2810
int sel = GGadgetGetFirstListSelectedItem(g);
2811
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_StyleNameDel),sel!=-1);
2812
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_StyleNameRename),sel!=-1);
2813
} else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
2814
e->u.control.subtype = et_buttonactivate;
2815
GFI_StyleNameRename(g,e);
2820
void GListMoveSelected(GGadget *list,int offset) {
2822
GTextInfo **old, **new;
2824
old = GGadgetGetList(list,&len);
2825
new = gcalloc(len+1,sizeof(GTextInfo *));
2826
j = (offset<0 ) ? 0 : len-1;
2827
for ( i=0; i<len; ++i ) if ( old[i]->selected ) {
2828
if ( offset==0x80000000 || offset==0x7fffffff )
2830
else if ( offset<0 ) {
2831
if ( (j= i+offset)<0 ) j=0;
2832
while ( new[j] ) ++j;
2834
if ( (j= i+offset)>=len ) j=len-1;
2835
while ( new[j] ) --j;
2837
new[j] = galloc(sizeof(GTextInfo));
2839
new[j]->text = u_copy(new[j]->text);
2840
if ( offset<0 ) ++j; else --j;
2842
for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
2843
while ( new[j] ) ++j;
2844
new[j] = galloc(sizeof(GTextInfo));
2846
new[j]->text = u_copy(new[j]->text);
2849
new[len] = gcalloc(1,sizeof(GTextInfo));
2850
GGadgetSetList(list,new,false);
2853
void GListDelSelected(GGadget *list) {
2855
GTextInfo **old, **new;
2857
old = GGadgetGetList(list,&len);
2858
new = gcalloc(len+1,sizeof(GTextInfo *));
2859
for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
2860
new[j] = galloc(sizeof(GTextInfo));
2862
new[j]->text = u_copy(new[j]->text);
2865
new[j] = gcalloc(1,sizeof(GTextInfo));
2866
GGadgetSetList(list,new,false);
2869
GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line) {
2870
GTextInfo **old, **new;
2873
old = GGadgetGetList(list,&len);
2874
new = gcalloc(len+1,sizeof(GTextInfo *));
2875
for ( i=0; i<len; ++i ) {
2876
new[i] = galloc(sizeof(GTextInfo));
2879
new[i]->text = u_copy(new[i]->text);
2881
new[i]->text = u_copy(line);
2883
new[i] = gcalloc(1,sizeof(GTextInfo));
2884
GGadgetSetList(list,new,false);
2885
GGadgetScrollListToPos(list,pos);
2889
GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select) {
2890
GTextInfo **old, **new;
2893
old = GGadgetGetList(list,&len);
2894
new = gcalloc(len+2,sizeof(GTextInfo *));
2895
for ( i=0; i<len; ++i ) {
2896
new[i] = galloc(sizeof(GTextInfo));
2898
new[i]->text = u_copy(new[i]->text);
2899
if ( select ) new[i]->selected = false;
2901
new[i] = gcalloc(1,sizeof(GTextInfo));
2902
new[i]->fg = new[i]->bg = COLOR_DEFAULT;
2903
new[i]->userdata = NULL;
2904
new[i]->text = u_copy(line);
2905
new[i]->selected = select;
2906
new[i+1] = gcalloc(1,sizeof(GTextInfo));
2907
GGadgetSetList(list,new,false);
2908
GGadgetScrollListToPos(list,i);
2912
GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line) {
2913
GTextInfo **old, **new;
2916
old = GGadgetGetList(list,&len);
2917
new = gcalloc(len+1,sizeof(GTextInfo *));
2918
for ( i=0; i<len; ++i ) {
2919
new[i] = galloc(sizeof(GTextInfo));
2922
new[i]->text = u_copy(new[i]->text);
2924
new[i]->text = utf82u_copy(line);
2926
new[i] = gcalloc(1,sizeof(GTextInfo));
2927
GGadgetSetList(list,new,false);
2928
GGadgetScrollListToPos(list,pos);
2932
GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select) {
2933
GTextInfo **old, **new;
2936
old = GGadgetGetList(list,&len);
2937
new = gcalloc(len+2,sizeof(GTextInfo *));
2938
for ( i=0; i<len; ++i ) {
2939
new[i] = galloc(sizeof(GTextInfo));
2941
new[i]->text = u_copy(new[i]->text);
2942
if ( select ) new[i]->selected = false;
2944
new[i] = gcalloc(1,sizeof(GTextInfo));
2945
new[i]->fg = new[i]->bg = COLOR_DEFAULT;
2946
new[i]->userdata = NULL;
2947
new[i]->text = utf82u_copy(line);
2948
new[i]->selected = select;
2949
new[i+1] = gcalloc(1,sizeof(GTextInfo));
2950
GGadgetSetList(list,new,false);
2951
GGadgetScrollListToPos(list,i);
2955
static int GFI_Cancel(GGadget *g, GEvent *e) {
2956
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
2957
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
2963
static int AskLoseUndoes() {
2964
#if defined(FONTFORGE_CONFIG_GDRAW)
2966
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
2967
#elif defined(FONTFORGE_CONFIG_GTK)
2968
static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
2970
return( gwwv_ask(_("Losing Undoes"),(const char **) buts,0,1,_("Changing the order of the splines in the font will lose all undoes.\nContinue anyway?")) );
2973
static void BadFamily() {
2974
gwwv_post_error(_("Bad Family Name"),_("Bad Family Name, must begin with an alphabetic character."));
2976
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
2978
static char *modifierlist[] = { "Ital", "Obli", "Kursive", "Cursive", "Slanted",
2979
"Expa", "Cond", NULL };
2980
static char *modifierlistfull[] = { "Italic", "Oblique", "Kursive", "Cursive", "Slanted",
2981
"Expanded", "Condensed", NULL };
2982
static char **mods[] = { knownweights, modifierlist, NULL };
2983
static char **fullmods[] = { realweights, modifierlistfull, NULL };
2985
char *_GetModifiers(char *fontname, char *familyname,char *weight) {
2989
/* URW fontnames don't match the familyname */
2990
/* "NimbusSanL-Regu" vs "Nimbus Sans L" (note "San" vs "Sans") */
2991
/* so look for a '-' if there is one and use that as the break point... */
2993
if ( (fpt=strchr(fontname,'-'))!=NULL ) {
2997
} else if ( familyname!=NULL ) {
2998
for ( pt = fontname, fpt=familyname; *fpt!='\0' && *pt!='\0'; ) {
2999
if ( *fpt == *pt ) {
3001
} else if ( *fpt==' ' )
3003
else if ( *pt==' ' )
3005
else if ( *fpt=='a' || *fpt=='e' || *fpt=='i' || *fpt=='o' || *fpt=='u' )
3006
++fpt; /* allow vowels to be omitted from family when in fontname */
3010
if ( *fpt=='\0' && *pt!='\0' )
3016
if ( fpt == NULL ) {
3017
for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
3018
pt = strstr(fontname,mods[i][j]);
3019
if ( pt!=NULL && (fpt==NULL || pt<fpt))
3024
for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
3025
if ( strcmp(fpt,mods[i][j])==0 )
3026
return( fullmods[i][j]);
3028
if ( strcmp(fpt,"BoldItal")==0 )
3029
return( "BoldItalic" );
3030
else if ( strcmp(fpt,"BoldObli")==0 )
3031
return( "BoldOblique" );
3036
return( weight==NULL || *weight=='\0' ? "Regular": weight );
3039
char *SFGetModifiers(SplineFont *sf) {
3040
return( _GetModifiers(sf->fontname,sf->familyname,sf->weight));
3043
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
3044
static const unichar_t *_uGetModifiers(const unichar_t *fontname, const unichar_t *familyname,
3045
const unichar_t *weight) {
3046
const unichar_t *pt, *fpt;
3047
static unichar_t regular[] = { 'R','e','g','u','l','a','r', 0 };
3048
static unichar_t space[20];
3051
/* URW fontnames don't match the familyname */
3052
/* "NimbusSanL-Regu" vs "Nimbus Sans L" (note "San" vs "Sans") */
3053
/* so look for a '-' if there is one and use that as the break point... */
3055
if ( (fpt=u_strchr(fontname,'-'))!=NULL ) {
3059
} else if ( familyname!=NULL ) {
3060
for ( pt = fontname, fpt=familyname; *fpt!='\0' && *pt!='\0'; ) {
3061
if ( *fpt == *pt ) {
3063
} else if ( *fpt==' ' )
3065
else if ( *pt==' ' )
3067
else if ( *fpt=='a' || *fpt=='e' || *fpt=='i' || *fpt=='o' || *fpt=='u' )
3068
++fpt; /* allow vowels to be omitted from family when in fontname */
3072
if ( *fpt=='\0' && *pt!='\0' )
3079
for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
3080
pt = uc_strstr(fontname,mods[i][j]);
3081
if ( pt!=NULL && (fpt==NULL || pt<fpt))
3087
for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
3088
if ( uc_strcmp(fpt,mods[i][j])==0 ) {
3089
uc_strcpy(space,fullmods[i][j]);
3093
if ( uc_strcmp(fpt,"BoldItal")==0 ) {
3094
uc_strcpy(space,"BoldItalic");
3096
} else if ( uc_strcmp(fpt,"BoldObli")==0 ) {
3097
uc_strcpy(space,"BoldOblique");
3103
return( weight==NULL || *weight=='\0' ? regular: weight );
3105
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
3107
void SFSetFontName(SplineFont *sf, char *family, char *mods,char *full) {
3111
n = galloc(strlen(family)+strlen(mods)+2);
3112
strcpy(n,family); strcat(n," "); strcat(n,mods);
3113
if ( full==NULL || *full == '\0' )
3115
for ( pt=tpt=n; *pt; ) {
3123
for ( pt=tpt=family; *pt; ) {
3132
free(sf->fullname); sf->fullname = copy(full);
3134
/* In the URW world fontnames aren't just a simple concatenation of */
3135
/* family name and modifiers, so neither the family name nor the modifiers */
3136
/* changed, then don't change the font name */
3137
if ( strcmp(family,sf->familyname)==0 && strcmp(n,sf->fontname)==0 )
3138
/* Don't change the fontname */;
3139
/* or anything else */
3141
free(sf->fontname); sf->fontname = n;
3142
free(sf->familyname); sf->familyname = copy(family);
3143
free(sf->weight); sf->weight = NULL;
3144
if ( strstrmatch(mods,"extralight")!=NULL || strstrmatch(mods,"extra-light")!=NULL )
3145
sf->weight = copy("ExtraLight");
3146
else if ( strstrmatch(mods,"demilight")!=NULL || strstrmatch(mods,"demi-light")!=NULL )
3147
sf->weight = copy("DemiLight");
3148
else if ( strstrmatch(mods,"demibold")!=NULL || strstrmatch(mods,"demi-bold")!=NULL )
3149
sf->weight = copy("DemiBold");
3150
else if ( strstrmatch(mods,"semibold")!=NULL || strstrmatch(mods,"semi-bold")!=NULL )
3151
sf->weight = copy("SemiBold");
3152
else if ( strstrmatch(mods,"demiblack")!=NULL || strstrmatch(mods,"demi-black")!=NULL )
3153
sf->weight = copy("DemiBlack");
3154
else if ( strstrmatch(mods,"extrabold")!=NULL || strstrmatch(mods,"extra-bold")!=NULL )
3155
sf->weight = copy("ExtraBold");
3156
else if ( strstrmatch(mods,"extrablack")!=NULL || strstrmatch(mods,"extra-black")!=NULL )
3157
sf->weight = copy("ExtraBlack");
3158
else if ( strstrmatch(mods,"book")!=NULL )
3159
sf->weight = copy("Book");
3160
else if ( strstrmatch(mods,"regular")!=NULL )
3161
sf->weight = copy("Regular");
3162
else if ( strstrmatch(mods,"roman")!=NULL )
3163
sf->weight = copy("Roman");
3164
else if ( strstrmatch(mods,"normal")!=NULL )
3165
sf->weight = copy("Normal");
3166
else if ( strstrmatch(mods,"demi")!=NULL )
3167
sf->weight = copy("Demi");
3168
else if ( strstrmatch(mods,"medium")!=NULL )
3169
sf->weight = copy("Medium");
3170
else if ( strstrmatch(mods,"bold")!=NULL )
3171
sf->weight = copy("Bold");
3172
else if ( strstrmatch(mods,"heavy")!=NULL )
3173
sf->weight = copy("Heavy");
3174
else if ( strstrmatch(mods,"black")!=NULL )
3175
sf->weight = copy("Black");
3176
else if ( strstrmatch(mods,"Nord")!=NULL )
3177
sf->weight = copy("Nord");
3178
/* Sigh. URW uses 4 letter abreviations... */
3179
else if ( strstrmatch(mods,"Regu")!=NULL )
3180
sf->weight = copy("Regular");
3181
else if ( strstrmatch(mods,"Medi")!=NULL )
3182
sf->weight = copy("Medium");
3183
else if ( strstrmatch(mods,"blac")!=NULL )
3184
sf->weight = copy("Black");
3186
sf->weight = copy("Medium");
3189
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
3190
if ( sf->fv!=NULL && sf->fv->gw!=NULL ) {
3193
GDrawSetWindowTitles(sf->fv->gw,temp = uc_copy(sf->fontname),NULL);
3195
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->views!=NULL ) {
3196
char buffer[300]; unichar_t ubuf[300]; CharView *cv;
3197
sprintf( buffer, "%.90s from %.90s", sf->glyphs[i]->name, sf->fontname );
3198
uc_strcpy(ubuf,buffer);
3199
for ( cv = sf->glyphs[i]->views; cv!=NULL; cv=cv->next )
3200
GDrawSetWindowTitles(cv->gw,ubuf,NULL);
3203
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
3205
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
3207
static int SetFontName(GWindow gw, SplineFont *sf) {
3208
const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
3209
const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
3210
const unichar_t *uweight = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Weight));
3211
const unichar_t *uhum = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Human));
3212
int diff = uc_strcmp(ufont,sf->fontname)!=0;
3214
free(sf->familyname);
3218
sf->familyname = cu_copy(ufamily);
3219
sf->fontname = cu_copy(ufont);
3220
sf->weight = cu_copy(uweight);
3221
sf->fullname = cu_copy(uhum);
3225
static int CheckNames(struct gfi_data *d) {
3226
const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family));
3227
const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname));
3228
unichar_t *end; const unichar_t *pt;
3229
#if defined(FONTFORGE_CONFIG_GDRAW)
3231
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
3232
#elif defined(FONTFORGE_CONFIG_GTK)
3233
static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
3236
if ( u_strlen(ufont)>63 ) {
3237
gwwv_post_error(_("Bad Font Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"));
3241
if ( *ufamily=='\0' ) {
3242
gwwv_post_error(_("A Font Family name is required"),_("A Font Family name is required"));
3245
/* A postscript name cannot be a number. There are two ways it can be a */
3246
/* number, it can be a real (which we can check for with strtod) or */
3247
/* it can be a "radix number" which is <intval>'#'<intval>. I'll only */
3248
/* do a cursory test for that */
3249
u_strtod(ufamily,&end);
3250
if ( *end=='\0' || (isdigit(ufamily[0]) && u_strchr(ufamily,'#')!=NULL) ) {
3251
gwwv_post_error(_("Bad Font Family Name"),_("A Postscript name may not be a number"));
3254
if ( u_strlen(ufamily)>31 ) {
3255
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 )
3258
if ( u_strlen(ufont)>31 ) {
3259
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 )
3261
} else if ( u_strlen(ufont)>29 ) {
3262
if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Adobe's fontname spec (5088.FontNames.pdf) says that fontnames must not be longer than 29 characters. Do you want to continue anyway?"))==1 )
3266
while ( *ufamily ) {
3267
if ( *ufamily<' ' || *ufamily>=0x7f ) {
3268
gwwv_post_error(_("Bad Font Family Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
3274
u_strtod(ufont,&end);
3275
if ( (*end=='\0' || (isdigit(ufont[0]) && u_strchr(ufont,'#')!=NULL)) &&
3277
gwwv_post_error(_("Bad Font Name"),_("A Postscript name may not be a number"));
3280
for ( pt=ufont; *pt; ++pt ) {
3281
if ( *pt<=' ' || *pt>=0x7f ||
3282
*pt=='(' || *pt=='[' || *pt=='{' || *pt=='<' ||
3283
*pt==')' || *pt==']' || *pt=='}' || *pt=='>' ||
3284
*pt=='%' || *pt=='/' ) {
3285
gwwv_post_error(_("Bad Font Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
3291
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
3293
void TTF_PSDupsDefault(SplineFont *sf) {
3294
struct ttflangname *english;
3295
char versionbuf[40];
3297
/* Ok, if we've just loaded a ttf file then we've got a bunch of langnames*/
3298
/* we copied some of them (copyright, family, fullname, etc) into equiv */
3299
/* postscript entries in the sf. If we then use FontInfo and change the */
3300
/* obvious postscript entries we are left with the old ttf entries. If */
3301
/* we generate a ttf file and then load it the old values pop up. */
3302
/* Solution: Anything we can generate by default should be set to NULL */
3303
for ( english=sf->names; english!=NULL && english->lang!=0x409; english=english->next );
3304
if ( english==NULL )
3306
if ( english->names[ttf_family]!=NULL &&
3307
strcmp(english->names[ttf_family],sf->familyname)==0 ) {
3308
free(english->names[ttf_family]);
3309
english->names[ttf_family]=NULL;
3311
if ( english->names[ttf_copyright]!=NULL &&
3312
strcmp(english->names[ttf_copyright],sf->copyright)==0 ) {
3313
free(english->names[ttf_copyright]);
3314
english->names[ttf_copyright]=NULL;
3316
if ( english->names[ttf_fullname]!=NULL &&
3317
strcmp(english->names[ttf_fullname],sf->fullname)==0 ) {
3318
free(english->names[ttf_fullname]);
3319
english->names[ttf_fullname]=NULL;
3321
if ( sf->subfontcnt!=0 || sf->version!=NULL ) {
3322
if ( sf->subfontcnt!=0 )
3323
sprintf( versionbuf, "Version %f", sf->cidversion );
3325
sprintf(versionbuf,"Version %.20s ", sf->version);
3326
if ( english->names[ttf_version]!=NULL &&
3327
strcmp(english->names[ttf_version],versionbuf)==0 ) {
3328
free(english->names[ttf_version]);
3329
english->names[ttf_version]=NULL;
3332
if ( english->names[ttf_subfamily]!=NULL &&
3333
strcmp(english->names[ttf_subfamily],SFGetModifiers(sf))==0 ) {
3334
free(english->names[ttf_subfamily]);
3335
english->names[ttf_subfamily]=NULL;
3338
/* User should not be allowed any access to this one, not ever */
3339
free(english->names[ttf_postscriptname]);
3340
english->names[ttf_postscriptname]=NULL;
3343
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
3344
static int ttfspecials[] = { ttf_copyright, ttf_family, ttf_fullname,
3345
ttf_subfamily, ttf_version, -1 };
3347
static char *tn_recalculatedef(struct gfi_data *d,int cur_id) {
3348
char versionbuf[40], *v;
3352
return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Notice)));
3354
return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Family)));
3356
return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Human)));
3358
return( u2utf8_copy(_uGetModifiers(
3359
_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)),
3360
_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family)),
3361
_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Weight)))));
3363
sprintf(versionbuf,_("Version %.20s"),
3364
v=GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Version)));
3366
return( copy(versionbuf));
3372
static char *TN_DefaultName(GGadget *g, int r, int c) {
3373
struct gfi_data *d = GGadgetGetUserData(g);
3375
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3377
if ( strings==NULL || !strings[3*r+2].user_bits )
3380
return( tn_recalculatedef(d,strings[3*r+1].u.md_ival ));
3383
static const char *langname(int lang,char *buffer) {
3385
for ( i=0; mslanguages[i].text!=NULL; ++i )
3386
if ( mslanguages[i].userdata == (void *) (intpt) lang )
3387
return( (char *) mslanguages[i].text );
3389
sprintf( buffer, "%04X", lang );
3393
static int strid_sorter(const void *pt1, const void *pt2) {
3394
const struct matrix_data *n1 = pt1, *n2 = pt2;
3395
char buf1[20], buf2[20];
3396
const char *l1, *l2;
3398
if ( n1[1].u.md_ival!=n2[1].u.md_ival )
3399
return( n1[1].u.md_ival - n2[1].u.md_ival );
3401
l1 = langname(n1[0].u.md_ival,buf1);
3402
l2 = langname(n2[0].u.md_ival,buf2);
3403
return( strcoll(l1,l2));
3406
static int lang_sorter(const void *pt1, const void *pt2) {
3407
const struct matrix_data *n1 = pt1, *n2 = pt2;
3408
char buf1[20], buf2[20];
3409
const char *l1, *l2;
3411
if ( n1[0].u.md_ival==n2[0].u.md_ival )
3412
return( n1[1].u.md_ival - n2[1].u.md_ival );
3414
l1 = langname(n1[0].u.md_ival,buf1);
3415
l2 = langname(n2[0].u.md_ival,buf2);
3416
return( strcoll(l1,l2));
3419
static int ms_thislocale = 0;
3420
static int specialvals(const struct matrix_data *n) {
3421
if ( n[0].u.md_ival == ms_thislocale )
3422
return( -10000000 );
3423
else if ( (n[0].u.md_ival&0x3ff) == (ms_thislocale&0x3ff) )
3424
return( -10000000 + (n[0].u.md_ival&~0x3ff) );
3425
if ( n[0].u.md_ival == 0x409 ) /* English */
3427
else if ( (n[0].u.md_ival&0x3ff) == 9 )
3428
return( -1000000 + (n[0].u.md_ival&~0x3ff) );
3433
static int speciallang_sorter(const void *pt1, const void *pt2) {
3434
const struct matrix_data *n1 = pt1, *n2 = pt2;
3435
char buf1[20], buf2[20];
3436
const char *l1, *l2;
3439
/* sort so that entries for the current language are first, then English */
3440
/* then alphabetical order */
3441
if ( n1[0].u.md_ival==n2[0].u.md_ival )
3442
return( n1[1].u.md_ival - n2[1].u.md_ival );
3444
pos1 = specialvals(n1); pos2 = specialvals(n2);
3445
if ( pos1<0 || pos2<0 )
3446
return( pos1-pos2 );
3447
l1 = langname(n1[0].u.md_ival,buf1);
3448
l2 = langname(n2[0].u.md_ival,buf2);
3449
return( strcoll(l1,l2));
3452
static void TTFNames_Resort(struct gfi_data *d) {
3453
int(*compar)(const void *, const void *);
3454
GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
3456
struct matrix_data *strings = GMatrixEditGet(edit, &rows);
3458
if ( strings==NULL )
3461
if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNLangSort)) )
3462
compar = lang_sorter;
3463
else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNStringSort)) )
3464
compar = strid_sorter;
3466
compar = speciallang_sorter;
3467
ms_thislocale = d->langlocalecode;
3468
qsort(strings,rows,3*sizeof(struct matrix_data),compar);
3471
static void DefaultLanguage(struct gfi_data *d) {
3472
const char *lang=NULL;
3474
static char *envs[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
3475
char langcountry[8], language[4];
3476
int langcode, langlocalecode;
3478
for ( i=0; envs[i]!=NULL; ++i ) {
3479
lang = getenv(envs[i]);
3481
langlen = strlen(lang);
3482
if (( langlen>5 && lang[5]=='.' && lang[2]=='_' ) ||
3483
(langlen==5 && lang[2]=='_' ) ||
3485
(langlen==3)) /* Some obscure languages have a 3 letter code */
3486
/* I understand this language */
3492
strncpy(langcountry,lang,5); langcountry[5] = '\0';
3493
strncpy(language,lang,3); language[3] = '\0';
3494
if ( language[2]=='_' ) language[2] = '\0';
3495
langlen = strlen(language);
3497
langcode = langlocalecode = -1;
3498
for ( i=0; ms_2_locals[i].loc_name!=NULL; ++i ) {
3499
if ( strmatch(langcountry,ms_2_locals[i].loc_name)==0 ) {
3500
langlocalecode = ms_2_locals[i].local_id;
3501
langcode = langlocalecode&0x3ff;
3503
} else if ( strncmp(language,ms_2_locals[i].loc_name,langlen)==0 )
3504
langcode = ms_2_locals[i].local_id&0x3ff;
3506
if ( langcode==-1 ) /* Default to English */
3508
d->langlocalecode = langlocalecode==-1 ? (langcode|0x400) : langlocalecode;
3511
static int GFI_Char(struct gfi_data *d,GEvent *event) {
3512
if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
3513
help("fontinfo.html");
3515
} else if ( event->u.chr.keysym=='s' &&
3516
(event->u.chr.state&ksm_control) &&
3517
(event->u.chr.state&ksm_meta) ) {
3518
MenuSaveAll(NULL,NULL,NULL);
3520
} else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
3521
if ( event->u.chr.state&ksm_shift ) {
3524
MenuExit(NULL,NULL,NULL);
3530
static int CheckActiveStyleTranslation(struct gfi_data *d,
3531
struct matrix_data *strings,int r, int rows) {
3532
int i,j, eng_pos, other_pos;
3533
char *english, *new=NULL, *temp, *pt;
3534
int other_lang = strings[3*r].u.md_ival;
3535
int changed = false;
3537
for ( i=rows-1; i>=0 ; --i )
3538
if ( strings[3*i+1].u.md_ival==ttf_subfamily &&
3539
strings[3*i].u.md_ival == 0x409 )
3541
if ( i<0 || (english = strings[3*i+2].u.md_str)==NULL )
3542
new = tn_recalculatedef(d,ttf_subfamily);
3544
new = copy(english);
3545
for ( i=0; stylelist[i]!=NULL; ++i ) {
3546
eng_pos = other_pos = -1;
3547
for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
3548
if ( stylelist[i][j].lang == other_lang ) {
3553
if ( other_pos==-1 )
3555
for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
3556
if ( stylelist[i][j].lang == 0x409 &&
3557
(pt = strstrmatch(new,stylelist[i][j].str))!=NULL ) {
3558
if ( pt==new && strlen(stylelist[i][j].str)==strlen(new) ) {
3560
free(strings[3*r+2].u.md_str);
3561
if ( other_lang==0x415 ) {
3562
/* polish needs a word before the translation */
3563
strings[3*r+2].u.md_str = galloc(strlen("odmiana ")+strlen(stylelist[i][other_pos].str)+1);
3564
strcpy(strings[3*r+2].u.md_str,"odmiana ");
3565
strcat(strings[3*r+2].u.md_str,stylelist[i][other_pos].str);
3567
strings[3*r+2].u.md_str = copy(stylelist[i][other_pos].str);
3570
temp = galloc((strlen(new)
3571
+ strlen(stylelist[i][other_pos].str)
3572
- strlen(stylelist[i][j].str)
3574
strncpy(temp,new,pt-new);
3575
strcpy(temp+(pt-new),stylelist[i][other_pos].str);
3576
strcat(temp+(pt-new),pt+strlen(stylelist[i][j].str));
3585
free(strings[3*r+2].u.md_str);
3586
if ( other_lang==0x415 ) {
3587
/* polish needs a word before the translation */
3588
strings[3*r+2].u.md_str = galloc(strlen("odmiana ")+strlen(new)+1);
3589
strcpy(strings[3*r+2].u.md_str,"odmiana ");
3590
strcat(strings[3*r+2].u.md_str,new);
3593
strings[3*r+2].u.md_str = new;
3599
#define MID_ToggleBase 1
3600
#define MID_MultiEdit 2
3601
#define MID_Delete 3
3603
static void TN_StrPopupDispatch(GWindow gw, GMenuItem *mi, GEvent *e) {
3604
struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(gw));
3605
GGadget *g = GWidgetGetControl(d->gw,CID_TNames);
3607
switch ( mi->mid ) {
3608
case MID_ToggleBase: {
3610
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3611
strings[3*d->tn_active+2].frozen = !strings[3*d->tn_active+2].frozen;
3612
if ( strings[3*d->tn_active+2].frozen ) {
3613
free( strings[3*d->tn_active+2].u.md_str );
3614
strings[3*d->tn_active+2].u.md_str = NULL;
3616
strings[3*d->tn_active+2].u.md_str = tn_recalculatedef(d,strings[3*d->tn_active+1].u.md_ival);
3621
GMatrixEditStringDlg(g,d->tn_active,2);
3624
GMatrixEditDeleteRow(g,d->tn_active);
3629
static int menusort(const void *m1, const void *m2) {
3630
const GMenuItem *mi1 = m1, *mi2 = m2;
3632
/* Should do a strcoll here, but I never wrote one */
3633
if ( mi1->ti.text_is_1byte && mi2->ti.text_is_1byte )
3634
return( strcoll( (char *) (mi1->ti.text), (char *) (mi2->ti.text)) );
3636
return( u_strcmp(mi1->ti.text,mi2->ti.text));
3639
static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c) {
3641
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3643
for ( i=0; mi[i].ti.text!=NULL; ++i ) {
3644
int strid = (intpt) mi[i].ti.userdata;
3645
for ( j=0; j<rows; ++j ) if ( j!=r )
3646
if ( strings[3*j].u.md_ival == strings[3*r].u.md_ival &&
3647
strings[3*j+1].u.md_ival == strid ) {
3648
mi[i].ti.disabled = true;
3652
qsort(mi,i,sizeof(mi[0]),menusort);
3655
static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c) {
3658
for ( i=0; mi[i].ti.text!=NULL; ++i )
3659
qsort(mi,i,sizeof(mi[0]),menusort);
3662
static void TN_NewName(GGadget *g,int row) {
3664
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3666
strings[3*row+1].u.md_ival = ttf_subfamily;
3669
static void TN_FinishEdit(GGadget *g,int row,int col,int wasnew) {
3671
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3672
uint8 found[ttf_namemax];
3673
struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
3677
if ( strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0' ) {
3678
GMatrixEditDeleteRow(g,row);
3683
memset(found,0,sizeof(found));
3684
found[ttf_idontknow] = true; /* reserved name id */
3685
for ( i=0; i<rows; ++i ) if ( i!=row ) {
3686
if ( strings[3*i].u.md_ival == strings[3*row].u.md_ival ) /* Same language */
3687
found[strings[3*i+1].u.md_ival] = true;
3689
if ( found[ strings[3*row+1].u.md_ival ] ) {
3690
/* This language already has an entry for this strid */
3692
if ( !found[ttf_subfamily] ) {
3693
strings[3*row+1].u.md_ival = ttf_subfamily;
3696
for ( i=0; i<ttf_namemax; ++i )
3698
strings[3*row+1].u.md_ival = i;
3705
if ( (strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0') ) {
3706
for ( i=0; i<rows; ++i ) if ( i!=row ) {
3707
if ( strings[3*row+1].u.md_ival == strings[3*i+1].u.md_ival &&
3708
(strings[3*row].u.md_ival&0xff) == (strings[3*i].u.md_ival&0xff)) {
3709
/* Same string, same language, different locale */
3710
/* first guess is the same as the other string. */
3711
if ( strings[3*i+2].u.md_str==NULL )
3712
strings[3*row+2].u.md_str = tn_recalculatedef(d,strings[3*row+1].u.md_ival );
3714
strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
3719
/* If we didn't find anything above, and if we've got a style */
3720
/* (subfamily) see if we can guess a translation from the english */
3721
if ( i==rows && strings[3*row+1].u.md_ival == ttf_subfamily )
3722
ret |= CheckActiveStyleTranslation(d,strings,row,rows);
3729
static int TN_CanDelete(GGadget *g,int row) {
3731
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3732
if ( strings==NULL )
3735
return( !strings[3*row+2].user_bits );
3738
static void TN_PopupMenu(GGadget *g,GEvent *event,int r,int c) {
3739
struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
3741
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3745
if ( strings==NULL )
3750
memset(mi,'\0',sizeof(mi));
3751
for ( i=0; i<3; ++i ) {
3752
mi[i].ti.fg = COLOR_DEFAULT;
3753
mi[i].ti.bg = COLOR_DEFAULT;
3755
mi[i].invoke = TN_StrPopupDispatch;
3756
mi[i].ti.text_is_1byte = true;
3758
mi[MID_Delete-1].ti.disabled = strings[3*r+2].user_bits;
3759
mi[MID_ToggleBase-1].ti.disabled = !strings[3*r+2].user_bits;
3760
if ( strings[3*r+2].frozen ) {
3761
mi[MID_MultiEdit-1].ti.disabled = true;
3762
mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Detach from PostScript Names");
3765
mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Same as PostScript Names");
3766
temp = tn_recalculatedef(d,strings[3*r+1].u.md_ival);
3767
mi[MID_ToggleBase-1].ti.disabled = (temp==NULL);
3771
mi[MID_MultiEdit-1].ti.disabled = true;
3772
mi[MID_MultiEdit-1].ti.text = (unichar_t *) _("Multi-line edit");
3773
mi[MID_Delete-1].ti.text = (unichar_t *) _("Delete");
3774
GMenuCreatePopupMenu(event->w,event, mi);
3777
static int TN_PassChar(GGadget *g,GEvent *e) {
3778
return( GFI_Char(GGadgetGetUserData(g),e));
3781
static char *TN_BigEditTitle(GGadget *g,int r, int c) {
3782
char buf[100], buf2[20];
3786
struct matrix_data *strings = GMatrixEditGet(g, &rows);
3788
lang = langname(strings[3*r].u.md_ival,buf2);
3789
for ( k=0; ttfnameids[k].text!=NULL && ttfnameids[k].userdata!=(void *) (intpt) strings[3*r+1].u.md_ival;
3791
snprintf(buf,sizeof(buf),_("%1$.30s string for %2$.30s"),
3792
lang, (char *) ttfnameids[k].text );
3793
return( copy( buf ));
3796
static void TNMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
3797
SplineFont *sf = d->sf;
3799
uint8 sawEnglishUS[ttf_namemax];
3800
struct ttflangname *tln;
3801
struct matrix_data *md;
3805
memset(mi,0,sizeof(*mi));
3810
for ( k=0; k<2; ++k ) {
3811
memset(sawEnglishUS,0,sizeof(sawEnglishUS));
3813
for ( tln = sf->names; tln!=NULL; tln = tln->next ) {
3814
for ( i=0; i<ttf_namemax; ++i ) if ( i!=ttf_postscriptname && tln->names[i]!=NULL ) {
3816
md[3*cnt ].u.md_ival = tln->lang;
3817
md[3*cnt+1].u.md_ival = i;
3818
md[3*cnt+2].u.md_str = copy(tln->names[i]);
3821
if ( tln->lang==0x409 )
3822
sawEnglishUS[i] = true;
3825
for ( i=0; ttfspecials[i]!=-1; ++i ) if ( !sawEnglishUS[ttfspecials[i]] ) {
3827
md[3*cnt ].u.md_ival = 0x409;
3828
md[3*cnt+1].u.md_ival = ttfspecials[i];
3829
md[3*cnt+2].u.md_str = NULL;
3830
/* if frozen is set then can't remove or edit. (old basedon bit) */
3831
md[3*cnt].frozen = md[3*cnt+1].frozen = md[3*cnt+2].frozen = true;
3832
/* if user_bits is set then can't remove. (old cantremove bit) */
3833
md[3*cnt].user_bits = md[3*cnt+1].user_bits = md[3*cnt+2].user_bits = true;
3838
md = gcalloc(3*(cnt+10),sizeof(struct matrix_data));
3840
for ( i=0; i<cnt; ++i ) if ( md[3*cnt].u.md_ival==0x409 ) {
3841
for ( j=0; ttfspecials[j]!=-1 && ttfspecials[j]!=md[3*cnt+1].u.md_ival; ++j );
3842
md[3*i].user_bits = md[3*i+1].user_bits = md[3*i+2].user_bits =
3843
( ttfspecials[j]!=-1 );
3845
mi->matrix_data = md;
3846
mi->initial_row_cnt = cnt;
3848
mi->initrow = TN_NewName;
3849
mi->finishedit = TN_FinishEdit;
3850
mi->candelete = TN_CanDelete;
3851
mi->popupmenu = TN_PopupMenu;
3852
mi->handle_key = TN_PassChar;
3853
mi->bigedittitle = TN_BigEditTitle;
3856
static int GFI_HelpOFL(GGadget *g, GEvent *e) {
3857
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3858
help("http://scripts.sil.org/OFL");
3863
static int GFI_AddOFL(GGadget *g, GEvent *e) {
3864
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3865
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
3866
GGadget *tng = GWidgetGetControl(GGadgetGetWindow(g),CID_TNames);
3868
struct matrix_data *tns, *newtns;
3869
int i,j,k,l,m, extras, len;
3870
char *all, *pt, **data;
3871
char buffer[1024], *bpt;
3872
const char *author = GetAuthor();
3873
char *reservedname, *fallback;
3878
tm = localtime(&now);
3880
tns = GMatrixEditGet(tng, &rows); newtns = NULL;
3881
for ( k=0; k<2; ++k ) {
3883
for ( i=0; ofl_str_lang_data[i].data!=NULL; ++i ) {
3884
for ( j=rows-1; j>=0; --j ) {
3885
if ( tns[j*3+1].u.md_ival==ofl_str_lang_data[i].strid &&
3886
tns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang ) {
3888
free(newtns[j*3+2].u.md_str);
3889
newtns[j*3+2].u.md_str = NULL;
3895
j = rows + extras++;
3897
newtns[j*3+1].u.md_ival = ofl_str_lang_data[i].strid;
3898
newtns[j*3+0].u.md_ival = ofl_str_lang_data[i].lang;
3899
data = ofl_str_lang_data[i].data;
3900
reservedname = fallback = NULL;
3901
for ( m=0; m<rows; ++m ) {
3902
if ( newtns[j*3+1].u.md_ival==ttf_family ) {
3903
if ( newtns[j*3+0].u.md_ival==0x409 )
3904
fallback = newtns[3*j+2].u.md_str;
3905
else if ( newtns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang )
3906
reservedname = newtns[3*j+2].u.md_str;
3909
if ( reservedname==NULL )
3910
reservedname = fallback;
3911
if ( reservedname==NULL )
3912
reservedname = d->sf->familyname;
3913
for ( m=0; m<2; ++m ) {
3915
for ( l=0; data[l]!=NULL; ++l ) {
3916
if ( l==0 || l==1 ) {
3917
sprintf( buffer, data[l], tm->tm_year+1900, author, reservedname );
3923
pt += strlen( bpt );
3926
len += strlen( bpt ) + 1; /* for a new line */
3929
newtns[j*3+2].u.md_str = all = pt = galloc(len+2);
3931
if ( pt>all ) pt[-1] = '\0';
3936
newtns = gcalloc((rows+extras)*3,sizeof(struct matrix_data));
3937
memcpy(newtns,tns,rows*3*sizeof(struct matrix_data));
3938
for ( i=0; i<rows; ++i )
3939
newtns[3*i+2].u.md_str = copy(newtns[3*i+2].u.md_str);
3942
GMatrixEditSet(tng, newtns, rows+extras, false);
3943
gwwv_post_notice(_("Please read the OFL"),_(
3944
"You should read the OFL and its FAQ \n"
3945
"at http://scripts.sil.org/OFL."
3947
"If you are not very familiar with English,\n"
3948
"please check if there is a translation of the \n"
3949
"FAQ or an unofficial translation of the license \n"
3950
"in your mother tongue or preferred language. \n"
3952
"Fontforge does not know about your email or URL,\n"
3953
"you will need to add them manually. \n"
3954
"Please fill in the copyright notice in the license\n"
3955
"header along with any Reserved Font Name(s).\n"
3956
"If you are branching from an existing font make sure\n"
3957
"you have the right to do so and remember to add your\n"
3958
"additional copyright notice along with any Reserved Font Name(s).\n" ));
3963
static int Gasp_Default(GGadget *g, GEvent *e) {
3964
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
3965
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
3966
GGadget *gg = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
3968
struct matrix_data *gasp;
3970
if ( !SFHasInstructions(d->sf)) {
3972
gasp = gcalloc(5,sizeof(struct matrix_data));
3973
gasp[0].u.md_ival = 65535;
3974
gasp[1].u.md_ival = 0; /* no grid fit (we have no instructions, we can't grid fit) */
3975
gasp[2].u.md_ival = 1; /* do anti-alias */
3976
gasp[2].u.md_ival = 0; /* do symmetric smoothing */
3977
gasp[2].u.md_ival = 0; /* do no grid fit w/ sym smooth */
3980
gasp = gcalloc(5,sizeof(struct matrix_data));
3981
gasp[0].u.md_ival = 8; gasp[1].u.md_ival = 0; gasp[2].u.md_ival = 1;
3982
gasp[3].u.md_ival = 0; gasp[4].u.md_ival = 0;
3983
gasp[5].u.md_ival = 16; gasp[6].u.md_ival = 1; gasp[7].u.md_ival = 0;
3984
gasp[8].u.md_ival = 0; gasp[9].u.md_ival = 0;
3985
gasp[10].u.md_ival = 65535; gasp[11].u.md_ival = 1; gasp[12].u.md_ival = 1;
3986
gasp[13].u.md_ival = 0; gasp[14].u.md_ival = 0;
3988
GMatrixEditSet(gg,gasp,rows,false);
3993
static int Gasp_CanDelete(GGadget *g,int row) {
3995
struct matrix_data *gasp = GMatrixEditGet(g, &rows);
3999
/* Only allow them to delete the sentinal entry if that would give us an */
4000
/* empty gasp table */
4001
return( gasp[5*row].u.md_ival!=0xffff || rows==1 );
4004
static int gasp_comp(const void *_md1, const void *_md2) {
4005
const struct matrix_data *md1 = _md1, *md2 = _md2;
4006
return( md1->u.md_ival - md2->u.md_ival );
4009
static void Gasp_FinishEdit(GGadget *g,int row,int col,int wasnew) {
4011
struct matrix_data *gasp = GMatrixEditGet(g, &rows);
4014
qsort(gasp,rows,3*sizeof(struct matrix_data),gasp_comp);
4019
static void GaspMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
4020
SplineFont *sf = d->sf;
4022
struct matrix_data *md;
4024
memset(mi,0,sizeof(*mi));
4026
mi->col_init = gaspci;
4028
if ( sf->gasp_cnt==0 ) {
4029
md = gcalloc(5,sizeof(struct matrix_data));
4030
mi->initial_row_cnt = 0;
4032
md = gcalloc(5*sf->gasp_cnt,sizeof(struct matrix_data));
4033
for ( i=0; i<sf->gasp_cnt; ++i ) {
4034
md[5*i ].u.md_ival = sf->gasp[i].ppem;
4035
md[5*i+1].u.md_ival = (sf->gasp[i].flags&1)?1:0;
4036
md[5*i+2].u.md_ival = (sf->gasp[i].flags&2)?1:0;
4037
md[5*i+3].u.md_ival = (sf->gasp[i].flags&4)?1:0;
4038
md[5*i+4].u.md_ival = (sf->gasp[i].flags&8)?1:0;
4040
mi->initial_row_cnt = sf->gasp_cnt;
4042
mi->matrix_data = md;
4044
mi->finishedit = Gasp_FinishEdit;
4045
mi->candelete = Gasp_CanDelete;
4046
mi->handle_key = TN_PassChar;
4049
static int GFI_GaspVersion(GGadget *g, GEvent *e) {
4050
if ( e->u.control.subtype == et_listselected ) {
4051
int version = GGadgetGetFirstListSelectedItem(g);
4052
GGadget *gasp = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
4053
if ( version == 0 ) {
4054
GMatrixEditEnableColumn(gasp,3,false);
4055
GMatrixEditEnableColumn(gasp,4,false);
4057
GMatrixEditEnableColumn(gasp,3,true);
4058
GMatrixEditEnableColumn(gasp,4,true);
4060
GGadgetRedraw(gasp);
4065
static int GFI_SortBy(GGadget *g, GEvent *e) {
4066
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4067
struct gfi_data *d = (struct gfi_data *) GDrawGetUserData(GGadgetGetWindow(g));
4069
GGadgetRedraw(GWidgetGetControl(d->gw,CID_TNames));
4074
static void BDFsSetAsDs(SplineFont *sf) {
4078
for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
4079
scale = bdf->pixelsize / (real) (sf->ascent+sf->descent);
4080
bdf->ascent = rint(sf->ascent*scale);
4081
bdf->descent = bdf->pixelsize-bdf->ascent;
4085
static char *texparams[] = { N_("Slant:"), N_("Space:"), N_("Stretch:"),
4086
N_("Shrink:"), N_("XHeight:"), N_("Quad:"),
4087
/* GT: Extra Space, see below for a full comment */
4088
N_("Extra Sp:"), NULL };
4089
static char *texpopups[] = { N_("In an italic font the horizontal change per unit vertical change"),
4090
N_("The amount of space between words when using this font"),
4091
N_("The amount of strechable space between words when using this font"),
4092
N_("The amount the space between words may shrink when using this font"),
4093
N_("The height of the lower case letters with flat tops"),
4094
N_("The width of one em"),
4095
N_("Either:\nThe amount of extra space to be added after a sentence\nOr the space to be used within math formulae"),
4098
static int ParseTeX(struct gfi_data *d) {
4100
double em = (d->sf->ascent+d->sf->descent), val;
4102
for ( i=0; texparams[i]!=0 ; ++i ) {
4103
val = GetReal8(d->gw,CID_TeX+i,texparams[i],&err);
4104
d->texdata.params[i] = rint( val/em * (1<<20) );
4106
if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
4107
d->texdata.type = tex_text;
4108
else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
4109
d->texdata.type = tex_math;
4111
d->texdata.type = tex_mathext;
4115
static int ttfmultuniqueids(SplineFont *sf,struct gfi_data *d) {
4116
struct ttflangname *tln;
4120
if ( d->names_set ) {
4121
GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
4123
struct matrix_data *strings = GMatrixEditGet(edit, &rows);
4124
for ( i=0; i<rows; ++i )
4125
if ( strings[3*i+1].u.md_ival==ttf_uniqueid ) {
4131
for ( tln = sf->names; tln!=NULL; tln=tln->next )
4132
if ( tln->names[ttf_uniqueid]!=NULL ) {
4141
static int ttfuniqueidmatch(SplineFont *sf,struct gfi_data *d) {
4142
struct ttflangname *tln;
4145
if ( sf->names==NULL )
4148
if ( !d->names_set ) {
4149
for ( tln = sf->names; tln!=NULL; tln=tln->next )
4150
if ( tln->names[ttf_uniqueid]!=NULL )
4153
GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
4155
struct matrix_data *strings = GMatrixEditGet(edit, &rows);
4157
for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
4158
if ( tln->names[ttf_uniqueid]==NULL )
4159
continue; /* Not set, so if it has been given a new value */
4160
/* that's a change, and if it hasn't that's ok */
4161
for ( i=0; i<rows; ++i )
4162
if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
4165
continue; /* removed. That's a change */
4166
if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )==0 )
4167
return( true ); /* name unchanged */
4173
static void ttfuniqueidfixup(SplineFont *sf,struct gfi_data *d) {
4174
struct ttflangname *tln;
4175
char *changed = NULL;
4178
if ( sf->names==NULL )
4181
if ( !d->names_set ) {
4182
for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
4183
free( tln->names[ttf_uniqueid]);
4184
tln->names[ttf_uniqueid] = NULL;
4187
GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
4189
struct matrix_data *strings = GMatrixEditGet(edit, &rows);
4191
/* see if any instances of the name have changed */
4192
for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
4193
if ( tln->names[ttf_uniqueid]==NULL )
4195
for ( i=0; i<rows; ++i )
4196
if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
4200
if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )!=0 )
4201
changed = copy(strings[3*i+2].u.md_str );
4204
/* All unique ids should be the same, if any changed set the unchanged */
4205
/* ones to the one that did (or the first of many if several changed) */
4206
for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
4207
if ( tln->names[ttf_uniqueid]==NULL )
4209
for ( i=0; i<rows; ++i )
4210
if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
4214
if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str)==0 ) {
4215
free(strings[3*i+2].u.md_str);
4216
strings[3*i+2].u.md_str = changed!=NULL
4224
static void StoreTTFNames(struct gfi_data *d) {
4225
struct ttflangname *tln;
4226
SplineFont *sf = d->sf;
4228
GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
4230
struct matrix_data *strings = GMatrixEditGet(edit, &rows);
4232
TTFLangNamesFree(sf->names); sf->names = NULL;
4234
for ( i=0; i<rows; ++i ) {
4235
for ( tln=sf->names; tln!=NULL && tln->lang!=strings[3*i].u.md_ival; tln=tln->next );
4237
tln = chunkalloc(sizeof(struct ttflangname));
4238
tln->lang = strings[3*i].u.md_ival;
4239
tln->next = sf->names;
4242
tln->names[strings[3*i+1].u.md_ival] = copy(strings[3*i+2].u.md_str );
4244
TTF_PSDupsDefault(sf);
4246
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
4248
/* If we change the ascent/descent of a sub font then consider changing the */
4249
/* as/ds of the master font. I used to think this irrelevant, but as the */
4250
/* typoAscent/Descent is based on the master's ascent/descent it actually */
4251
/* is meaningful. Set the master to the subfont with the most glyphs */
4252
void CIDMasterAsDes(SplineFont *sf) {
4253
SplineFont *cidmaster = sf->cidmaster;
4255
int i, cid, cnt, bcnt;
4257
if ( cidmaster==NULL )
4259
best = NULL; bcnt = 0;
4260
for ( i=0; i<cidmaster->subfontcnt; ++i ) {
4261
sf = cidmaster->subfonts[i];
4262
for ( cid=cnt=0; cid<sf->glyphcnt; ++cid )
4263
if ( sf->glyphs[cid]!=NULL )
4270
if ( best==NULL && cidmaster->subfontcnt>0 )
4271
best = cidmaster->subfonts[0];
4273
double ratio = 1000.0/(best->ascent+best->descent);
4274
int ascent = rint(best->ascent*ratio);
4275
if ( cidmaster->ascent!=ascent || cidmaster->descent!=1000-ascent ) {
4276
cidmaster->ascent = ascent;
4277
cidmaster->descent = 1000-ascent;
4282
void SFSetModTime(SplineFont *sf) {
4285
sf->modificationtime = now;
4288
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
4289
static void GFI_ApplyLookupChanges(struct gfi_data *gfi) {
4292
SplineFont *sf = gfi->sf;
4293
struct lookup_subtable *sublast;
4295
for ( isgpos=0; isgpos<2; ++isgpos ) {
4296
struct lkdata *lk = &gfi->tables[isgpos];
4297
for ( i=0; i<lk->cnt; ++i ) {
4298
if ( lk->all[i].deleted )
4299
SFRemoveLookup(gfi->sf,lk->all[i].lookup);
4300
else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
4301
if ( lk->all[i].subtables[j].deleted )
4302
SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable);
4306
for ( i=0; i<lk->cnt; ++i ) {
4307
if ( !lk->all[i].deleted ) {
4309
last->next = lk->all[i].lookup;
4311
sf->gpos_lookups = lk->all[i].lookup;
4313
sf->gsub_lookups = lk->all[i].lookup;
4314
last = lk->all[i].lookup;
4316
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
4317
if ( !lk->all[i].subtables[j].deleted ) {
4318
if ( sublast!=NULL )
4319
sublast->next = lk->all[i].subtables[j].subtable;
4321
last->subtables = lk->all[i].subtables[j].subtable;
4322
sublast = lk->all[i].subtables[j].subtable;
4325
if ( sublast!=NULL )
4326
sublast->next = NULL;
4328
last->subtables = NULL;
4330
free(lk->all[i].subtables);
4335
sf->gpos_lookups = NULL;
4337
sf->gsub_lookups = NULL;
4342
static int GFI_OK(GGadget *g, GEvent *e) {
4343
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
4344
GWindow gw = GGadgetGetWindow(g);
4345
struct gfi_data *d = GDrawGetUserData(gw);
4346
SplineFont *sf = d->sf, *_sf;
4348
int reformat_fv=0, retitle_fv=false;
4349
int upos, uwid, as, des, err = false, weight=0;
4350
int uniqueid, linegap=0, vlinegap=0, winascent=0, windescent=0;
4351
int tlinegap=0, tascent=0, tdescent=0, hascent=0, hdescent=0;
4352
int winaoff=true, windoff=true;
4353
int taoff=true, tdoff=true, haoff = true, hdoff = true;
4354
real ia, cidversion;
4355
const unichar_t *txt, *fond; unichar_t *end;
4357
int vmetrics, vorigin, namechange, order2;
4358
int xuidchanged = false;
4359
GTextInfo *pfmfam, *ibmfam, *fstype, *nlitem;
4362
int subs[4], super[4], strike[2];
4363
int design_size, size_top, size_bottom, styleid;
4364
int strokedfont = false;
4366
#ifdef FONTFORGE_CONFIG_TYPE3
4367
int multilayer = false;
4371
extern int allow_utf8_glyphnames;
4374
struct matrix_data *strings = GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
4375
struct matrix_data *gasp = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Gasp), &gasprows);
4377
if ( strings==NULL || gasp==NULL )
4379
if ( gasprows>0 && gasp[5*gasprows-5].u.md_ival!=65535 ) {
4380
gwwv_post_error(_("Bad Grid Fiting table"),_("The 'gasp' (Grid Fit) table must end with a pixel entry of 65535"));
4383
if ( !CheckNames(d))
4385
if ( !PIFinishFormer(d))
4392
if ( ttfmultuniqueids(sf,d)) {
4393
#if defined(FONTFORGE_CONFIG_GDRAW)
4395
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
4396
#elif defined(FONTFORGE_CONFIG_GTK)
4397
static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
4399
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 )
4402
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
4403
if ( !isalpha(*txt)) {
4407
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ItalicAngle));
4408
ia = u_strtod(txt,&end);
4410
Protest8(_("_Italic Angle:"));
4413
order2 = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsOrder2));
4414
strokedfont = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsStrokedFont));
4415
strokewidth = GetReal8(gw,CID_StrokeWidth,_("Stroke _Width:"),&err);
4416
#ifdef FONTFORGE_CONFIG_TYPE3
4417
multilayer = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
4419
vmetrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_HasVerticalMetrics));
4420
upos = GetReal8(gw,CID_UPos, _("Underline _Position:"),&err);
4421
uwid = GetReal8(gw,CID_UWidth,S_("Underline|_Height:"),&err);
4422
GetInt8(gw,CID_Em,_("_Em Size:"),&err); /* just check for errors. redundant info */
4423
as = GetInt8(gw,CID_Ascent,_("_Ascent:"),&err);
4424
des = GetInt8(gw,CID_Descent,_("_Descent:"),&err);
4425
uniqueid = GetInt8(gw,CID_UniqueID,_("UniqueID"),&err);
4426
design_size = rint(10*GetReal8(gw,CID_DesignSize,_("De_sign Size:"),&err));
4427
size_bottom = rint(10*GetReal8(gw,CID_DesignBottom,_("_Bottom"),&err));
4428
size_top = rint(10*GetReal8(gw,CID_DesignTop,_("_Top"),&err));
4429
styleid = GetInt8(gw,CID_StyleID,_("Style _ID:"),&err);
4432
if ( sf->subfontcnt!=0 ) {
4433
cidversion = GetReal8(gw,CID_Version,_("_Version"),&err);
4438
vorigin = GetInt8(gw,CID_VOrigin,_("Vertical _Origin:"),&err);
4439
os2version = sf->os2_version;
4441
char *os2v = GGadgetGetTitle8(GWidgetGetControl(gw,CID_OS2Version));
4442
if ( strcasecmp(os2v,_( (char *) os2versions[0].text ))== 0 )
4445
os2version = GetInt8(gw,CID_OS2Version,_("Weight, Width, Slope Only"),&err);
4447
/* Only use the normal routine if we get no value, because */
4448
/* "400 Book" is a reasonable setting, but would cause GetInt */
4450
weight = u_strtol(_GGadgetGetTitle(GWidgetGetControl(gw,CID_WeightClass)),NULL,10);
4452
weight = GetInt8(gw,CID_WeightClass,_("_Weight Class"),&err);
4453
linegap = GetInt8(gw,CID_LineGap,_("HHead _Line Gap:"),&err);
4454
tlinegap = GetInt8(gw,CID_TypoLineGap,_("Typo Line _Gap:"),&err);
4456
vlinegap = GetInt8(gw,CID_VLineGap,_("VHead _Column Spacing:"),&err);
4457
winaoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinAscentIsOff));
4458
windoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinDescentIsOff));
4459
winascent = GetInt8(gw,CID_WinAscent,winaoff ? _("Win _Ascent Offset:") : _("Win Ascent:"),&err);
4460
windescent = GetInt8(gw,CID_WinDescent,windoff ? _("Win _Descent Offset:") : _("Win Descent:"),&err);
4461
taoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoAscentIsOff));
4462
tdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoDescentIsOff));
4463
tascent = GetInt8(gw,CID_TypoAscent,taoff ? _("_Typo Ascent Offset:") : _("Typo Ascent:"),&err);
4464
tdescent = GetInt8(gw,CID_TypoDescent,tdoff ? _("T_ypo Descent Offset:") : _("Typo Descent:"),&err);
4465
haoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadAscentIsOff));
4466
hdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadDescentIsOff));
4467
hascent = GetInt8(gw,CID_HHeadAscent,haoff ? _("_HHead Ascent Offset:") : _("HHead Ascent:"),&err);
4468
hdescent = GetInt8(gw,CID_HHeadDescent,hdoff ? _("HHead De_scent Offset:") : _("HHead Descent:"),&err);
4472
if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault)) ) {
4473
for ( i=0; i<4; ++i )
4474
subs[i] = GetInt8(gw,CID_SubXSize+i,_("Subscript"),&err);
4475
for ( i=0; i<4; ++i )
4476
super[i] = GetInt8(gw,CID_SuperXSize+i,_("Superscript"),&err);
4477
for ( i=0; i<2; ++i )
4478
strike[i] = GetInt8(gw,CID_StrikeoutSize+i,_("Strikeout"),&err);
4480
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Vendor));
4481
if ( u_strlen(txt)>4 || txt[0]>0x7e || (txt[0]!='\0' && (txt[1]>0x7e ||
4482
(txt[1]!='\0' && (txt[2]>0x7e || (txt[2]!='\0' && txt[3]>0x7e))))) ) {
4483
if ( u_strlen(txt)>4 )
4484
gwwv_post_error(_("Bad IBM Family"),_("Tag must be 4 characters long"));
4486
gwwv_post_error(_("Bad IBM Family"),_("A tag must be 4 ASCII characters"));
4489
os2_vendor[0] = txt[0]==0 ? ' ' : txt[0];
4490
os2_vendor[1] = txt[0]==0 || txt[1]=='\0' ? ' ' : txt[1];
4491
os2_vendor[2] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' ? ' ' : txt[2];
4492
os2_vendor[3] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' || txt[3]=='\0' ? ' ' : txt[3];
4500
if ( as+des>16384 || des<0 || as<0 ) {
4501
gwwv_post_error(_("Bad Ascent/Descent"),_("Ascent and Descent must be positive and their sum less than 16384"));
4505
if ( !GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic)) ) {
4507
ti = GGadgetGetList(GWidgetGetControl(d->gw,CID_MacStyles),&len);
4508
for ( i=0; i<len; ++i )
4509
if ( ti[i]->selected )
4510
mcs |= (int) (intpt) ti[i]->userdata;
4511
if ( (mcs&sf_condense) && (mcs&sf_extend)) {
4512
gwwv_post_error(_("Bad Style"),_("A style may not have both condense and extend set (it makes no sense)"));
4516
if ( order2!=sf->order2 && sf->changed && AskLoseUndoes())
4518
if ( order2!=sf->order2 && !SFCloseAllInstrs(sf))
4521
nlitem = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_Namelist));
4523
nl = DefaultNameListForNewFonts();
4525
char *name = u2utf8_copy(nlitem->text);
4526
nl = NameListByName(name);
4529
if ( nl->uses_unicode && !allow_utf8_glyphnames ) {
4530
gwwv_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."));
4533
#ifdef FONTFORGE_CONFIG_TYPE3
4534
if ( strokedfont!=sf->strokedfont || multilayer!=sf->multilayer ) {
4535
if ( sf->strokedfont && multilayer )
4536
SFSetLayerWidthsStroked(sf,sf->strokewidth);
4537
else if ( sf->multilayer )
4538
SFSplinesFromLayers(sf,strokedfont);
4539
SFReinstanciateRefs(sf);
4540
if ( multilayer!=sf->multilayer ) {
4541
sf->multilayer = multilayer;
4544
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
4545
sf->glyphs[i]->changedsincelasthinted = !strokedfont && !multilayer;
4548
if ( strokedfont!=sf->strokedfont )
4549
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
4550
sf->glyphs[i]->changedsincelasthinted = !strokedfont;
4552
sf->strokedfont = strokedfont;
4553
sf->strokewidth = strokewidth;
4554
GDrawSetCursor(gw,ct_watch);
4555
namechange = SetFontName(gw,sf);
4556
if ( namechange ) retitle_fv = true;
4557
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_XUID));
4558
xuidchanged = (sf->xuid==NULL && *txt!='\0') ||
4559
(sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0);
4561
((uniqueid!=0 && uniqueid==sf->uniqueid) ||
4562
(sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0) ||
4563
ttfuniqueidmatch(sf,d)) ) {
4566
buts[0] = _("Change");
4567
buts[1] = _("Retain");
4568
#if defined(FONTFORGE_CONFIG_GDRAW)
4569
buts[2] = _("_Cancel");
4570
#elif defined(FONTFORGE_CONFIG_GTK)
4571
buts[2] = GTK_STOCK_CANCEL;
4574
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?"));
4576
GDrawSetCursor(gw,ct_pointer);
4580
if ( uniqueid!=0 && uniqueid==sf->uniqueid )
4581
uniqueid = 4000000 + (rand()&0x3ffff);
4582
if ( sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 ) {
4583
SFRandomChangeXUID(sf);
4587
if ( ttfuniqueidmatch(sf,d))
4588
ttfuniqueidfixup(sf,d);
4591
sf->xuid = *txt=='\0'?NULL:cu_copy(txt);
4595
sf->gasp_cnt = gasprows;
4599
sf->gasp = galloc(gasprows*sizeof(struct gasp));
4600
sf->gasp_version = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_GaspVersion));
4601
for ( i=0; i<gasprows; ++i ) {
4602
sf->gasp[i].ppem = gasp[5*i].u.md_ival;
4603
if ( sf->gasp_version==0 )
4604
sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
4605
(gasp[5*i+2].u.md_ival<<1);
4607
sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
4608
(gasp[5*i+2].u.md_ival<<1) |
4609
(gasp[5*i+2].u.md_ival<<2) |
4610
(gasp[5*i+2].u.md_ival<<3);
4613
sf->head_optimized_for_cleartype = GGadgetIsChecked(GWidgetGetControl(gw,CID_HeadClearType));
4615
OtfNameListFree(sf->fontstyle_name);
4616
sf->fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
4617
sf->design_size = design_size;
4618
sf->design_range_bottom = size_bottom;
4619
sf->design_range_top = size_top;
4620
sf->fontstyle_id = styleid;
4622
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Notice));
4623
free(sf->copyright); sf->copyright = cu_copy(txt);
4624
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Comment));
4625
free(sf->comments); sf->comments = cu_copy(*txt?txt:NULL);
4626
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_DefBaseName));
4627
if ( *txt=='\0' || GGadgetIsChecked(GWidgetGetControl(gw,CID_SameAsFontname)) )
4629
free(sf->defbasefilename); sf->defbasefilename = u2utf8_copy(txt);
4630
if ( sf->subfontcnt!=0 ) {
4631
sf->cidversion = cidversion;
4633
txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Version));
4634
free(sf->version); sf->version = cu_copy(txt);
4636
fond = _GGadgetGetTitle(GWidgetGetControl(gw,CID_MacFOND));
4637
free(sf->fondname); sf->fondname = NULL;
4639
sf->fondname = cu_copy(fond);
4641
sf->italicangle = ia;
4644
sf->uniqueid = uniqueid;
4645
sf->texdata = d->texdata;
4647
interp = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_Interpretation));
4648
if ( interp==-1 ) sf->uni_interp = ui_none;
4649
else sf->uni_interp = (intpt) interpretations[interp].userdata;
4651
sf->for_new_glyphs = nl;
4653
if ( sf->hasvmetrics!=vmetrics )
4654
CVPaletteDeactivate(); /* Force a refresh later */
4655
_sf = sf->cidmaster?sf->cidmaster:sf;
4656
_sf->hasvmetrics = vmetrics;
4657
for ( j=0; j<_sf->subfontcnt; ++j )
4658
_sf->subfonts[j]->hasvmetrics = vmetrics;
4660
_sf->vertical_origin = vorigin;
4661
for ( j=0; j<_sf->subfontcnt; ++j )
4662
_sf->subfonts[j]->vertical_origin = vorigin;
4665
if ( d->private!=NULL ) {
4666
PSDictFree(sf->private);
4667
sf->private = d->private;
4673
sf->os2_version = os2version;
4674
sf->use_typo_metrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseTypoMetrics));
4675
sf->weight_width_slope_only = GGadgetIsChecked(GWidgetGetControl(gw,CID_WeightWidthSlopeOnly));
4676
sf->pfminfo.weight = weight;
4677
sf->pfminfo.width = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_WidthClass))+1;
4678
pfmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PFMFamily));
4680
sf->pfminfo.pfmfamily = (intpt) (pfmfam->userdata);
4682
sf->pfminfo.pfmfamily = 0x11;
4683
ibmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_IBMFamily));
4685
sf->pfminfo.os2_family_class = (intpt) (ibmfam->userdata);
4687
sf->pfminfo.os2_family_class = 0x00;
4688
memcpy(sf->pfminfo.os2_vendor,os2_vendor,sizeof(os2_vendor));
4689
fstype = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_FSType));
4691
sf->pfminfo.fstype = (intpt) (fstype->userdata);
4693
sf->pfminfo.fstype = 0xc;
4694
if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_NoSubsetting)))
4695
sf->pfminfo.fstype |=0x100;
4696
if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_OnlyBitmaps)))
4697
sf->pfminfo.fstype |=0x200;
4698
for ( i=0; i<10; ++i )
4699
sf->pfminfo.panose[i] = (intpt) (GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PanFamily+i))->userdata);
4700
sf->pfminfo.panose_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
4701
sf->pfminfo.os2_typolinegap = tlinegap;
4702
sf->pfminfo.linegap = linegap;
4704
sf->pfminfo.vlinegap = vlinegap;
4705
sf->pfminfo.os2_winascent = winascent;
4706
sf->pfminfo.os2_windescent = windescent;
4707
sf->pfminfo.winascent_add = winaoff;
4708
sf->pfminfo.windescent_add = windoff;
4709
sf->pfminfo.os2_typoascent = tascent;
4710
sf->pfminfo.os2_typodescent = tdescent;
4711
sf->pfminfo.typoascent_add = taoff;
4712
sf->pfminfo.typodescent_add = tdoff;
4713
sf->pfminfo.hhead_ascent = hascent;
4714
sf->pfminfo.hhead_descent = hdescent;
4715
sf->pfminfo.hheadascent_add = haoff;
4716
sf->pfminfo.hheaddescent_add = hdoff;
4717
sf->pfminfo.pfmset = true;
4719
sf->pfminfo.subsuper_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
4720
if ( sf->pfminfo.subsuper_set ) {
4721
sf->pfminfo.os2_subxsize = subs[0];
4722
sf->pfminfo.os2_subysize = subs[1];
4723
sf->pfminfo.os2_subxoff = subs[2];
4724
sf->pfminfo.os2_subyoff = subs[3];
4725
sf->pfminfo.os2_supxsize = super[0];
4726
sf->pfminfo.os2_supysize = super[1];
4727
sf->pfminfo.os2_supxoff = super[2];
4728
sf->pfminfo.os2_supyoff = super[3];
4729
sf->pfminfo.os2_strikeysize = strike[0];
4730
sf->pfminfo.os2_strikeypos = strike[1];
4733
/* must come after all scaleable fields (linegap, etc.) */
4734
if ( as!=sf->ascent || des!=sf->descent ) {
4735
if ( as+des != sf->ascent+sf->descent && GGadgetIsChecked(GWidgetGetControl(gw,CID_Scale)) )
4736
SFScaleToEm(sf,as,des);
4745
if ( order2!=sf->order2 ) {
4747
SFConvertToOrder2(sf);
4749
SFConvertToOrder3(sf);
4751
GFI_ApplyLookupChanges(d);
4752
if ( retitle_fv ) { FontView *fvs;
4753
for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame )
4757
FontViewReformatAll(sf);
4760
sf->changed_since_autosave = true;
4761
sf->changed_since_xuidchanged = !xuidchanged;
4762
/* Just in case they changed the blue values and we are showing blues */
4763
/* in outline views... */
4764
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
4766
for ( cv = sf->glyphs[i]->views; cv!=NULL; cv=cv->next ) {
4767
cv->back_img_out_of_date = true;
4768
GDrawRequestExpose(cv->v,NULL,false);
4771
MacFeatListFree(sf->features);
4772
sf->features = GGadgetGetUserData(GWidgetGetControl(d->gw,CID_Features));
4773
last_aspect = d->old_aspect;
4775
MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
4776
sf->mark_class_cnt = d->mark_class_cnt;
4777
sf->mark_classes = d->mark_classes;
4778
sf->mark_class_names = d->mark_class_names;
4782
SFReplaceFontnameBDFProps(sf);
4787
static void GFI_AsDsLab(struct gfi_data *d, int cid) {
4788
int isoffset = GGadgetIsChecked(GWidgetGetControl(d->gw,cid));
4798
case CID_WinAscentIsOff:
4799
offt = _("Win Ascent Offset:"); baret = _("Win Ascent:");
4800
ocid = CID_WinAscent; labcid = CID_WinAscentLab;
4803
case CID_WinDescentIsOff:
4804
offt = _("Win Descent Offset:"); baret = _("Win Descent:");
4805
ocid = CID_WinDescent; labcid = CID_WinDescentLab;
4807
case CID_TypoAscentIsOff:
4808
offt = _("Typo Ascent Offset:"); baret = _("Typo Ascent:");
4809
ocid = CID_TypoAscent; labcid = CID_TypoAscentLab;
4812
case CID_TypoDescentIsOff:
4813
offt = _("Typo Descent Offset:"); baret = _("Typo Descent:");
4814
ocid = CID_TypoDescent; labcid = CID_TypoDescentLab;
4816
case CID_HHeadAscentIsOff:
4817
offt = _("HHead Ascent Offset:"); baret = _("HHead Ascent:");
4818
ocid = CID_HHeadAscent; labcid = CID_HHeadAscentLab;
4821
case CID_HHeadDescentIsOff:
4822
offt = _("HHead Descent Offset:"); baret = _("HHead Descent:");
4823
ocid = CID_HHeadDescent; labcid = CID_HHeadDescentLab;
4829
GGadgetSetTitle8(GWidgetGetControl(d->gw,labcid),
4830
isoffset?offt:baret);
4831
if ( cid == CID_TypoAscentIsOff ) {
4832
const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4833
double av=u_strtod(as,&end);
4834
b.maxy = *end=='\0' ? av : d->sf->ascent;
4835
} else if ( cid == CID_TypoDescentIsOff ) {
4836
const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4837
double dv=u_strtod(ds,&end);
4838
b.miny = *end=='\0' ? -dv : -d->sf->descent;
4840
CIDFindBounds(d->sf,&b);
4841
if ( cid == CID_WinDescentIsOff ) b.miny = -b.miny;
4844
val = u_strtod(_GGadgetGetTitle(GWidgetGetControl(d->gw,ocid)),NULL);
4846
sprintf( buf,"%g",rint( val-(ismax ? b.maxy : b.miny)) );
4848
sprintf( buf,"%g",rint( val+(ismax ? b.maxy : b.miny)) );
4849
GGadgetSetTitle8(GWidgetGetControl(d->gw,ocid),buf);
4852
static int GFI_AsDesIsOff(GGadget *g, GEvent *e) {
4853
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4854
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4855
GFI_AsDsLab(d,GGadgetGetCid(g));
4860
static void _GFI_PanoseDefault(struct gfi_data *d) {
4862
int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_PanDefault));
4864
for ( i=0; i<10; ++i ) {
4865
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamily+i),!isdefault);
4866
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamilyLab+i),!isdefault);
4869
char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
4870
struct pfminfo info;
4871
memset(&info,0,sizeof(info));
4872
SFDefaultOS2Info(&info,d->sf,n);
4874
for ( i=0; i<10; ++i )
4875
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
4879
static int GFI_PanoseDefault(GGadget *g, GEvent *e) {
4880
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4881
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4882
_GFI_PanoseDefault(d);
4887
static void GFI_SubSuperSet(struct gfi_data *d, struct pfminfo *info) {
4891
sprintf( buffer, "%d", info->os2_subxsize );
4892
uc_strcpy(ubuf,buffer);
4893
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXSize),ubuf);
4895
sprintf( buffer, "%d", info->os2_subysize );
4896
uc_strcpy(ubuf,buffer);
4897
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYSize),ubuf);
4899
sprintf( buffer, "%d", info->os2_subxoff );
4900
uc_strcpy(ubuf,buffer);
4901
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXOffset),ubuf);
4903
sprintf( buffer, "%d", info->os2_subyoff );
4904
uc_strcpy(ubuf,buffer);
4905
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYOffset),ubuf);
4908
sprintf( buffer, "%d", info->os2_supxsize );
4909
uc_strcpy(ubuf,buffer);
4910
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXSize),ubuf);
4912
sprintf( buffer, "%d", info->os2_supysize );
4913
uc_strcpy(ubuf,buffer);
4914
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYSize),ubuf);
4916
sprintf( buffer, "%d", info->os2_supxoff );
4917
uc_strcpy(ubuf,buffer);
4918
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXOffset),ubuf);
4920
sprintf( buffer, "%d", info->os2_supyoff );
4921
uc_strcpy(ubuf,buffer);
4922
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYOffset),ubuf);
4925
sprintf( buffer, "%d", info->os2_strikeysize );
4926
uc_strcpy(ubuf,buffer);
4927
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutSize),ubuf);
4929
sprintf( buffer, "%d", info->os2_strikeypos );
4930
uc_strcpy(ubuf,buffer);
4931
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutPos),ubuf);
4934
static void _GFI_SubSuperDefault(struct gfi_data *d) {
4936
int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault));
4938
for ( i=0; i<10; ++i )
4939
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_SubXSize+i),!isdefault);
4941
const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4942
const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4943
const unichar_t *ia = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4944
unichar_t *aend, *dend, *iend;
4945
double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend),iav=u_strtod(ia,&iend);
4946
struct pfminfo info;
4947
if ( *aend!='\0' ) av = d->sf->ascent;
4948
if ( *dend!='\0' ) dv = d->sf->descent;
4949
if ( *iend!='\0' ) iav = d->sf->italicangle;
4950
memset(&info,0,sizeof(info));
4951
SFDefaultOS2SubSuper(&info,(int) (dv+av), iav);
4952
GFI_SubSuperSet(d,&info);
4956
static int GFI_SubSuperDefault(GGadget *g, GEvent *e) {
4957
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
4958
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
4959
_GFI_SubSuperDefault(d);
4964
static void TTFSetup(struct gfi_data *d) {
4965
struct pfminfo info;
4966
char buffer[10]; unichar_t ubuf[10];
4967
int i, lg, vlg, tlg;
4968
const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
4969
const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
4970
unichar_t *aend, *dend;
4971
double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend);
4973
info = d->sf->pfminfo;
4974
if ( !info.pfmset ) {
4975
/* Base this stuff on the CURRENT name */
4976
/* if the user just created a font, and named it *Bold, then the sf */
4977
/* won't yet have Bold in its name, and basing the weight on it would*/
4978
/* give the wrong answer. That's why we don't do this init until we */
4979
/* get to one of the ttf aspects, it gives the user time to set the */
4981
/* And on CURRENT values of ascent and descent */
4982
char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
4983
if ( *aend=='\0' && *dend=='\0' ) {
4984
if ( info.linegap==0 )
4985
info.linegap = rint(.09*(av+dv));
4986
if ( info.vlinegap==0 )
4987
info.vlinegap = info.linegap;
4988
if ( info.os2_typolinegap==0 )
4989
info.os2_typolinegap = info.linegap;
4991
lg = info.linegap; vlg = info.vlinegap; tlg = info.os2_typolinegap;
4992
SFDefaultOS2Info(&info,d->sf,n);
4996
info.vlinegap = vlg;
4998
info.os2_typolinegap = tlg;
5002
if ( info.weight>0 && info.weight<=900 && info.weight%100==0 )
5003
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),
5004
(char *) weightclass[info.weight/100-1].text);
5006
sprintf( buffer, "%d", info.weight );
5007
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),buffer);
5009
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_WidthClass),info.width-1);
5010
for ( i=0; pfmfamily[i].text!=NULL; ++i )
5011
if ( (intpt) (pfmfamily[i].userdata)==info.pfmfamily ) {
5012
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PFMFamily),i);
5016
if ( d->sf->os2_version>=0 && d->sf->os2_version<=4 )
5017
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_OS2Version),d->sf->os2_version);
5019
sprintf( buffer,"%d", d->sf->os2_version );
5020
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_OS2Version),buffer);
5022
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_UseTypoMetrics),d->sf->use_typo_metrics);
5023
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WeightWidthSlopeOnly),d->sf->weight_width_slope_only);
5025
for ( i=0; ibmfamily[i].text!=NULL; ++i )
5026
if ( (intpt) (ibmfamily[i].userdata)==info.os2_family_class ) {
5027
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_IBMFamily),i);
5030
if ( info.os2_vendor[0]!='\0' ) {
5031
ubuf[0] = info.os2_vendor[0];
5032
ubuf[1] = info.os2_vendor[1];
5033
ubuf[2] = info.os2_vendor[2];
5034
ubuf[3] = info.os2_vendor[3];
5036
} else if ( TTFFoundry!=NULL )
5037
uc_strncpy(ubuf,TTFFoundry,4);
5039
uc_strcpy(ubuf,"PfEd");
5040
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Vendor),ubuf);
5043
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_PanDefault),!info.panose_set);
5044
_GFI_PanoseDefault(d);
5045
if ( info.panose_set )
5046
for ( i=0; i<10; ++i )
5047
GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
5049
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault),!info.subsuper_set);
5050
if ( info.subsuper_set )
5051
GFI_SubSuperSet(d,&info);
5052
_GFI_SubSuperDefault(d);
5055
/* FSType is already set */
5056
sprintf( buffer, "%d", info.linegap );
5057
uc_strcpy(ubuf,buffer);
5058
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_LineGap),ubuf);
5059
sprintf( buffer, "%d", info.vlinegap );
5060
uc_strcpy(ubuf,buffer);
5061
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_VLineGap),ubuf);
5062
sprintf( buffer, "%d", info.os2_typolinegap );
5063
uc_strcpy(ubuf,buffer);
5064
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoLineGap),ubuf);
5066
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinAscentIsOff),info.winascent_add);
5067
GFI_AsDsLab(d,CID_WinAscentIsOff);
5068
sprintf( buffer, "%d", info.os2_winascent );
5069
uc_strcpy(ubuf,buffer);
5070
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinAscent),ubuf);
5071
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinDescentIsOff),info.windescent_add);
5072
GFI_AsDsLab(d,CID_WinDescentIsOff);
5073
sprintf( buffer, "%d", info.os2_windescent );
5074
uc_strcpy(ubuf,buffer);
5075
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinDescent),ubuf);
5077
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoAscentIsOff),info.typoascent_add);
5078
GFI_AsDsLab(d,CID_TypoAscentIsOff);
5079
sprintf( buffer, "%d", info.os2_typoascent );
5080
uc_strcpy(ubuf,buffer);
5081
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoAscent),ubuf);
5082
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoDescentIsOff),info.typodescent_add);
5083
GFI_AsDsLab(d,CID_TypoDescentIsOff);
5084
sprintf( buffer, "%d", info.os2_typodescent );
5085
uc_strcpy(ubuf,buffer);
5086
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoDescent),ubuf);
5088
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadAscentIsOff),info.hheadascent_add);
5089
GFI_AsDsLab(d,CID_HHeadAscentIsOff);
5090
sprintf( buffer, "%d", info.hhead_ascent );
5091
uc_strcpy(ubuf,buffer);
5092
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadAscent),ubuf);
5093
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadDescentIsOff),info.hheaddescent_add);
5094
GFI_AsDsLab(d,CID_HHeadDescentIsOff);
5095
sprintf( buffer, "%d", info.hhead_descent );
5096
uc_strcpy(ubuf,buffer);
5097
GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadDescent),ubuf);
5100
static char *mathparams[] = {
5101
/* GT: TeX parameters for math fonts. "Num" means numerator, "Denom" */
5102
/* GT: means denominator, "Sup" means superscript, "Sub" means subscript */
5104
N_("Num2:"), N_("Num3:"), N_("Denom1:"),
5105
N_("Denom2:"), N_("Sup1:"), N_("Sup2:"), N_("Sup3:"), N_("Sub1:"), N_("Sub2:"),
5106
N_("SupDrop:"), N_("SubDrop:"), N_("Delim1:"), N_("Delim2:"), N_("Axis Ht:"),
5108
static char *mathpopups[] = { N_("Amount to raise baseline for numerators in display styles"),
5109
N_("Amount to raise baseline for numerators in non-display styles"),
5110
N_("Amount to raise baseline for numerators in non-display atop styles"),
5111
N_("Amount to lower baseline for denominators in display styles"),
5112
N_("Amount to lower baseline for denominators in non-display styles"),
5113
N_("Amount to raise baseline for superscripts in display styles"),
5114
N_("Amount to raise baseline for superscripts in non-display styles"),
5115
N_("Amount to raise baseline for superscripts in modified styles"),
5116
N_("Amount to lower baseline for subscripts in display styles"),
5117
N_("Amount to lower baseline for subscripts in non-display styles"),
5118
N_("Amount above top of large box to place baseline of superscripts"),
5119
N_("Amount below bottom of large box to place baseline of subscripts"),
5120
N_("Size of comb delimiters in display styles"),
5121
N_("Size of comb delimiters in non-display styles"),
5122
N_("Height of fraction bar above base line"),
5124
/* GT: Default Rule Thickness. A rule being a typographic term for a straight */
5125
/* GT: black line on a printed page. */
5126
static char *extparams[] = { N_("Def Rule Thick:"),
5127
/* GT: I don't really understand these "Big Op Space" things. They have */
5128
/* GT: something to do with TeX and are roughly defined a few strings down */
5129
N_("Big Op Space1:"),
5130
N_("Big Op Space2:"),
5131
N_("Big Op Space3:"),
5132
N_("Big Op Space4:"),
5133
N_("Big Op Space5:"), 0 };
5134
static char *extpopups[] = { N_("Default thickness of over and overline bars"),
5135
N_("The minimum glue space above a large displayed operator"),
5136
N_("The minimum glue space below a large displayed operator"),
5137
N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is above the operator"),
5138
N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is below the operator"),
5139
N_("The extra glue place above and below displayed limits"),
5142
static int mp_e_h(GWindow gw, GEvent *event) {
5145
if ( event->type==et_close ) {
5146
struct gfi_data *d = GDrawGetUserData(gw);
5148
} else if ( event->type == et_char ) {
5150
} else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
5151
struct gfi_data *d = GDrawGetUserData(gw);
5152
if ( GGadgetGetCid(event->u.control.g)) {
5154
double em = (d->sf->ascent+d->sf->descent), val;
5156
if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
5157
params = mathparams;
5160
for ( i=0; params[i]!=0 && !err; ++i ) {
5161
val = GetReal8(gw,CID_TeX+i,params[i],&err);
5163
d->texdata.params[i+7] = rint( val/em * (1<<20) );
5173
static int GFI_MoreParams(GGadget *g, GEvent *e) {
5177
GWindowAttrs wattrs;
5178
GGadgetCreateData txgcd[35];
5179
GTextInfo txlabel[35];
5181
char **params, **popups;
5182
char values[20][20];
5184
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5185
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5186
if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
5188
else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) ) {
5190
params = mathparams;
5191
popups = mathpopups;
5198
memset(&wattrs,0,sizeof(wattrs));
5199
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
5200
wattrs.event_masks = ~(1<<et_charup);
5201
wattrs.is_dlg = true;
5202
wattrs.restrict_input_to_me = 1;
5203
wattrs.undercursor = 1;
5204
wattrs.cursor = ct_pointer;
5205
/* GT: More Parameters */
5206
wattrs.utf8_window_title = _("More Params");
5208
pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
5209
pos.height = GDrawPointsToPixels(NULL,tot*26+60);
5210
gw = GDrawCreateTopWindow(NULL,&pos,mp_e_h,d,&wattrs);
5212
memset(&txlabel,0,sizeof(txlabel));
5213
memset(&txgcd,0,sizeof(txgcd));
5216
for ( i=0; params[i]!=0; ++i ) {
5217
txlabel[k].text = (unichar_t *) params[i];
5218
txlabel[k].text_is_1byte = true;
5219
txgcd[k].gd.label = &txlabel[k];
5220
txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = y+4;
5221
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
5222
txgcd[k].gd.popup_msg = (unichar_t *) popups[i];
5223
txgcd[k++].creator = GLabelCreate;
5225
sprintf( values[i], "%g", d->texdata.params[i+7]*(double) (d->sf->ascent+d->sf->descent)/(double) (1<<20));
5226
txlabel[k].text = (unichar_t *) values[i];
5227
txlabel[k].text_is_1byte = true;
5228
txgcd[k].gd.label = &txlabel[k];
5229
txgcd[k].gd.pos.x = 85; txgcd[k].gd.pos.y = y;
5230
txgcd[k].gd.pos.width = 75;
5231
txgcd[k].gd.flags = gg_visible | gg_enabled;
5232
txgcd[k].gd.cid = CID_TeX + i;
5233
txgcd[k++].creator = GTextFieldCreate;
5237
txgcd[k].gd.pos.x = 30-3; txgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
5238
txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
5239
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
5240
txlabel[k].text = (unichar_t *) _("_OK");
5241
txlabel[k].text_is_1byte = true;
5242
txlabel[k].text_in_resource = true;
5243
txgcd[k].gd.label = &txlabel[k];
5244
txgcd[k].gd.cid = true;
5245
txgcd[k++].creator = GButtonCreate;
5247
txgcd[k].gd.pos.x = -30; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+3;
5248
txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
5249
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
5250
txlabel[k].text = (unichar_t *) _("_Cancel");
5251
txlabel[k].text_is_1byte = true;
5252
txlabel[k].text_in_resource = true;
5253
txgcd[k].gd.label = &txlabel[k];
5254
txgcd[k].gd.cid = false;
5255
txgcd[k++].creator = GButtonCreate;
5257
txgcd[k].gd.pos.x = 2; txgcd[k].gd.pos.y = 2;
5258
txgcd[k].gd.pos.width = pos.width-4; txgcd[k].gd.pos.height = pos.height-4;
5259
txgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
5260
txgcd[k].creator = GGroupCreate;
5262
GGadgetsCreate(gw,txgcd);
5264
GDrawSetVisible(gw,true);
5266
while ( !d->mpdone )
5267
GDrawProcessOneEvent(NULL);
5268
GDrawDestroyWindow(gw);
5273
static int GFI_TeXChanged(GGadget *g, GEvent *e) {
5274
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5275
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5276
if ( GGadgetGetCid(g)==CID_TeXText ) {
5277
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
5278
/* GT: Extra Space */
5280
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
5282
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
5284
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),true);
5290
static void DefaultTeX(struct gfi_data *d) {
5293
SplineFont *sf = d->sf;
5297
if ( sf->texdata.type==tex_unset ) {
5298
TeXDefaultParams(sf);
5299
d->texdata = sf->texdata;
5302
for ( i=0; i<7; ++i ) {
5303
sprintf( buffer,"%g", d->texdata.params[i]*(sf->ascent+sf->descent)/(double) (1<<20));
5304
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeX+i),buffer);
5306
if ( sf->texdata.type==tex_math )
5307
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathSym), true);
5308
else if ( sf->texdata.type == tex_mathext )
5309
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathExt), true);
5311
GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXText), true);
5312
GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
5313
/* GT: Extra Space */
5315
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
5319
static int GFI_MacAutomatic(GGadget *g, GEvent *e) {
5320
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5321
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5322
int autom = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic));
5323
GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MacStyles),!autom);
5328
static void FigureUnicode(struct gfi_data *d) {
5329
int includeempties = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_UnicodeEmpties));
5330
GGadget *list = GWidgetGetControl(d->gw,CID_Unicode);
5331
struct rangeinfo *ri;
5336
GGadgetClearList(list);
5337
ri = SFUnicodeRanges(d->sf,(includeempties?ur_includeempty:0)|ur_sortbyunicode);
5338
if ( ri==NULL ) cnt=0;
5340
for ( cnt=0; ri[cnt].range!=NULL; ++cnt );
5342
ti = galloc((cnt+1) * sizeof( GTextInfo * ));
5343
for ( i=0; i<cnt; ++i ) {
5344
if ( ri[i].range->first==-1 )
5345
snprintf( buffer, sizeof(buffer),
5346
"%s %d/0", _(ri[i].range->name), ri[i].cnt);
5348
snprintf( buffer, sizeof(buffer),
5349
"%s U+%04X-U+%04X %d/%d",
5350
_(ri[i].range->name),
5351
(int) ri[i].range->first, (int) ri[i].range->last,
5352
ri[i].cnt, ri[i].range->actual );
5353
ti[i] = gcalloc(1,sizeof(GTextInfo));
5354
ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
5355
ti[i]->text = utf82u_copy(buffer);
5356
ti[i]->userdata = ri[i].range;
5358
ti[i] = gcalloc(1,sizeof(GTextInfo));
5359
GGadgetSetList(list,ti,false);
5363
static int GFI_UnicodeRangeChange(GGadget *g, GEvent *e) {
5364
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5365
GTextInfo *ti = GGadgetGetListItemSelected(g);
5366
struct unicoderange *r;
5368
SplineFont *sf = d->sf;
5369
FontView *fv = sf->fv;
5370
EncMap *map = fv->map;
5375
if ( e->type!=et_controlevent ||
5376
(e->u.control.subtype != et_listselected &&e->u.control.subtype != et_listdoubleclick))
5381
for ( i=0; i<map->enccount; ++i )
5382
fv->selected[i] = 0;
5384
if ( e->u.control.subtype == et_listselected ) {
5385
for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
5386
enc = map->backmap[gid];
5387
if ( sf->glyphs[gid]->unicodeenc>=r->first && sf->glyphs[gid]->unicodeenc<=r->last &&
5389
if ( first==-1 || enc<first ) first = enc;
5390
fv->selected[enc] = true;
5393
} else if ( e->u.control.subtype == et_listdoubleclick && !r->unassigned ) {
5394
char *found = gcalloc(r->last-r->first+1,1);
5395
for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
5396
int u = sf->glyphs[gid]->unicodeenc;
5397
if ( u>=r->first && u<=r->last ) {
5398
found[u-r->first] = true;
5401
for ( i=0; i<=r->last-r->first; ++i ) {
5402
if ( isunicodepointassigned(i+r->first) && !found[i] ) {
5403
enc = EncFromUni(i+r->first,map->enc);
5405
if ( first==-1 || enc<first ) first = enc;
5406
fv->selected[enc] = true;
5415
FVScrollToChar(fv,first);
5417
GDrawRequestExpose(fv->v,NULL,false);
5421
static int GFI_UnicodeEmptiesChange(GGadget *g, GEvent *e) {
5422
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
5423
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5429
static int GFI_AspectChange(GGadget *g, GEvent *e) {
5430
if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_radiochanged )) {
5431
struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
5432
int new_aspect = GTabSetGetSel(g);
5435
if ( d->old_aspect == d->tn_aspect )
5436
GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
5437
if ( !d->ttf_set && new_aspect == d->ttfv_aspect )
5439
else if ( !d->names_set && new_aspect == d->tn_aspect ) {
5441
d->names_set = true;
5442
} else if ( !d->tex_set && new_aspect == d->tx_aspect )
5444
else if ( new_aspect == d->unicode_aspect )
5446
d->old_aspect = new_aspect;
5451
static int e_h(GWindow gw, GEvent *event) {
5452
if ( event->type==et_close ) {
5453
struct gfi_data *d = GDrawGetUserData(gw);
5455
} else if ( event->type==et_destroy ) {
5456
struct gfi_data *d = GDrawGetUserData(gw);
5458
} else if ( event->type==et_char ) {
5459
return( GFI_Char(GDrawGetUserData(gw),event));
5464
static void GFI_InitMarkClasses(struct gfi_data *d) {
5465
SplineFont *sf = d->sf;
5468
d->mark_class_cnt = sf->mark_class_cnt;
5469
if ( d->mark_class_cnt!=0 ) {
5470
d->mark_classes = galloc(d->mark_class_cnt*sizeof(char *));
5471
d->mark_class_names = galloc(d->mark_class_cnt*sizeof(unichar_t *));
5472
d->mark_classes[0] = NULL; d->mark_class_names[0] = NULL;
5473
for ( i=1; i<d->mark_class_cnt; ++i ) {
5474
d->mark_classes[i] = copy(sf->mark_classes[i]);
5475
d->mark_class_names[i] = copy(sf->mark_class_names[i]);
5480
static void LookupSetup(struct lkdata *lk,OTLookup *lookups) {
5483
struct lookup_subtable *sub;
5485
for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next );
5486
lk->cnt = cnt; lk->max = cnt+10;
5487
lk->all = gcalloc(lk->max,sizeof(struct lkinfo));
5488
for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next ) {
5489
lk->all[cnt].lookup = otl;
5490
for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next );
5491
lk->all[cnt].subtable_cnt = subcnt; lk->all[cnt].subtable_max = subcnt+10;
5492
lk->all[cnt].subtables = gcalloc(lk->all[cnt].subtable_max,sizeof(struct lksubinfo));
5493
for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next )
5494
lk->all[cnt].subtables[subcnt].subtable = sub;
5498
static void LookupInfoFree(struct lkdata *lk) {
5501
for ( cnt=0; cnt<lk->cnt; ++cnt )
5502
free(lk->all[cnt].subtables);
5508
struct selection_bits {
5509
int lookup_cnt, sub_cnt; /* Number of selected lookups, and selected sub tables */
5510
int a_lookup, a_sub; /* The index of one of those lookups, or subtables */
5511
int a_sub_lookup; /* the index of the lookup containing a_sub */
5512
int any_first, any_last; /* Whether any of the selected items is first or last in its catagory */
5513
int sub_table_mergeable; /* Can we merge the selected subtables? */
5514
int lookup_mergeable; /* Can we merge the selected lookups? */
5517
static void LookupParseSelection(struct lkdata *lk, struct selection_bits *sel) {
5518
int lookup_cnt, sub_cnt, any_first, any_last, all_one_lookup;
5519
int a_lookup, a_sub, a_sub_lookup;
5520
int sub_mergeable, lookup_mergeable;
5523
lookup_cnt = sub_cnt = any_first = any_last = 0;
5524
all_one_lookup = a_lookup = a_sub = a_sub_lookup = -1;
5525
sub_mergeable = lookup_mergeable = true;
5526
for ( i=0; i<lk->cnt; ++i ) {
5527
if ( lk->all[i].deleted )
5529
if ( lk->all[i].selected ) {
5533
else if ( lk->all[i].lookup->lookup_type!=lk->all[a_lookup].lookup->lookup_type ||
5534
lk->all[i].lookup->lookup_flags!=lk->all[a_lookup].lookup->lookup_flags )
5535
lookup_mergeable = false;
5536
if ( i==0 ) any_first=true;
5537
if ( i==lk->cnt-1 ) any_last=true;
5539
if ( lk->all[i].open ) {
5540
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5541
if ( lk->all[i].subtables[j].deleted )
5543
if ( lk->all[i].subtables[j].selected ) {
5546
a_sub = j; a_sub_lookup = i;
5548
if ( j==0 ) any_first = true;
5549
if ( j==lk->all[i].subtable_cnt-1 ) any_last = true;
5550
if ( lk->all[i].subtables[j].subtable->kc!=NULL ||
5551
lk->all[i].subtables[j].subtable->fpst!=NULL ||
5552
lk->all[i].subtables[j].subtable->sm!=NULL )
5553
sub_mergeable = false;
5554
if ( all_one_lookup==-1 )
5556
else if ( all_one_lookup!=i )
5557
all_one_lookup = -2;
5563
sel->lookup_cnt = lookup_cnt;
5564
sel->sub_cnt = sub_cnt;
5565
sel->a_lookup = a_lookup;
5567
sel->a_sub_lookup = a_sub_lookup;
5568
sel->any_first = any_first;
5569
sel->any_last = any_last;
5570
sel->sub_table_mergeable = sub_mergeable && all_one_lookup && sub_cnt>=2 && lookup_cnt==0;
5571
sel->lookup_mergeable = lookup_mergeable && lookup_cnt>=2 && sub_cnt==0;
5574
void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos) {
5575
struct lkdata *lk = &gfi->tables[isgpos];
5576
struct selection_bits sel;
5579
LookupParseSelection(lk,&sel);
5581
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupTop),!sel.any_first &&
5582
sel.lookup_cnt+sel.sub_cnt==1);
5583
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupUp),!sel.any_first &&
5584
sel.lookup_cnt+sel.sub_cnt!=0);
5585
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupDown),!sel.any_last &&
5586
sel.lookup_cnt+sel.sub_cnt!=0);
5587
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupBottom),!sel.any_last &&
5588
sel.lookup_cnt+sel.sub_cnt==1);
5589
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddLookup),
5590
(sel.lookup_cnt+sel.sub_cnt<=1));
5591
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddSubtable),
5592
(sel.lookup_cnt==1 && sel.sub_cnt<=1) || (sel.lookup_cnt==0 && sel.sub_cnt==1));
5593
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditMetadata),
5594
(sel.lookup_cnt==1 && sel.sub_cnt==0) ||
5595
(sel.lookup_cnt==0 && sel.sub_cnt==1));
5596
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditSubtable),sel.lookup_cnt==0 &&
5598
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_DeleteLookup),sel.lookup_cnt!=0 ||
5600
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_MergeLookup),
5601
(sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
5602
(sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable));
5603
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_RevertLookups),true);
5604
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupSort),lk->cnt>1 );
5606
for ( ofv=fv_list; ofv!=NULL; ofv = ofv->next ) {
5607
SplineFont *osf = ofv->sf;
5608
if ( osf->cidmaster ) osf = osf->cidmaster;
5609
if ( osf==gfi->sf || gfi->sf->cidmaster==osf )
5611
if ( (isgpos && osf->gpos_lookups!=NULL) || (!isgpos && osf->gsub_lookups!=NULL) )
5614
GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_ImportLookups),ofv!=NULL);
5617
void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh) {
5620
GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
5621
struct lkdata *lk = &gfi->tables[isgpos];
5622
GGadget *vsb = GWidgetGetControl(gfi->gw,CID_LookupVSB+isgpos);
5623
GGadget *hsb = GWidgetGetControl(gfi->gw,CID_LookupHSB+isgpos);
5624
int off_top, off_left;
5626
GDrawSetFont(gw,gfi->font);
5628
for ( i=0; i<lk->cnt; ++i ) {
5629
if ( lk->all[i].deleted )
5632
wmax = GDrawGetText8Width(gw,lk->all[i].lookup->lookup_name,-1,NULL);
5633
if ( wmax > width ) width = wmax;
5634
if ( lk->all[i].open ) {
5635
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5636
if ( lk->all[i].subtables[j].deleted )
5639
wmax = gfi->fh+GDrawGetText8Width(gw,lk->all[i].subtables[j].subtable->subtable_name,-1,NULL);
5640
if ( wmax > width ) width = wmax;
5645
GScrollBarSetBounds(vsb,0,lcnt,(gfi->lkheight-2*LK_MARGIN)/gfi->fh);
5646
GScrollBarSetBounds(hsb,0,width,gfi->lkwidth-2*LK_MARGIN);
5647
off_top = lk->off_top;
5648
if ( off_top+((gfi->lkheight-2*LK_MARGIN)/gfi->fh) > lcnt )
5649
off_top = lcnt - (gfi->lkheight-2*LK_MARGIN)/gfi->fh;
5652
off_left = lk->off_left;
5653
if ( off_left+gfi->lkwidth-2*LK_MARGIN > width )
5654
off_left = width-(gfi->lkwidth-2*LK_MARGIN);
5657
if ( off_top!=lk->off_top || off_left!=lk->off_left ) {
5658
lk->off_top = off_top; lk->off_left = off_left;
5659
GScrollBarSetPos(vsb,off_top);
5660
GScrollBarSetPos(hsb,off_left);
5664
GDrawRequestExpose(gw,NULL,true);
5667
static int LookupsHScroll(GGadget *g,GEvent *event) {
5668
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5669
int isgpos = GGadgetGetCid(g)-CID_LookupHSB;
5670
struct lkdata *lk = &gfi->tables[isgpos];
5671
int newpos = lk->off_left;
5672
int32 sb_min, sb_max, sb_pagesize;
5674
if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
5677
GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
5678
switch( event->u.control.u.sb.type ) {
5683
newpos -= 9*sb_pagesize/10;
5686
newpos -= sb_pagesize/15;
5689
newpos += sb_pagesize/15;
5691
case et_sb_downpage:
5692
newpos += 9*sb_pagesize/10;
5695
newpos = sb_max-sb_pagesize;
5698
case et_sb_thumbrelease:
5699
newpos = event->u.control.u.sb.pos;
5702
newpos -= sb_pagesize/30;
5704
case et_sb_halfdown:
5705
newpos += sb_pagesize/30;
5708
if ( newpos>sb_max-sb_pagesize )
5709
newpos = sb_max-sb_pagesize;
5710
if ( newpos<0 ) newpos = 0;
5711
if ( newpos!=lk->off_left ) {
5712
lk->off_left = newpos;
5713
GScrollBarSetPos(event->u.control.g,newpos);
5714
GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,true);
5719
static int LookupsVScroll(GGadget *g,GEvent *event) {
5720
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5721
int isgpos = GGadgetGetCid(g)-CID_LookupVSB;
5722
struct lkdata *lk = &gfi->tables[isgpos];
5723
int newpos = lk->off_top;
5724
int32 sb_min, sb_max, sb_pagesize;
5726
if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
5729
GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
5730
switch( event->u.control.u.sb.type ) {
5735
newpos -= 9*sb_pagesize/10;
5743
case et_sb_downpage:
5744
newpos += 9*sb_pagesize/10;
5747
newpos = (sb_max-sb_pagesize);
5750
case et_sb_thumbrelease:
5751
newpos = event->u.control.u.sb.pos;
5754
if ( newpos>(sb_max-sb_pagesize) )
5755
newpos = (sb_max-sb_pagesize);
5756
if ( newpos<0 ) newpos = 0;
5757
if ( newpos!=lk->off_top ) {
5758
/*int diff = newpos-lk->off_top;*/
5759
lk->off_top = newpos;
5760
GScrollBarSetPos(event->u.control.g,newpos);
5761
/*GDrawScroll(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,0,diff*gfi->fh);*/
5762
GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,true);
5767
static int GFI_LookupOrder(GGadget *g, GEvent *e) {
5769
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5770
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5771
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
5772
struct lkdata *lk = &gfi->tables[isgpos];
5775
struct lksubinfo temp2;
5776
int cid = GGadgetGetCid(g);
5777
GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
5779
if ( cid==CID_LookupTop ) {
5780
for ( i=0; i<lk->cnt; ++i ) {
5781
if ( lk->all[i].deleted )
5783
if ( lk->all[i].selected ) {
5785
for ( k=i-1; k>=0; --k )
5786
lk->all[k+1] = lk->all[k];
5790
if ( lk->all[i].open ) {
5791
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5792
if ( lk->all[i].subtables[j].deleted )
5794
if ( lk->all[i].subtables[j].selected ) {
5795
temp2 = lk->all[i].subtables[j];
5796
for ( k=j-1; k>=0; --k )
5797
lk->all[i].subtables[k+1] = lk->all[i].subtables[k];
5798
lk->all[i].subtables[0] = temp2;
5804
} else if ( cid==CID_LookupBottom ) {
5805
for ( i=0; i<lk->cnt; ++i ) {
5806
if ( lk->all[i].deleted )
5808
if ( lk->all[i].selected ) {
5810
for ( k=i; k<lk->cnt-1; --k )
5811
lk->all[k] = lk->all[k+1];
5812
lk->all[lk->cnt-1] = temp;
5815
if ( lk->all[i].open ) {
5816
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5817
if ( lk->all[i].subtables[j].deleted )
5819
if ( lk->all[i].subtables[j].selected ) {
5820
temp2 = lk->all[i].subtables[j];
5821
for ( k=j; k<lk->all[i].subtable_cnt-1; --k )
5822
lk->all[i].subtables[k] = lk->all[i].subtables[k+1];
5823
lk->all[i].subtables[lk->all[i].subtable_cnt-1] = temp2;
5829
} else if ( cid==CID_LookupUp ) {
5830
for ( i=0; i<lk->cnt; ++i ) {
5831
if ( lk->all[i].deleted )
5833
if ( lk->all[i].selected && i!=0 ) {
5835
lk->all[i] = lk->all[i-1];
5836
lk->all[i-1] = temp;
5838
if ( lk->all[i].open ) {
5839
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5840
if ( lk->all[i].subtables[j].deleted )
5842
if ( lk->all[i].subtables[j].selected && j!=0 ) {
5843
temp2 = lk->all[i].subtables[j];
5844
lk->all[i].subtables[j] = lk->all[i].subtables[j-1];
5845
lk->all[i].subtables[j-1] = temp2;
5850
} else if ( cid==CID_LookupDown ) {
5851
for ( i=lk->cnt-1; i>=0; --i ) {
5852
if ( lk->all[i].deleted )
5854
if ( lk->all[i].selected && i!=lk->cnt-1 ) {
5856
lk->all[i] = lk->all[i+1];
5857
lk->all[i+1] = temp;
5859
if ( lk->all[i].open ) {
5860
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5861
if ( lk->all[i].subtables[j].deleted )
5863
if ( lk->all[i].subtables[j].selected && j!=lk->all[i].subtable_cnt-1 ) {
5864
temp2 = lk->all[i].subtables[j];
5865
lk->all[i].subtables[j] = lk->all[i].subtables[j+1];
5866
lk->all[i].subtables[j+1] = temp2;
5873
GFI_LookupEnableButtons(gfi,isgpos);
5874
GDrawRequestExpose(gw,NULL,true);
5879
static int GFI_LookupSort(GGadget *g, GEvent *e) {
5881
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
5882
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
5883
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
5884
struct lkdata *lk = &gfi->tables[isgpos];
5888
for ( i=0; i<lk->cnt; ++i ) {
5889
int order = FeatureOrderId(isgpos,lk->all[i].lookup->features);
5890
for ( j=i+1; j<lk->cnt; ++j ) {
5891
int jorder = FeatureOrderId(isgpos,lk->all[j].lookup->features);
5892
if ( order>jorder) {
5894
lk->all[i] = lk->all[j];
5900
GFI_LookupEnableButtons(gfi,isgpos);
5905
/* ??? *//* How about a series of buttons to show only by lookup_type, feat-tag, script-tag */
5907
void GFI_CCDEnd(struct gfi_data *d) {
5912
void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success) {
5914
struct lookup_subtable *sub, *prev;
5915
FPST *ftest, *fprev;
5918
/* We can't allow incomplete FPSTs to float around */
5919
/* If they didn't fill it in, delete it */
5920
otl = fpst->subtable->lookup;
5922
for ( sub=otl->subtables; sub!=NULL && sub!=fpst->subtable; prev = sub, sub=sub->next );
5925
otl->subtables = sub->next;
5927
prev->next = sub->next;
5928
free(sub->subtable_name);
5929
chunkfree(sub,sizeof(struct lookup_subtable));
5932
for ( ftest=d->sf->possub; ftest!=NULL && ftest!=fpst; fprev = ftest, ftest=ftest->next );
5933
if ( ftest!=NULL ) {
5935
d->sf->possub = fpst->next;
5937
fprev->next = fpst->next;
5940
chunkfree(fpst,sizeof(FPST));
5944
void GFI_SMDEnd(struct gfi_data *d) {
5949
void GFI_FinishSMNew(struct gfi_data *d,ASM *sm, int success, int isnew) {
5951
struct lookup_subtable *sub, *prev;
5952
ASM *smtest, *smprev;
5954
if ( !success && isnew ) {
5955
/* We can't allow incomplete state machines floating around */
5956
/* If they didn't fill it in, delete it */
5957
otl = sm->subtable->lookup;
5959
for ( sub=otl->subtables; sub!=NULL && sub!=sm->subtable; prev = sub, sub=sub->next );
5962
otl->subtables = sub->next;
5964
prev->next = sub->next;
5965
free(sub->subtable_name);
5966
chunkfree(sub,sizeof(struct lookup_subtable));
5969
for ( smtest=d->sf->sm; smtest!=NULL && smtest!=sm; smprev = smtest, smtest=smtest->next );
5970
if ( smtest!=NULL ) {
5972
d->sf->sm = sm->next;
5974
smprev->next = sm->next;
5976
chunkfree(sm,sizeof(ASM));
5980
static void LookupSubtableContents(struct gfi_data *gfi,int isgpos) {
5981
struct lkdata *lk = &gfi->tables[isgpos];
5984
for ( i=0; i<lk->cnt; ++i ) {
5985
if ( lk->all[i].deleted )
5987
if ( lk->all[i].open ) {
5988
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
5989
if ( lk->all[i].subtables[j].deleted )
5991
if ( lk->all[i].subtables[j].selected ) {
5992
_LookupSubtableContents(gfi->sf,lk->all[i].subtables[j].subtable,NULL);
6000
static int GFI_LookupEditSubtableContents(GGadget *g, GEvent *e) {
6002
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6003
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6004
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6005
LookupSubtableContents(gfi,isgpos);
6010
static int GFI_LookupAddLookup(GGadget *g, GEvent *e) {
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];
6017
OTLookup *otl = chunkalloc(sizeof(OTLookup));
6019
if ( !EditLookup(otl,isgpos,gfi->sf)) {
6020
chunkfree(otl,sizeof(OTLookup));
6023
for ( i=lk->cnt-1; i>=0; --i ) {
6024
if ( !lk->all[i].deleted && lk->all[i].selected ) {
6025
lk->all[i].selected = false;
6028
if ( !lk->all[i].deleted && lk->all[i].open ) {
6029
for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6030
if ( !lk->all[i].subtables[j].deleted &&
6031
lk->all[i].subtables[j].selected ) {
6032
lk->all[i].subtables[j].selected = false;
6035
if ( j<lk->all[i].subtable_cnt )
6039
if ( lk->cnt>=lk->max )
6040
lk->all = grealloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
6041
for ( k=lk->cnt; k>i+1; --k )
6042
lk->all[k] = lk->all[k-1];
6043
memset(&lk->all[k],0,sizeof(struct lkinfo));
6044
lk->all[k].lookup = otl;
6045
lk->all[k].new = true;
6046
lk->all[k].selected = true;
6049
otl->next = gfi->sf->gpos_lookups;
6050
gfi->sf->gpos_lookups = otl;
6052
otl->next = gfi->sf->gsub_lookups;
6053
gfi->sf->gsub_lookups = otl;
6056
/* Make sure the window is scrolled to display the new lookup */
6058
for ( i=0; i<lk->cnt; ++i ) {
6059
if ( lk->all[i].deleted )
6064
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6065
if ( lk->all[i].subtables[j].deleted )
6070
if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
6073
GFI_LookupScrollbars(gfi,isgpos, true);
6074
GFI_LookupEnableButtons(gfi,isgpos);
6079
static int GFI_LookupAddSubtable(GGadget *g, GEvent *e) {
6081
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6082
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6083
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6084
struct lkdata *lk = &gfi->tables[isgpos];
6086
struct lookup_subtable *sub;
6089
for ( i=0; i<lk->cnt; ++i ) {
6090
if ( lk->all[i].deleted )
6094
if ( lk->all[i].selected )
6096
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6097
if ( lk->all[i].subtables[j].deleted )
6100
if ( lk->all[i].subtables[j].selected )
6108
sub = chunkalloc(sizeof(struct lookup_subtable));
6109
sub->lookup = lk->all[i].lookup;
6110
if ( !EditSubtable(sub,isgpos,gfi->sf,NULL)) {
6111
chunkfree(sub,sizeof(struct lookup_subtable));
6114
if ( lk->all[i].subtable_cnt>=lk->all[i].subtable_max )
6115
lk->all[i].subtables = grealloc(lk->all[i].subtables,(lk->all[i].subtable_max+=10)*sizeof(struct lksubinfo));
6116
for ( k=lk->all[i].subtable_cnt; k>j+1; --k )
6117
lk->all[i].subtables[k] = lk->all[i].subtables[k-1];
6118
memset(&lk->all[i].subtables[k],0,sizeof(struct lksubinfo));
6119
lk->all[i].subtables[k].subtable = sub;
6120
lk->all[i].subtables[k].new = true;
6121
sub->next = lk->all[i].lookup->subtables;
6122
lk->all[i].lookup->subtables = sub;
6123
++lk->all[i].subtable_cnt;
6125
/* Make sure the window is scrolled to display the new subtable */
6126
if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
6129
GFI_LookupScrollbars(gfi,isgpos, true);
6130
GFI_LookupEnableButtons(gfi,isgpos);
6135
static int GFI_LookupEditMetadata(GGadget *g, GEvent *e) {
6137
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6138
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6139
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6140
struct lkdata *lk = &gfi->tables[isgpos];
6143
for ( i=0; i<lk->cnt; ++i ) {
6144
if ( lk->all[i].deleted )
6146
if ( lk->all[i].selected ) {
6147
EditLookup(lk->all[i].lookup,isgpos,gfi->sf);
6149
} else if ( lk->all[i].open ) {
6150
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6151
if ( lk->all[i].subtables[j].deleted )
6153
if ( lk->all[i].subtables[j].selected ) {
6154
EditSubtable(lk->all[i].subtables[j].subtable,isgpos,gfi->sf,NULL);
6164
static int GFI_LookupMergeLookup(GGadget *g, GEvent *e) {
6166
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6167
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6169
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6170
struct lkdata *lk = &gfi->tables[isgpos];
6171
struct selection_bits sel;
6173
struct lkinfo *lkfirst;
6174
struct lksubinfo *sbfirst;
6175
struct lookup_subtable *sub;
6177
LookupParseSelection(lk,&sel);
6178
if ( !sel.sub_table_mergeable && !sel.lookup_mergeable )
6181
buts[0] = _("Do it");
6182
buts[1] = _("_Cancel");
6184
if ( gwwv_ask(_("Cannot be Undone"),(const char **) buts,0,1,_("The Merge operation cannot be reverted.\nDo it anyway?"))==1 )
6186
if ( sel.lookup_mergeable ) {
6188
for ( i=0; i<lk->cnt; ++i ) {
6189
if ( lk->all[i].selected && !lk->all[i].deleted ) {
6190
if ( lkfirst==NULL )
6191
lkfirst = &lk->all[i];
6193
FLMerge(lkfirst->lookup,lk->all[i].lookup);
6194
if ( lkfirst->subtable_cnt+lk->all[i].subtable_cnt >= lkfirst->subtable_max )
6195
lkfirst->subtables = grealloc(lkfirst->subtables,(lkfirst->subtable_max+=lk->all[i].subtable_cnt)*sizeof(struct lksubinfo));
6196
memcpy(lkfirst->subtables+lkfirst->subtable_cnt,
6197
lk->all[i].subtables,lk->all[i].subtable_cnt*sizeof(struct lksubinfo));
6198
lkfirst->subtable_cnt += lk->all[i].subtable_cnt;
6199
for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6200
lk->all[i].subtables[j].subtable->lookup = lkfirst->lookup;
6201
if ( lk->all[i].lookup->subtables!=NULL ) {
6202
for ( sub = lk->all[i].lookup->subtables; sub->next!=NULL; sub = sub->next );
6203
sub->next = lkfirst->lookup->subtables;
6204
lkfirst->lookup->subtables = lk->all[i].lookup->subtables;
6205
lk->all[i].lookup->subtables = NULL;
6207
lk->all[i].subtable_cnt = 0;
6208
lk->all[i].deleted = true;
6209
lk->all[i].open = false;
6210
lk->all[i].selected = false;
6214
} else if ( sel.sub_table_mergeable ) {
6216
for ( i=0; i<lk->cnt; ++i ) if ( !lk->all[i].deleted && lk->all[i].open ) {
6217
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) if ( !lk->all[i].subtables[j].deleted ) {
6218
if ( lk->all[i].subtables[j].selected ) {
6219
if ( sbfirst == NULL )
6220
sbfirst = &lk->all[i].subtables[j];
6222
SFSubTablesMerge(gfi->sf,sbfirst->subtable,lk->all[i].subtables[j].subtable);
6223
lk->all[i].subtables[j].deleted = true;
6224
lk->all[i].subtables[j].selected = false;
6228
if ( sbfirst!=NULL ) /* Can only merge subtables within a lookup, so if we found anything, in a lookup that's everything */
6232
GFI_LookupScrollbars(gfi,isgpos, true);
6233
GFI_LookupEnableButtons(gfi,isgpos);
6238
static int GFI_LookupDeleteLookup(GGadget *g, GEvent *e) {
6240
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6241
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6242
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6243
struct lkdata *lk = &gfi->tables[isgpos];
6246
for ( i=0; i<lk->cnt; ++i ) {
6247
if ( lk->all[i].deleted )
6249
if ( lk->all[i].selected )
6250
lk->all[i].deleted = true;
6251
else if ( lk->all[i].open ) {
6252
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6253
if ( lk->all[i].subtables[j].deleted )
6255
if ( lk->all[i].subtables[j].selected )
6256
lk->all[i].subtables[j].deleted = true;
6261
GFI_LookupScrollbars(gfi,isgpos, true);
6262
GFI_LookupEnableButtons(gfi,isgpos);
6268
static int GFI_LookupRevertLookup(GGadget *g, GEvent *e) {
6270
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6271
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6272
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6273
struct lkdata *lk = &gfi->tables[isgpos];
6276
/* First remove any new lookups, subtables */
6277
for ( i=0; i<lk->cnt; ++i ) {
6278
if ( lk->all[i].new )
6279
SFRemoveLookup(gfi->sf,lk->all[i].lookup);
6281
for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6282
if ( lk->all[i].subtables[j].new )
6283
SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable);
6287
/* Now since we didn't actually delete anything we don't need to do */
6288
/* anything to resurrect them */
6290
/* Finally we need to restore the original order. */
6291
/* But that just means regenerating the lk structure. So free it and */
6295
LookupSetup(lk,isgpos?gfi->sf->gpos_lookups:gfi->sf->gsub_lookups);
6297
GFI_LookupScrollbars(gfi,isgpos, true);
6298
GFI_LookupEnableButtons(gfi,isgpos);
6303
static int import_e_h(GWindow gw, GEvent *event) {
6304
int *done = GDrawGetUserData(gw);
6306
if ( event->type==et_close ) {
6308
} else if ( event->type==et_char ) {
6309
if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
6310
help("fontinfo.html#Lookups");
6314
} else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
6315
switch ( GGadgetGetCid(event->u.control.g)) {
6327
static int GFI_LookupImportLookup(GGadget *g, GEvent *e) {
6329
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
6330
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6331
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6337
GGadgetCreateData gcd[7], *varray[8], *harray[7];
6339
GWindowAttrs wattrs;
6344
/* Figure out what lookups can be imported from which (open) fonts */
6346
for ( j=0; j<2; ++j ) {
6347
for ( ofv=fv_list; ofv!=NULL; ofv=ofv->next ) {
6349
if ( osf->cidmaster ) osf = osf->cidmaster;
6350
osf->ticked = false;
6353
for ( ofv=fv_list; ofv!=NULL; ofv=ofv->next ) {
6355
if ( osf->cidmaster ) osf = osf->cidmaster;
6356
if ( osf->ticked || osf==gfi->sf || osf==gfi->sf->cidmaster ||
6357
( isgpos && osf->gpos_lookups==NULL) ||
6358
(!isgpos && osf->gsub_lookups==NULL) )
6363
ti[cnt].line = true;
6367
ti[cnt].text = (unichar_t *) copy( osf->fontname );
6368
ti[cnt].text_is_1byte = true;
6369
ti[cnt].disabled = true;
6370
ti[cnt].userdata = osf;
6373
for ( otl = isgpos ? osf->gpos_lookups : osf->gsub_lookups; otl!=NULL; otl=otl->next ) {
6375
ti[cnt].text = (unichar_t *) strconcat( " ", otl->lookup_name );
6376
ti[cnt].text_is_1byte = true;
6377
ti[cnt].userdata = otl;
6383
ti = gcalloc((cnt+1),sizeof(GTextInfo));
6386
memset(gcd,0,sizeof(gcd));
6387
memset(label,0,sizeof(label));
6390
label[i].text = (unichar_t *) _("Select lookups from other fonts");
6391
label[i].text_is_1byte = true;
6392
label[i].text_in_resource = true;
6393
gcd[i].gd.label = &label[i];
6394
gcd[i].gd.pos.x = 12; gcd[i].gd.pos.y = 6+6;
6395
gcd[i].gd.flags = gg_visible | gg_enabled;
6396
gcd[i].creator = GLabelCreate;
6397
varray[0] = &gcd[i++]; varray[1] = NULL;
6399
gcd[i].gd.pos.height = 12*12+6;
6400
gcd[i].gd.flags = gg_enabled|gg_visible|gg_list_multiplesel|gg_utf8_popup;
6401
gcd[i].gd.u.list = ti;
6402
gcd[i].creator = GListCreate;
6403
varray[2] = &gcd[i++]; varray[3] = NULL;
6405
gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
6406
label[i].text = (unichar_t *) _("_Import");
6407
label[i].text_is_1byte = true;
6408
label[i].text_in_resource = true;
6409
gcd[i].gd.label = &label[i];
6410
gcd[i].gd.cid = CID_OK;
6411
harray[0] = GCD_Glue; harray[1] = &gcd[i]; harray[2] = GCD_Glue;
6412
gcd[i++].creator = GButtonCreate;
6414
gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
6415
label[i].text = (unichar_t *) _("_Cancel");
6416
label[i].text_is_1byte = true;
6417
label[i].text_in_resource = true;
6418
gcd[i].gd.label = &label[i];
6419
gcd[i].gd.cid = CID_Cancel;
6420
harray[3] = GCD_Glue; harray[4] = &gcd[i]; harray[5] = GCD_Glue; harray[6] = NULL;
6421
gcd[i++].creator = GButtonCreate;
6423
gcd[i].gd.flags = gg_enabled|gg_visible;
6424
gcd[i].gd.u.boxelements = harray;
6425
gcd[i].creator = GHBoxCreate;
6426
varray[4] = &gcd[i++]; varray[5] = NULL; varray[6] = NULL;
6428
gcd[i].gd.pos.x = gcd[i].gd.pos.y = 2;
6429
gcd[i].gd.flags = gg_enabled|gg_visible;
6430
gcd[i].gd.u.boxelements = varray;
6431
gcd[i].creator = GHVGroupCreate;
6433
memset(&wattrs,0,sizeof(wattrs));
6434
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
6435
wattrs.event_masks = ~(1<<et_charup);
6436
wattrs.restrict_input_to_me = 1;
6437
wattrs.undercursor = 1;
6438
wattrs.cursor = ct_pointer;
6439
wattrs.utf8_window_title = _("Import Lookup...");
6440
wattrs.is_dlg = true;
6442
pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
6443
pos.height = GDrawPointsToPixels(NULL,193);
6444
gw = GDrawCreateTopWindow(NULL,&pos,import_e_h,&done,&wattrs);
6446
GGadgetsCreate(gw,&gcd[i]);
6447
GHVBoxSetExpandableRow(gcd[i].ret,1);
6448
GHVBoxSetExpandableCol(gcd[i-1].ret,gb_expandgluesame);
6449
GHVBoxFitWindow(gcd[i].ret);
6450
GTextInfoListFree(ti);
6451
GDrawSetVisible(gw,true);
6454
GDrawProcessOneEvent(NULL);
6457
GTextInfo **ti = GGadgetGetList(gcd[1].ret,&len);
6459
for ( i=0; i<len; ++i ) {
6460
if ( ti[i]->disabled )
6461
osf = ti[i]->userdata;
6462
else if ( ti[i]->selected && ti[i]->text!=NULL )
6463
OTLookupCopyInto(gfi->sf,osf,(OTLookup *) ti[i]->userdata);
6466
GDrawDestroyWindow(gw);
6468
GFI_LookupScrollbars(gfi,isgpos, true);
6469
GFI_LookupEnableButtons(gfi,isgpos);
6474
static int GFI_LookupAspectChange(GGadget *g, GEvent *e) {
6476
if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
6477
struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
6478
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6479
GFI_LookupEnableButtons(gfi,isgpos);
6484
static void LookupExpose(GWindow pixmap, struct gfi_data *gfi, int isgpos) {
6486
struct lkdata *lk = &gfi->tables[isgpos];
6489
r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6490
r.y = LK_MARGIN; r.height = gfi->lkheight-2*LK_MARGIN;
6491
GDrawPushClip(pixmap,&r,&old);
6492
GDrawSetFont(pixmap,gfi->font);
6495
for ( i=0; i<lk->cnt; ++i ) {
6496
if ( lk->all[i].deleted )
6498
if ( lcnt>=lk->off_top ) {
6499
if ( lk->all[i].selected ) {
6500
r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6501
r.y = (lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
6502
GDrawFillRect(pixmap,&r,0xffff00);
6504
r.x = LK_MARGIN-lk->off_left; r.width = (gfi->as&~1);
6505
r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = r.width;
6506
GDrawDrawRect(pixmap,&r,0x000000);
6507
GDrawDrawLine(pixmap,r.x+2,r.y+(r.height/2), r.x+r.width-2,r.y+(r.height/2), 0x000000);
6508
if ( !lk->all[i].open )
6509
GDrawDrawLine(pixmap,r.x+(r.width/2),r.y+2, r.x+(r.width/2),r.y+r.height-2, 0x000000);
6510
GDrawDrawText8(pixmap,r.x+gfi->fh, r.y+gfi->as,
6511
lk->all[i].lookup->lookup_name,-1,NULL,0x000000);
6514
if ( lk->all[i].open ) {
6515
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
6516
if ( lk->all[i].subtables[j].deleted )
6518
if ( lcnt>=lk->off_top ) {
6519
if ( lk->all[i].subtables[j].selected ) {
6520
r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
6521
r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
6522
GDrawFillRect(pixmap,&r,0xffff00);
6524
r.x = LK_MARGIN+2*gfi->fh-lk->off_left;
6525
r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh;
6526
GDrawDrawText8(pixmap,r.x, r.y+gfi->as,
6527
lk->all[i].subtables[j].subtable->subtable_name,-1,NULL,0x000000);
6533
GDrawPopClip(pixmap,&old);
6536
static void LookupDeselect(struct lkdata *lk) {
6539
for ( i=0; i<lk->cnt; ++i ) {
6540
lk->all[i].selected = false;
6541
for ( j=0; j<lk->all[i].subtable_cnt; ++j )
6542
lk->all[i].subtables[j].selected = false;
6546
static void LookupPopup(GWindow gw,OTLookup *otl,struct lookup_subtable *sub) {
6547
extern char *lookup_type_names[2][10];
6548
static char popup_msg[300];
6551
FeatureScriptLangList *fl;
6552
struct scriptlanglist *sl;
6555
if ( (otl->lookup_type&0xff)>= 0xf0 ) {
6556
if ( otl->lookup_type==kern_statemachine )
6557
lookuptype = _("Kerning State Machine");
6558
else if ( otl->lookup_type==morx_indic )
6559
lookuptype = _("Indic State Machine");
6560
else if ( otl->lookup_type==morx_context )
6561
lookuptype = _("Contextual State Machine");
6563
lookuptype = _("Contextual State Machine");
6564
} else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
6565
lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
6567
lookuptype = S_("LookupType|Unknown");
6568
snprintf(popup_msg,sizeof(popup_msg), "%s\n", lookuptype);
6569
pos = strlen(popup_msg);
6571
if ( sub!=NULL && otl->lookup_type==gpos_pair && sub->kc!=NULL ) {
6572
snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_("(kerning class)\n") );
6573
pos += strlen( popup_msg+pos );
6576
if ( otl->features==NULL )
6577
snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_("Not attached to a feature"));
6579
for ( fl=otl->features; fl!=NULL && pos<sizeof(popup_msg)-2; fl=fl->next ) {
6580
snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c: ",
6581
fl->featuretag>>24, fl->featuretag>>16,
6582
fl->featuretag>>8, fl->featuretag&0xff );
6583
pos += strlen( popup_msg+pos );
6584
for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
6585
snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c{",
6586
sl->script>>24, sl->script>>16,
6587
sl->script>>8, sl->script&0xff );
6588
pos += strlen( popup_msg+pos );
6589
for ( l=0; l<sl->lang_cnt; ++l ) {
6590
uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
6591
snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c,",
6593
lang>>8, lang&0xff );
6594
pos += strlen( popup_msg+pos );
6596
if ( popup_msg[pos-1]==',' )
6597
popup_msg[pos-1] = '}';
6598
else if ( pos<sizeof(popup_msg)-2 )
6599
popup_msg[pos++] = '}';
6600
if ( pos<sizeof(popup_msg)-2 )
6601
popup_msg[pos++] = ' ';
6603
if ( pos<sizeof(popup_msg)-2 )
6604
popup_msg[pos++] = '\n';
6607
if ( pos>=sizeof(popup_msg) )
6608
pos = sizeof(popup_msg)-1;
6609
popup_msg[pos]='\0';
6610
GGadgetPreparePopup8(gw,popup_msg);
6613
static void AddDFLT(OTLookup *otl) {
6614
FeatureScriptLangList *fl;
6615
struct scriptlanglist *sl;
6618
for ( fl = otl->features; fl!=NULL; fl=fl->next ) {
6619
int hasDFLT = false, hasdflt=false;
6620
for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
6621
if ( sl->script == DEFAULT_SCRIPT )
6623
for ( l=0; l<sl->lang_cnt; ++l ) {
6624
uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
6625
if ( lang==DEFAULT_LANG ) {
6630
if ( hasdflt && hasDFLT )
6633
if ( hasDFLT /* Already there */ ||
6634
!hasdflt /* Shouldn't add it */ )
6636
sl = chunkalloc(sizeof(struct scriptlanglist));
6637
sl->script = DEFAULT_SCRIPT;
6639
sl->langs[0] = DEFAULT_LANG;
6640
sl->next = fl->scripts;
6645
static void AALTRemoveOld(SplineFont *sf,struct lkdata *lk) {
6647
FeatureScriptLangList *fl, *prev;
6649
for ( i=0; i<lk->cnt; ++i ) {
6650
if ( lk->all[i].deleted )
6653
for ( fl = lk->all[i].lookup->features; fl!=NULL; prev=fl, fl=fl->next ) {
6654
if ( fl->featuretag==CHR('a','a','l','t') ) {
6655
if ( fl==lk->all[i].lookup->features && fl->next==NULL )
6656
lk->all[i].deleted = true;
6659
lk->all[i].lookup->features = fl->next;
6661
prev->next = fl->next;
6663
FeatureScriptLangListFree(fl);
6672
struct sllk { uint32 script; int cnt, max; OTLookup **lookups; int lcnt, lmax; uint32 *langs; };
6674
static void AddOTLToSllk(struct sllk *sllk, OTLookup *otl, struct scriptlanglist *sl) {
6677
if ( otl->lookup_type==gsub_single || otl->lookup_type==gsub_alternate ) {
6678
for ( i=0; i<sllk->cnt; ++i )
6679
if ( sllk->lookups[i]==otl )
6681
if ( i==sllk->cnt ) {
6682
if ( sllk->cnt>=sllk->max )
6683
sllk->lookups = grealloc(sllk->lookups,(sllk->max+=5)*sizeof(OTLookup *));
6684
sllk->lookups[sllk->cnt++] = otl;
6685
for ( l=0; l<sl->lang_cnt; ++l ) {
6686
uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
6687
for ( j=0; j<sllk->lcnt; ++j )
6688
if ( sllk->langs[j]==lang )
6690
if ( j==sllk->lcnt ) {
6691
if ( sllk->lcnt>=sllk->lmax )
6692
sllk->langs = grealloc(sllk->langs,(sllk->lmax+=sl->lang_cnt+MAX_LANG)*sizeof(uint32));
6693
sllk->langs[sllk->lcnt++] = lang;
6697
} else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ) {
6698
struct lookup_subtable *sub;
6699
for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
6700
FPST *fpst = sub->fpst;
6701
for ( j=0; j<fpst->rule_cnt; ++j ) {
6702
struct fpst_rule *r = &fpst->rules[j];
6703
for ( k=0; k<r->lookup_cnt; ++k )
6704
AddOTLToSllk(sllk,r->lookups[k].lookup,sl);
6708
/* reverse contextual chaining is weird and I shall ignore it. Adobe does too*/
6711
static char *ComponentsFromPSTs(PST **psts,int pcnt) {
6717
/* First find all the names */
6718
for ( i=0; i<pcnt; ++i ) {
6719
char *nlist = psts[i]->u.alt.components;
6720
char *start, *pt, ch;
6722
for ( start = nlist; ; ) {
6723
while ( *start==' ' )
6727
for ( pt=start; *pt!=' ' && *pt!='\0'; ++pt );
6728
ch = *pt; *pt = '\0';
6729
for ( j=0; j<ncnt; ++j )
6730
if ( strcmp( start,names[j])==0 )
6734
names = grealloc(names,(nmax+=10)*sizeof(char *));
6735
names[ncnt++] = copy(start);
6743
for ( i=0; i<ncnt; ++i )
6744
len += strlen(names[i])+1;
6745
if ( len==0 ) len=1;
6748
for ( i=0; i<ncnt; ++i ) {
6749
strcpy(ret+len,names[i]);
6750
len += strlen(names[i]);
6758
for ( i=0; i<ncnt; ++i )
6764
static int SllkMatch(struct sllk *sllk,int s1,int s2) {
6767
if ( sllk[s1].cnt != sllk[s2].cnt )
6770
for ( i=0; i<sllk[s1].cnt; ++i ) {
6771
if ( sllk[s1].lookups[i] != sllk[s2].lookups[i] )
6778
static void AALTCreateNew(SplineFont *sf, struct lkdata *lk) {
6779
/* different script/lang combinations may need different 'aalt' lookups */
6780
/* well, let's just say different script combinations */
6781
/* for each script/lang combo find all single/alternate subs for each */
6782
/* glyph. Merge those choices and create new lookup with that info */
6783
struct sllk *sllk = NULL;
6784
int sllk_cnt=0, sllk_max = 0;
6787
struct lookup_subtable *sub;
6789
FeatureScriptLangList *fl;
6790
struct scriptlanglist *sl;
6795
/* Find all scripts, and all the single/alternate lookups for each */
6796
/* and all the languages used for these in each script */
6797
for ( i=0; i<lk->cnt; ++i ) {
6798
otl = lk->all[i].lookup;
6799
for ( fl=otl->features; fl!=NULL; fl=fl->next )
6800
for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
6801
for ( s=0; s<sllk_cnt; ++s )
6802
if ( sl->script == sllk[s].script )
6804
if ( s==sllk_cnt ) {
6805
if ( sllk_cnt>=sllk_max )
6806
sllk = grealloc(sllk,(sllk_max+=10)*sizeof(struct sllk));
6807
memset(&sllk[sllk_cnt],0,sizeof(struct sllk));
6808
sllk[sllk_cnt++].script = sl->script;
6810
AddOTLToSllk(&sllk[s], otl,sl);
6813
/* Each of these gets its own gsub_alternate lookup which gets inserted */
6814
/* at the head of the lookup list. Each lookup has one subtable */
6815
for ( i=0; i<sllk_cnt; ++i ) {
6816
if ( sllk[i].cnt==0 ) /* Script used, but provides no alternates */
6818
/* Make the new lookup (and all its supporting data structures) */
6819
otl = chunkalloc(sizeof(OTLookup));
6820
otl->lookup_type = gsub_alternate;
6821
otl->lookup_flags = sllk[i].lookups[0]->lookup_flags & pst_r2l;
6822
otl->features = fl = chunkalloc(sizeof(FeatureScriptLangList));
6823
fl->featuretag = CHR('a','a','l','t');
6824
/* Any other scripts with the same lookup set? */
6825
for ( j=i; j<sllk_cnt; ++j ) {
6826
if ( i==j || SllkMatch(sllk,i,j)) {
6827
sl = chunkalloc(sizeof(struct scriptlanglist));
6828
sl->next = fl->scripts;
6830
sl->script = sllk[j].script;
6831
sl->lang_cnt = sllk[j].lcnt;
6832
if ( sl->lang_cnt>MAX_LANG )
6833
sl->morelangs = galloc((sl->lang_cnt-MAX_LANG)*sizeof(uint32));
6834
for ( l=0; l<sl->lang_cnt; ++l )
6836
sl->langs[l] = sllk[j].langs[l];
6838
sl->morelangs[l-MAX_LANG] = sllk[j].langs[l];
6839
if ( i!=j ) sllk[j].cnt = 0; /* Mark as processed */
6842
otl->subtables = sub = chunkalloc(sizeof(struct lookup_subtable));
6844
sub->per_glyph_pst_or_kern = true;
6846
/* Add it to the various lists it needs to be in */
6847
if ( lk->cnt>=lk->max )
6848
lk->all = grealloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
6849
for ( k=lk->cnt; k>0; --k )
6850
lk->all[k] = lk->all[k-1];
6851
memset(&lk->all[0],0,sizeof(struct lkinfo));
6852
lk->all[0].lookup = otl;
6853
lk->all[0].new = true;
6855
otl->next = sf->gsub_lookups;
6856
sf->gsub_lookups = otl;
6858
/* Now add the new subtable */
6859
lk->all[0].subtables = gcalloc(1,sizeof(struct lksubinfo));
6860
lk->all[0].subtable_cnt = lk->all[0].subtable_max = 1;
6861
lk->all[0].subtables[0].subtable = sub;
6862
lk->all[0].subtables[0].new = true;
6864
/* Now look at every glyph in the font, and see if it has any of the */
6865
/* lookups we are interested in, and if it does, build a new pst */
6866
/* containing all posibilities listed on any of them */
6867
if ( sf->cidmaster ) sf = sf->cidmaster;
6868
psts = galloc(sllk[i].cnt*sizeof(PST *));
6871
_sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
6872
for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
6874
for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
6875
if ( pst->subtable==NULL )
6877
for ( j=0; j<sllk[i].cnt; ++j )
6878
if ( pst->subtable->lookup == sllk[i].lookups[j] )
6880
if ( j<sllk[i].cnt )
6885
pst = chunkalloc(sizeof(PST));
6886
pst->subtable = sub;
6887
pst->type = pst_alternate;
6888
pst->next = sc->possub;
6890
pst->u.alt.components = ComponentsFromPSTs(psts,pcnt);
6893
} while ( k<sf->subfontcnt );
6895
NameOTLookup(otl,sf);
6898
for ( i=0; i<sllk_cnt; ++i ) {
6899
free( sllk[i].langs );
6900
free( sllk[i].lookups );
6905
static void lookupmenu_dispatch(GWindow v, GMenuItem *mi, GEvent *e) {
6907
struct gfi_data *gfi = GDrawGetUserData(v);
6911
if ( mi->mid==CID_SaveFeat || mi->mid==CID_SaveLookup ) {
6912
char *filename, *defname;
6914
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
6915
struct lkdata *lk = &gfi->tables[isgpos];
6916
OTLookup *otl = NULL;
6918
if ( mi->mid==CID_SaveLookup ) {
6919
for ( i=0; i<lk->cnt && (!lk->all[i].selected || lk->all[i].deleted); ++i );
6922
otl = lk->all[i].lookup;
6924
defname = strconcat(gfi->sf->fontname,".fea");
6925
filename = gwwv_save_filename(_("Feature file?"),defname,"*.fea");
6927
if ( filename==NULL )
6929
/* Convert to def encoding !!! */
6930
out = fopen(filename,"w");
6932
gwwv_post_error(_("Cannot open file"),_("Cannot open %s"), filename );
6937
FeatDumpOneLookup( out,gfi->sf,otl );
6939
FeatDumpFontLookups( out,gfi->sf );
6941
gwwv_post_error(_("Output error"),_("An error occurred writing %s"), filename );
6948
} else if ( mi->mid==CID_AddAllAlternates ) {
6949
/* First we want to remove any old aalt-only lookups */
6950
/* (and remove the 'aalt' tag from any lookups with multiple features) */
6951
/* Then add the new ones */
6952
struct lkdata *lk = &gfi->tables[0]; /* GSUB */
6953
int has_aalt_only=false, has_aalt_mixed = false;
6955
FeatureScriptLangList *fl;
6957
for ( i=0; i<lk->cnt; ++i ) {
6958
if ( lk->all[i].deleted )
6960
for ( fl = lk->all[i].lookup->features; fl!=NULL; fl=fl->next ) {
6961
if ( fl->featuretag==CHR('a','a','l','t') ) {
6962
if ( fl==lk->all[i].lookup->features && fl->next==NULL )
6963
has_aalt_only = true;
6965
has_aalt_mixed = true;
6970
if ( has_aalt_only || has_aalt_mixed ) {
6971
#if defined(FONTFORGE_CONFIG_GDRAW)
6972
buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2] = NULL;
6973
#elif defined(FONTFORGE_CONFIG_GTK)
6974
buts[0] = GTK_STOCK_OK; buts[1] = GTK_STOCK_CANCEL; buts[2] = NULL;
6976
ret = gwwv_ask(has_aalt_only?_("Lookups will be removed"):_("Feature tags will be removed"),
6977
(const char **) buts,0,1,
6979
_("Warning: There are already some 'aalt' lookups in\n"
6980
"the font. If you proceed with this command those\n"
6981
"lookups will be removed and new lookups will be\n"
6982
"generated. The old information will be LOST.\n"
6983
" Is that what you want?") :
6985
_("Warning: There are already some 'aalt' lookups in\n"
6986
"the font but there are other feature tags associated\n"
6987
"with these lookups. If you proceed with this command\n"
6988
"the 'aalt' tag will be removed from those lookups,\n"
6989
"and new lookups will be generate which will NOT be\n"
6990
"associated with the other feature tag(s).\n"
6991
" Is that what you want?") :
6992
_("Warning: There are already some 'aalt' lookups in\n"
6993
"the font, some have no other feature tags associated\n"
6994
"with them and these will be removed, others have other\n"
6995
"tags associated and these will remain while the 'aalt'\n"
6996
"tag will be removed from the lookup -- a new lookup\n"
6997
"will be generated which is not associated with any\n"
6998
"other feature tags.\n"
6999
" Is that what you want?") );
7002
AALTRemoveOld(gfi->sf,lk);
7004
AALTCreateNew(gfi->sf,lk);
7005
GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+0)),NULL,true);
7006
} else if ( mi->mid==CID_AddDFLT ) {
7007
struct selection_bits sel;
7010
int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
7011
struct lkdata *lk = &gfi->tables[isgpos];
7013
LookupParseSelection(lk,&sel);
7014
#if defined(FONTFORGE_CONFIG_GDRAW)
7015
if ( sel.lookup_cnt==0 ) {
7016
buts[0] = _("_Apply to All"); buts[1] = _("_Cancel"); buts[2]=NULL;
7018
buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = _("_Cancel"); buts[3]=NULL;
7020
#elif defined(FONTFORGE_CONFIG_GTK)
7021
if ( sel.lookup_cnt==0 ) {
7022
buts[0] = _("_Apply to All"); buts[1] = GTK_STOCK_CANCEL; buts[2]=NULL;
7024
buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = GTK_STOCK_CANCEL; buts[3]=NULL;
7027
ret = gwwv_ask(_("Apply to:"),(const char **) buts,0,sel.lookup_cnt==0?1:2,_("Apply change to which lookups?"));
7031
else if ( (ret==1 && sel.lookup_cnt==0) || (ret==2 && sel.lookup_cnt!=0))
7033
for ( i=0; i<lk->cnt; ++i ) {
7034
if ( lk->all[i].deleted )
7036
if ( lk->all[i].selected || toall ) {
7037
AddDFLT(lk->all[i].lookup);
7041
memset(&dummy,0,sizeof(dummy));
7042
dummy.type = et_controlevent;
7043
dummy.u.control.subtype = et_buttonpress;
7044
dummy.u.control.g = GWidgetGetControl(gfi->gw,mi->mid);
7045
dummy.w = GGadgetGetWindow(dummy.u.control.g);
7046
dummy.u.control.u.button.button = e->u.mouse.button;
7047
GGadgetDispatchEvent(dummy.u.control.g,&dummy);
7051
static GMenuItem lookuppopupmenu[] = {
7052
{ { (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 },
7053
{ { (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 },
7054
{ { (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 },
7055
{ { (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 },
7056
{ { (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 },
7057
{ { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
7058
{ { (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 },
7059
{ { (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 },
7060
{ { (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 },
7061
{ { (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 },
7062
{ { (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 },
7063
{ { (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 },
7064
{ { (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 },
7065
{ { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
7066
{ { (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 },
7067
{ { (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 },
7068
{ { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
7069
{ { (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 },
7070
{ { (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_RevertLookups },
7071
{ { (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 },
7074
static void LookupMenu(struct gfi_data *gfi,struct lkdata *lk,GEvent *event) {
7075
struct selection_bits sel;
7078
LookupParseSelection(lk,&sel);
7079
for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i ) {
7080
switch ( lookuppopupmenu[i].mid ) {
7085
lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt!=1;
7088
lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt==0;
7090
case CID_LookupDown:
7091
lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt==0;
7093
case CID_LookupBottom:
7094
lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt!=1;
7096
case CID_LookupSort:
7097
lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
7100
lookuppopupmenu[i].ti.disabled = sel.lookup_cnt+sel.sub_cnt>1;
7102
case CID_AddSubtable:
7103
lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt>1) && (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
7105
case CID_EditMetadata:
7106
lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt!=0) &&
7107
(sel.lookup_cnt!=0 || sel.sub_cnt!=1);
7109
case CID_EditSubtable:
7110
lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=0 || sel.sub_cnt!=1;
7112
case CID_DeleteLookup:
7113
lookuppopupmenu[i].ti.disabled = sel.lookup_cnt==0 && sel.sub_cnt==0;
7115
case CID_MergeLookup:
7116
lookuppopupmenu[i].ti.disabled = !(
7117
(sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
7118
(sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable) );
7120
case CID_RevertLookups:
7121
lookuppopupmenu[i].ti.disabled = false;
7123
case CID_SaveLookup:
7124
lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=1 || sel.sub_cnt!=0;
7125
for ( j=0; j<lk->cnt; ++j ) if ( lk->all[j].selected ) {
7126
int type = lk->all[j].lookup->lookup_type;
7127
if ( type==kern_statemachine || type==morx_indic ||
7128
type==morx_context || type==morx_insert )
7129
lookuppopupmenu[i].ti.disabled = true;
7134
lookuppopupmenu[i].ti.disabled = lk->cnt==0;
7136
case CID_AddAllAlternates:
7137
lookuppopupmenu[i].ti.disabled = lk->cnt==0 || lk==&gfi->tables[1]/*Only applies to GSUB*/;
7140
lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
7144
GMenuCreatePopupMenu(event->w,event, lookuppopupmenu);
7148
static void LookupMouse(struct gfi_data *gfi, int isgpos, GEvent *event) {
7149
struct lkdata *lk = &gfi->tables[isgpos];
7150
int l = (event->u.mouse.y-LK_MARGIN)/gfi->fh + lk->off_top;
7151
int inbox = event->u.mouse.x>=LK_MARGIN &&
7152
event->u.mouse.x>=LK_MARGIN-lk->off_left &&
7153
event->u.mouse.x<=LK_MARGIN-lk->off_left+gfi->as+1;
7154
GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
7157
if ( l<0 || event->u.mouse.y>=(gfi->lkheight-2*LK_MARGIN) )
7161
for ( i=0; i<lk->cnt; ++i ) {
7162
if ( lk->all[i].deleted )
7165
if ( event->type==et_mouseup )
7167
else if ( event->type==et_mousemove ) {
7168
LookupPopup(gw,lk->all[i].lookup,NULL);
7171
if ( inbox || event->u.mouse.clicks>1 ) {
7172
lk->all[i].open = !lk->all[i].open;
7173
GFI_LookupScrollbars(gfi, isgpos, true);
7176
if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
7178
lk->all[i].selected = true;
7180
lk->all[i].selected = !lk->all[i].selected;
7181
GFI_LookupEnableButtons(gfi,isgpos);
7182
GDrawRequestExpose(gw,NULL,true);
7183
if ( event->u.mouse.button==3 )
7184
LookupMenu(gfi,lk,event);
7189
if ( lk->all[i].open ) {
7190
for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
7191
if ( lk->all[i].subtables[j].deleted )
7194
if ( event->type==et_mouseup )
7196
else if ( event->type==et_mousemove ) {
7197
LookupPopup(gw,lk->all[i].lookup,lk->all[i].subtables[j].subtable);
7201
return; /* Can't open this guy */
7202
if ( event->u.mouse.clicks>1 )
7203
LookupSubtableContents(gfi,isgpos);
7205
if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
7207
lk->all[i].subtables[j].selected = true;
7209
lk->all[i].subtables[j].selected = !lk->all[i].subtables[j].selected;
7210
GFI_LookupEnableButtons(gfi,isgpos);
7211
GDrawRequestExpose(gw,NULL,true);
7212
if ( event->u.mouse.button==3 )
7213
LookupMenu(gfi,lk,event);
7224
static int lookups_e_h(GWindow gw, GEvent *event, int isgpos) {
7225
struct gfi_data *gfi = GDrawGetUserData(gw);
7227
if (( event->type==et_mouseup || event->type==et_mousedown ) &&
7228
(event->u.mouse.button==4 || event->u.mouse.button==5) ) {
7229
return( GGadgetDispatchEvent(GWidgetGetControl(gw,CID_LookupVSB+isgpos),event));
7232
switch ( event->type ) {
7234
return( GFI_Char(gfi,event) );
7236
LookupExpose(gw,gfi,isgpos);
7238
case et_mousedown: case et_mousemove: case et_mouseup:
7239
LookupMouse(gfi,isgpos,event);
7243
GDrawGetSize(gw,&r);
7244
gfi->lkheight = r.height; gfi->lkwidth = r.width;
7245
GFI_LookupScrollbars(gfi,false,false);
7246
GFI_LookupScrollbars(gfi,true,false);
7253
static int gposlookups_e_h(GWindow gw, GEvent *event) {
7254
return( lookups_e_h(gw,event,true));
7257
static int gsublookups_e_h(GWindow gw, GEvent *event) {
7258
return( lookups_e_h(gw,event,false));
7261
void FontInfo(SplineFont *sf,int defaspect,int sync) {
7264
GWindowAttrs wattrs;
7265
GTabInfo aspects[22], vaspects[5], lkaspects[3];
7266
GGadgetCreateData mgcd[10], ngcd[17], psgcd[30], tngcd[8],
7267
pgcd[8], vgcd[19], pangcd[22], comgcd[3], txgcd[23],
7268
mfgcd[8], mcgcd[8], szgcd[19], mkgcd[5], metgcd[29], vagcd[3], ssgcd[23],
7269
xugcd[7], dgcd[6], ugcd[4], gaspgcd[5], gaspgcd_def[2], lksubgcd[2][4],
7270
lkgcd[2], lkbuttonsgcd[15];
7271
GGadgetCreateData mb[2], mb2, nb[2], nb2, nb3, xub[2], psb[2], psb2[3], ppbox[3],
7272
vbox[4], metbox[2], ssbox[2], panbox[2], combox[2], mkbox[3],
7273
txbox[5], ubox[2], dbox[2],
7274
mcbox[3], mfbox[3], szbox[6], tnboxes[4], gaspboxes[3],
7276
GGadgetCreateData *marray[7], *marray2[9], *narray[26], *narray2[7], *narray3[3],
7277
*xuarray[13], *psarray[10], *psarray2[21], *psarray3[3], *psarray4[10],
7278
*ppbuttons[5], *pparray[4], *vradio[5], *varray[38], *metarray[46],
7279
*ssarray[58], *panarray[38], *comarray[2],
7280
*mkarray[3], *mkarray2[4], *txarray[5], *txarray2[30],
7281
*txarray3[6], *txarray4[6], *uarray[3], *darray[10],
7282
*mcarray[13], *mcarray2[7],
7283
*mfarray[14], *szarray[7], *szarray2[5], *szarray3[7],
7284
*szarray4[4], *szarray5[6], *tnvarray[4], *tnharray[6], *tnharray2[5], *gaspharray[6],
7285
*gaspvarray[3], *lkarray[2][7], *lkbuttonsarray[17], *lkharray[3];
7286
GTextInfo mlabel[10], nlabel[16], pslabel[30], tnlabel[7],
7287
plabel[8], vlabel[19], panlabel[22], comlabel[3], txlabel[23],
7288
mflabel[8], mclabel[8], szlabel[17], mklabel[5], metlabel[28],
7289
sslabel[23], xulabel[6], dlabel[5], ulabel[1], gasplabel[5],
7291
GTextInfo *namelistnames;
7293
char iabuf[20], upbuf[20], uwbuf[20], asbuf[20], dsbuf[20],
7294
vbuf[20], uibuf[12], vorig[20], embuf[20];
7295
char dszbuf[20], dsbbuf[20], dstbuf[21], sibuf[20], swbuf[20];
7299
/* static unichar_t monospace[] = { 'c','o','u','r','i','e','r',',','m', 'o', 'n', 'o', 's', 'p', 'a', 'c', 'e',',','c','a','s','l','o','n',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };*/
7300
static unichar_t sans[] = { 'h','e','l','v','e','t','i','c','a',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
7304
char createtime[200], modtime[200];
7305
unichar_t *tmpcreatetime, *tmpmodtime;
7307
const struct tm *tm;
7308
struct matrixinit mi, gaspmi;
7312
if ( sf->fontinfo!=NULL ) {
7313
GDrawSetVisible(((struct gfi_data *) (sf->fontinfo))->gw,true);
7314
GDrawRaise( ((struct gfi_data *) (sf->fontinfo))->gw );
7317
if ( defaspect==-1 )
7318
defaspect = last_aspect;
7320
d = gcalloc(1,sizeof(struct gfi_data));
7323
memset(&wattrs,0,sizeof(wattrs));
7324
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg;
7325
wattrs.event_masks = ~(1<<et_charup);
7326
wattrs.is_dlg = true;
7328
wattrs.mask |= wam_restrict;
7329
wattrs.restrict_input_to_me = 1;
7331
wattrs.undercursor = 1;
7332
wattrs.cursor = ct_pointer;
7333
snprintf(title,sizeof(title),_("Font Information for %.90s"),
7335
wattrs.utf8_window_title = title;
7337
#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
7338
pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268+85));
7340
pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268));
7342
pos.height = GDrawPointsToPixels(NULL,375);
7343
gw = GDrawCreateTopWindow(NULL,&pos,e_h,d,&wattrs);
7348
d->texdata = sf->texdata;
7350
memset(&nlabel,0,sizeof(nlabel));
7351
memset(&ngcd,0,sizeof(ngcd));
7353
nlabel[0].text = (unichar_t *) _("Fo_ntname:");
7354
nlabel[0].text_is_1byte = true;
7355
nlabel[0].text_in_resource = true;
7356
ngcd[0].gd.label = &nlabel[0];
7357
ngcd[0].gd.pos.x = 12; ngcd[0].gd.pos.y = 6+6;
7358
ngcd[0].gd.flags = gg_visible | gg_enabled;
7359
ngcd[0].creator = GLabelCreate;
7361
ngcd[1].gd.pos.x = 115; ngcd[1].gd.pos.y = ngcd[0].gd.pos.y-6; ngcd[1].gd.pos.width = 137;
7362
ngcd[1].gd.flags = gg_visible | gg_enabled;
7363
nlabel[1].text = (unichar_t *) sf->fontname;
7364
nlabel[1].text_is_1byte = true;
7365
ngcd[1].gd.label = &nlabel[1];
7366
ngcd[1].gd.cid = CID_Fontname;
7367
ngcd[1].gd.handle_controlevent = GFI_NameChange;
7368
ngcd[1].creator = GTextFieldCreate;
7370
nlabel[2].text = (unichar_t *) _("_Family Name:");
7371
nlabel[2].text_is_1byte = true;
7372
nlabel[2].text_in_resource = true;
7373
ngcd[2].gd.label = &nlabel[2];
7374
ngcd[2].gd.pos.x = 12; ngcd[2].gd.pos.y = ngcd[0].gd.pos.y+26;
7375
ngcd[2].gd.flags = gg_visible | gg_enabled;
7376
ngcd[2].creator = GLabelCreate;
7378
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;
7379
ngcd[3].gd.flags = gg_visible | gg_enabled;
7380
nlabel[3].text = (unichar_t *) (sf->familyname?sf->familyname:sf->fontname);
7381
nlabel[3].text_is_1byte = true;
7382
ngcd[3].gd.label = &nlabel[3];
7383
ngcd[3].gd.cid = CID_Family;
7384
ngcd[3].gd.handle_controlevent = GFI_FamilyChange;
7385
ngcd[3].creator = GTextFieldCreate;
7386
if ( sf->familyname==NULL || strstr(sf->familyname,"Untitled")==sf->familyname )
7387
d->family_untitled = true;
7389
ngcd[4].gd.pos.x = 12; ngcd[4].gd.pos.y = ngcd[3].gd.pos.y+26+6;
7390
nlabel[4].text = (unichar_t *) _("Name For Human_s:");
7391
nlabel[4].text_is_1byte = true;
7392
nlabel[4].text_in_resource = true;
7393
ngcd[4].gd.label = &nlabel[4];
7394
ngcd[4].gd.flags = gg_visible | gg_enabled;
7395
ngcd[4].creator = GLabelCreate;
7397
ngcd[5].gd.pos.x = 115; ngcd[5].gd.pos.y = ngcd[4].gd.pos.y-6; ngcd[5].gd.pos.width = 137;
7398
ngcd[5].gd.flags = gg_visible | gg_enabled;
7399
nlabel[5].text = (unichar_t *) (sf->fullname?sf->fullname:sf->fontname);
7400
nlabel[5].text_is_1byte = true;
7401
ngcd[5].gd.label = &nlabel[5];
7402
ngcd[5].gd.cid = CID_Human;
7403
ngcd[5].gd.handle_controlevent = GFI_HumanChange;
7404
ngcd[5].creator = GTextFieldCreate;
7405
if ( sf->fullname==NULL || strstr(sf->fullname,"Untitled")==sf->fullname )
7406
d->human_untitled = true;
7408
nlabel[6].text = (unichar_t *) _("_Weight");
7409
nlabel[6].text_is_1byte = true;
7410
nlabel[6].text_in_resource = true;
7411
ngcd[6].gd.label = &nlabel[6];
7412
ngcd[6].gd.pos.x = ngcd[4].gd.pos.x; ngcd[6].gd.pos.y = ngcd[4].gd.pos.y+26;
7413
ngcd[6].gd.flags = gg_visible | gg_enabled;
7414
ngcd[6].creator = GLabelCreate;
7416
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;
7417
ngcd[7].gd.flags = gg_visible | gg_enabled;
7418
nlabel[7].text = (unichar_t *) (sf->weight?sf->weight:"Regular");
7419
nlabel[7].text_is_1byte = true;
7420
ngcd[7].gd.label = &nlabel[7];
7421
ngcd[7].gd.cid = CID_Weight;
7422
ngcd[7].creator = GTextFieldCreate;
7424
ngcd[8].gd.pos.x = 12; ngcd[8].gd.pos.y = ngcd[6].gd.pos.y+26;
7425
nlabel[8].text = (unichar_t *) _("_Version:");
7426
nlabel[8].text_is_1byte = true;
7427
nlabel[8].text_in_resource = true;
7428
ngcd[8].gd.label = &nlabel[8];
7429
ngcd[8].gd.flags = gg_visible | gg_enabled;
7430
ngcd[8].creator = GLabelCreate;
7432
ngcd[9].gd.pos.x = 115; ngcd[9].gd.pos.y = ngcd[8].gd.pos.y-6; ngcd[9].gd.pos.width = 137;
7433
ngcd[9].gd.flags = gg_visible | gg_enabled;
7434
nlabel[9].text = (unichar_t *) (sf->version?sf->version:"");
7435
nlabel[9].text_is_1byte = true;
7436
if ( sf->subfontcnt!=0 ) {
7437
sprintf( vbuf,"%g", sf->cidversion );
7438
nlabel[9].text = (unichar_t *) vbuf;
7440
ngcd[9].gd.label = &nlabel[9];
7441
ngcd[9].gd.cid = CID_Version;
7442
ngcd[9].creator = GTextFieldCreate;
7444
ngcd[10].gd.pos.x = 12; ngcd[10].gd.pos.y = ngcd[8].gd.pos.y+28;
7445
nlabel[10].text = (unichar_t *) _("_Base Filename:");
7446
nlabel[10].text_is_1byte = true;
7447
nlabel[10].text_in_resource = true;
7448
ngcd[10].gd.label = &nlabel[10];
7449
ngcd[10].gd.popup_msg = (unichar_t *) _("Use this as the default base for the filename\nwhen generating a font." );
7450
ngcd[10].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
7451
ngcd[10].creator = GLabelCreate;
7453
ngcd[11].gd.pos.x = 95; ngcd[11].gd.pos.y = ngcd[10].gd.pos.y-11;
7454
/* GT: The space in front of "Same" makes things line up better */
7455
nlabel[11].text = (unichar_t *) _(" Same as Fontname");
7456
nlabel[11].text_is_1byte = true;
7457
ngcd[11].gd.label = &nlabel[11];
7458
ngcd[11].gd.flags = sf->defbasefilename==NULL ? (gg_visible | gg_enabled | gg_cb_on ) : (gg_visible | gg_enabled);
7459
ngcd[11].gd.cid = CID_SameAsFontname;
7460
ngcd[11].creator = GRadioCreate;
7462
ngcd[12].gd.pos.x = 95; ngcd[12].gd.pos.y = ngcd[10].gd.pos.y+11;
7463
nlabel[12].text = (unichar_t *) "";
7464
nlabel[12].text_is_1byte = true;
7465
ngcd[12].gd.label = &nlabel[12];
7466
ngcd[12].gd.flags = sf->defbasefilename!=NULL ?
7467
(gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold ) :
7468
(gg_visible | gg_enabled | gg_rad_continueold);
7469
ngcd[12].gd.cid = CID_HasDefBase;
7470
ngcd[12].creator = GRadioCreate;
7472
ngcd[13].gd.pos.x = 115; ngcd[13].gd.pos.y = ngcd[12].gd.pos.y-4; ngcd[13].gd.pos.width = 137;
7473
ngcd[13].gd.flags = gg_visible | gg_enabled;
7474
nlabel[13].text = (unichar_t *) (sf->defbasefilename?sf->defbasefilename:"");
7475
nlabel[13].text_is_1byte = true;
7476
ngcd[13].gd.label = &nlabel[13];
7477
ngcd[13].gd.cid = CID_DefBaseName;
7478
ngcd[13].gd.handle_controlevent = GFI_DefBaseChange;
7479
ngcd[13].creator = GTextFieldCreate;
7481
ngcd[14].gd.pos.x = 12; ngcd[14].gd.pos.y = ngcd[10].gd.pos.y+22;
7482
ngcd[14].gd.flags = gg_visible | gg_enabled;
7483
nlabel[14].text = (unichar_t *) _("Copy_right:");
7484
nlabel[14].text_is_1byte = true;
7485
nlabel[14].text_in_resource = true;
7486
ngcd[14].gd.label = &nlabel[14];
7487
ngcd[14].creator = GLabelCreate;
7489
ngcd[15].gd.pos.x = 12; ngcd[15].gd.pos.y = ngcd[14].gd.pos.y+14;
7490
ngcd[15].gd.pos.width = ngcd[5].gd.pos.x+ngcd[5].gd.pos.width-26;
7491
ngcd[15].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
7492
if ( sf->copyright!=NULL ) {
7493
nlabel[15].text = (unichar_t *) sf->copyright;
7494
nlabel[15].text_is_1byte = true;
7495
ngcd[15].gd.label = &nlabel[15];
7497
ngcd[15].gd.cid = CID_Notice;
7498
ngcd[15].creator = GTextAreaCreate;
7500
memset(&nb,0,sizeof(nb)); memset(&nb2,0,sizeof(nb2)); memset(&nb3,0,sizeof(nb3));
7502
narray3[0] = &ngcd[12]; narray3[1] = &ngcd[13]; narray3[2] = NULL;
7504
narray2[0] = &ngcd[10]; narray2[1] = &ngcd[11]; narray2[2] = NULL;
7505
narray2[3] = GCD_RowSpan; narray2[4] = &nb3; narray2[5] = NULL;
7508
narray[0] = &ngcd[0]; narray[1] = &ngcd[1]; narray[2] = NULL;
7509
narray[3] = &ngcd[2]; narray[4] = &ngcd[3]; narray[5] = NULL;
7510
narray[6] = &ngcd[4]; narray[7] = &ngcd[5]; narray[8] = NULL;
7511
narray[9] = &ngcd[6]; narray[10] = &ngcd[7]; narray[11] = NULL;
7512
narray[12] = &ngcd[8]; narray[13] = &ngcd[9]; narray[14] = NULL;
7513
narray[15] = &nb2; narray[16] = GCD_ColSpan; narray[17] = NULL;
7514
narray[18] = &ngcd[14]; narray[19] = GCD_ColSpan; narray[20] = NULL;
7515
narray[21] = &ngcd[15]; narray[22] = GCD_ColSpan; narray[23] = NULL;
7518
nb3.gd.flags = gg_enabled|gg_visible;
7519
nb3.gd.u.boxelements = narray3;
7520
nb3.creator = GHBoxCreate;
7522
nb2.gd.flags = gg_enabled|gg_visible;
7523
nb2.gd.u.boxelements = narray2;
7524
nb2.creator = GHVBoxCreate;
7526
nb[0].gd.flags = gg_enabled|gg_visible;
7527
nb[0].gd.u.boxelements = narray;
7528
nb[0].creator = GHVBoxCreate;
7530
/******************************************************************************/
7531
memset(&xulabel,0,sizeof(xulabel));
7532
memset(&xugcd,0,sizeof(xugcd));
7534
xugcd[0].gd.pos.x = 12; xugcd[0].gd.pos.y = 10+6;
7535
xugcd[0].gd.flags = gg_visible | gg_enabled;
7536
xulabel[0].text = (unichar_t *) _("_XUID:");
7537
xulabel[0].text_is_1byte = true;
7538
xulabel[0].text_in_resource = true;
7539
xugcd[0].gd.label = &xulabel[0];
7540
xugcd[0].creator = GLabelCreate;
7542
xugcd[1].gd.pos.x = 103; xugcd[1].gd.pos.y = xugcd[0].gd.pos.y-6; xugcd[1].gd.pos.width = 142;
7543
xugcd[1].gd.flags = gg_visible | gg_enabled;
7544
if ( sf->xuid!=NULL ) {
7545
xulabel[1].text = (unichar_t *) sf->xuid;
7546
xulabel[1].text_is_1byte = true;
7547
xugcd[1].gd.label = &xulabel[1];
7549
xugcd[1].gd.cid = CID_XUID;
7550
xugcd[1].creator = GTextFieldCreate;
7552
xugcd[2].gd.pos.x = 12; xugcd[2].gd.pos.y = xugcd[1].gd.pos.y+26+6;
7553
xulabel[2].text = (unichar_t *) _("_UniqueID:");
7554
xulabel[2].text_is_1byte = true;
7555
xulabel[2].text_in_resource = true;
7556
xugcd[2].gd.label = &xulabel[2];
7557
xugcd[2].gd.flags = gg_visible | gg_enabled;
7558
xugcd[2].creator = GLabelCreate;
7560
xugcd[3].gd.pos.x = xugcd[1].gd.pos.x; xugcd[3].gd.pos.y = xugcd[2].gd.pos.y-6; xugcd[3].gd.pos.width = 80;
7561
xugcd[3].gd.flags = gg_visible | gg_enabled;
7562
xulabel[3].text = (unichar_t *) "";
7563
xulabel[3].text_is_1byte = true;
7564
if ( sf->uniqueid!=0 ) {
7565
sprintf( uibuf, "%d", sf->uniqueid );
7566
xulabel[3].text = (unichar_t *) uibuf;
7568
xugcd[3].gd.label = &xulabel[3];
7569
xugcd[3].gd.cid = CID_UniqueID;
7570
xugcd[3].creator = GTextFieldCreate;
7572
xugcd[4].gd.pos.x = 8; xugcd[4].gd.pos.y = xugcd[3].gd.pos.y+26+6;
7573
xulabel[4].text = (unichar_t *) _("(Adobe now considers XUID/UniqueID unnecessary)");
7574
xulabel[4].text_is_1byte = true;
7575
xulabel[4].text_in_resource = true;
7576
xugcd[4].gd.label = &xulabel[4];
7577
xugcd[4].gd.flags = gg_visible | gg_enabled;
7578
xugcd[4].creator = GLabelCreate;
7580
xuarray[0] = &xugcd[0]; xuarray[1] = &xugcd[1]; xuarray[2] = NULL;
7581
xuarray[3] = &xugcd[2]; xuarray[4] = &xugcd[3]; xuarray[5] = NULL;
7582
xuarray[6] = &xugcd[4]; xuarray[7] = GCD_ColSpan; xuarray[8] = NULL;
7583
xuarray[9] = GCD_Glue; xuarray[10] = GCD_Glue; xuarray[11] = NULL;
7586
memset(xub,0,sizeof(xub));
7587
xub[0].gd.flags = gg_enabled|gg_visible;
7588
xub[0].gd.u.boxelements = xuarray;
7589
xub[0].creator = GHVBoxCreate;
7591
/******************************************************************************/
7592
memset(&pslabel,0,sizeof(pslabel));
7593
memset(&psgcd,0,sizeof(psgcd));
7595
psgcd[0].gd.pos.x = 12; psgcd[0].gd.pos.y = 12;
7596
psgcd[0].gd.flags = gg_visible | gg_enabled;
7597
pslabel[0].text = (unichar_t *) _("_Ascent:");
7598
pslabel[0].text_is_1byte = true;
7599
pslabel[0].text_in_resource = true;
7600
psgcd[0].gd.label = &pslabel[0];
7601
psgcd[0].creator = GLabelCreate;
7603
psgcd[1].gd.pos.x = 103; psgcd[1].gd.pos.y = psgcd[0].gd.pos.y-6; psgcd[1].gd.pos.width = 47;
7604
psgcd[1].gd.flags = gg_visible | gg_enabled;
7605
sprintf( asbuf, "%d", sf->ascent );
7606
pslabel[1].text = (unichar_t *) asbuf;
7607
pslabel[1].text_is_1byte = true;
7608
psgcd[1].gd.label = &pslabel[1];
7609
psgcd[1].gd.cid = CID_Ascent;
7610
psgcd[1].gd.handle_controlevent = GFI_EmChanged;
7611
psgcd[1].creator = GTextFieldCreate;
7613
psgcd[2].gd.pos.x = 155; psgcd[2].gd.pos.y = psgcd[0].gd.pos.y;
7614
psgcd[2].gd.flags = gg_visible | gg_enabled;
7615
pslabel[2].text = (unichar_t *) _("_Descent:");
7616
pslabel[2].text_is_1byte = true;
7617
pslabel[2].text_in_resource = true;
7618
psgcd[2].gd.label = &pslabel[2];
7619
psgcd[2].creator = GLabelCreate;
7621
psgcd[3].gd.pos.x = 200; psgcd[3].gd.pos.y = psgcd[1].gd.pos.y; psgcd[3].gd.pos.width = 47;
7622
psgcd[3].gd.flags = gg_visible | gg_enabled;
7623
sprintf( dsbuf, "%d", sf->descent );
7624
pslabel[3].text = (unichar_t *) dsbuf;
7625
pslabel[3].text_is_1byte = true;
7626
psgcd[3].gd.label = &pslabel[3];
7627
psgcd[3].gd.cid = CID_Descent;
7628
psgcd[3].gd.handle_controlevent = GFI_EmChanged;
7629
psgcd[3].creator = GTextFieldCreate;
7631
psgcd[4].gd.pos.x = psgcd[0].gd.pos.x+5; psgcd[4].gd.pos.y = psgcd[0].gd.pos.y+24;
7632
psgcd[4].gd.flags = gg_visible | gg_enabled;
7633
pslabel[4].text = (unichar_t *) _(" _Em Size:");
7634
pslabel[4].text_is_1byte = true;
7635
pslabel[4].text_in_resource = true;
7636
psgcd[4].gd.label = &pslabel[4];
7637
psgcd[4].creator = GLabelCreate;
7639
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;
7640
psgcd[5].gd.flags = gg_visible | gg_enabled;
7641
sprintf( embuf, "%d", sf->descent+sf->ascent );
7642
pslabel[5].text = (unichar_t *) embuf;
7643
pslabel[5].text_is_1byte = true;
7644
psgcd[5].gd.label = &pslabel[5];
7645
psgcd[5].gd.cid = CID_Em;
7646
psgcd[5].gd.u.list = emsizes;
7647
psgcd[5].gd.handle_controlevent = GFI_EmChanged;
7648
psgcd[5].creator = GListFieldCreate;
7650
psgcd[6].gd.pos.x = psgcd[2].gd.pos.x; psgcd[6].gd.pos.y = psgcd[4].gd.pos.y-4;
7651
psgcd[6].gd.flags = gg_visible | gg_enabled | gg_cb_on;
7652
pslabel[6].text = (unichar_t *) _("_Scale Outlines");
7653
pslabel[6].text_is_1byte = true;
7654
pslabel[6].text_in_resource = true;
7655
psgcd[6].gd.label = &pslabel[6];
7656
psgcd[6].gd.cid = CID_Scale;
7657
psgcd[6].creator = GCheckBoxCreate;
7659
/* I've reversed the label, text field order in the gcd here because */
7660
/* that way the text field will be displayed on top of the label rather */
7661
/* than the reverse, and in Russian that's important translation of */
7662
/* "Italic Angle" is too long. Oops, no it's the next one, might as well leave in here though */
7663
psgcd[8].gd.pos.x = 12; psgcd[8].gd.pos.y = psgcd[5].gd.pos.y+26+6;
7664
psgcd[8].gd.flags = gg_visible | gg_enabled;
7665
pslabel[8].text = (unichar_t *) _("_Italic Angle:");
7666
pslabel[8].text_is_1byte = true;
7667
pslabel[8].text_in_resource = true;
7668
psgcd[8].gd.label = &pslabel[8];
7669
psgcd[8].creator = GLabelCreate;
7671
psgcd[7].gd.pos.x = 103; psgcd[7].gd.pos.y = psgcd[8].gd.pos.y-6;
7672
psgcd[7].gd.pos.width = 47;
7673
psgcd[7].gd.flags = gg_visible | gg_enabled;
7674
sprintf( iabuf, "%g", (double) sf->italicangle );
7675
pslabel[7].text = (unichar_t *) iabuf;
7676
pslabel[7].text_is_1byte = true;
7677
psgcd[7].gd.label = &pslabel[7];
7678
psgcd[7].gd.cid = CID_ItalicAngle;
7679
psgcd[7].creator = GTextFieldCreate;
7681
psgcd[9].gd.pos.y = psgcd[7].gd.pos.y;
7682
psgcd[9].gd.pos.width = -1; psgcd[9].gd.pos.height = 0;
7683
psgcd[9].gd.pos.x = psgcd[3].gd.pos.x+psgcd[3].gd.pos.width-
7684
GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
7685
/*if ( strstrmatch(sf->fontname,"Italic")!=NULL ||strstrmatch(sf->fontname,"Oblique")!=NULL )*/
7686
psgcd[9].gd.flags = gg_visible | gg_enabled;
7687
pslabel[9].text = (unichar_t *) _("_Guess");
7688
pslabel[9].text_is_1byte = true;
7689
pslabel[9].text_in_resource = true;
7690
psgcd[9].gd.label = &pslabel[9];
7691
psgcd[9].gd.handle_controlevent = GFI_GuessItalic;
7692
psgcd[9].creator = GButtonCreate;
7694
/* I've reversed the label, text field order in the gcd here because */
7695
/* that way the text field will be displayed on top of the label rather */
7696
/* than the reverse, and in Russian that's important translation of */
7697
/* "Underline position" is too long. */
7698
psgcd[11].gd.pos.x = 12; psgcd[11].gd.pos.y = psgcd[7].gd.pos.y+26+6;
7699
psgcd[11].gd.flags = gg_visible | gg_enabled;
7700
pslabel[11].text = (unichar_t *) _("Underline _Position:");
7701
pslabel[11].text_is_1byte = true;
7702
pslabel[11].text_in_resource = true;
7703
psgcd[11].gd.label = &pslabel[11];
7704
psgcd[11].creator = GLabelCreate;
7706
psgcd[10].gd.pos.x = 103; psgcd[10].gd.pos.y = psgcd[11].gd.pos.y-6; psgcd[10].gd.pos.width = 47;
7707
psgcd[10].gd.flags = gg_visible | gg_enabled;
7708
sprintf( upbuf, "%g", (double) sf->upos );
7709
pslabel[10].text = (unichar_t *) upbuf;
7710
pslabel[10].text_is_1byte = true;
7711
psgcd[10].gd.label = &pslabel[10];
7712
psgcd[10].gd.cid = CID_UPos;
7713
psgcd[10].creator = GTextFieldCreate;
7715
psgcd[12].gd.pos.x = 155; psgcd[12].gd.pos.y = psgcd[11].gd.pos.y;
7716
psgcd[12].gd.flags = gg_visible | gg_enabled;
7717
pslabel[12].text = (unichar_t *) S_("Underline|_Height:");
7718
pslabel[12].text_is_1byte = true;
7719
pslabel[12].text_in_resource = true;
7720
psgcd[12].gd.label = &pslabel[12];
7721
psgcd[12].creator = GLabelCreate;
7723
psgcd[13].gd.pos.x = 200; psgcd[13].gd.pos.y = psgcd[10].gd.pos.y; psgcd[13].gd.pos.width = 47;
7724
psgcd[13].gd.flags = gg_visible | gg_enabled;
7725
sprintf( uwbuf, "%g", (double) sf->uwidth );
7726
pslabel[13].text = (unichar_t *) uwbuf;
7727
pslabel[13].text_is_1byte = true;
7728
psgcd[13].gd.label = &pslabel[13];
7729
psgcd[13].gd.cid = CID_UWidth;
7730
psgcd[13].creator = GTextFieldCreate;
7732
psgcd[14].gd.pos.x = 12; psgcd[14].gd.pos.y = psgcd[13].gd.pos.y+26;
7733
pslabel[14].text = (unichar_t *) _("Has _Vertical Metrics");
7734
pslabel[14].text_is_1byte = true;
7735
pslabel[14].text_in_resource = true;
7736
psgcd[14].gd.label = &pslabel[14];
7737
psgcd[14].gd.cid = CID_HasVerticalMetrics;
7738
psgcd[14].gd.flags = gg_visible | gg_enabled;
7739
if ( sf->hasvmetrics )
7740
psgcd[14].gd.flags |= gg_cb_on;
7741
psgcd[14].gd.handle_controlevent = GFI_VMetricsCheck;
7742
psgcd[14].creator = GCheckBoxCreate;
7744
psgcd[15].gd.pos.x = 12; psgcd[15].gd.pos.y = psgcd[14].gd.pos.y+22;
7745
pslabel[15].text = (unichar_t *) _("Vertical _Origin:");
7746
pslabel[15].text_is_1byte = true;
7747
pslabel[15].text_in_resource = true;
7748
psgcd[15].gd.label = &pslabel[15];
7749
psgcd[15].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : gg_visible;
7750
psgcd[15].gd.cid = CID_VOriginLab;
7751
psgcd[15].creator = GLabelCreate;
7753
psgcd[16].gd.pos.x = psgcd[7].gd.pos.x; psgcd[16].gd.pos.y = psgcd[15].gd.pos.y-4; psgcd[16].gd.pos.width = psgcd[15].gd.pos.width;
7754
psgcd[16].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : gg_visible;
7755
pslabel[16].text = (unichar_t *) "";
7756
pslabel[16].text_is_1byte = true;
7757
if ( sf->vertical_origin!=0 || sf->hasvmetrics ) {
7758
sprintf( vorig, "%d", sf->vertical_origin );
7759
pslabel[16].text = (unichar_t *) vorig;
7761
psgcd[16].gd.label = &pslabel[16];
7762
psgcd[16].gd.cid = CID_VOrigin;
7763
psgcd[16].creator = GTextFieldCreate;
7765
psgcd[17].gd.pos.x = 12; psgcd[17].gd.pos.y = psgcd[16].gd.pos.y+22;
7766
pslabel[17].text = (unichar_t *) _("_Quadratic Splines");
7767
pslabel[17].text_is_1byte = true;
7768
pslabel[17].text_in_resource = true;
7769
psgcd[17].gd.label = &pslabel[17];
7770
psgcd[17].gd.flags = sf->order2 ? (gg_visible | gg_enabled | gg_cb_on | gg_utf8_popup) : (gg_visible | gg_enabled | gg_utf8_popup);
7771
psgcd[17].gd.cid = CID_IsOrder2;
7772
psgcd[17].creator = GCheckBoxCreate;
7773
psgcd[17].gd.popup_msg = (unichar_t *) _("Use quadratic (that is truetype) splines to hold the outlines of this\nfont rather than cubic (postscript) splines. Set this option if you\nare editing truetype font. Unset it if you are editing an opentype\nor postscript font (FontForge will convert to the appropriate\nspline type when it generates fonts so this is not required).");
7775
#ifdef FONTFORGE_CONFIG_TYPE3
7776
psgcd[18].gd.pos.x = 12; psgcd[18].gd.pos.y = psgcd[17].gd.pos.y+18;
7777
pslabel[18].text = (unichar_t *) _("_Outline Font");
7778
pslabel[18].text_is_1byte = true;
7779
pslabel[18].text_in_resource = true;
7780
psgcd[18].gd.label = &pslabel[18];
7781
psgcd[18].gd.flags = (!sf->strokedfont && !sf->multilayer)?
7782
(gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
7783
psgcd[18].creator = GRadioCreate;
7785
psgcd[19].gd.pos.x = 12; psgcd[19].gd.pos.y = psgcd[18].gd.pos.y+14;
7786
pslabel[19].text = (unichar_t *) _("_Multi Layered Font");
7787
pslabel[19].text_is_1byte = true;
7788
pslabel[19].text_in_resource = true;
7789
psgcd[19].gd.label = &pslabel[19];
7790
psgcd[19].gd.flags = sf->multilayer ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_utf8_popup | gg_rad_continueold);
7791
psgcd[19].gd.cid = CID_IsMultiLayer;
7792
psgcd[19].creator = GRadioCreate;
7793
psgcd[19].gd.popup_msg = (unichar_t *) _("Allow editing of multiple colors and shades, fills and strokes.\nMulti layered fonts can only be output as type3 or svg fonts.");
7795
psgcd[20].gd.pos.x = 12; psgcd[20].gd.pos.y = psgcd[19].gd.pos.y+14;
7796
pslabel[20].text = (unichar_t *) _("_Stroked Font");
7797
pslabel[20].text_is_1byte = true;
7798
pslabel[20].text_in_resource = true;
7799
psgcd[20].gd.label = &pslabel[20];
7800
psgcd[20].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on) : (gg_visible | gg_enabled | gg_utf8_popup);
7801
psgcd[20].gd.cid = CID_IsStrokedFont;
7802
psgcd[20].creator = GRadioCreate;
7803
psgcd[20].gd.popup_msg = (unichar_t *) _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
7807
psgcd[18].gd.pos.x = 12; psgcd[18].gd.pos.y = psgcd[17].gd.pos.y+16;
7808
pslabel[18].text = (unichar_t *) _("_Stroked Font");
7809
pslabel[18].text_is_1byte = true;
7810
pslabel[18].text_in_resource = true;
7811
psgcd[18].gd.label = &pslabel[18];
7812
psgcd[18].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on) : (gg_visible | gg_enabled | gg_utf8_popup);
7813
psgcd[18].gd.cid = CID_IsStrokedFont;
7814
psgcd[18].creator = GCheckBoxCreate;
7815
psgcd[18].gd.popup_msg = (unichar_t *) _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
7820
psgcd[k].gd.pos.x = 12; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+20;
7821
pslabel[k].text = (unichar_t *) _("Stroke _Width:");
7822
pslabel[k].text_is_1byte = true;
7823
pslabel[k].text_in_resource = true;
7824
psgcd[k].gd.label = &pslabel[k];
7825
psgcd[k].gd.flags = gg_visible | gg_enabled;
7826
psgcd[k++].creator = GLabelCreate;
7828
sprintf( swbuf,"%g", (double) sf->strokewidth );
7829
psgcd[k].gd.pos.x = 115; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6; psgcd[k].gd.pos.width = 137;
7830
psgcd[k].gd.flags = gg_visible | gg_enabled;
7831
pslabel[k].text = (unichar_t *) swbuf;
7832
pslabel[k].text_is_1byte = true;
7833
psgcd[k].gd.label = &pslabel[k];
7834
psgcd[k].gd.cid = CID_StrokeWidth;
7835
psgcd[k++].creator = GTextFieldCreate;
7837
psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
7838
psgcd[k].gd.flags = gg_visible | gg_enabled;
7839
pslabel[k].text = (unichar_t *) _("Interpretation:");
7840
pslabel[k].text_is_1byte = true;
7841
pslabel[k].text_in_resource = true;
7842
psgcd[k].gd.label = &pslabel[k];
7843
psgcd[k++].creator = GLabelCreate;
7845
psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
7846
psgcd[k].gd.flags = gg_visible | gg_enabled;
7847
psgcd[k].gd.u.list = interpretations;
7848
psgcd[k].gd.cid = CID_Interpretation;
7849
psgcd[k].creator = GListButtonCreate;
7850
for ( i=0; interpretations[i].text!=NULL || interpretations[i].line; ++i ) {
7851
if ( (void *) (sf->uni_interp)==interpretations[i].userdata &&
7852
interpretations[i].text!=NULL ) {
7853
interpretations[i].selected = true;
7854
psgcd[k].gd.label = &interpretations[i];
7856
interpretations[i].selected = false;
7860
psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
7861
psgcd[k].gd.flags = gg_visible | gg_enabled;
7862
pslabel[k].text = (unichar_t *) _("Name List:");
7863
pslabel[k].text_is_1byte = true;
7864
pslabel[k].text_in_resource = true;
7865
psgcd[k].gd.label = &pslabel[k];
7866
psgcd[k++].creator = GLabelCreate;
7868
psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
7869
psgcd[k].gd.flags = gg_visible | gg_enabled;
7870
psgcd[k].gd.cid = CID_Namelist;
7871
psgcd[k].creator = GListButtonCreate;
7872
nlnames = AllNamelistNames();
7873
for ( i=0; nlnames[i]!=NULL; ++i);
7874
namelistnames = gcalloc(i+1,sizeof(GTextInfo));
7875
for ( i=0; nlnames[i]!=NULL; ++i) {
7876
namelistnames[i].text = (unichar_t *) nlnames[i];
7877
namelistnames[i].text_is_1byte = true;
7878
if ( strcmp(_(sf->for_new_glyphs->title),nlnames[i])==0 ) {
7879
namelistnames[i].selected = true;
7880
psgcd[k].gd.label = &namelistnames[i];
7883
psgcd[k++].gd.u.list = namelistnames;
7887
if ( sf->subfontcnt!=0 ) {
7888
for ( i=0; i<=13; ++i )
7889
psgcd[i].gd.flags &= ~gg_enabled;
7890
} else if ( sf->cidmaster!=NULL ) {
7891
for ( i=14; i<=16; ++i )
7892
psgcd[i].gd.flags &= ~gg_enabled;
7895
psarray[0] = &psb2[0];
7896
psarray[1] = &psgcd[14];
7897
psarray[2] = &psb2[1];
7898
psarray[3] = &psgcd[17];
7899
psarray[4] = &psgcd[18];
7900
#ifdef FONTFORGE_CONFIG_TYPE3
7901
psarray[5] = &psgcd[19];
7902
psarray[6] = &psgcd[20];
7907
psarray[j++] = &psb2[2];
7909
psarray[j++] = GCD_Glue;
7910
psarray[j++] = NULL;
7912
psarray2[0] = &psgcd[0]; psarray2[1] = &psgcd[1]; psarray2[2] = &psgcd[2]; psarray2[3] = &psgcd[3]; psarray2[4] = NULL;
7913
psarray2[5] = &psgcd[4]; psarray2[6] = &psgcd[5]; psarray2[7] = &psgcd[6]; psarray2[8] = GCD_ColSpan; psarray2[9] = NULL;
7914
psarray2[10] = &psgcd[8]; psarray2[11] = &psgcd[7]; psarray2[12] = &psgcd[9]; psarray2[13] = GCD_ColSpan; psarray2[14] = NULL;
7915
psarray2[15] = &psgcd[11]; psarray2[16] = &psgcd[10]; psarray2[17] = &psgcd[12]; psarray2[18] = &psgcd[13]; psarray2[19] = NULL;
7916
psarray2[20] = NULL;
7918
psarray3[0] = &psgcd[15]; psarray3[1] = &psgcd[16]; psarray3[2] = NULL;
7920
psarray4[0] = &psgcd[k-6]; psarray4[1] = &psgcd[k-5]; psarray4[2] = NULL;
7921
psarray4[3] = &psgcd[k-4]; psarray4[4] = &psgcd[k-3]; psarray4[5] = NULL;
7922
psarray4[6] = &psgcd[k-2]; psarray4[7] = &psgcd[k-1]; psarray4[8] = NULL;
7925
memset(psb,0,sizeof(psb));
7926
psb[0].gd.flags = gg_enabled|gg_visible;
7927
psb[0].gd.u.boxelements = psarray;
7928
psb[0].creator = GVBoxCreate;
7930
memset(psb2,0,sizeof(psb2));
7931
psb2[0].gd.flags = gg_enabled|gg_visible;
7932
psb2[0].gd.u.boxelements = psarray2;
7933
psb2[0].creator = GHVBoxCreate;
7935
psb2[1].gd.flags = gg_enabled|gg_visible;
7936
psb2[1].gd.u.boxelements = psarray3;
7937
psb2[1].creator = GHBoxCreate;
7939
psb2[2].gd.flags = gg_enabled|gg_visible;
7940
psb2[2].gd.u.boxelements = psarray4;
7941
psb2[2].creator = GHVBoxCreate;
7942
/******************************************************************************/
7944
memset(&plabel,0,sizeof(plabel));
7945
memset(&pgcd,0,sizeof(pgcd));
7947
pgcd[0].gd.pos.x = 10; pgcd[0].gd.pos.y = 6;
7948
pgcd[0].gd.pos.width = 240; pgcd[0].gd.pos.height = 8*12+10;
7949
pgcd[0].gd.flags = gg_visible | gg_enabled;
7950
pgcd[0].gd.cid = CID_PrivateEntries;
7951
pgcd[0].gd.u.list = PI_ListSet(sf);
7952
pgcd[0].gd.handle_controlevent = PI_ListSel;
7953
pgcd[0].creator = GListCreate;
7955
pgcd[1].gd.pos.x = 10; pgcd[1].gd.pos.y = pgcd[0].gd.pos.y+pgcd[0].gd.pos.height+10;
7956
pgcd[1].gd.pos.width = pgcd[0].gd.pos.width; pgcd[1].gd.pos.height = 8*12+10;
7957
pgcd[1].gd.flags = gg_visible | gg_enabled;
7958
pgcd[1].gd.cid = CID_PrivateValues;
7959
pgcd[1].creator = GTextAreaCreate;
7961
pgcd[2].gd.pos.x = 10; pgcd[2].gd.pos.y = 300-35-30;
7962
pgcd[2].gd.pos.width = -1; pgcd[2].gd.pos.height = 0;
7963
pgcd[2].gd.flags = gg_visible | gg_enabled ;
7964
plabel[2].text = (unichar_t *) _("_Add");
7965
plabel[2].text_is_1byte = true;
7966
plabel[2].text_in_resource = true;
7967
pgcd[2].gd.label = &plabel[2];
7968
pgcd[2].gd.handle_controlevent = PI_Add;
7969
pgcd[2].gd.cid = CID_Add;
7970
pgcd[2].creator = GButtonCreate;
7972
pgcd[3].gd.pos.x = (260)/2-GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor)-5;
7973
pgcd[3].gd.pos.y = pgcd[2].gd.pos.y;
7974
pgcd[3].gd.pos.width = -1; pgcd[3].gd.pos.height = 0;
7975
pgcd[3].gd.flags = gg_visible ;
7976
plabel[3].text = (unichar_t *) _("_Guess");
7977
plabel[3].text_is_1byte = true;
7978
plabel[3].text_in_resource = true;
7979
pgcd[3].gd.label = &plabel[3];
7980
pgcd[3].gd.handle_controlevent = PI_Guess;
7981
pgcd[3].gd.cid = CID_Guess;
7982
pgcd[3].creator = GButtonCreate;
7984
pgcd[4].gd.pos.x = -(260/2-GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor)-5);
7985
pgcd[4].gd.pos.y = pgcd[2].gd.pos.y;
7986
pgcd[4].gd.pos.width = -1; pgcd[4].gd.pos.height = 0;
7987
pgcd[4].gd.flags = gg_visible | gg_utf8_popup ;
7988
/* GT: This is an abbreviation for Histogram */
7989
plabel[4].text = (unichar_t *) _("_Hist.");
7990
plabel[4].text_is_1byte = true;
7991
plabel[4].text_in_resource = true;
7992
pgcd[4].gd.label = &plabel[4];
7993
pgcd[4].gd.handle_controlevent = PI_Hist;
7994
pgcd[4].gd.cid = CID_Hist;
7995
pgcd[4].gd.popup_msg = (unichar_t *) _("Histogram Dialog");
7996
pgcd[4].creator = GButtonCreate;
7998
pgcd[5].gd.pos.x = -10; pgcd[5].gd.pos.y = pgcd[2].gd.pos.y;
7999
pgcd[5].gd.pos.width = -1; pgcd[5].gd.pos.height = 0;
8000
pgcd[5].gd.flags = gg_visible | gg_enabled ;
8001
plabel[5].text = (unichar_t *) _("_Remove");
8002
plabel[5].text_is_1byte = true;
8003
plabel[5].text_in_resource = true;
8004
pgcd[5].gd.label = &plabel[5];
8005
pgcd[5].gd.handle_controlevent = PI_Delete;
8006
pgcd[5].gd.cid = CID_Remove;
8007
pgcd[5].creator = GButtonCreate;
8009
ppbuttons[0] = &pgcd[2]; ppbuttons[1] = &pgcd[3];
8010
ppbuttons[2] = &pgcd[4]; ppbuttons[3] = &pgcd[5]; ppbuttons[4] = NULL;
8012
pparray[0] = &pgcd[0]; pparray[1] = &pgcd[1]; pparray[2] = &ppbox[2];
8015
memset(ppbox,0,sizeof(ppbox));
8016
ppbox[0].gd.flags = gg_enabled|gg_visible;
8017
ppbox[0].gd.u.boxelements = pparray;
8018
ppbox[0].creator = GVBoxCreate;
8020
ppbox[2].gd.flags = gg_enabled|gg_visible;
8021
ppbox[2].gd.u.boxelements = ppbuttons;
8022
ppbox[2].creator = GHBoxCreate;
8023
/******************************************************************************/
8024
memset(&vlabel,0,sizeof(vlabel));
8025
memset(&vgcd,0,sizeof(vgcd));
8027
vgcd[0].gd.pos.x = 10; vgcd[0].gd.pos.y = 12;
8028
vlabel[0].text = (unichar_t *) _("_Weight Class");
8029
vlabel[0].text_is_1byte = true;
8030
vlabel[0].text_in_resource = true;
8031
vgcd[0].gd.label = &vlabel[0];
8032
vgcd[0].gd.flags = gg_visible | gg_enabled;
8033
vgcd[0].creator = GLabelCreate;
8035
vgcd[1].gd.pos.x = 90; vgcd[1].gd.pos.y = vgcd[0].gd.pos.y-6; vgcd[1].gd.pos.width = 140;
8036
vgcd[1].gd.flags = gg_visible | gg_enabled;
8037
vgcd[1].gd.cid = CID_WeightClass;
8038
vgcd[1].gd.u.list = weightclass;
8039
vgcd[1].creator = GListFieldCreate;
8041
vgcd[2].gd.pos.x = 10; vgcd[2].gd.pos.y = vgcd[1].gd.pos.y+26+6;
8042
vlabel[2].text = (unichar_t *) _("Width _Class");
8043
vlabel[2].text_is_1byte = true;
8044
vlabel[2].text_in_resource = true;
8045
vgcd[2].gd.label = &vlabel[2];
8046
vgcd[2].gd.flags = gg_visible | gg_enabled;
8047
vgcd[2].creator = GLabelCreate;
8049
vgcd[3].gd.pos.x = 90; vgcd[3].gd.pos.y = vgcd[2].gd.pos.y-6;
8050
vgcd[3].gd.flags = gg_visible | gg_enabled;
8051
vgcd[3].gd.cid = CID_WidthClass;
8052
vgcd[3].gd.u.list = widthclass;
8053
vgcd[3].creator = GListButtonCreate;
8055
vgcd[4].gd.pos.x = 10; vgcd[4].gd.pos.y = vgcd[3].gd.pos.y+26+6;
8056
vlabel[4].text = (unichar_t *) _("P_FM Family");
8057
vlabel[4].text_is_1byte = true;
8058
vlabel[4].text_in_resource = true;
8059
vgcd[4].gd.label = &vlabel[4];
8060
vgcd[4].gd.flags = gg_visible | gg_enabled;
8061
vgcd[4].creator = GLabelCreate;
8063
vgcd[5].gd.pos.x = 90; vgcd[5].gd.pos.y = vgcd[4].gd.pos.y-6; vgcd[5].gd.pos.width = 140;
8064
vgcd[5].gd.flags = gg_visible | gg_enabled;
8065
vgcd[5].gd.cid = CID_PFMFamily;
8066
vgcd[5].gd.u.list = pfmfamily;
8067
vgcd[5].creator = GListButtonCreate;
8069
vgcd[6].gd.pos.x = 10; vgcd[6].gd.pos.y = vgcd[5].gd.pos.y+26+6;
8070
vlabel[6].text = (unichar_t *) _("_Embeddable");
8071
vlabel[6].text_is_1byte = true;
8072
vlabel[6].text_in_resource = true;
8073
vgcd[6].gd.label = &vlabel[6];
8074
vgcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8075
vgcd[6].gd.popup_msg = (unichar_t *) _("Can this font be embedded in a downloadable (pdf)\ndocument, and if so, what behaviors are permitted on\nboth the document and the font.");
8076
vgcd[6].creator = GLabelCreate;
8078
vgcd[7].gd.pos.x = 90; vgcd[7].gd.pos.y = vgcd[6].gd.pos.y-6;
8079
vgcd[7].gd.pos.width = 140;
8080
vgcd[7].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8081
vgcd[7].gd.cid = CID_FSType;
8082
vgcd[7].gd.u.list = fstype;
8083
vgcd[7].gd.popup_msg = vgcd[6].gd.popup_msg;
8084
vgcd[7].creator = GListButtonCreate;
8085
fstype[0].selected = fstype[1].selected =
8086
fstype[2].selected = fstype[3].selected = false;
8087
if ( sf->pfminfo.fstype&0x8 /* also catches the "not set" case == -1 */ )
8089
else if ( sf->pfminfo.fstype&0x4 )
8091
else if ( sf->pfminfo.fstype&0x2 )
8095
fstype[i].selected = true;
8096
vgcd[7].gd.label = &fstype[i];
8098
vgcd[8].gd.pos.x = 20; vgcd[8].gd.pos.y = vgcd[7].gd.pos.y+26;
8099
vlabel[8].text = (unichar_t *) _("No Subsetting");
8100
vlabel[8].text_is_1byte = true;
8101
vgcd[8].gd.label = &vlabel[8];
8102
vgcd[8].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8103
if ( sf->pfminfo.fstype!=-1 && (sf->pfminfo.fstype&0x100) )
8104
vgcd[8].gd.flags |= gg_cb_on;
8105
vgcd[8].gd.popup_msg = (unichar_t *) _("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.");
8106
vgcd[8].gd.cid = CID_NoSubsetting;
8107
vgcd[8].creator = GCheckBoxCreate;
8109
vgcd[9].gd.pos.x = 110; vgcd[9].gd.pos.y = vgcd[8].gd.pos.y;
8110
vlabel[9].text = (unichar_t *) _("Only Embed Bitmaps");
8111
vlabel[9].text_is_1byte = true;
8112
vgcd[9].gd.label = &vlabel[9];
8113
vgcd[9].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8114
if ( sf->pfminfo.fstype!=-1 && ( sf->pfminfo.fstype&0x200 ))
8115
vgcd[9].gd.flags |= gg_cb_on;
8116
vgcd[9].gd.popup_msg = (unichar_t *) _("Only Bitmaps may be embedded.\nOutline descriptions may not be\n(if font file contains no bitmaps\nthen nothing may be embedded).");
8117
vgcd[9].gd.cid = CID_OnlyBitmaps;
8118
vgcd[9].creator = GCheckBoxCreate;
8120
vgcd[10].gd.pos.x = 10; vgcd[10].gd.pos.y = vgcd[9].gd.pos.y+24;
8121
vlabel[10].text = (unichar_t *) _("Vendor ID:");
8122
vlabel[10].text_is_1byte = true;
8123
vgcd[10].gd.label = &vlabel[10];
8124
vgcd[10].gd.flags = gg_visible | gg_enabled;
8125
vgcd[10].creator = GLabelCreate;
8127
vgcd[11].gd.pos.x = 90; vgcd[11].gd.pos.y = vgcd[11-1].gd.pos.y-4;
8128
vgcd[11].gd.pos.width = 50;
8129
vgcd[11].gd.flags = gg_visible | gg_enabled;
8130
/* value set later */
8131
vgcd[11].gd.cid = CID_Vendor;
8132
vgcd[11].creator = GTextFieldCreate;
8134
vgcd[12].gd.pos.x = 10; vgcd[12].gd.pos.y = vgcd[11].gd.pos.y+24+6;
8135
vlabel[12].text = (unichar_t *) _("_IBM Family:");
8136
vlabel[12].text_is_1byte = true;
8137
vlabel[12].text_in_resource = true;
8138
vgcd[12].gd.label = &vlabel[12];
8139
vgcd[12].gd.flags = gg_visible | gg_enabled;
8140
vgcd[12].creator = GLabelCreate;
8142
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;
8143
vgcd[13].gd.flags = gg_visible | gg_enabled;
8144
vgcd[13].gd.cid = CID_IBMFamily;
8145
vgcd[13].gd.u.list = ibmfamily;
8146
vgcd[13].creator = GListButtonCreate;
8148
vgcd[14].gd.pos.x = 10; vgcd[14].gd.pos.y = vgcd[13].gd.pos.y+24+6;
8149
vlabel[14].text = (unichar_t *) _("Weight, Width, Slope Only");
8150
vlabel[14].text_is_1byte = true;
8151
vlabel[14].text_in_resource = true;
8152
vgcd[14].gd.label = &vlabel[14];
8153
vgcd[14].gd.cid = CID_WeightWidthSlopeOnly;
8154
vgcd[14].gd.popup_msg = (unichar_t *) _("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)." );
8155
vgcd[14].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8156
vgcd[14].creator = GCheckBoxCreate;
8158
vgcd[15].gd.pos.x = 10; vgcd[15].gd.pos.y = vgcd[11].gd.pos.y+24+6;
8159
vlabel[15].text = (unichar_t *) _("_OS/2 Version");
8160
vlabel[15].text_is_1byte = true;
8161
vlabel[15].text_in_resource = true;
8162
vgcd[15].gd.label = &vlabel[15];
8163
vgcd[15].gd.popup_msg = (unichar_t *) _("The 'OS/2' table has changed slightly over the years,\nGenerally fields have been added, but occasionally their\nmeanings have been redefined." );
8164
vgcd[15].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8165
vgcd[15].creator = GLabelCreate;
8167
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;
8168
vgcd[16].gd.flags = gg_visible | gg_enabled;
8169
vgcd[16].gd.cid = CID_OS2Version;
8170
vgcd[16].gd.u.list = os2versions;
8171
vgcd[16].creator = GListFieldCreate;
8173
vradio[0] = GCD_Glue; vradio[1] = &vgcd[8]; vradio[2] = &vgcd[9]; vradio[3] = GCD_Glue; vradio[4] = NULL;
8175
varray[0] = &vgcd[15]; varray[1] = &vgcd[16]; varray[2] = NULL;
8176
varray[3] = &vgcd[0]; varray[4] = &vgcd[1]; varray[5] = NULL;
8177
varray[6] = &vgcd[2]; varray[7] = &vgcd[3]; varray[8] = NULL;
8178
varray[9] = &vgcd[4]; varray[10] = &vgcd[5]; varray[11] = NULL;
8179
varray[12] = &vgcd[6]; varray[13] = &vgcd[7]; varray[14] = NULL;
8180
varray[15] = &vbox[2]; varray[16] = GCD_ColSpan; varray[17] = NULL;
8181
varray[18] = &vgcd[10]; varray[19] = &vgcd[11]; varray[20] = NULL;
8182
varray[21] = &vgcd[12]; varray[22] = &vgcd[13]; varray[23] = NULL;
8183
varray[24] = &vgcd[14]; varray[25] = GCD_ColSpan; varray[26] = NULL;
8184
varray[27] = GCD_Glue; varray[28] = GCD_Glue; varray[29] = NULL;
8185
varray[30] = GCD_Glue; varray[31] = GCD_Glue; varray[32] = NULL;
8186
varray[33] = varray[37] = NULL;
8188
memset(vbox,0,sizeof(vbox));
8189
vbox[0].gd.flags = gg_enabled|gg_visible;
8190
vbox[0].gd.u.boxelements = varray;
8191
vbox[0].creator = GHVBoxCreate;
8193
vbox[2].gd.flags = gg_enabled|gg_visible;
8194
vbox[2].gd.u.boxelements = vradio;
8195
vbox[2].creator = GHBoxCreate;
8197
/******************************************************************************/
8199
memset(&metgcd,0,sizeof(metgcd));
8200
memset(&metlabel,'\0',sizeof(metlabel));
8204
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = 9;
8205
metlabel[i].text = (unichar_t *) _("Win _Ascent Offset:");
8206
metlabel[i].text_is_1byte = true;
8207
metlabel[i].text_in_resource = true;
8208
metgcd[i].gd.label = &metlabel[i];
8209
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8210
metgcd[i].gd.popup_msg = (unichar_t *) _("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.");
8211
metgcd[i].gd.cid = CID_WinAscentLab;
8212
metarray[j++] = &metgcd[i];
8213
metgcd[i++].creator = GLabelCreate;
8215
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8216
metgcd[i].gd.pos.width = 50;
8217
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8218
/* value set later */
8219
metgcd[i].gd.cid = CID_WinAscent;
8220
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8221
metarray[j++] = &metgcd[i];
8222
metgcd[i++].creator = GTextFieldCreate;
8224
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8225
metlabel[i].text = (unichar_t *) _("Is Offset");
8226
metlabel[i].text_is_1byte = true;
8227
metgcd[i].gd.label = &metlabel[i];
8228
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8229
/* value set later */
8230
metgcd[i].gd.cid = CID_WinAscentIsOff;
8231
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8232
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8233
metarray[j++] = &metgcd[i];
8234
metgcd[i++].creator = GCheckBoxCreate;
8235
metarray[j++] = NULL;
8237
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8238
metlabel[i].text = (unichar_t *) _("Win _Descent Offset:");
8239
metlabel[i].text_is_1byte = true;
8240
metlabel[i].text_in_resource = true;
8241
metgcd[i].gd.label = &metlabel[i];
8242
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8243
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8244
metgcd[i].gd.cid = CID_WinDescentLab;
8245
metarray[j++] = &metgcd[i];
8246
metgcd[i++].creator = GLabelCreate;
8248
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8249
metgcd[i].gd.pos.width = 50;
8250
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8251
/* value set later */
8252
metgcd[i].gd.cid = CID_WinDescent;
8253
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8254
metarray[j++] = &metgcd[i];
8255
metgcd[i++].creator = GTextFieldCreate;
8257
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8258
metlabel[i].text = (unichar_t *) _("Is Offset");
8259
metlabel[i].text_is_1byte = true;
8260
metgcd[i].gd.label = &metlabel[i];
8261
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8262
/* value set later */
8263
metgcd[i].gd.cid = CID_WinDescentIsOff;
8264
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8265
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8266
metarray[j++] = &metgcd[i];
8267
metgcd[i++].creator = GCheckBoxCreate;
8268
metarray[j++] = NULL;
8270
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8271
metlabel[i].text = (unichar_t *) _("_Typo Ascent Offset:");
8272
metlabel[i].text_is_1byte = true;
8273
metlabel[i].text_in_resource = true;
8274
metgcd[i].gd.label = &metlabel[i];
8275
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8276
metgcd[i].gd.popup_msg = (unichar_t *) _("The type 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.");
8277
metgcd[i].gd.cid = CID_TypoAscentLab;
8278
metarray[j++] = &metgcd[i];
8279
metgcd[i++].creator = GLabelCreate;
8281
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8282
metgcd[i].gd.pos.width = 50;
8283
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8284
/* value set later */
8285
metgcd[i].gd.cid = CID_TypoAscent;
8286
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8287
metarray[j++] = &metgcd[i];
8288
metgcd[i++].creator = GTextFieldCreate;
8290
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8291
metlabel[i].text = (unichar_t *) _("Is Offset");
8292
metlabel[i].text_is_1byte = true;
8293
metgcd[i].gd.label = &metlabel[i];
8294
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8295
/* value set later */
8296
metgcd[i].gd.cid = CID_TypoAscentIsOff;
8297
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8298
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8299
metarray[j++] = &metgcd[i];
8300
metgcd[i++].creator = GCheckBoxCreate;
8301
metarray[j++] = NULL;
8303
metgcd[i].gd.pos.x = 5; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8304
metlabel[i].text = (unichar_t *) _("Really use Typo metrics");
8305
metlabel[i].text_is_1byte = true;
8306
metgcd[i].gd.label = &metlabel[i];
8307
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8308
/* value set later */
8309
metgcd[i].gd.cid = CID_UseTypoMetrics;
8310
metgcd[i].gd.popup_msg = (unichar_t *) _("The spec already says that the typeo metrics should be\nused to determine line spacing. But so many\nprograms fail to follow the spec that MS desided a bit\nwas needed to remind them to do so.");
8311
metarray[j++] = &metgcd[i]; metarray[j++] = GCD_ColSpan; metarray[j++] = GCD_Glue;
8312
metgcd[i++].creator = GCheckBoxCreate;
8313
metarray[j++] = NULL;
8315
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8316
metlabel[i].text = (unichar_t *) _("T_ypo Descent Offset:");
8317
metlabel[i].text_is_1byte = true;
8318
metlabel[i].text_in_resource = true;
8319
metgcd[i].gd.label = &metlabel[i];
8320
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8321
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8322
metgcd[i].gd.cid = CID_TypoDescentLab;
8323
metarray[j++] = &metgcd[i];
8324
metgcd[i++].creator = GLabelCreate;
8326
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8327
metgcd[i].gd.pos.width = 50;
8328
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8329
/* value set later */
8330
metgcd[i].gd.cid = CID_TypoDescent;
8331
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8332
metarray[j++] = &metgcd[i];
8333
metgcd[i++].creator = GTextFieldCreate;
8335
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8336
metlabel[i].text = (unichar_t *) _("Is Offset");
8337
metlabel[i].text_is_1byte = true;
8338
metgcd[i].gd.label = &metlabel[i];
8339
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8340
/* value set later */
8341
metgcd[i].gd.cid = CID_TypoDescentIsOff;
8342
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8343
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8344
metarray[j++] = &metgcd[i];
8345
metgcd[i++].creator = GCheckBoxCreate;
8346
metarray[j++] = NULL;
8348
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8349
metlabel[i].text = (unichar_t *) _("Typo Line _Gap:");
8350
metlabel[i].text_is_1byte = true;
8351
metlabel[i].text_in_resource = true;
8352
metgcd[i].gd.label = &metlabel[i];
8353
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8354
metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the TypoLinegap field in the OS/2 table, used on MS Windows");
8355
metarray[j++] = &metgcd[i];
8356
metgcd[i++].creator = GLabelCreate;
8358
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8359
metgcd[i].gd.pos.width = 50;
8360
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8361
/* Line gap value set later */
8362
metgcd[i].gd.cid = CID_TypoLineGap;
8363
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8364
metarray[j++] = &metgcd[i];
8365
metgcd[i++].creator = GTextFieldCreate;
8366
metarray[j++] = GCD_Glue;
8367
metarray[j++] = NULL;
8369
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+4;
8370
metlabel[i].text = (unichar_t *) _("_HHead Ascent Offset:");
8371
metlabel[i].text_is_1byte = true;
8372
metlabel[i].text_in_resource = true;
8373
metgcd[i].gd.label = &metlabel[i];
8374
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8375
metgcd[i].gd.popup_msg = (unichar_t *) _("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.");
8376
metgcd[i].gd.cid = CID_HHeadAscentLab;
8377
metarray[j++] = &metgcd[i];
8378
metgcd[i++].creator = GLabelCreate;
8380
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8381
metgcd[i].gd.pos.width = 50;
8382
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8383
/* value set later */
8384
metgcd[i].gd.cid = CID_HHeadAscent;
8385
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8386
metarray[j++] = &metgcd[i];
8387
metgcd[i++].creator = GTextFieldCreate;
8389
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8390
metlabel[i].text = (unichar_t *) _("Is Offset");
8391
metlabel[i].text_is_1byte = true;
8392
metgcd[i].gd.label = &metlabel[i];
8393
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8394
/* value set later */
8395
metgcd[i].gd.cid = CID_HHeadAscentIsOff;
8396
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8397
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8398
metarray[j++] = &metgcd[i];
8399
metgcd[i++].creator = GCheckBoxCreate;
8400
metarray[j++] = NULL;
8402
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8403
metlabel[i].text = (unichar_t *) _("HHead De_scent Offset:");
8404
metlabel[i].text_in_resource = true;
8405
metlabel[i].text_is_1byte = true;
8406
metgcd[i].gd.label = &metlabel[i];
8407
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8408
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8409
metgcd[i].gd.cid = CID_HHeadDescentLab;
8410
metarray[j++] = &metgcd[i];
8411
metgcd[i++].creator = GLabelCreate;
8413
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8414
metgcd[i].gd.pos.width = 50;
8415
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8416
/* value set later */
8417
metgcd[i].gd.cid = CID_HHeadDescent;
8418
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8419
metarray[j++] = &metgcd[i];
8420
metgcd[i++].creator = GTextFieldCreate;
8422
metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
8423
metlabel[i].text = (unichar_t *) _("Is Offset");
8424
metlabel[i].text_is_1byte = true;
8425
metgcd[i].gd.label = &metlabel[i];
8426
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8427
/* value set later */
8428
metgcd[i].gd.cid = CID_HHeadDescentIsOff;
8429
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8430
metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
8431
metarray[j++] = &metgcd[i];
8432
metgcd[i++].creator = GCheckBoxCreate;
8433
metarray[j++] = NULL;
8435
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
8436
metlabel[i].text = (unichar_t *) _("HHead _Line Gap:");
8437
metlabel[i].text_is_1byte = true;
8438
metlabel[i].text_in_resource = true;
8439
metgcd[i].gd.label = &metlabel[i];
8440
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8441
metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the linegap field in the hhea table, used on the mac");
8442
metarray[j++] = &metgcd[i];
8443
metgcd[i++].creator = GLabelCreate;
8445
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
8446
metgcd[i].gd.pos.width = 50;
8447
metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8448
/* Line gap value set later */
8449
metgcd[i].gd.cid = CID_LineGap;
8450
metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
8451
metarray[j++] = &metgcd[i];
8452
metgcd[i++].creator = GTextFieldCreate;
8453
metarray[j++] = GCD_Glue;
8454
metarray[j++] = NULL;
8456
metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+6;
8457
metlabel[i].text = (unichar_t *) _("VHead _Column Spacing:");
8458
metlabel[i].text_is_1byte = true;
8459
metlabel[i].text_in_resource = true;
8460
metgcd[i].gd.label = &metlabel[i];
8461
metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
8462
metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the linegap field in the vhea table.\nThis is the horizontal spacing between rows\nof vertically set text.");
8463
metgcd[i].gd.cid = CID_VLineGapLab;
8464
metarray[j++] = &metgcd[i];
8465
metgcd[i++].creator = GLabelCreate;
8467
metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-6;
8468
metgcd[i].gd.pos.width = 50;
8469
metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
8470
/* V Line gap value set later */
8471
metgcd[i].gd.cid = CID_VLineGap;
8472
metgcd[i].gd.popup_msg = metgcd[17].gd.popup_msg;
8473
metarray[j++] = &metgcd[i];
8474
metgcd[i++].creator = GTextFieldCreate;
8475
metarray[j++] = GCD_Glue;
8476
metarray[j++] = NULL;
8477
metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue;
8479
metarray[j++] = NULL; metarray[j++] = NULL;
8481
memset(metbox,0,sizeof(metbox));
8482
metbox[0].gd.flags = gg_enabled|gg_visible;
8483
metbox[0].gd.u.boxelements = metarray;
8484
metbox[0].creator = GHVBoxCreate;
8485
/******************************************************************************/
8487
memset(&ssgcd,0,sizeof(ssgcd));
8488
memset(&sslabel,'\0',sizeof(sslabel));
8492
ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = 5;
8493
sslabel[i].text = (unichar_t *) S_("SubscriptSuperUse|Default");
8494
sslabel[i].text_is_1byte = true;
8495
ssgcd[i].gd.label = &sslabel[i];
8496
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8497
/* value set later */
8498
ssgcd[i].gd.cid = CID_SubSuperDefault;
8499
ssgcd[i].gd.handle_controlevent = GFI_SubSuperDefault;
8500
ssarray[j++] = &ssgcd[i];
8501
ssgcd[i++].creator = GCheckBoxCreate;
8502
ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
8503
ssarray[j++] = NULL;
8505
ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+16;
8506
sslabel[i].text = (unichar_t *) _("Subscript");
8507
sslabel[i].text_is_1byte = true;
8508
ssgcd[i].gd.label = &sslabel[i];
8509
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8510
ssarray[j++] = &ssgcd[i];
8511
ssgcd[i++].creator = GLabelCreate;
8513
ssgcd[i].gd.pos.x = 120; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-4;
8514
/* GT: X is a coordinate, the leading spaces help to align it */
8515
sslabel[i].text = (unichar_t *) _(" X");
8516
sslabel[i].text_is_1byte = true;
8517
ssgcd[i].gd.label = &sslabel[i];
8518
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8519
ssarray[j++] = &ssgcd[i];
8520
ssgcd[i++].creator = GLabelCreate;
8522
ssgcd[i].gd.pos.x = 180; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
8523
/* GT: Y is a coordinate, the leading spaces help to align it */
8524
sslabel[i].text = (unichar_t *) _("Y");
8525
sslabel[i].text_is_1byte = true;
8526
ssgcd[i].gd.label = &sslabel[i];
8527
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8528
ssarray[j++] = &ssgcd[i];
8529
ssgcd[i++].creator = GLabelCreate;
8530
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8532
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+14+4;
8533
sslabel[i].text = (unichar_t *) _("Size");
8534
sslabel[i].text_is_1byte = true;
8535
ssgcd[i].gd.label = &sslabel[i];
8536
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8537
ssarray[j++] = &ssgcd[i];
8538
ssgcd[i++].creator = GLabelCreate;
8540
ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8541
ssgcd[i].gd.pos.width = 50;
8542
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8544
ssgcd[i].gd.cid = CID_SubXSize;
8545
ssarray[j++] = &ssgcd[i];
8546
ssgcd[i++].creator = GTextFieldCreate;
8548
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
8549
ssgcd[i].gd.pos.width = 50;
8550
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8552
ssgcd[i].gd.cid = CID_SubYSize;
8553
ssarray[j++] = &ssgcd[i];
8554
ssgcd[i++].creator = GTextFieldCreate;
8555
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8557
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
8558
sslabel[i].text = (unichar_t *) _("Offset");
8559
sslabel[i].text_is_1byte = true;
8560
ssgcd[i].gd.label = &sslabel[i];
8561
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8562
ssarray[j++] = &ssgcd[i];
8563
ssgcd[i++].creator = GLabelCreate;
8565
ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8566
ssgcd[i].gd.pos.width = 50;
8567
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8569
ssgcd[i].gd.cid = CID_SubXOffset;
8570
ssarray[j++] = &ssgcd[i];
8571
ssgcd[i++].creator = GTextFieldCreate;
8573
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
8574
ssgcd[i].gd.pos.width = 50;
8575
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8577
ssgcd[i].gd.cid = CID_SubYOffset;
8578
ssarray[j++] = &ssgcd[i];
8579
ssgcd[i++].creator = GTextFieldCreate;
8580
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8583
ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
8584
sslabel[i].text = (unichar_t *) _("Superscript");
8585
sslabel[i].text_is_1byte = true;
8586
ssgcd[i].gd.label = &sslabel[i];
8587
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8588
ssarray[j++] = &ssgcd[i];
8589
ssgcd[i++].creator = GLabelCreate;
8590
ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
8591
ssarray[j++] = NULL;
8593
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
8594
sslabel[i].text = (unichar_t *) _("Size");
8595
sslabel[i].text_is_1byte = true;
8596
ssgcd[i].gd.label = &sslabel[i];
8597
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8598
ssarray[j++] = &ssgcd[i];
8599
ssgcd[i++].creator = GLabelCreate;
8601
ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8602
ssgcd[i].gd.pos.width = 50;
8603
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8605
ssgcd[i].gd.cid = CID_SuperXSize;
8606
ssarray[j++] = &ssgcd[i];
8607
ssgcd[i++].creator = GTextFieldCreate;
8609
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
8610
ssgcd[i].gd.pos.width = 50;
8611
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8613
ssgcd[i].gd.cid = CID_SuperYSize;
8614
ssarray[j++] = &ssgcd[i];
8615
ssgcd[i++].creator = GTextFieldCreate;
8616
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8618
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
8619
sslabel[i].text = (unichar_t *) _("Offset");
8620
sslabel[i].text_is_1byte = true;
8621
ssgcd[i].gd.label = &sslabel[i];
8622
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8623
ssarray[j++] = &ssgcd[i];
8624
ssgcd[i++].creator = GLabelCreate;
8626
ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8627
ssgcd[i].gd.pos.width = 50;
8628
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8630
ssgcd[i].gd.cid = CID_SuperXOffset;
8631
ssarray[j++] = &ssgcd[i];
8632
ssgcd[i++].creator = GTextFieldCreate;
8634
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
8635
ssgcd[i].gd.pos.width = 50;
8636
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8638
ssgcd[i].gd.cid = CID_SuperYOffset;
8639
ssarray[j++] = &ssgcd[i];
8640
ssgcd[i++].creator = GTextFieldCreate;
8641
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8644
ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
8645
sslabel[i].text = (unichar_t *) _("Strikeout");
8646
sslabel[i].text_is_1byte = true;
8647
ssgcd[i].gd.label = &sslabel[i];
8648
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8649
ssarray[j++] = &ssgcd[i];
8650
ssgcd[i++].creator = GLabelCreate;
8651
ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
8652
ssarray[j++] = NULL;
8654
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
8655
sslabel[i].text = (unichar_t *) _("Size");
8656
sslabel[i].text_is_1byte = true;
8657
ssgcd[i].gd.label = &sslabel[i];
8658
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8659
ssarray[j++] = &ssgcd[i];
8660
ssgcd[i++].creator = GLabelCreate;
8661
ssarray[j++] = GCD_Glue;
8663
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8664
ssgcd[i].gd.pos.width = 50;
8665
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8667
ssgcd[i].gd.cid = CID_StrikeoutSize;
8668
ssarray[j++] = &ssgcd[i];
8669
ssgcd[i++].creator = GTextFieldCreate;
8670
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8672
ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-2].gd.pos.y+26;
8673
sslabel[i].text = (unichar_t *) _("Pos");
8674
sslabel[i].text_is_1byte = true;
8675
ssgcd[i].gd.label = &sslabel[i];
8676
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8677
ssarray[j++] = &ssgcd[i];
8678
ssgcd[i++].creator = GLabelCreate;
8679
ssarray[j++] = GCD_Glue;
8681
ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
8682
ssgcd[i].gd.pos.width = 50;
8683
ssgcd[i].gd.flags = gg_visible | gg_enabled;
8685
ssgcd[i].gd.cid = CID_StrikeoutPos;
8686
ssarray[j++] = &ssgcd[i];
8687
ssgcd[i++].creator = GTextFieldCreate;
8688
ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
8690
ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
8692
ssarray[j++] = NULL; ssarray[j++] = NULL;
8694
memset(ssbox,0,sizeof(ssbox));
8695
ssbox[0].gd.flags = gg_enabled|gg_visible;
8696
ssbox[0].gd.u.boxelements = ssarray;
8697
ssbox[0].creator = GHVBoxCreate;
8698
/******************************************************************************/
8699
memset(&panlabel,0,sizeof(panlabel));
8700
memset(&pangcd,0,sizeof(pangcd));
8704
pangcd[i].gd.pos.x = 5; pangcd[i].gd.pos.y = 5;
8705
panlabel[i].text = (unichar_t *) S_("PanoseUse|Default");
8706
panlabel[i].text_is_1byte = true;
8707
pangcd[i].gd.label = &panlabel[i];
8708
pangcd[i].gd.flags = gg_visible | gg_enabled;
8709
/* value set later */
8710
pangcd[i].gd.cid = CID_PanDefault;
8711
/*pangcd[i].gd.popup_msg = pangcd[i-1].gd.popup_msg;*/
8712
pangcd[i].gd.handle_controlevent = GFI_PanoseDefault;
8713
panarray[j++] = &pangcd[i];
8714
pangcd[i++].creator = GCheckBoxCreate;
8715
panarray[j++] = GCD_Glue; panarray[j++] = NULL;
8717
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+14+4;
8718
panlabel[i].text = (unichar_t *) S_("Panose|_Family");
8719
panlabel[i].text_is_1byte = true;
8720
panlabel[i].text_in_resource = true;
8721
pangcd[i].gd.label = &panlabel[i];
8722
pangcd[i].gd.cid = CID_PanFamilyLab;
8723
pangcd[i].gd.flags = gg_visible | gg_enabled;
8724
panarray[j++] = &pangcd[i];
8725
pangcd[i++].creator = GLabelCreate;
8727
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8728
pangcd[i].gd.flags = gg_visible | gg_enabled;
8729
pangcd[i].gd.cid = CID_PanFamily;
8730
pangcd[i].gd.u.list = panfamily;
8731
panarray[j++] = &pangcd[i];
8732
pangcd[i++].creator = GListButtonCreate;
8733
panarray[j++] = NULL;
8735
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8736
panlabel[i].text = (unichar_t *) _("_Serifs");
8737
panlabel[i].text_is_1byte = true;
8738
panlabel[i].text_in_resource = true;
8739
pangcd[i].gd.label = &panlabel[i];
8740
pangcd[i].gd.cid = CID_PanSerifsLab;
8741
pangcd[i].gd.flags = gg_visible | gg_enabled;
8742
panarray[j++] = &pangcd[i];
8743
pangcd[i++].creator = GLabelCreate;
8745
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8746
pangcd[i].gd.flags = gg_visible | gg_enabled;
8747
pangcd[i].gd.cid = CID_PanSerifs;
8748
pangcd[i].gd.u.list = panserifs;
8749
panarray[j++] = &pangcd[i];
8750
pangcd[i++].creator = GListButtonCreate;
8751
panarray[j++] = NULL;
8753
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8754
panlabel[i].text = (unichar_t *) S_("Panose|_Weight");
8755
panlabel[i].text_is_1byte = true;
8756
panlabel[i].text_in_resource = true;
8757
pangcd[i].gd.label = &panlabel[i];
8758
pangcd[i].gd.cid = CID_PanWeightLab;
8759
pangcd[i].gd.flags = gg_visible | gg_enabled;
8760
panarray[j++] = &pangcd[i];
8761
pangcd[i++].creator = GLabelCreate;
8763
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8764
pangcd[i].gd.flags = gg_visible | gg_enabled;
8765
pangcd[i].gd.cid = CID_PanWeight;
8766
pangcd[i].gd.u.list = panweight;
8767
panarray[j++] = &pangcd[i];
8768
pangcd[i++].creator = GListButtonCreate;
8769
panarray[j++] = NULL;
8771
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8772
panlabel[i].text = (unichar_t *) _("_Proportion");
8773
panlabel[i].text_is_1byte = true;
8774
panlabel[i].text_in_resource = true;
8775
pangcd[i].gd.label = &panlabel[i];
8776
pangcd[i].gd.cid = CID_PanPropLab;
8777
pangcd[i].gd.flags = gg_visible | gg_enabled;
8778
panarray[j++] = &pangcd[i];
8779
pangcd[i++].creator = GLabelCreate;
8781
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8782
pangcd[i].gd.flags = gg_visible | gg_enabled;
8783
pangcd[i].gd.cid = CID_PanProp;
8784
pangcd[i].gd.u.list = panprop;
8785
panarray[j++] = &pangcd[i];
8786
pangcd[i++].creator = GListButtonCreate;
8787
panarray[j++] = NULL;
8789
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8790
panlabel[i].text = (unichar_t *) _("_Contrast");
8791
panlabel[i].text_is_1byte = true;
8792
panlabel[i].text_in_resource = true;
8793
pangcd[i].gd.label = &panlabel[i];
8794
pangcd[i].gd.cid = CID_PanContrastLab;
8795
pangcd[i].gd.flags = gg_visible | gg_enabled;
8796
panarray[j++] = &pangcd[i];
8797
pangcd[i++].creator = GLabelCreate;
8799
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8800
pangcd[i].gd.flags = gg_visible | gg_enabled;
8801
pangcd[i].gd.cid = CID_PanContrast;
8802
pangcd[i].gd.u.list = pancontrast;
8803
panarray[j++] = &pangcd[i];
8804
pangcd[i++].creator = GListButtonCreate;
8805
panarray[j++] = NULL;
8807
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8808
panlabel[i].text = (unichar_t *) _("Stroke _Variation");
8809
panlabel[i].text_is_1byte = true;
8810
panlabel[i].text_in_resource = true;
8811
pangcd[i].gd.label = &panlabel[i];
8812
pangcd[i].gd.cid = CID_PanStrokeVarLab;
8813
pangcd[i].gd.flags = gg_visible | gg_enabled;
8814
panarray[j++] = &pangcd[i];
8815
pangcd[i++].creator = GLabelCreate;
8817
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8818
pangcd[i].gd.flags = gg_visible | gg_enabled;
8819
pangcd[i].gd.cid = CID_PanStrokeVar;
8820
pangcd[i].gd.u.list = panstrokevar;
8821
panarray[j++] = &pangcd[i];
8822
pangcd[i++].creator = GListButtonCreate;
8823
panarray[j++] = NULL;
8825
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8826
panlabel[i].text = (unichar_t *) _("_Arm Style");
8827
panlabel[i].text_is_1byte = true;
8828
panlabel[i].text_in_resource = true;
8829
pangcd[i].gd.label = &panlabel[i];
8830
pangcd[i].gd.cid = CID_PanArmStyleLab;
8831
pangcd[i].gd.flags = gg_visible | gg_enabled;
8832
panarray[j++] = &pangcd[i];
8833
pangcd[i++].creator = GLabelCreate;
8835
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8836
pangcd[i].gd.flags = gg_visible | gg_enabled;
8837
pangcd[i].gd.cid = CID_PanArmStyle;
8838
pangcd[i].gd.u.list = panarmstyle;
8839
panarray[j++] = &pangcd[i];
8840
pangcd[i++].creator = GListButtonCreate;
8841
panarray[j++] = NULL;
8843
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8844
panlabel[i].text = (unichar_t *) _("_Letterform");
8845
panlabel[i].text_is_1byte = true;
8846
panlabel[i].text_in_resource = true;
8847
pangcd[i].gd.label = &panlabel[i];
8848
pangcd[i].gd.cid = CID_PanLetterformLab;
8849
pangcd[i].gd.flags = gg_visible | gg_enabled;
8850
panarray[j++] = &pangcd[i];
8851
pangcd[i++].creator = GLabelCreate;
8853
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8854
pangcd[i].gd.flags = gg_visible | gg_enabled;
8855
pangcd[i].gd.cid = CID_PanLetterform;
8856
pangcd[i].gd.u.list = panletterform;
8857
panarray[j++] = &pangcd[i];
8858
pangcd[i++].creator = GListButtonCreate;
8859
panarray[j++] = NULL;
8861
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8862
panlabel[i].text = (unichar_t *) _("_Midline");
8863
panlabel[i].text_is_1byte = true;
8864
panlabel[i].text_in_resource = true;
8865
pangcd[i].gd.label = &panlabel[i];
8866
pangcd[i].gd.cid = CID_PanMidLineLab;
8867
pangcd[i].gd.flags = gg_visible | gg_enabled;
8868
panarray[j++] = &pangcd[i];
8869
pangcd[i++].creator = GLabelCreate;
8871
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8872
pangcd[i].gd.flags = gg_visible | gg_enabled;
8873
pangcd[i].gd.cid = CID_PanMidLine;
8874
pangcd[i].gd.u.list = panmidline;
8875
panarray[j++] = &pangcd[i];
8876
pangcd[i++].creator = GListButtonCreate;
8877
panarray[j++] = NULL;
8879
pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
8880
panlabel[i].text = (unichar_t *) _("_X-Height");
8881
panlabel[i].text_is_1byte = true;
8882
panlabel[i].text_in_resource = true;
8883
pangcd[i].gd.label = &panlabel[i];
8884
pangcd[i].gd.cid = CID_PanXHeightLab;
8885
pangcd[i].gd.flags = gg_visible | gg_enabled;
8886
panarray[j++] = &pangcd[i];
8887
pangcd[i++].creator = GLabelCreate;
8889
pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
8890
pangcd[i].gd.flags = gg_visible | gg_enabled;
8891
pangcd[i].gd.cid = CID_PanXHeight;
8892
pangcd[i].gd.u.list = panxheight;
8893
panarray[j++] = &pangcd[i];
8894
pangcd[i++].creator = GListButtonCreate;
8895
panarray[j++] = NULL;
8897
panarray[j++] = GCD_Glue; panarray[j++] = GCD_Glue;
8899
panarray[j++] = NULL; panarray[j++] = NULL;
8901
memset(panbox,0,sizeof(panbox));
8902
panbox[0].gd.flags = gg_enabled|gg_visible;
8903
panbox[0].gd.u.boxelements = panarray;
8904
panbox[0].creator = GHVBoxCreate;
8905
/******************************************************************************/
8907
memset(&vagcd,0,sizeof(vagcd));
8908
memset(&vaspects,'\0',sizeof(vaspects));
8911
vaspects[i].text = (unichar_t *) _("Misc.");
8912
vaspects[i].text_is_1byte = true;
8913
vaspects[i++].gcd = vbox;
8915
vaspects[i].text = (unichar_t *) _("Metrics");
8916
vaspects[i].text_is_1byte = true;
8917
vaspects[i++].gcd = metbox;
8919
vaspects[i].text = (unichar_t *) _("Sub/Super");
8920
vaspects[i].text_is_1byte = true;
8921
vaspects[i++].gcd = ssbox;
8923
vaspects[i].text = (unichar_t *) _("Panose");
8924
vaspects[i].text_is_1byte = true;
8925
vaspects[i++].gcd = panbox;
8927
vagcd[0].gd.pos.x = 4; vagcd[0].gd.pos.y = 6;
8928
vagcd[0].gd.pos.width = 252;
8929
vagcd[0].gd.pos.height = 300;
8930
vagcd[0].gd.u.tabs = vaspects;
8931
vagcd[0].gd.flags = gg_visible | gg_enabled;
8932
/*vagcd[0].gd.handle_controlevent = GFI_TTFAspectChange;*/
8933
vagcd[0].gd.cid = CID_TTFTabs;
8934
vagcd[0].creator = GTabSetCreate;
8936
/******************************************************************************/
8937
memset(&gaspboxes,0,sizeof(gaspboxes));
8938
memset(&gaspgcd,0,sizeof(gaspgcd));
8939
memset(&gasplabel,0,sizeof(gasplabel));
8940
memset(&gaspgcd_def,0,sizeof(gaspgcd_def));
8942
GaspMatrixInit(&gaspmi,d);
8946
gasplabel[i].text = (unichar_t *) S_("Gasp|_Version");
8947
gasplabel[i].text_is_1byte = true;
8948
gasplabel[i].text_in_resource = true;
8949
gaspgcd[i].gd.label = &gasplabel[i];
8950
gaspgcd[i].gd.flags = gg_visible | gg_enabled;
8951
gaspharray[j++] = &gaspgcd[i];
8952
gaspgcd[i++].creator = GLabelCreate;
8954
gaspgcd[i].gd.flags = gg_visible | gg_enabled;
8955
gaspgcd[i].gd.cid = CID_GaspVersion;
8956
gaspgcd[i].gd.label = &gaspversions[sf->gasp_version];
8957
gaspgcd[i].gd.u.list = gaspversions;
8958
gaspharray[j++] = &gaspgcd[i];
8959
gaspgcd[i].gd.handle_controlevent = GFI_GaspVersion;
8960
gaspgcd[i++].creator = GListButtonCreate;
8961
gaspharray[j++] = GCD_HPad10;
8963
gasplabel[i].text = (unichar_t *) _("Optimized For Cleartype");
8964
gasplabel[i].text_is_1byte = true;
8965
gasplabel[i].text_in_resource = true;
8966
gaspgcd[i].gd.label = &gasplabel[i];
8967
gaspgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
8968
gaspgcd[i].gd.cid = CID_HeadClearType;
8969
if ( sf->head_optimized_for_cleartype )
8970
gaspgcd[i].gd.flags |= gg_cb_on;
8971
gaspgcd[i].gd.popup_msg = (unichar_t *) _("Actually a bit in the 'head' table.\nIf unset then certain East Asian fonts will not be hinted");
8972
gaspharray[j++] = &gaspgcd[i];
8973
gaspgcd[i++].creator = GCheckBoxCreate;
8974
gaspharray[j++] = NULL;
8976
gaspboxes[2].gd.flags = gg_enabled|gg_visible;
8977
gaspboxes[2].gd.u.boxelements = gaspharray;
8978
gaspboxes[2].creator = GHBoxCreate;
8980
gaspvarray[0] = &gaspboxes[2];
8982
gaspgcd[i].gd.pos.width = 300; gaspgcd[i].gd.pos.height = 200;
8983
gaspgcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
8984
gaspgcd[i].gd.cid = CID_Gasp;
8985
gaspgcd[i].gd.u.matrix = &gaspmi;
8986
gaspgcd[i].gd.popup_msg = (unichar_t *) _(
8987
"The 'gasp' table gives you control over when grid-fitting and\n"
8988
"anti-aliased rasterizing are done.\n"
8989
"The table consists of an (ordered) list of pixel sizes each with\n"
8990
"a set of flags. Those flags apply to all pixel sizes bigger than\n"
8991
"the previous table entry but less than or equal to the current.\n"
8992
"The list must be terminated with a pixel size of 65535.\n"
8993
"Version 1 of the table contains two additional flags that\n"
8994
"apply to MS's ClearType rasterizer.\n\n"
8995
"The 'gasp' table only applies to truetype fonts.");
8996
gaspgcd[i].data = d;
8997
gaspgcd[i].creator = GMatrixEditCreate;
8998
gaspvarray[1] = &gaspgcd[i];
8999
gaspvarray[2] = NULL;
9001
gaspboxes[0].gd.flags = gg_enabled|gg_visible;
9002
gaspboxes[0].gd.u.boxelements = gaspvarray;
9003
gaspboxes[0].creator = GVBoxCreate;
9005
gaspgcd_def[0].gd.flags = gg_visible | gg_enabled;
9006
gasplabel[4].text = (unichar_t *) S_("Gasp|_Default");
9007
gasplabel[4].text_is_1byte = true;
9008
gasplabel[4].text_in_resource = true;
9009
gaspgcd_def[0].gd.label = &gasplabel[4];
9010
gaspgcd_def[0].gd.handle_controlevent = Gasp_Default;
9011
gaspgcd_def[0].creator = GButtonCreate;
9012
/******************************************************************************/
9013
memset(&tnlabel,0,sizeof(tnlabel));
9014
memset(&tngcd,0,sizeof(tngcd));
9015
memset(&tnboxes,0,sizeof(tnboxes));
9017
TNMatrixInit(&mi,d);
9019
tngcd[0].gd.pos.x = 5; tngcd[0].gd.pos.y = 6;
9020
tngcd[0].gd.flags = gg_visible | gg_enabled;
9021
tnlabel[0].text = (unichar_t *) _("Sort By:");
9022
tnlabel[0].text_is_1byte = true;
9023
tngcd[0].gd.label = &tnlabel[0];
9024
tngcd[0].creator = GLabelCreate;
9025
tnharray[0] = &tngcd[0];
9027
tngcd[1].gd.pos.x = 50; tngcd[1].gd.pos.y = tngcd[0].gd.pos.y-4;
9028
tngcd[1].gd.flags = gg_enabled | gg_visible;
9029
tngcd[1].gd.cid = CID_TNLangSort;
9030
tnlabel[1].text = (unichar_t *) _("_Language");
9031
tnlabel[1].text_is_1byte = true;
9032
tnlabel[1].text_in_resource = true;
9033
tngcd[1].gd.label = &tnlabel[1];
9034
tngcd[1].creator = GRadioCreate;
9035
tngcd[1].gd.handle_controlevent = GFI_SortBy;
9036
tnharray[1] = &tngcd[1];
9038
tngcd[2].gd.pos.x = 120; tngcd[2].gd.pos.y = tngcd[1].gd.pos.y;
9039
tngcd[2].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
9040
tngcd[2].gd.cid = CID_TNStringSort;
9041
tnlabel[2].text = (unichar_t *) _("_String Type");
9042
tnlabel[2].text_is_1byte = true;
9043
tnlabel[2].text_in_resource = true;
9044
tngcd[2].gd.label = &tnlabel[2];
9045
tngcd[2].creator = GRadioCreate;
9046
tngcd[2].gd.handle_controlevent = GFI_SortBy;
9047
tnharray[2] = &tngcd[2];
9049
tngcd[3].gd.pos.x = 195; tngcd[3].gd.pos.y = tngcd[1].gd.pos.y;
9050
tngcd[3].gd.flags = gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold;
9051
tnlabel[3].text = (unichar_t *) S_("SortingScheme|Default");
9052
tnlabel[3].text_is_1byte = true;
9053
tngcd[3].gd.label = &tnlabel[3];
9054
tngcd[3].creator = GRadioCreate;
9055
tngcd[3].gd.handle_controlevent = GFI_SortBy;
9056
tnharray[3] = &tngcd[3]; tnharray[4] = GCD_Glue; tnharray[5] = NULL;
9058
tngcd[4].gd.pos.x = 10; tngcd[4].gd.pos.y = tngcd[1].gd.pos.y+14;
9059
tngcd[4].gd.pos.width = 300; tngcd[4].gd.pos.height = 200;
9060
tngcd[4].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
9061
tngcd[4].gd.cid = CID_TNames;
9062
tngcd[4].gd.u.matrix = &mi;
9063
tngcd[4].gd.popup_msg = (unichar_t *) _(
9064
"To create a new name, left click on the <New> button, and select a locale.\n"
9065
"To change the locale, left click on it.\n"
9066
"To change the string type, left click on it.\n"
9067
"To change the text, left click in it and then type.\n"
9068
"To delete a name, right click on the name & select Delete from the menu.\n"
9069
"To associate or disassocate a truetype name to its postscript equivalent\n"
9070
"right click and select the appropriate menu item." );
9072
tngcd[4].creator = GMatrixEditCreate;
9074
tngcd[5].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9075
/* GT: when translating this please leave the "SIL Open Font License" in */
9076
/* GT: English (possibly translating it in parentheses). I believe there */
9077
/* GT: are legal reasons for this. */
9078
/* GT: So "A\303\261adir SIL Open Font License (licencia de fuentes libres)" */
9079
tnlabel[5].text = (unichar_t *) S_("Add SIL ");
9080
tnlabel[5].image_precedes = false;
9081
tnlabel[5].image = &OFL_logo;
9082
tnlabel[5].text_is_1byte = true;
9083
tnlabel[5].text_in_resource = true;
9084
tngcd[5].gd.label = &tnlabel[5];
9085
tngcd[5].gd.handle_controlevent = GFI_AddOFL;
9086
tngcd[5].gd.popup_msg = (unichar_t *) _(
9087
"The SIL Open Font License (OFL) is designed for free/libre/open font projects.\n"
9088
"Most other FLOSS licenses are designed for conventional software and are problematic for fonts.\n"
9089
"The OFL is a community-approved license and is well-suited for releasing fonts to be freely \n"
9090
"used, studied, copied, modified, embedded, merged and distributed while maintaining artistic integrity.\n"
9091
"You are encouraged you to use it if you can.\n"
9093
"For more details about the OFL - and the corresponding FAQ - see http://scripts.sil.org/OFL \n"
9095
"Simply press this button to add the OFL metadata to your font.\n"
9097
tngcd[5].creator = GButtonCreate;
9099
tngcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9100
tnlabel[6].text = (unichar_t *) S_("OFL website");
9101
tnlabel[6].text_is_1byte = true;
9102
tnlabel[6].text_in_resource = true;
9103
tngcd[6].gd.label = &tnlabel[6];
9104
tngcd[6].gd.handle_controlevent = GFI_HelpOFL;
9105
tngcd[6].gd.popup_msg = (unichar_t *) _(
9107
"Click here to go to http://scripts.sil.org/OFL \n"
9108
"to get all the details about the Open Font License \n"
9109
"and to read the corresponding FAQ. \n"
9111
tngcd[6].creator = GButtonCreate;
9112
tnharray2[0] = &tngcd[5]; tnharray2[1] = &tngcd[6]; tnharray2[2] = GCD_Glue; tnharray2[3] = NULL;
9113
tnvarray[0] = &tnboxes[2]; tnvarray[1] = &tngcd[4]; tnvarray[2] = &tnboxes[3]; tnvarray[3] = NULL;
9115
tnboxes[0].gd.flags = gg_enabled|gg_visible;
9116
tnboxes[0].gd.u.boxelements = tnvarray;
9117
tnboxes[0].creator = GVBoxCreate;
9119
tnboxes[2].gd.flags = gg_enabled|gg_visible;
9120
tnboxes[2].gd.u.boxelements = tnharray;
9121
tnboxes[2].creator = GHBoxCreate;
9123
tnboxes[3].gd.flags = gg_enabled|gg_visible;
9124
tnboxes[3].gd.u.boxelements = tnharray2;
9125
tnboxes[3].creator = GHBoxCreate;
9126
/******************************************************************************/
9127
memset(&comlabel,0,sizeof(comlabel));
9128
memset(&comgcd,0,sizeof(comgcd));
9130
comgcd[0].gd.pos.x = 10; comgcd[0].gd.pos.y = 10;
9131
comgcd[0].gd.pos.width = ngcd[11].gd.pos.width; comgcd[0].gd.pos.height = 230;
9132
comgcd[0].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
9133
comgcd[0].gd.cid = CID_Comment;
9134
comlabel[0].text = (unichar_t *) sf->comments;
9135
comlabel[0].text_is_1byte = true;
9136
if ( comlabel[0].text==NULL ) comlabel[0].text = (unichar_t *) "";
9137
comgcd[0].gd.label = &comlabel[0];
9138
comgcd[0].creator = GTextAreaCreate;
9140
comarray[0] = &comgcd[0]; comarray[1] = NULL;
9141
memset(combox,0,sizeof(combox));
9142
combox[0].gd.flags = gg_enabled|gg_visible;
9143
combox[0].gd.u.boxelements = comarray;
9144
combox[0].creator = GHBoxCreate;
9146
/******************************************************************************/
9147
memset(&mklabel,0,sizeof(mklabel));
9148
memset(&mkgcd,0,sizeof(mkgcd));
9150
mkgcd[0].gd.pos.x = 10; mkgcd[0].gd.pos.y = 10;
9151
mkgcd[0].gd.pos.width = ngcd[15].gd.pos.width; mkgcd[0].gd.pos.height = 200;
9152
mkgcd[0].gd.flags = gg_visible | gg_enabled;
9153
mkgcd[0].gd.cid = CID_MarkClasses;
9154
mkgcd[0].gd.u.list = MarkClassesList(sf);
9155
mkgcd[0].gd.handle_controlevent = GFI_MarkSelChanged;
9156
mkgcd[0].creator = GListCreate;
9158
mkgcd[1].gd.pos.x = 10; mkgcd[1].gd.pos.y = mkgcd[0].gd.pos.y+mkgcd[0].gd.pos.height+4;
9159
mkgcd[1].gd.pos.width = -1;
9160
mkgcd[1].gd.flags = gg_visible | gg_enabled;
9161
/* GT: See the long comment at "Property|New" */
9162
/* GT: The msgstr should contain a translation of "_New...", ignore "Mark|" */
9163
mklabel[1].text = (unichar_t *) S_("Mark|_New...");
9164
mklabel[1].text_is_1byte = true;
9165
mklabel[1].text_in_resource = true;
9166
mkgcd[1].gd.label = &mklabel[1];
9167
mkgcd[1].gd.cid = CID_MarkNew;
9168
mkgcd[1].gd.handle_controlevent = GFI_MarkNew;
9169
mkgcd[1].creator = GButtonCreate;
9171
mkgcd[2].gd.pos.x = -10; mkgcd[2].gd.pos.y = mkgcd[1].gd.pos.y;
9172
mkgcd[2].gd.pos.width = -1;
9173
mkgcd[2].gd.flags = gg_visible;
9174
mklabel[2].text = (unichar_t *) _("_Edit...");
9175
mklabel[2].text_is_1byte = true;
9176
mklabel[2].text_in_resource = true;
9177
mkgcd[2].gd.label = &mklabel[2];
9178
mkgcd[2].gd.cid = CID_MarkEdit;
9179
mkgcd[2].gd.handle_controlevent = GFI_MarkEdit;
9180
mkgcd[2].creator = GButtonCreate;
9182
mkarray[0] = &mkgcd[0]; mkarray[1] = &mkbox[2]; mkarray[2] = NULL;
9183
mkarray2[0] = &mkgcd[1]; mkarray2[1] = GCD_Glue; mkarray2[2] = &mkgcd[2];
9185
memset(mkbox,0,sizeof(mkbox));
9186
mkbox[0].gd.flags = gg_enabled|gg_visible;
9187
mkbox[0].gd.u.boxelements = mkarray;
9188
mkbox[0].creator = GVBoxCreate;
9190
mkbox[2].gd.flags = gg_enabled|gg_visible;
9191
mkbox[2].gd.u.boxelements = mkarray2;
9192
mkbox[2].creator = GHBoxCreate;
9193
/******************************************************************************/
9194
memset(&txlabel,0,sizeof(txlabel));
9195
memset(&txgcd,0,sizeof(txgcd));
9198
txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 General");
9199
txlabel[k].text_is_1byte = true;
9200
txgcd[k].gd.label = &txlabel[k];
9201
txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = 10;
9202
txgcd[k].gd.flags = gg_visible | gg_enabled;
9203
txgcd[k].gd.cid = CID_TeXText;
9204
txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
9205
txgcd[k++].creator = GRadioCreate;
9207
txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 Math Symbol");
9208
txlabel[k].text_is_1byte = true;
9209
txgcd[k].gd.label = &txlabel[k];
9210
txgcd[k].gd.pos.x = 80; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
9211
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
9212
txgcd[k].gd.cid = CID_TeXMathSym;
9213
txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
9214
txgcd[k++].creator = GRadioCreate;
9216
txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 Math Extension");
9217
txlabel[k].text_is_1byte = true;
9218
txgcd[k].gd.label = &txlabel[k];
9219
txgcd[k].gd.pos.x = 155; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
9220
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
9221
txgcd[k].gd.cid = CID_TeXMathExt;
9222
txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
9223
txgcd[k++].creator = GRadioCreate;
9225
for ( i=j=0; texparams[i]!=0; ++i ) {
9226
txlabel[k].text = (unichar_t *) texparams[i];
9227
txlabel[k].text_is_1byte = true;
9228
txgcd[k].gd.label = &txlabel[k];
9229
txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = txgcd[k-2].gd.pos.y+26;
9230
txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9231
txgcd[k].gd.popup_msg = (unichar_t *) texpopups[i];
9232
txarray2[j++] = &txgcd[k];
9233
txgcd[k++].creator = GLabelCreate;
9235
txgcd[k].gd.pos.x = 70; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y-4;
9236
txgcd[k].gd.flags = gg_visible | gg_enabled;
9237
txgcd[k].gd.cid = CID_TeX + i;
9238
txarray2[j++] = &txgcd[k];
9239
txgcd[k++].creator = GTextFieldCreate;
9240
txarray2[j++] = GCD_Glue;
9241
txarray2[j++] = NULL;
9243
txgcd[k-2].gd.cid = CID_TeXExtraSpLabel;
9244
txarray2[j++] = NULL;
9246
/* GT: More Parameters */
9247
txlabel[k].text = (unichar_t *) _("More Params");
9248
txlabel[k].text_is_1byte = true;
9249
txgcd[k].gd.label = &txlabel[k];
9250
txgcd[k].gd.pos.x = 20; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+26;
9251
txgcd[k].gd.flags = gg_visible | gg_enabled;
9252
txgcd[k].gd.handle_controlevent = GFI_MoreParams;
9253
txgcd[k].gd.cid = CID_MoreParams;
9254
txgcd[k++].creator = GButtonCreate;
9256
txarray[0] = &txbox[2]; txarray[1] = &txbox[3]; txarray[2] = &txbox[4]; txarray[3] = GCD_Glue; txarray[4] = NULL;
9257
txarray3[0] = &txgcd[0]; txarray3[1] = GCD_Glue; txarray3[2] = &txgcd[1];
9258
txarray3[3] = GCD_Glue; txarray3[4] = &txgcd[2]; txarray3[5] = NULL;
9259
txarray4[0] = GCD_Glue; txarray4[1] = &txgcd[k-1];
9260
txarray4[2] = txarray4[3] = txarray4[4] = GCD_Glue; txarray4[5] = NULL;
9261
memset(txbox,0,sizeof(txbox));
9262
txbox[0].gd.flags = gg_enabled|gg_visible;
9263
txbox[0].gd.u.boxelements = txarray;
9264
txbox[0].creator = GVBoxCreate;
9266
txbox[2].gd.flags = gg_enabled|gg_visible;
9267
txbox[2].gd.u.boxelements = txarray3;
9268
txbox[2].creator = GHBoxCreate;
9270
txbox[3].gd.flags = gg_enabled|gg_visible;
9271
txbox[3].gd.u.boxelements = txarray2;
9272
txbox[3].creator = GHVBoxCreate;
9274
txbox[4].gd.flags = gg_enabled|gg_visible;
9275
txbox[4].gd.u.boxelements = txarray4;
9276
txbox[4].creator = GHBoxCreate;
9277
/******************************************************************************/
9278
memset(&szlabel,0,sizeof(szlabel));
9279
memset(&szgcd,0,sizeof(szgcd));
9283
szlabel[k].text = (unichar_t *) _("De_sign Size:");
9284
szlabel[k].text_is_1byte = true;
9285
szlabel[k].text_in_resource = true;
9286
szgcd[k].gd.label = &szlabel[k];
9287
szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = 9;
9288
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9289
szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
9290
szgcd[k++].creator = GLabelCreate;
9292
sprintf(dszbuf, "%.1f", sf->design_size/10.0);
9293
szlabel[k].text = (unichar_t *) dszbuf;
9294
szlabel[k].text_is_1byte = true;
9295
szgcd[k].gd.label = &szlabel[k];
9296
szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
9297
szgcd[k].gd.pos.width = 60;
9298
szgcd[k].gd.flags = gg_visible | gg_enabled;
9299
szgcd[k].gd.cid = CID_DesignSize;
9300
szgcd[k++].creator = GTextFieldCreate;
9302
szlabel[k].text = (unichar_t *) S_("Size|Points");
9303
szlabel[k].text_is_1byte = true;
9304
szgcd[k].gd.label = &szlabel[k];
9305
szgcd[k].gd.pos.x = 134; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
9306
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9307
szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
9308
szgcd[k++].creator = GLabelCreate;
9310
szlabel[k].text = (unichar_t *) _("Design Range");
9311
szlabel[k].text_is_1byte = true;
9312
szgcd[k].gd.label = &szlabel[k];
9313
szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+24;
9314
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9315
szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
9316
szgcd[k++].creator = GLabelCreate;
9318
szgcd[k].gd.pos.x = 8; szgcd[k].gd.pos.y = GDrawPointsToPixels(NULL,szgcd[k-1].gd.pos.y+6);
9319
szgcd[k].gd.pos.width = pos.width-32; szgcd[k].gd.pos.height = GDrawPointsToPixels(NULL,36);
9320
szgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
9321
szgcd[k++].creator = GGroupCreate;
9323
szlabel[k].text = (unichar_t *) _("_Bottom:");
9324
szlabel[k].text_is_1byte = true;
9325
szlabel[k].text_in_resource = true;
9326
szgcd[k].gd.label = &szlabel[k];
9327
szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+18;
9328
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9329
szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
9330
szgcd[k++].creator = GLabelCreate;
9332
sprintf(dsbbuf, "%.1f", sf->design_range_bottom/10.0);
9333
szlabel[k].text = (unichar_t *) dsbbuf;
9334
szlabel[k].text_is_1byte = true;
9335
szgcd[k].gd.label = &szlabel[k];
9336
szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
9337
szgcd[k].gd.pos.width = 60;
9338
szgcd[k].gd.flags = gg_visible | gg_enabled;
9339
szgcd[k].gd.cid = CID_DesignBottom;
9340
szgcd[k++].creator = GTextFieldCreate;
9342
szlabel[k].text = (unichar_t *) _("_Top:");
9343
szlabel[k].text_is_1byte = true;
9344
szlabel[k].text_in_resource = true;
9345
szgcd[k].gd.label = &szlabel[k];
9346
szgcd[k].gd.pos.x = 140; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
9347
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9348
szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
9349
szgcd[k++].creator = GLabelCreate;
9351
sprintf(dstbuf, "%.1f", sf->design_range_top/10.0);
9352
szlabel[k].text = (unichar_t *) dstbuf;
9353
szlabel[k].text_is_1byte = true;
9354
szgcd[k].gd.label = &szlabel[k];
9355
szgcd[k].gd.pos.x = 180; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
9356
szgcd[k].gd.pos.width = 60;
9357
szgcd[k].gd.flags = gg_visible | gg_enabled;
9358
szgcd[k].gd.cid = CID_DesignTop;
9359
szgcd[k++].creator = GTextFieldCreate;
9361
szlabel[k].text = (unichar_t *) _("Style _ID:");
9362
szlabel[k].text_is_1byte = true;
9363
szlabel[k].text_in_resource = true;
9364
szgcd[k].gd.label = &szlabel[k];
9365
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;
9366
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9367
szgcd[k].gd.popup_msg = (unichar_t *) _("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");
9368
szgcd[k++].creator = GLabelCreate;
9370
sprintf(sibuf, "%d", sf->fontstyle_id);
9371
szlabel[k].text = (unichar_t *) sibuf;
9372
szlabel[k].text_is_1byte = true;
9373
szgcd[k].gd.label = &szlabel[k];
9374
szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
9375
szgcd[k].gd.pos.width = 60;
9376
szgcd[k].gd.flags = gg_visible | gg_enabled;
9377
szgcd[k].gd.cid = CID_StyleID;
9378
szgcd[k++].creator = GTextFieldCreate;
9380
szlabel[k].text = (unichar_t *) _("Style Name:");
9381
szlabel[k].text_is_1byte = true;
9382
szgcd[k].gd.label = &szlabel[k];
9383
szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+22;
9384
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9385
szgcd[k].gd.popup_msg = (unichar_t *) _("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.");
9386
szgcd[k++].creator = GLabelCreate;
9388
szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y+14;
9389
szgcd[k].gd.pos.width = ngcd[15].gd.pos.width; szgcd[k].gd.pos.height = 100;
9390
szgcd[k].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic;
9391
szgcd[k].gd.cid = CID_StyleName;
9392
szgcd[k].gd.handle_controlevent = GFI_StyleNameSelChanged;
9393
szgcd[k++].creator = GListCreate;
9395
szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y+szgcd[k-1].gd.pos.height+4;
9396
szgcd[k].gd.pos.width = -1;
9397
szgcd[k].gd.flags = gg_visible | gg_enabled;
9398
szlabel[k].text = (unichar_t *) S_("StyleName|_New...");
9399
szlabel[k].text_is_1byte = true;
9400
szlabel[k].text_in_resource = true;
9401
szgcd[k].gd.label = &szlabel[k];
9402
szgcd[k].gd.cid = CID_StyleNameNew;
9403
szgcd[k].gd.handle_controlevent = GFI_StyleNameNew;
9404
szgcd[k++].creator = GButtonCreate;
9406
szgcd[k].gd.pos.x = 20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
9407
szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y;
9408
szgcd[k].gd.pos.width = -1;
9409
szgcd[k].gd.flags = gg_visible;
9410
szlabel[k].text = (unichar_t *) _("_Delete");
9411
szlabel[k].text_is_1byte = true;
9412
szlabel[k].text_in_resource = true;
9413
szgcd[k].gd.label = &szlabel[k];
9414
szgcd[k].gd.cid = CID_StyleNameDel;
9415
szgcd[k].gd.handle_controlevent = GFI_StyleNameDel;
9416
szgcd[k++].creator = GButtonCreate;
9418
szgcd[k].gd.pos.x = 10 + 2*(10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor));
9419
szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y;
9420
szgcd[k].gd.pos.width = -1;
9421
szgcd[k].gd.flags = gg_visible;
9422
szlabel[k].text = (unichar_t *) _("_Edit...");
9423
szlabel[k].text_is_1byte = true;
9424
szlabel[k].text_in_resource = true;
9425
szgcd[k].gd.label = &szlabel[k];
9426
szgcd[k].gd.cid = CID_StyleNameRename;
9427
szgcd[k].gd.handle_controlevent = GFI_StyleNameRename;
9428
szgcd[k++].creator = GButtonCreate;
9430
szarray[0] = &szbox[2];
9431
szarray[1] = &szbox[3];
9432
szarray[2] = &szbox[4];
9433
szarray[3] = &szgcd[11];
9434
szarray[4] = &szgcd[12];
9435
szarray[5] = &szbox[5];
9438
szarray2[0] = &szgcd[0]; szarray2[1] = &szgcd[1]; szarray2[2] = &szgcd[2]; szarray2[3] = GCD_Glue; szarray2[4] = NULL;
9439
szarray3[0] = &szgcd[5]; szarray3[1] = &szgcd[6]; szarray3[2] = &szgcd[7]; szarray3[3] = &szgcd[8]; szarray3[4] = GCD_Glue; szarray3[5] = NULL;
9441
szarray4[0] = &szgcd[9]; szarray4[1] = &szgcd[10]; szarray4[2] = GCD_Glue; szarray4[3] = NULL;
9442
szarray5[0] = &szgcd[13]; szarray5[1] = GCD_Glue;
9443
szarray5[2] = &szgcd[14]; szarray5[3] = GCD_Glue;
9444
szarray5[4] = &szgcd[15]; szarray5[5] = NULL;
9446
memset(szbox,0,sizeof(szbox));
9447
szbox[0].gd.flags = gg_enabled|gg_visible;
9448
szbox[0].gd.u.boxelements = szarray;
9449
szbox[0].creator = GVBoxCreate;
9451
szbox[2].gd.flags = gg_enabled|gg_visible;
9452
szbox[2].gd.u.boxelements = szarray2;
9453
szbox[2].creator = GHBoxCreate;
9455
szbox[3].gd.flags = gg_enabled|gg_visible;
9456
szbox[3].gd.label = (GTextInfo *) &szgcd[3];
9457
szbox[3].gd.u.boxelements = szarray3;
9458
szbox[3].creator = GHVGroupCreate;
9460
szbox[4].gd.flags = gg_enabled|gg_visible;
9461
szbox[4].gd.u.boxelements = szarray4;
9462
szbox[4].creator = GHBoxCreate;
9464
szbox[5].gd.flags = gg_enabled|gg_visible;
9465
szbox[5].gd.u.boxelements = szarray5;
9466
szbox[5].creator = GHBoxCreate;
9468
/******************************************************************************/
9469
memset(&mcgcd,0,sizeof(mcgcd));
9470
memset(&mclabel,'\0',sizeof(mclabel));
9473
mclabel[k].text = (unichar_t *) _("Mac Style Set:");
9474
mclabel[k].text_is_1byte = true;
9475
mcgcd[k].gd.label = &mclabel[k];
9476
mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 7;
9477
mcgcd[k].gd.flags = gg_visible | gg_enabled;
9478
mcgcd[k++].creator = GLabelCreate;
9480
mclabel[k].text = (unichar_t *) _("Automatic");
9481
mclabel[k].text_is_1byte = true;
9482
mcgcd[k].gd.label = &mclabel[k];
9483
mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 20;
9484
mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
9485
mcgcd[k].gd.cid = CID_MacAutomatic;
9486
mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
9487
mcgcd[k++].creator = GRadioCreate;
9489
mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = 20;
9490
mcgcd[k].gd.flags = (sf->macstyle!=-1) ? (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_rad_continueold);
9491
mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
9492
mcgcd[k++].creator = GRadioCreate;
9494
mcgcd[k].gd.pos.x = 110; mcgcd[k].gd.pos.y = 20;
9495
mcgcd[k].gd.pos.width = 120; mcgcd[k].gd.pos.height = 7*12+10;
9496
mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_list_multiplesel) : (gg_visible | gg_enabled | gg_list_multiplesel);
9497
mcgcd[k].gd.cid = CID_MacStyles;
9498
mcgcd[k].gd.u.list = macstyles;
9499
mcgcd[k++].creator = GListCreate;
9501
mclabel[k].text = (unichar_t *) _("FOND Name:");
9502
mclabel[k].text_is_1byte = true;
9503
mcgcd[k].gd.label = &mclabel[k];
9504
mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y + mcgcd[k-1].gd.pos.height+8;
9505
mcgcd[k].gd.flags = gg_visible | gg_enabled;
9506
mcgcd[k++].creator = GLabelCreate;
9508
mclabel[k].text = (unichar_t *) sf->fondname;
9509
mclabel[k].text_is_1byte = true;
9510
mcgcd[k].gd.label = sf->fondname==NULL ? NULL : &mclabel[k];
9511
mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y - 4;
9512
mcgcd[k].gd.flags = gg_visible | gg_enabled;
9513
mcgcd[k].gd.cid = CID_MacFOND;
9514
mcgcd[k++].creator = GTextFieldCreate;
9517
mcs = MacStyleCode(sf,NULL);
9518
for ( i=0; macstyles[i].text!=NULL; ++i )
9519
macstyles[i].selected = (mcs&(int) (intpt) macstyles[i].userdata)? 1 : 0;
9521
mcarray[0] = &mcgcd[0]; mcarray[1] = GCD_Glue; mcarray[2] = NULL;
9522
mcarray[3] = &mcbox[2]; mcarray[4] = &mcgcd[3]; mcarray[5] = NULL;
9523
mcarray[6] = &mcgcd[4]; mcarray[7] = &mcgcd[5]; mcarray[8] = NULL;
9524
mcarray[9] = GCD_Glue; mcarray[10] = GCD_Glue; mcarray[11] = NULL;
9526
mcarray2[0] = &mcgcd[1]; mcarray2[1] = &mcgcd[2]; mcarray2[2] = NULL;
9527
mcarray2[3] = GCD_Glue; mcarray2[4] = GCD_Glue; mcarray2[5] = NULL;
9530
memset(mcbox,0,sizeof(mcbox));
9531
mcbox[0].gd.flags = gg_enabled|gg_visible;
9532
mcbox[0].gd.u.boxelements = mcarray;
9533
mcbox[0].creator = GHVBoxCreate;
9535
mcbox[2].gd.flags = gg_enabled|gg_visible;
9536
mcbox[2].gd.u.boxelements = mcarray2;
9537
mcbox[2].creator = GHVBoxCreate;
9539
/******************************************************************************/
9540
memset(&lksubgcd,0,sizeof(lksubgcd));
9541
memset(&lkgcd,0,sizeof(lkgcd));
9542
memset(&lkaspects,'\0',sizeof(lkaspects));
9543
memset(&lkbox,'\0',sizeof(lkbox));
9544
memset(&lkbuttonsgcd,'\0',sizeof(lkbuttonsgcd));
9545
memset(&lkbuttonslabel,'\0',sizeof(lkbuttonslabel));
9547
LookupSetup(&d->tables[0],sf->gsub_lookups);
9548
LookupSetup(&d->tables[1],sf->gpos_lookups);
9551
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9552
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9553
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup to be first in the lookup ordering\nor moves the currently selected subtable to be first in its lookup.");
9554
lkbuttonslabel[i].text = (unichar_t *) _("_Top");
9555
lkbuttonslabel[i].text_is_1byte = true;
9556
lkbuttonslabel[i].text_in_resource = true;
9557
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9558
lkbuttonsgcd[i].gd.cid = CID_LookupTop;
9559
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
9560
lkbuttonsgcd[i++].creator = GButtonCreate;
9562
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9563
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9564
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup before the previous lookup\nor moves the currently selected subtable before the previous subtable.");
9565
lkbuttonslabel[i].text = (unichar_t *) _("_Up");
9566
lkbuttonslabel[i].text_is_1byte = true;
9567
lkbuttonslabel[i].text_in_resource = true;
9568
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9569
lkbuttonsgcd[i].gd.cid = CID_LookupUp;
9570
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
9571
lkbuttonsgcd[i++].creator = GButtonCreate;
9573
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9574
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9575
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup after the next lookup\nor moves the currently selected subtable after the next subtable.");
9576
lkbuttonslabel[i].text = (unichar_t *) _("_Down");
9577
lkbuttonslabel[i].text_is_1byte = true;
9578
lkbuttonslabel[i].text_in_resource = true;
9579
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9580
lkbuttonsgcd[i].gd.cid = CID_LookupDown;
9581
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
9582
lkbuttonsgcd[i++].creator = GButtonCreate;
9584
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9585
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9586
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("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");
9587
lkbuttonslabel[i].text = (unichar_t *) _("_Bottom");
9588
lkbuttonslabel[i].text_is_1byte = true;
9589
lkbuttonslabel[i].text_in_resource = true;
9590
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9591
lkbuttonsgcd[i].gd.cid = CID_LookupBottom;
9592
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
9593
lkbuttonsgcd[i++].creator = GButtonCreate;
9595
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9596
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9597
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Sorts the lookups in a default ordering based on feature tags");
9598
lkbuttonslabel[i].text = (unichar_t *) _("_Sort");
9599
lkbuttonslabel[i].text_is_1byte = true;
9600
lkbuttonslabel[i].text_in_resource = true;
9601
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9602
lkbuttonsgcd[i].gd.cid = CID_LookupSort;
9603
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupSort;
9604
lkbuttonsgcd[i++].creator = GButtonCreate;
9606
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9607
lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled ;
9608
lkbuttonsgcd[i++].creator = GLineCreate;
9610
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9611
lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup ;
9612
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Adds a new lookup after the selected lookup\nor at the start of the lookup list if nothing is selected.");
9613
lkbuttonslabel[i].text = (unichar_t *) _("Add _Lookup");
9614
lkbuttonslabel[i].text_is_1byte = true;
9615
lkbuttonslabel[i].text_in_resource = true;
9616
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9617
lkbuttonsgcd[i].gd.cid = CID_AddLookup;
9618
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddLookup;
9619
lkbuttonsgcd[i++].creator = GButtonCreate;
9621
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9622
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9623
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Adds a new lookup subtable after the selected subtable\nor at the start of the lookup if nothing is selected.");
9624
lkbuttonslabel[i].text = (unichar_t *) _("Add Sub_table");
9625
lkbuttonslabel[i].text_is_1byte = true;
9626
lkbuttonslabel[i].text_in_resource = true;
9627
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9628
lkbuttonsgcd[i].gd.cid = CID_AddSubtable;
9629
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddSubtable;
9630
lkbuttonsgcd[i++].creator = GButtonCreate;
9632
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9633
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9634
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits a lookup or lookup subtable.");
9635
lkbuttonslabel[i].text = (unichar_t *) _("Edit _Metadata");
9636
lkbuttonslabel[i].text_is_1byte = true;
9637
lkbuttonslabel[i].text_in_resource = true;
9638
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9639
lkbuttonsgcd[i].gd.cid = CID_EditMetadata;
9640
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditMetadata;
9641
lkbuttonsgcd[i++].creator = GButtonCreate;
9643
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9644
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9645
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits the transformations in a lookup subtable.");
9646
lkbuttonslabel[i].text = (unichar_t *) _("_Edit Data");
9647
lkbuttonslabel[i].text_is_1byte = true;
9648
lkbuttonslabel[i].text_in_resource = true;
9649
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9650
lkbuttonsgcd[i].gd.cid = CID_EditSubtable;
9651
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditSubtableContents;
9652
lkbuttonsgcd[i++].creator = GButtonCreate;
9654
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9655
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9656
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Deletes any selected lookups and their subtables, or deletes any selected subtables.\nThis will also delete any transformations associated with those subtables.");
9657
lkbuttonslabel[i].text = (unichar_t *) _("De_lete");
9658
lkbuttonslabel[i].text_is_1byte = true;
9659
lkbuttonslabel[i].text_in_resource = true;
9660
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9661
lkbuttonsgcd[i].gd.cid = CID_DeleteLookup;
9662
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupDeleteLookup;
9663
lkbuttonsgcd[i++].creator = GButtonCreate;
9665
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9666
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9667
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Merges two selected (and compatible) lookups into one,\nor merges two selected subtables of a lookup into one");
9668
lkbuttonslabel[i].text = (unichar_t *) _("_Merge");
9669
lkbuttonslabel[i].text_is_1byte = true;
9670
lkbuttonslabel[i].text_in_resource = true;
9671
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9672
lkbuttonsgcd[i].gd.cid = CID_MergeLookup;
9673
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupMergeLookup;
9674
lkbuttonsgcd[i++].creator = GButtonCreate;
9676
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9677
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9678
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Reverts the lookup list to its original condition.\nBut any changes to subtable data will remain.");
9679
lkbuttonslabel[i].text = (unichar_t *) _("_Revert");
9680
lkbuttonslabel[i].text_is_1byte = true;
9681
lkbuttonslabel[i].text_in_resource = true;
9682
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9683
lkbuttonsgcd[i].gd.cid = CID_RevertLookups;
9684
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupRevertLookup;
9685
lkbuttonsgcd[i++].creator = GButtonCreate;
9687
lkbuttonsarray[i] = &lkbuttonsgcd[i];
9688
lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
9689
lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Imports a lookup (and all its subtables) from another font.");
9690
lkbuttonslabel[i].text = (unichar_t *) _("_Import");
9691
lkbuttonslabel[i].text_is_1byte = true;
9692
lkbuttonslabel[i].text_in_resource = true;
9693
lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
9694
lkbuttonsgcd[i].gd.cid = CID_ImportLookups;
9695
lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupImportLookup;
9696
lkbuttonsgcd[i++].creator = GButtonCreate;
9697
lkbuttonsarray[i] = GCD_Glue;
9698
lkbuttonsarray[i+1] = NULL;
9700
for ( i=0; i<2; ++i ) {
9701
lkaspects[i].text = (unichar_t *) (i?"GPOS":"GSUB");
9702
lkaspects[i].text_is_1byte = true;
9703
lkaspects[i].gcd = &lkbox[2*i];
9705
lksubgcd[i][0].gd.pos.x = 10; lksubgcd[i][0].gd.pos.y = 10;
9706
lksubgcd[i][0].gd.pos.width = ngcd[15].gd.pos.width;
9707
lksubgcd[i][0].gd.pos.height = 150;
9708
lksubgcd[i][0].gd.flags = gg_visible | gg_enabled;
9709
lksubgcd[i][0].gd.u.drawable_e_h = i ? gposlookups_e_h : gsublookups_e_h;
9710
lksubgcd[i][0].gd.cid = CID_LookupWin+i;
9711
lksubgcd[i][0].creator = GDrawableCreate;
9713
lksubgcd[i][1].gd.pos.x = 10; lksubgcd[i][1].gd.pos.y = 10;
9714
lksubgcd[i][1].gd.pos.height = 150;
9715
lksubgcd[i][1].gd.flags = gg_visible | gg_enabled | gg_sb_vert;
9716
lksubgcd[i][1].gd.cid = CID_LookupVSB+i;
9717
lksubgcd[i][1].gd.handle_controlevent = LookupsVScroll;
9718
lksubgcd[i][1].creator = GScrollBarCreate;
9720
lksubgcd[i][2].gd.pos.x = 10; lksubgcd[i][2].gd.pos.y = 10;
9721
lksubgcd[i][2].gd.pos.width = 150;
9722
lksubgcd[i][2].gd.flags = gg_visible | gg_enabled;
9723
lksubgcd[i][2].gd.cid = CID_LookupHSB+i;
9724
lksubgcd[i][2].gd.handle_controlevent = LookupsHScroll;
9725
lksubgcd[i][2].creator = GScrollBarCreate;
9727
lksubgcd[i][3].gd.pos.x = 10; lksubgcd[i][3].gd.pos.y = 10;
9728
lksubgcd[i][3].gd.pos.width = lksubgcd[i][3].gd.pos.height = _GScrollBar_Width;
9729
lksubgcd[i][3].gd.flags = gg_visible | gg_enabled | gg_tabset_nowindow;
9730
lksubgcd[i][3].creator = GDrawableCreate;
9732
lkarray[i][0] = &lksubgcd[i][0]; lkarray[i][1] = &lksubgcd[i][1]; lkarray[i][2] = NULL;
9733
lkarray[i][3] = &lksubgcd[i][2]; lkarray[i][4] = &lksubgcd[i][3]; lkarray[i][5] = NULL;
9734
lkarray[i][6] = NULL;
9736
lkbox[2*i].gd.flags = gg_enabled|gg_visible;
9737
lkbox[2*i].gd.u.boxelements = lkarray[i];
9738
lkbox[2*i].creator = GHVBoxCreate;
9741
lkaspects[0].selected = true;
9743
lkgcd[0].gd.pos.x = 4; lkgcd[0].gd.pos.y = 10;
9744
lkgcd[0].gd.pos.width = 250;
9745
lkgcd[0].gd.pos.height = 260;
9746
lkgcd[0].gd.u.tabs = lkaspects;
9747
lkgcd[0].gd.flags = gg_visible | gg_enabled;
9748
lkgcd[0].gd.cid = CID_Lookups;
9749
lkgcd[0].gd.handle_controlevent = GFI_LookupAspectChange;
9750
lkgcd[0].creator = GTabSetCreate;
9752
lkharray[0] = &lkgcd[0]; lkharray[1] = &lkbox[4]; lkharray[2] = NULL;
9754
lkbox[4].gd.flags = gg_enabled|gg_visible;
9755
lkbox[4].gd.u.boxelements = lkbuttonsarray;
9756
lkbox[4].creator = GVBoxCreate;
9758
lkbox[5].gd.flags = gg_enabled|gg_visible;
9759
lkbox[5].gd.u.boxelements = lkharray;
9760
lkbox[5].creator = GHBoxCreate;
9763
/******************************************************************************/
9764
memset(&mfgcd,0,sizeof(mfgcd));
9765
memset(&mflabel,'\0',sizeof(mflabel));
9766
memset(mfbox,0,sizeof(mfbox));
9768
GCDFillMacFeat(mfgcd,mflabel,250,sf->features, false, mfbox, mfarray);
9769
/******************************************************************************/
9771
memset(&dlabel,0,sizeof(dlabel));
9772
memset(&dgcd,0,sizeof(dgcd));
9774
dlabel[0].text = (unichar_t *) _("Creation Date:");
9775
dlabel[0].text_is_1byte = true;
9776
dlabel[0].text_in_resource = true;
9777
dgcd[0].gd.label = &dlabel[0];
9778
dgcd[0].gd.pos.x = 12; dgcd[0].gd.pos.y = 6+6;
9779
dgcd[0].gd.flags = gg_visible | gg_enabled;
9780
dgcd[0].creator = GLabelCreate;
9782
t = sf->creationtime;
9784
strftime(createtime,sizeof(createtime),"%c",tm);
9785
tmpcreatetime = def2u_copy(createtime);
9786
dgcd[1].gd.pos.x = 115; dgcd[1].gd.pos.y = dgcd[0].gd.pos.y;
9787
dgcd[1].gd.flags = gg_visible | gg_enabled;
9788
dlabel[1].text = tmpcreatetime;
9789
dgcd[1].gd.label = &dlabel[1];
9790
dgcd[1].creator = GLabelCreate;
9792
dlabel[2].text = (unichar_t *) _("Modification Date:");
9793
dlabel[2].text_is_1byte = true;
9794
dlabel[2].text_in_resource = true;
9795
dgcd[2].gd.label = &dlabel[2];
9796
dgcd[2].gd.pos.x = 12; dgcd[2].gd.pos.y = dgcd[0].gd.pos.y+14;
9797
dgcd[2].gd.flags = gg_visible | gg_enabled;
9798
dgcd[2].creator = GLabelCreate;
9800
t = sf->modificationtime;
9802
strftime(modtime,sizeof(modtime),"%c",tm);
9803
tmpmodtime = def2u_copy(modtime);
9804
dgcd[3].gd.pos.x = 115; dgcd[3].gd.pos.y = dgcd[2].gd.pos.y;
9805
dgcd[3].gd.flags = gg_visible | gg_enabled;
9806
dlabel[3].text = tmpmodtime;
9807
dgcd[3].gd.label = &dlabel[3];
9808
dgcd[3].creator = GLabelCreate;
9810
darray[0] = &dgcd[0]; darray[1] = &dgcd[1]; darray[2] = NULL;
9811
darray[3] = &dgcd[2]; darray[4] = &dgcd[3]; darray[5] = NULL;
9812
darray[6] = GCD_Glue; darray[7] = GCD_Glue; darray[8] = NULL;
9815
memset(dbox,0,sizeof(dbox));
9816
dbox[0].gd.flags = gg_enabled|gg_visible;
9817
dbox[0].gd.u.boxelements = darray;
9818
dbox[0].creator = GHVBoxCreate;
9819
/******************************************************************************/
9821
memset(&ulabel,0,sizeof(ulabel));
9822
memset(&ugcd,0,sizeof(ugcd));
9824
ulabel[0].text = (unichar_t *) _("Include Empty Blocks");
9825
ulabel[0].text_is_1byte = true;
9826
ulabel[0].text_in_resource = true;
9827
ugcd[0].gd.label = &ulabel[0];
9828
ugcd[0].gd.pos.x = 12; ugcd[0].gd.pos.y = 10;
9829
ugcd[0].gd.flags = gg_visible | gg_enabled;
9830
ugcd[0].gd.handle_controlevent = GFI_UnicodeEmptiesChange;
9831
ugcd[0].gd.cid = CID_UnicodeEmpties;
9832
ugcd[0].creator = GCheckBoxCreate;
9834
ugcd[1].gd.pos.x = 12; ugcd[1].gd.pos.y = 30;
9835
ugcd[1].gd.pos.width = ngcd[15].gd.pos.width;
9836
ugcd[1].gd.pos.height = 200;
9837
ugcd[1].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
9838
ugcd[1].gd.cid = CID_Unicode;
9839
ugcd[1].gd.handle_controlevent = GFI_UnicodeRangeChange;
9840
ugcd[1].gd.popup_msg = (unichar_t *) _("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.");
9841
ugcd[1].creator = GListCreate;
9843
uarray[0] = &ugcd[0]; uarray[1] = &ugcd[1]; uarray[2] = NULL;
9845
memset(ubox,0,sizeof(ubox));
9846
ubox[0].gd.flags = gg_enabled|gg_visible;
9847
ubox[0].gd.u.boxelements = uarray;
9848
ubox[0].creator = GVBoxCreate;
9850
/******************************************************************************/
9852
memset(&mlabel,0,sizeof(mlabel));
9853
memset(&mgcd,0,sizeof(mgcd));
9854
memset(&aspects,'\0',sizeof(aspects));
9858
aspects[i].text = (unichar_t *) _("Names");
9860
aspects[i].text_is_1byte = true;
9861
aspects[i++].gcd = nb;
9863
aspects[i].text = (unichar_t *) _("General");
9864
aspects[i].text_is_1byte = true;
9865
aspects[i++].gcd = psb;
9867
aspects[i].text = (unichar_t *) _("PS UID");
9868
aspects[i].text_is_1byte = true;
9869
aspects[i++].gcd = xub;
9871
d->private_aspect = i;
9872
aspects[i].text = (unichar_t *) _("PS Private");
9873
aspects[i].text_is_1byte = true;
9874
aspects[i++].gcd = ppbox;
9877
aspects[i].text = (unichar_t *) _("OS/2");
9878
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9879
aspects[i].text_is_1byte = true;
9880
aspects[i++].gcd = vagcd;
9883
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9884
aspects[i].text = (unichar_t *) _("TTF Names");
9885
aspects[i].text_is_1byte = true;
9886
aspects[i++].gcd = tnboxes;
9888
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9889
aspects[i].text = (unichar_t *) _("Grid Fitting");
9890
aspects[i].text_is_1byte = true;
9891
aspects[i++].gcd = gaspboxes;
9894
/* xgettext won't use non-ASCII messages */
9895
aspects[i].text = (unichar_t *) U_("\316\244\316\265\316\247"); /* Tau epsilon Chi, in greek */
9896
aspects[i].text_is_1byte = true;
9897
aspects[i++].gcd = txbox;
9899
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9900
aspects[i].text = (unichar_t *) _("Size");
9901
aspects[i].text_is_1byte = true;
9902
aspects[i++].gcd = szbox;
9904
aspects[i].text = (unichar_t *) _("Comment");
9905
aspects[i].text_is_1byte = true;
9906
aspects[i++].gcd = combox;
9908
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9909
aspects[i].text = (unichar_t *) _("Mark Classes");
9910
aspects[i].text_is_1byte = true;
9911
aspects[i++].gcd = mkbox;
9913
/* GT: OpenType GPOS/GSUB lookups */
9914
if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
9915
aspects[i].text = (unichar_t *) S_("OpenType|Lookups");
9916
aspects[i].text_is_1byte = true;
9917
aspects[i++].gcd = &lkbox[5];
9919
aspects[i].text = (unichar_t *) _("Mac");
9920
aspects[i].text_is_1byte = true;
9921
aspects[i++].gcd = mcbox;
9923
aspects[i].text = (unichar_t *) _("Mac Features");
9924
aspects[i].text_is_1byte = true;
9925
aspects[i++].gcd = mfbox;
9927
#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
9928
aspects[i].text = (unichar_t *) _("Dates");
9929
aspects[i].text_is_1byte = true;
9930
aspects[i++].gcd = dbox;
9932
d->unicode_aspect = i;
9933
aspects[i].text = (unichar_t *) _("Unicode Ranges");
9934
aspects[i].text_is_1byte = true;
9935
aspects[i++].gcd = ubox;
9938
aspects[defaspect].selected = true;
9940
mgcd[0].gd.pos.x = 4; mgcd[0].gd.pos.y = 6;
9941
mgcd[0].gd.u.tabs = aspects;
9942
#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
9943
mgcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_vert;
9944
mgcd[0].gd.pos.width = 260+85;
9945
mgcd[0].gd.pos.height = 325;
9947
mgcd[0].gd.flags = gg_visible | gg_enabled;
9948
mgcd[0].gd.pos.width = 260;
9949
mgcd[0].gd.pos.height = 325;
9951
mgcd[0].gd.handle_controlevent = GFI_AspectChange;
9952
mgcd[0].gd.cid = CID_Tabs;
9953
mgcd[0].creator = GTabSetCreate;
9955
mgcd[1].gd.pos.x = 30-3; mgcd[1].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
9956
mgcd[1].gd.pos.width = -1; mgcd[1].gd.pos.height = 0;
9957
mgcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
9958
mlabel[1].text = (unichar_t *) _("_OK");
9959
mlabel[1].text_is_1byte = true;
9960
mlabel[1].text_in_resource = true;
9961
mgcd[1].gd.label = &mlabel[1];
9962
mgcd[1].gd.handle_controlevent = GFI_OK;
9963
mgcd[1].gd.cid = CID_OK;
9964
mgcd[1].creator = GButtonCreate;
9966
mgcd[2].gd.pos.x = -30; mgcd[2].gd.pos.y = mgcd[1].gd.pos.y+3;
9967
mgcd[2].gd.pos.width = -1; mgcd[2].gd.pos.height = 0;
9968
mgcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
9969
mlabel[2].text = (unichar_t *) _("_Cancel");
9970
mlabel[2].text_is_1byte = true;
9971
mlabel[2].text_in_resource = true;
9972
mgcd[2].gd.label = &mlabel[2];
9973
mgcd[2].gd.handle_controlevent = GFI_Cancel;
9974
mgcd[2].gd.cid = CID_Cancel;
9975
mgcd[2].creator = GButtonCreate;
9977
mgcd[3].gd.pos.x = 2; mgcd[3].gd.pos.y = 2;
9978
mgcd[3].gd.pos.width = pos.width-4; mgcd[3].gd.pos.height = pos.height-4;
9979
mgcd[3].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
9980
mgcd[3].gd.cid = CID_MainGroup;
9981
mgcd[3].creator = GGroupCreate;
9983
marray2[0] = marray2[2] = marray2[3] = marray2[4] = marray2[6] = GCD_Glue; marray2[7] = NULL;
9984
marray2[1] = &mgcd[1]; marray2[5] = &mgcd[2];
9986
marray[0] = &mgcd[0]; marray[1] = NULL;
9987
marray[2] = &mb2; marray[3] = NULL;
9988
marray[4] = GCD_Glue; marray[5] = NULL;
9991
memset(mb,0,sizeof(mb));
9992
mb[0].gd.pos.x = mb[0].gd.pos.y = 2;
9993
mb[0].gd.flags = gg_enabled|gg_visible;
9994
mb[0].gd.u.boxelements = marray;
9995
mb[0].creator = GHVBoxCreate;
9997
memset(&mb2,0,sizeof(mb2));
9998
mb2.gd.flags = gg_enabled|gg_visible;
9999
mb2.gd.u.boxelements = marray2;
10000
mb2.creator = GHBoxCreate;
10002
GGadgetsCreate(gw,mb);
10003
GMatrixEditSetNewText(tngcd[4].ret,S_("TrueTypeName|New"));
10004
GGadgetSelectOneListItem(gaspgcd[0].ret,sf->gasp_version);
10005
GMatrixEditSetNewText(gaspgcd[3].ret,S_("gaspTableEntry|New"));
10006
GMatrixEditAddButtons(gaspgcd[3].ret,gaspgcd_def);
10007
if ( sf->gasp_version==0 ) {
10008
GMatrixEditEnableColumn(gaspgcd[3].ret,3,false);
10009
GMatrixEditEnableColumn(gaspgcd[3].ret,4,false);
10011
GHVBoxSetExpandableCol(gaspboxes[2].ret,2);
10012
GHVBoxSetExpandableRow(gaspboxes[0].ret,1);
10014
GHVBoxSetExpandableRow(mb[0].ret,0);
10015
GHVBoxSetExpandableCol(mb2.ret,gb_expandgluesame);
10017
GHVBoxSetExpandableCol(nb[0].ret,1);
10018
GHVBoxSetExpandableRow(nb[0].ret,7);
10019
GHVBoxSetExpandableCol(nb2.ret,1);
10020
GHVBoxSetExpandableCol(nb3.ret,1);
10022
GHVBoxSetExpandableCol(xub[0].ret,1);
10023
GHVBoxSetExpandableRow(xub[0].ret,3);
10025
GHVBoxSetExpandableRow(psb[0].ret,psrow);
10026
GHVBoxSetExpandableCol(psb2[0].ret,3);
10027
GHVBoxSetExpandableCol(psb2[1].ret,1);
10028
GHVBoxSetExpandableCol(psb2[2].ret,1);
10030
GHVBoxSetExpandableRow(ppbox[0].ret,0);
10031
GHVBoxSetExpandableCol(ppbox[2].ret,gb_samesize);
10033
GHVBoxSetExpandableRow(vbox[0].ret,gb_expandglue);
10034
GHVBoxSetExpandableCol(vbox[0].ret,1);
10035
GHVBoxSetExpandableCol(vbox[2].ret,gb_expandglue);
10037
GHVBoxSetExpandableRow(metbox[0].ret,10);
10038
GHVBoxSetExpandableCol(metbox[0].ret,1);
10040
GHVBoxSetExpandableRow(ssbox[0].ret,gb_expandglue);
10041
GHVBoxSetExpandableCol(ssbox[0].ret,gb_expandglue);
10043
GHVBoxSetExpandableRow(panbox[0].ret,gb_expandglue);
10044
GHVBoxSetExpandableCol(panbox[0].ret,1);
10046
GHVBoxSetExpandableRow(mkbox[0].ret,0);
10047
GHVBoxSetExpandableCol(mkbox[2].ret,gb_expandglue);
10049
GHVBoxSetExpandableRow(txbox[0].ret,gb_expandglue);
10050
GHVBoxSetExpandableCol(txbox[2].ret,gb_expandglue);
10051
GHVBoxSetExpandableCol(txbox[3].ret,gb_expandglue);
10052
GHVBoxSetExpandableCol(txbox[4].ret,gb_expandglue);
10054
GHVBoxSetExpandableRow(szbox[0].ret,4);
10055
GHVBoxSetPadding(szbox[2].ret,6,2);
10056
GHVBoxSetExpandableCol(szbox[2].ret,gb_expandglue);
10057
GHVBoxSetPadding(szbox[3].ret,6,2);
10058
GHVBoxSetExpandableCol(szbox[3].ret,gb_expandglue);
10059
GHVBoxSetPadding(szbox[4].ret,6,2);
10060
GHVBoxSetExpandableCol(szbox[4].ret,gb_expandglue);
10061
GHVBoxSetExpandableCol(szbox[5].ret,gb_expandglue);
10063
GHVBoxSetExpandableRow(tnboxes[0].ret,1);
10064
GHVBoxSetExpandableCol(tnboxes[2].ret,gb_expandglue);
10065
GHVBoxSetExpandableCol(tnboxes[3].ret,gb_expandglue);
10067
GHVBoxSetExpandableRow(mcbox[0].ret,gb_expandglue);
10068
GHVBoxSetExpandableCol(mcbox[0].ret,1);
10069
GHVBoxSetExpandableRow(mcbox[2].ret,gb_expandglue);
10071
GHVBoxSetExpandableRow(mfbox[0].ret,0);
10072
GHVBoxSetExpandableRow(mfbox[2].ret,gb_expandglue);
10074
GHVBoxSetExpandableRow(dbox[0].ret,gb_expandglue);
10075
GHVBoxSetExpandableCol(dbox[0].ret,1);
10077
GHVBoxSetExpandableRow(ubox[0].ret,1);
10079
GHVBoxSetExpandableCol(lkbox[0].ret,0);
10080
GHVBoxSetExpandableRow(lkbox[0].ret,0);
10081
GHVBoxSetPadding(lkbox[0].ret,0,0);
10082
GHVBoxSetExpandableCol(lkbox[2].ret,0);
10083
GHVBoxSetExpandableRow(lkbox[2].ret,0);
10084
GHVBoxSetPadding(lkbox[2].ret,0,0);
10085
GHVBoxSetExpandableRow(lkbox[4].ret,gb_expandglue);
10086
GHVBoxSetExpandableCol(lkbox[5].ret,0);
10088
GFI_LookupEnableButtons(d,true);
10089
GFI_LookupEnableButtons(d,false);
10091
memset(&rq,0,sizeof(rq));
10092
rq.family_name = sans;
10093
rq.point_size = 12;
10095
d->font = GDrawInstanciateFont(GDrawGetDisplayOfWindow(gw),&rq);
10096
GDrawFontMetrics(d->font,&as,&ds,&ld);
10097
d->as = as; d->fh = as+ds;
10099
GTextInfoListFree(namelistnames);
10100
GTextInfoListFree(pgcd[0].gd.u.list);
10102
for ( i=0; i<mi.initial_row_cnt; ++i )
10103
free( mi.matrix_data[3*i+2].u.md_str );
10104
free( mi.matrix_data );
10106
free(tmpcreatetime);
10109
GHVBoxFitWindow(mb[0].ret);
10111
if ( GTabSetGetTabLines(mgcd[0].ret)>3 ) {
10112
int offset = (GTabSetGetTabLines(mgcd[0].ret)-2)*GDrawPointsToPixels(NULL,20);
10113
GDrawResize(gw,pos.width,pos.height+offset);
10117
GWidgetIndicateFocusGadget(ngcd[1].ret);
10119
GFI_AspectChange(mgcd[0].ret,NULL);
10120
GFI_InitMarkClasses(d);
10121
GGadgetSetList(GWidgetGetControl(gw,CID_StyleName),StyleNames(sf->fontstyle_name),false);
10123
GWidgetHidePalettes();
10124
GDrawSetVisible(gw,true);
10128
GDrawProcessOneEvent(NULL);
10132
void FontMenuFontInfo(void *_fv) {
10133
FontInfo( ((FontView *) _fv)->sf,-1,false);
10136
void FontInfoDestroy(SplineFont *sf) {
10137
if ( sf->fontinfo )
10138
GFI_CancelClose( (struct gfi_data *) (sf->fontinfo) );
10140
#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
10143
void FontInfoInit(void) {
10144
static int done = false;
10146
static GTextInfo *needswork[] = {
10147
macstyles, widthclass, weightclass, fstype, pfmfamily, ibmfamily,
10148
panfamily, panserifs, panweight, panprop, pancontrast, panstrokevar,
10149
panarmstyle, panletterform, panmidline, panxheight, mslanguages,
10150
ttfnameids, interpretations, gridfit, antialias, os2versions,
10153
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
10154
static char **needswork2[] = { texparams, texpopups,
10155
mathparams, mathpopups, extparams, extpopups,
10162
scriptingSaveEnglishNames(ttfnameids,mslanguages);
10164
for ( j=0; needswork[j]!=NULL; ++j ) {
10165
for ( i=0; needswork[j][i].text!=NULL; ++i )
10166
needswork[j][i].text = (unichar_t *) S_((char *) needswork[j][i].text);
10168
#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
10169
for ( j=0; needswork2[j]!=NULL; ++j ) {
10170
for ( i=0; needswork2[j][i]!=NULL; ++i )
10171
needswork2[j][i] = _(needswork2[j][i]);
10174
ci[0].title = S_(ci[0].title);
10175
ci[1].title = S_(ci[1].title);
10176
ci[2].title = S_(ci[2].title);
10178
gaspci[0].title = S_(gaspci[0].title);
10179
gaspci[1].title = S_(gaspci[1].title);
10180
gaspci[2].title = S_(gaspci[2].title);
10181
gaspci[3].title = S_(gaspci[3].title);
10182
gaspci[4].title = S_(gaspci[4].title);