LCOV - code coverage report
Current view: top level - fontforgeexe - fontinfo.c (source / functions) Hit Total Coverage
Test: FontForge coverage report 2017-08-04 01:21:11+02:00 (commit d35f7e4107a9e1db65cce47c468fcc914cecb8fd) Lines: 30 6537 0.5 %
Date: 2017-08-04 Functions: 3 160 1.9 %

          Line data    Source code
       1             : /* -*- coding: utf-8 -*- */
       2             : /* Copyright (C) 2000-2012 by George Williams */
       3             : /*
       4             :  * Redistribution and use in source and binary forms, with or without
       5             :  * modification, are permitted provided that the following conditions are met:
       6             : 
       7             :  * Redistributions of source code must retain the above copyright notice, this
       8             :  * list of conditions and the following disclaimer.
       9             : 
      10             :  * Redistributions in binary form must reproduce the above copyright notice,
      11             :  * this list of conditions and the following disclaimer in the documentation
      12             :  * and/or other materials provided with the distribution.
      13             : 
      14             :  * The name of the author may not be used to endorse or promote products
      15             :  * derived from this software without specific prior written permission.
      16             : 
      17             :  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
      18             :  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
      19             :  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
      20             :  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
      21             :  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
      22             :  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
      23             :  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
      24             :  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      25             :  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
      26             :  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      27             :  */
      28             : #include "autowidth.h"
      29             : #include "bitmapchar.h"
      30             : #include "dumppfa.h"
      31             : #include "encoding.h"
      32             : #include "featurefile.h"
      33             : #include "fontforgeui.h"
      34             : #include "lookups.h"
      35             : #include "namelist.h"
      36             : #include "ofl.h"
      37             : #include "parsepfa.h"
      38             : #include "parsettf.h"
      39             : #include "psread.h"
      40             : #include "sfd.h"
      41             : #include "splineorder2.h"
      42             : #include "splinesaveafm.h"
      43             : #include "splineutil.h"
      44             : #include "splineutil2.h"
      45             : #include "tottf.h"
      46             : #include <ustring.h>
      47             : #include <chardata.h>
      48             : #include <utype.h>
      49             : #include "unicoderange.h"
      50             : #include <locale.h>
      51             : #include "sfundo.h"
      52             : #include "collabclientui.h"
      53             : 
      54             : extern int _GScrollBar_Width;
      55             : extern GBox _ggadget_Default_Box;
      56             : #define ACTIVE_BORDER   (_ggadget_Default_Box.active_border)
      57             : #define MAIN_FOREGROUND (_ggadget_Default_Box.main_foreground)
      58             : 
      59             : #include <gkeysym.h>
      60             : #include <math.h>
      61             : #include <unistd.h>
      62             : #include <time.h>
      63             : 
      64             : static int last_aspect=0;
      65             : 
      66             : GTextInfo emsizes[] = {
      67             :     { (unichar_t *) "1000", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      68             :     { (unichar_t *) "1024", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      69             :     { (unichar_t *) "2048", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      70             :     { (unichar_t *) "4096", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      71             :     GTEXTINFO_EMPTY
      72             : };
      73             : 
      74             : /* Note that we are storing integer data in a pointer field, hence the casts. They are not to be dereferenced. */
      75             : GTextInfo interpretations[] = {
      76             : /* GT: See the long comment at "Property|New" */
      77             : /* GT: The msgstr should contain a translation of "None", ignore "Interpretation|" */
      78             : /* GT: In french this could be "Aucun" or "Aucune" depending on the gender */
      79             : /* GT:  of "Interpretation" */
      80             :     { (unichar_t *) N_("Interpretation|None"), NULL, 0, 0, (void *) ui_none, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      81             : /*  { (unichar_t *) N_("Adobe Public Use Defs."), NULL, 0, 0, (void *) ui_adobe, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
      82             : /*  { (unichar_t *) N_("Greek"), NULL, 0, 0, (void *) ui_greek, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
      83             :     { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) ui_japanese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      84             :     { (unichar_t *) N_("Traditional Chinese"), NULL, 0, 0, (void *) ui_trad_chinese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      85             :     { (unichar_t *) N_("Simplified Chinese"), NULL, 0, 0, (void *) ui_simp_chinese, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      86             :     { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) ui_korean, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      87             : /*  { (unichar_t *) N_("AMS Public Use"), NULL, 0, 0, (void *) ui_ams, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'}, */
      88             :     GTEXTINFO_EMPTY
      89             : };
      90             : GTextInfo macstyles[] = {
      91             :     { (unichar_t *) N_("MacStyles|Bold"), NULL, 0, 0, (void *) sf_bold, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      92             :     { (unichar_t *) N_("MacStyles|Italic"), NULL, 0, 0, (void *) sf_italic, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      93             :     { (unichar_t *) N_("MacStyles|Condense"), NULL, 0, 0, (void *) sf_condense, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      94             :     { (unichar_t *) N_("MacStyles|Expand"), NULL, 0, 0, (void *) sf_extend, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      95             :     { (unichar_t *) N_("MacStyles|Underline"), NULL, 0, 0, (void *) sf_underline, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      96             :     { (unichar_t *) N_("MacStyles|Outline"), NULL, 0, 0, (void *) sf_outline, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      97             :     { (unichar_t *) N_("MacStyles|Shadow"), NULL, 0, 0, (void *) sf_shadow, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
      98             :     GTEXTINFO_EMPTY
      99             : };
     100             : static GTextInfo widthclass[] = {
     101             :     { (unichar_t *) N_("Ultra-Condensed (50%)"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     102             :     { (unichar_t *) N_("Extra-Condensed (62.5%)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     103             :     { (unichar_t *) N_("Condensed (75%)"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     104             :     { (unichar_t *) N_("Semi-Condensed (87.5%)"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     105             :     { (unichar_t *) N_("Medium (100%)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     106             :     { (unichar_t *) N_("Semi-Expanded (112.5%)"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     107             :     { (unichar_t *) N_("Expanded (125%)"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     108             :     { (unichar_t *) N_("Extra-Expanded (150%)"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     109             :     { (unichar_t *) N_("Ultra-Expanded (200%)"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     110             :     GTEXTINFO_EMPTY
     111             : };
     112             : static GTextInfo weightclass[] = {
     113             :     { (unichar_t *) N_("100 Thin"), NULL, 0, 0, (void *) 100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     114             :     { (unichar_t *) N_("200 Extra-Light"), NULL, 0, 0, (void *) 200, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     115             :     { (unichar_t *) N_("300 Light"), NULL, 0, 0, (void *) 300, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     116             :     { (unichar_t *) N_("400 Regular"), NULL, 0, 0, (void *) 400, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     117             :     { (unichar_t *) N_("500 Medium"), NULL, 0, 0, (void *) 500, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     118             :     { (unichar_t *) N_("600 Semi-Bold"), NULL, 0, 0, (void *) 600, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     119             :     { (unichar_t *) N_("700 Bold"), NULL, 0, 0, (void *) 700, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     120             :     { (unichar_t *) N_("800 Extra-Bold"), NULL, 0, 0, (void *) 800, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     121             :     { (unichar_t *) N_("900 Black"), NULL, 0, 0, (void *) 900, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     122             :     GTEXTINFO_EMPTY
     123             : };
     124             : static GTextInfo fstype[] = {
     125             :     { (unichar_t *) N_("Never Embed/No Editing"), NULL, 0, 0, (void *) 0x02, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     126             :     { (unichar_t *) N_("Printable Document"), NULL, 0, 0, (void *) 0x04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     127             :     { (unichar_t *) N_("Editable Document"), NULL, 0, 0, (void *) 0x08, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     128             :     { (unichar_t *) N_("Installable Font"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     129             :     GTEXTINFO_EMPTY
     130             : };
     131             : static GTextInfo pfmfamily[] = {
     132             :     { (unichar_t *) N_("Serif"), NULL, 0, 0, (void *) 0x11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     133             :     { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     134             :     { (unichar_t *) N_("Monospace"), NULL, 0, 0, (void *) 0x31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     135             : /* GT: See the long comment at "Property|New" */
     136             : /* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
     137             : /* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
     138             : /* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
     139             :     { (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 0x41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     140             :     { (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 0x51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     141             :     GTEXTINFO_EMPTY
     142             : };
     143             : static GTextInfo ibmfamily[] = {
     144             :     { (unichar_t *) N_("No Classification"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     145             :     { (unichar_t *) N_("Old Style Serifs"), NULL, 0, 0, (void *) 0x100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     146             :     { (unichar_t *) N_("OSS Rounded Legibility"), NULL, 0, 0, (void *) 0x101, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     147             :     { (unichar_t *) N_("OSS Geralde"), NULL, 0, 0, (void *) 0x102, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     148             :     { (unichar_t *) N_("OSS Venetian"), NULL, 0, 0, (void *) 0x103, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     149             :     { (unichar_t *) N_("OSS Modified Venetian"), NULL, 0, 0, (void *) 0x104, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     150             :     { (unichar_t *) N_("OSS Dutch Modern"), NULL, 0, 0, (void *) 0x105, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     151             :     { (unichar_t *) N_("OSS Dutch Trad"), NULL, 0, 0, (void *) 0x106, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     152             :     { (unichar_t *) N_("OSS Contemporary"), NULL, 0, 0, (void *) 0x107, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     153             :     { (unichar_t *) N_("OSS Calligraphic"), NULL, 0, 0, (void *) 0x108, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     154             :     { (unichar_t *) N_("OSS Miscellaneous"), NULL, 0, 0, (void *) 0x10f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     155             :     { (unichar_t *) N_("Transitional Serifs"), NULL, 0, 0, (void *) 0x200, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     156             :     { (unichar_t *) N_("TS Direct Line"), NULL, 0, 0, (void *) 0x201, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     157             :     { (unichar_t *) N_("TS Script"), NULL, 0, 0, (void *) 0x202, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     158             :     { (unichar_t *) N_("TS Miscellaneous"), NULL, 0, 0, (void *) 0x20f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     159             :     { (unichar_t *) N_("Modern Serifs"), NULL, 0, 0, (void *) 0x300, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     160             :     { (unichar_t *) N_("MS Italian"), NULL, 0, 0, (void *) 0x301, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     161             :     { (unichar_t *) N_("MS Script"), NULL, 0, 0, (void *) 0x302, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     162             :     { (unichar_t *) N_("MS Miscellaneous"), NULL, 0, 0, (void *) 0x30f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     163             :     { (unichar_t *) N_("Clarendon Serifs"), NULL, 0, 0, (void *) 0x400, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     164             :     { (unichar_t *) N_("CS Clarendon"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     165             :     { (unichar_t *) N_("CS Modern"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     166             :     { (unichar_t *) N_("CS Traditional"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     167             :     { (unichar_t *) N_("CS Newspaper"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     168             :     { (unichar_t *) N_("CS Stub Serif"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     169             :     { (unichar_t *) N_("CS Monotone"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     170             :     { (unichar_t *) N_("CS Typewriter"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     171             :     { (unichar_t *) N_("CS Miscellaneous"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     172             :     { (unichar_t *) N_("Slab Serifs"), NULL, 0, 0, (void *) 0x500, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     173             :     { (unichar_t *) N_("Slab Serifs|SS Monotone"), NULL, 0, 0, (void *) 0x501, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     174             :     { (unichar_t *) N_("Slab Serifs|SS Humanist"), NULL, 0, 0, (void *) 0x502, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     175             :     { (unichar_t *) N_("Slab Serifs|SS Geometric"), NULL, 0, 0, (void *) 0x503, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     176             :     { (unichar_t *) N_("Slab Serifs|SS Swiss"), NULL, 0, 0, (void *) 0x504, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     177             :     { (unichar_t *) N_("Slab Serifs|SS Typewriter"), NULL, 0, 0, (void *) 0x505, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     178             :     { (unichar_t *) N_("Slab Serifs|SS Miscellaneous"), NULL, 0, 0, (void *) 0x50f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     179             :     { (unichar_t *) N_("Freeform Serifs"), NULL, 0, 0, (void *) 0x700, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     180             :     { (unichar_t *) N_("FS Modern"), NULL, 0, 0, (void *) 0x701, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     181             :     { (unichar_t *) N_("FS Miscellaneous"), NULL, 0, 0, (void *) 0x70f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     182             :     { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x800, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     183             :     { (unichar_t *) N_("Sans-Serif|SS IBM NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     184             :     { (unichar_t *) N_("Sans-Serif|SS Humanist"), NULL, 0, 0, (void *) 0x802, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     185             :     { (unichar_t *) N_("Sans-Serif|SS Low-x Round Geometric"), NULL, 0, 0, (void *) 0x803, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     186             :     { (unichar_t *) N_("Sans-Serif|SS High-x Round Geometric"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     187             :     { (unichar_t *) N_("Sans-Serif|SS NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x805, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     188             :     { (unichar_t *) N_("Sans-Serif|SS Modified Grotesque Gothic"), NULL, 0, 0, (void *) 0x806, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     189             :     { (unichar_t *) N_("Sans-Serif|SS Typewriter Gothic"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     190             :     { (unichar_t *) N_("Sans-Serif|SS Matrix"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     191             :     { (unichar_t *) N_("Sans-Serif|SS Miscellaneous"), NULL, 0, 0, (void *) 0x80f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     192             :     { (unichar_t *) N_("Ornamentals"), NULL, 0, 0, (void *) 0x900, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     193             :     { (unichar_t *) N_("O Engraver"), NULL, 0, 0, (void *) 0x901, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     194             :     { (unichar_t *) N_("O Black Letter"), NULL, 0, 0, (void *) 0x902, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     195             :     { (unichar_t *) N_("O Decorative"), NULL, 0, 0, (void *) 0x903, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     196             :     { (unichar_t *) N_("O Three Dimensional"), NULL, 0, 0, (void *) 0x904, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     197             :     { (unichar_t *) N_("O Miscellaneous"), NULL, 0, 0, (void *) 0x90f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     198             :     { (unichar_t *) N_("Scripts"), NULL, 0, 0, (void *) 0xa00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     199             :     { (unichar_t *) N_("S Uncial"), NULL, 0, 0, (void *) 0xa01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     200             :     { (unichar_t *) N_("S Brush Joined"), NULL, 0, 0, (void *) 0xa02, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     201             :     { (unichar_t *) N_("S Formal Joined"), NULL, 0, 0, (void *) 0xa03, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     202             :     { (unichar_t *) N_("S Monotone Joined"), NULL, 0, 0, (void *) 0xa04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     203             :     { (unichar_t *) N_("S Calligraphic"), NULL, 0, 0, (void *) 0xa05, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     204             :     { (unichar_t *) N_("S Brush Unjoined"), NULL, 0, 0, (void *) 0xa06, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     205             :     { (unichar_t *) N_("S Formal Unjoined"), NULL, 0, 0, (void *) 0xa07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     206             :     { (unichar_t *) N_("S Monotone Unjoined"), NULL, 0, 0, (void *) 0xa08, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     207             :     { (unichar_t *) N_("S Miscellaneous"), NULL, 0, 0, (void *) 0xa0f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     208             :     { (unichar_t *) N_("Symbolic"), NULL, 0, 0, (void *) 0xc00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     209             :     { (unichar_t *) N_("Sy Mixed Serif"), NULL, 0, 0, (void *) 0xc03, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     210             :     { (unichar_t *) N_("Sy Old Style Serif"), NULL, 0, 0, (void *) 0xc06, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     211             :     { (unichar_t *) N_("Sy Neo-grotesque Sans Serif"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     212             :     { (unichar_t *) N_("Sy Miscellaneous"), NULL, 0, 0, (void *) 0xc0f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     213             :     GTEXTINFO_EMPTY
     214             : };
     215             : static GTextInfo stylemap[] = {
     216             :     { (unichar_t *) N_("Automatic"), NULL, 0, 0, (void *) -1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     217             :     { (unichar_t *) N_("None"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     218             :     { (unichar_t *) N_("Regular"), NULL, 0, 0, (void *) 0x40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     219             :     { (unichar_t *) N_("Italic"), NULL, 0, 0, (void *) 0x01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     220             :     { (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 0x20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     221             :     { (unichar_t *) N_("Bold Italic"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     222             :     GTEXTINFO_EMPTY
     223             : };
     224             : static GTextInfo os2versions[] = {
     225             :     { (unichar_t *) N_("OS2Version|Automatic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     226             :     { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     227             :     { (unichar_t *) N_("2"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     228             :     { (unichar_t *) N_("3"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     229             :     { (unichar_t *) N_("4"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     230             :     GTEXTINFO_EMPTY
     231             : };
     232             : static GTextInfo gaspversions[] = {
     233             :     { (unichar_t *) N_("0"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     234             :     { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     235             :     GTEXTINFO_EMPTY
     236             : };
     237             : static GTextInfo panfamily[] = {
     238             :     { (unichar_t *) N_("PanoseFamily|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     239             :     { (unichar_t *) N_("PanoseFamily|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     240             :     { (unichar_t *) N_("Latin: Text and Display"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     241             : /* GT: See the long comment at "Property|New" */
     242             : /* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
     243             : /* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
     244             : /* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
     245             :     { (unichar_t *) N_("cursive|Latin: Handwritten"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     246             :     { (unichar_t *) N_("Latin: Decorative"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     247             :     { (unichar_t *) N_("Latin: Pictorial and Symbol"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     248             :     { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     249             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     250             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     251             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     252             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     253             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     254             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     255             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     256             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     257             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     258             :     GTEXTINFO_EMPTY
     259             : };
     260             : static GTextInfo panunknown[] = {
     261             :     { (unichar_t *) "Any", NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     262             :     { (unichar_t *) "No Fit", NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     263             :     { (unichar_t *) "2", NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     264             :     { (unichar_t *) "3", NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     265             :     { (unichar_t *) "4", NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     266             :     { (unichar_t *) "5", NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     267             :     { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     268             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     269             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     270             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     271             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     272             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     273             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     274             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     275             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     276             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     277             :     GTEXTINFO_EMPTY
     278             : };
     279             : static GTextInfo panserifs[] = {
     280             :     { (unichar_t *) N_("PanoseSerifs|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     281             :     { (unichar_t *) N_("PanoseSerifs|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     282             :     { (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     283             :     { (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     284             :     { (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     285             :     { (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     286             :     { (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     287             :     { (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     288             :     { (unichar_t *) N_("Bone"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     289             :     { (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     290             :     { (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     291             :     { (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     292             :     { (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     293             :     { (unichar_t *) N_("Perpendicular Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     294             :     { (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     295             :     { (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     296             :     GTEXTINFO_EMPTY
     297             : };
     298             : static GTextInfo panweight[] = {
     299             :     { (unichar_t *) N_("PanoseWeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     300             :     { (unichar_t *) N_("PanoseWeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     301             :     { (unichar_t *) N_("Very Light"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     302             :     { (unichar_t *) N_("Light"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     303             :     { (unichar_t *) N_("PanoseWeight|Thin"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     304             :     { (unichar_t *) N_("Book"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     305             :     { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     306             :     { (unichar_t *) N_("Demi"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     307             :     { (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     308             :     { (unichar_t *) N_("Heavy"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     309             :     { (unichar_t *) N_("Black"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     310             :     { (unichar_t *) N_("Extra Black (Nord)"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     311             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     312             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     313             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     314             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     315             :     GTEXTINFO_EMPTY
     316             : };
     317             : static GTextInfo panprop[] = {
     318             :     { (unichar_t *) N_("PanoseProportion|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     319             :     { (unichar_t *) N_("PanoseProportion|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     320             :     { (unichar_t *) N_("Old Style"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     321             :     { (unichar_t *) N_("Modern"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     322             :     { (unichar_t *) N_("Even Width"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     323             :     { (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     324             :     { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     325             :     { (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     326             :     { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     327             :     { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     328             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     329             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     330             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     331             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     332             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     333             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     334             :     GTEXTINFO_EMPTY
     335             : };
     336             : static GTextInfo pancontrast[] = {
     337             :     { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     338             :     { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     339             :     { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     340             :     { (unichar_t *) N_("PanoseContrast|Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     341             :     { (unichar_t *) N_("PanoseContrast|Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     342             :     { (unichar_t *) N_("PanoseContrast|Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     343             :     { (unichar_t *) N_("PanoseContrast|Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     344             :     { (unichar_t *) N_("PanoseContrast|Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     345             :     { (unichar_t *) N_("PanoseContrast|High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     346             :     { (unichar_t *) N_("PanoseContrast|Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     347             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     348             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     349             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     350             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     351             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     352             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     353             :     GTEXTINFO_EMPTY
     354             : };
     355             : static GTextInfo panstrokevar[] = {
     356             :     { (unichar_t *) N_("PanoseStrokeVariation|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     357             :     { (unichar_t *) N_("PanoseStrokeVariation|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     358             :     { (unichar_t *) N_("No Variation"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     359             :     { (unichar_t *) N_("Gradual/Diagonal"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     360             :     { (unichar_t *) N_("Gradual/Transitional"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     361             :     { (unichar_t *) N_("Gradual/Vertical"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     362             :     { (unichar_t *) N_("Gradual/Horizontal"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     363             :     { (unichar_t *) N_("Rapid/Vertical"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     364             :     { (unichar_t *) N_("Rapid/Horizontal"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     365             :     { (unichar_t *) N_("Instant/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     366             :     { (unichar_t *) N_("Instant/Horizontal"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     367             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     368             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     369             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     370             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     371             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     372             :     GTEXTINFO_EMPTY
     373             : };
     374             : static GTextInfo panarmstyle[] = {
     375             :     { (unichar_t *) N_("PanoseArmStyle|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     376             :     { (unichar_t *) N_("PanoseArmStyle|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     377             :     { (unichar_t *) N_("Straight Arms/Horizontal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     378             :     { (unichar_t *) N_("Straight Arms/Wedge"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     379             :     { (unichar_t *) N_("Straight Arms/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     380             :     { (unichar_t *) N_("Straight Arms/Single Serif"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     381             :     { (unichar_t *) N_("Straight Arms/Double Serif"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     382             :     { (unichar_t *) N_("Non-Straight Arms/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     383             :     { (unichar_t *) N_("Non-Straight Arms/Wedge"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     384             :     { (unichar_t *) N_("Non-Straight Arms/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     385             :     { (unichar_t *) N_("Non-Straight Arms/Single Serif"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     386             :     { (unichar_t *) N_("Non-Straight Arms/Double Serif"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     387             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     388             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     389             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     390             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     391             :     GTEXTINFO_EMPTY
     392             : };
     393             : static GTextInfo panletterform[] = {
     394             :     { (unichar_t *) N_("PanoseLetterform|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     395             :     { (unichar_t *) N_("PanoseLetterform|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     396             :     { (unichar_t *) N_("Normal/Contact"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     397             :     { (unichar_t *) N_("Normal/Weighted"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     398             :     { (unichar_t *) N_("Normal/Boxed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     399             :     { (unichar_t *) N_("Normal/Flattened"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     400             :     { (unichar_t *) N_("Normal/Rounded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     401             :     { (unichar_t *) N_("Normal/Off-Center"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     402             :     { (unichar_t *) N_("Normal/Square"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     403             :     { (unichar_t *) N_("Oblique/Contact"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     404             :     { (unichar_t *) N_("Oblique/Weighted"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     405             :     { (unichar_t *) N_("Oblique/Boxed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     406             :     { (unichar_t *) N_("Oblique/Flattened"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     407             :     { (unichar_t *) N_("Oblique/Rounded"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     408             :     { (unichar_t *) N_("Oblique/Off-Center"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     409             :     { (unichar_t *) N_("Oblique/Square"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     410             :     GTEXTINFO_EMPTY
     411             : };
     412             : static GTextInfo panmidline[] = {
     413             :     { (unichar_t *) N_("PanoseMidline|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     414             :     { (unichar_t *) N_("PanoseMidline|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     415             :     { (unichar_t *) N_("PanoseMidline|Standard/Trimmed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     416             :     { (unichar_t *) N_("PanoseMidline|Standard/Pointed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     417             :     { (unichar_t *) N_("PanoseMidline|Standard/Serifed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     418             :     { (unichar_t *) N_("PanoseMidline|High/Trimmed"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     419             :     { (unichar_t *) N_("PanoseMidline|High/Pointed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     420             :     { (unichar_t *) N_("PanoseMidline|High/Serifed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     421             :     { (unichar_t *) N_("PanoseMidline|Constant/Trimmed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     422             :     { (unichar_t *) N_("PanoseMidline|Constant/Pointed"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     423             :     { (unichar_t *) N_("PanoseMidline|Constant/Serifed"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     424             :     { (unichar_t *) N_("PanoseMidline|Low/Trimmed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     425             :     { (unichar_t *) N_("PanoseMidline|Low/Pointed"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     426             :     { (unichar_t *) N_("PanoseMidline|Low/Serifed"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     427             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     428             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     429             :     GTEXTINFO_EMPTY
     430             : };
     431             : static GTextInfo panxheight[] = {
     432             :     { (unichar_t *) N_("PanoseXHeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     433             :     { (unichar_t *) N_("PanoseXHeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     434             :     { (unichar_t *) N_("PanoseXHeight|Constant/Small"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     435             :     { (unichar_t *) N_("PanoseXHeight|Constant/Standard"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     436             :     { (unichar_t *) N_("PanoseXHeight|Constant/Large"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     437             :     { (unichar_t *) N_("PanoseXHeight|Ducking/Small"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     438             :     { (unichar_t *) N_("PanoseXHeight|Ducking/Standard"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     439             :     { (unichar_t *) N_("PanoseXHeight|Ducking/Large"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     440             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     441             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     442             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     443             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     444             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     445             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     446             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     447             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     448             :     GTEXTINFO_EMPTY
     449             : };
     450             : /* Latin: Hand written */
     451             : static GTextInfo pantool[] = {
     452             :     { (unichar_t *) N_("PanoseTool|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     453             :     { (unichar_t *) N_("PanoseTool|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     454             :     { (unichar_t *) N_("Flat Nib"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     455             :     { (unichar_t *) N_("Pressure Point"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     456             :     { (unichar_t *) N_("Engraved"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     457             :     { (unichar_t *) N_("Ball (Round Cap)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     458             :     { (unichar_t *) N_("Brush"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     459             :     { (unichar_t *) N_("Rough"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     460             :     { (unichar_t *) N_("Felt Pen or Brush Tip"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     461             :     { (unichar_t *) N_("Wild Brush - Drips a lot"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     462             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     463             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     464             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     465             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     466             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     467             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     468             :     GTEXTINFO_EMPTY
     469             : };
     470             : static GTextInfo panspacing[] = {
     471             :     { (unichar_t *) N_("PanoseSpacing|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     472             :     { (unichar_t *) N_("PanoseSpacing|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     473             :     { (unichar_t *) N_("Proportional Spaced"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     474             :     { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     475             :     { (unichar_t *) "4", NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     476             :     { (unichar_t *) "5", NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     477             :     { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     478             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     479             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     480             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     481             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     482             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     483             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     484             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     485             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     486             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     487             :     GTEXTINFO_EMPTY
     488             : };
     489             : static GTextInfo panasprat[] = {
     490             :     { (unichar_t *) N_("PanoseAspectRatio|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     491             :     { (unichar_t *) N_("PanoseAspectRatio|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     492             :     { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     493             :     { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     494             :     { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     495             :     { (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     496             :     { (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     497             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     498             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     499             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     500             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     501             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     502             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     503             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     504             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     505             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     506             :     GTEXTINFO_EMPTY
     507             : };
     508             : static GTextInfo pancontrast2[] = {
     509             :     { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     510             :     { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     511             :     { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     512             :     { (unichar_t *) N_("Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     513             :     { (unichar_t *) N_("Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     514             :     { (unichar_t *) N_("Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     515             :     { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     516             :     { (unichar_t *) N_("Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     517             :     { (unichar_t *) N_("High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     518             :     { (unichar_t *) N_("Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     519             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     520             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     521             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     522             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     523             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     524             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     525             :     GTEXTINFO_EMPTY
     526             : };
     527             : static GTextInfo pantopology[] = {
     528             :     { (unichar_t *) N_("PanoseTopology|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     529             :     { (unichar_t *) N_("PanoseTopology|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     530             :     { (unichar_t *) N_("Roman Disconnected"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     531             :     { (unichar_t *) N_("Roman Trailing"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     532             :     { (unichar_t *) N_("Roman Connected"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     533             :     { (unichar_t *) N_("Cursive Disconnected"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     534             :     { (unichar_t *) N_("Cursive Trailing"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     535             :     { (unichar_t *) N_("Cursive Connected"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     536             :     { (unichar_t *) N_("Blackletter Disconnected"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     537             :     { (unichar_t *) N_("Blackletter Trailing"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     538             :     { (unichar_t *) N_("Blackletter Connected"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     539             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     540             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     541             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     542             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     543             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     544             :     GTEXTINFO_EMPTY
     545             : };
     546             : static GTextInfo panform[] = {
     547             :     { (unichar_t *) N_("PanoseForm|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     548             :     { (unichar_t *) N_("PanoseForm|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     549             :     { (unichar_t *) N_("Upright/No Wrapping"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     550             :     { (unichar_t *) N_("Upright/Some Wrapping"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     551             :     { (unichar_t *) N_("Upright/More Wrapping"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     552             :     { (unichar_t *) N_("Upright/Extreme Wrapping"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     553             :     { (unichar_t *) N_("Oblique/No Wrapping"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     554             :     { (unichar_t *) N_("Oblique/Some Wrapping"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     555             :     { (unichar_t *) N_("Oblique/More Wrapping"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     556             :     { (unichar_t *) N_("Oblique/Extreme Wrapping"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     557             :     { (unichar_t *) N_("Exaggerated/No Wrapping"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     558             :     { (unichar_t *) N_("Exaggerated/Some Wrapping"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     559             :     { (unichar_t *) N_("Exaggerated/More Wrapping"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     560             :     { (unichar_t *) N_("Exaggerated/Extreme Wrapping"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     561             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     562             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     563             :     GTEXTINFO_EMPTY
     564             : };
     565             : static GTextInfo panfinials[] = {
     566             :     { (unichar_t *) N_("PanoseFinials|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     567             :     { (unichar_t *) N_("PanoseFinials|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     568             :     { (unichar_t *) N_("None/No Loops"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     569             :     { (unichar_t *) N_("None/Closed Loops"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     570             :     { (unichar_t *) N_("None/Open Loops"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     571             :     { (unichar_t *) N_("Sharp/No Loops"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     572             :     { (unichar_t *) N_("Sharp/Closed Loops"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     573             :     { (unichar_t *) N_("Sharp/Open Loops"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     574             :     { (unichar_t *) N_("Tapered/No Loops"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     575             :     { (unichar_t *) N_("Tapered/Closed Loops"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     576             :     { (unichar_t *) N_("Tapered/Open Loops"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     577             :     { (unichar_t *) N_("Round/No Loops"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     578             :     { (unichar_t *) N_("Round/Closed Loops"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     579             :     { (unichar_t *) N_("Round/Open Loops"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     580             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     581             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     582             :     GTEXTINFO_EMPTY
     583             : };
     584             : static GTextInfo panxascent[] = {
     585             :     { (unichar_t *) N_("PanoseXAscent|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     586             :     { (unichar_t *) N_("PanoseXAscent|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     587             :     { (unichar_t *) N_("PanoseXAscent|Very Low"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     588             :     { (unichar_t *) N_("PanoseXAscent|Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     589             :     { (unichar_t *) N_("PanoseXAscent|Medium"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     590             :     { (unichar_t *) N_("PanoseXAscent|High"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     591             :     { (unichar_t *) N_("PanoseXAscent|Very High"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     592             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     593             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     594             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     595             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     596             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     597             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     598             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     599             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     600             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     601             :     GTEXTINFO_EMPTY
     602             : };
     603             : /* Latin: Decorative */
     604             : static GTextInfo panclass[] = {
     605             :     { (unichar_t *) N_("PanoseClass|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     606             :     { (unichar_t *) N_("PanoseClass|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     607             :     { (unichar_t *) N_("Derivative"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     608             :     { (unichar_t *) N_("Non-standard Topology"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     609             :     { (unichar_t *) N_("Non-standard Elements"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     610             :     { (unichar_t *) N_("Non-standard Aspect"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     611             :     { (unichar_t *) N_("Initials"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     612             :     { (unichar_t *) N_("Cartoon"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     613             :     { (unichar_t *) N_("Picture Stems"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     614             :     { (unichar_t *) N_("Ornamented"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     615             :     { (unichar_t *) N_("Text and Background"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     616             :     { (unichar_t *) N_("Collage"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     617             :     { (unichar_t *) N_("Montage"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     618             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     619             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     620             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     621             :     GTEXTINFO_EMPTY
     622             : };
     623             : static GTextInfo panaspect[] = {
     624             :     { (unichar_t *) N_("PanoseAspect|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     625             :     { (unichar_t *) N_("PanoseAspect|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     626             :     { (unichar_t *) N_("Super Condensed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     627             :     { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     628             :     { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     629             :     { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     630             :     { (unichar_t *) N_("Extended"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     631             :     { (unichar_t *) N_("Very Extended"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     632             :     { (unichar_t *) N_("Super Extended"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     633             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     634             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     635             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     636             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     637             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     638             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     639             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     640             :     GTEXTINFO_EMPTY
     641             : };
     642             : static GTextInfo pancontrast3[] = {
     643             :     { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     644             :     { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     645             :     { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     646             :     { (unichar_t *) N_("Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     647             :     { (unichar_t *) N_("Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     648             :     { (unichar_t *) N_("Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     649             :     { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     650             :     { (unichar_t *) N_("Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     651             :     { (unichar_t *) N_("High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     652             :     { (unichar_t *) N_("Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     653             :     { (unichar_t *) N_("Horizontal Low"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     654             :     { (unichar_t *) N_("Horizontal Medium"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     655             :     { (unichar_t *) N_("Horizontal High"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     656             :     { (unichar_t *) N_("Broken"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     657             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     658             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     659             :     GTEXTINFO_EMPTY
     660             : };
     661             : static GTextInfo panserifvar[] = {
     662             :     { (unichar_t *) N_("PanoseSerifVariant|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     663             :     { (unichar_t *) N_("PanoseSerifVariant|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     664             :     { (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     665             :     { (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     666             :     { (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     667             :     { (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     668             :     { (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     669             :     { (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     670             : /*!*/{ (unichar_t *) N_("Oval"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     671             :     { (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     672             :     { (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     673             :     { (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     674             :     { (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     675             :     { (unichar_t *) N_("Perpendicular Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     676             :     { (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     677             :     { (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     678             : /* Um, these guys are only supposed to go up to 15, so why does this have a 16? */
     679             : /*!*/{ (unichar_t *) N_("PanoseSerivfs|Script"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     680             :     GTEXTINFO_EMPTY
     681             : };
     682             : static GTextInfo pantreatment[] = {
     683             :     { (unichar_t *) N_("PanoseTreatment|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     684             :     { (unichar_t *) N_("PanoseTreatment|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     685             :     { (unichar_t *) N_("Standard Solid Fill"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     686             :     { (unichar_t *) N_("No Fill"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     687             :     { (unichar_t *) N_("Patterned Fill"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     688             :     { (unichar_t *) N_("Complex Fill"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     689             :     { (unichar_t *) N_("Shaped Fill"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     690             :     { (unichar_t *) N_("Drawn or Distressed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     691             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     692             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     693             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     694             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     695             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     696             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     697             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     698             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     699             :     GTEXTINFO_EMPTY
     700             : };
     701             : static GTextInfo panlining[] = {
     702             :     { (unichar_t *) N_("PanoseLining|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     703             :     { (unichar_t *) N_("PanoseLining|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     704             :     { (unichar_t *) N_("PanoseLining|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     705             :     { (unichar_t *) N_("PanoseLining|Inline"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     706             :     { (unichar_t *) N_("PanoseLining|Outline"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     707             :     { (unichar_t *) N_("PanoseLining|Engraved (Multiple Lines)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     708             :     { (unichar_t *) N_("PanoseLining|Shadow"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     709             :     { (unichar_t *) N_("PanoseLining|Relief"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     710             :     { (unichar_t *) N_("PanoseLining|Backdrop"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     711             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     712             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     713             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     714             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     715             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     716             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     717             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     718             :     GTEXTINFO_EMPTY
     719             : };
     720             : static GTextInfo pantopology2[] = {
     721             :     { (unichar_t *) N_("PanoseTopology|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     722             :     { (unichar_t *) N_("PanoseTopology|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     723             :     { (unichar_t *) N_("Standard"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     724             :     { (unichar_t *) N_("Square"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     725             :     { (unichar_t *) N_("Multiple Segment"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     726             :     { (unichar_t *) N_("Deco (E,M,S) Waco Midline"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     727             :     { (unichar_t *) N_("Uneven Weighting"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     728             :     { (unichar_t *) N_("Diverse Arms"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     729             :     { (unichar_t *) N_("Diverse Forms"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     730             :     { (unichar_t *) N_("Lombardic Forms"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     731             :     { (unichar_t *) N_("Upper Case in Lower Case"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     732             :     { (unichar_t *) N_("Implied Topology"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     733             :     { (unichar_t *) N_("Horseshoe E and A"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     734             :     { (unichar_t *) N_("Cursive"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     735             :     { (unichar_t *) N_("Blackletter"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     736             :     { (unichar_t *) N_("Swash Variance"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     737             :     GTEXTINFO_EMPTY
     738             : };
     739             : static GTextInfo pancharrange[] = {
     740             :     { (unichar_t *) N_("PanoseCharRange|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     741             :     { (unichar_t *) N_("PanoseCharRange|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     742             :     { (unichar_t *) N_("Extended Collection"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     743             :     { (unichar_t *) N_("Literals"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     744             :     { (unichar_t *) N_("No Lower Case"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     745             :     { (unichar_t *) N_("Small Caps"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     746             :     { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     747             :     { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     748             :     { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     749             :     { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     750             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     751             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     752             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     753             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     754             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     755             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     756             :     GTEXTINFO_EMPTY
     757             : };
     758             : /* Latin: Symbol */
     759             : static GTextInfo pankind[] = {
     760             :     { (unichar_t *) N_("PanoseKind|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     761             :     { (unichar_t *) N_("PanoseKind|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     762             :     { (unichar_t *) N_("Montages"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     763             :     { (unichar_t *) N_("Pictures"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     764             :     { (unichar_t *) N_("Shapes"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     765             :     { (unichar_t *) N_("Scientific"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     766             :     { (unichar_t *) N_("Music"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     767             :     { (unichar_t *) N_("Expert"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     768             :     { (unichar_t *) N_("Patterns"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     769             :     { (unichar_t *) N_("Borders"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     770             :     { (unichar_t *) N_("Icons"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     771             :     { (unichar_t *) N_("Logos"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     772             :     { (unichar_t *) N_("Industry Specific"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     773             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     774             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     775             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     776             :     GTEXTINFO_EMPTY
     777             : };
     778             : static GTextInfo panasprat2[] = {
     779             :     { (unichar_t *) N_("PanoseAspect|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     780             :     { (unichar_t *) N_("PanoseAspect|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     781             :     { (unichar_t *) N_("No Width"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     782             :     { (unichar_t *) N_("Exceptionally Wide"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     783             :     { (unichar_t *) N_("Super Wide"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     784             :     { (unichar_t *) N_("Very Wide"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     785             :     { (unichar_t *) N_("Wide"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     786             :     { (unichar_t *) N_("Normal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     787             :     { (unichar_t *) N_("Narrow"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     788             :     { (unichar_t *) N_("Very Narrow"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     789             :     { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     790             :     { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     791             :     { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     792             :     { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     793             :     { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     794             :     { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     795             :     GTEXTINFO_EMPTY
     796             : };
     797             : 
     798             : static struct titlelist { char *name; GTextInfo *variants; } panoses[][9] = {
     799             :     /*Any*/    {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
     800             :     /*NoFit*/  {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
     801             :     /*LtnTxt*/ {{ N_("_Serifs"), panserifs }, { N_("Panose|_Weight"), panweight }, { N_("_Proportion"), panprop }, { N_("_Contrast"), pancontrast }, { N_("Stroke _Variation"), panstrokevar }, { N_("_Arm Style"), panarmstyle }, { N_("_Letterform"), panletterform }, { N_("_Midline"), panmidline }, { N_("_X-Height"), panxheight }},
     802             :     /*LtnHnd*/ {{ N_("_Tool"), pantool }, { N_("Panose|_Weight"), panweight }, { N_("_Spacing"), panspacing }, { N_("_Aspect Ratio"), panasprat }, { N_("_Contrast"), pancontrast2 }, { N_("_Topology"), pantopology }, { N_("F_orm"), panform }, { N_("F_inials"), panfinials }, { N_("_X-Ascent"), panxascent }},
     803             :     /*LtnDcr*/ {{ N_("_Class"), panclass }, { N_("Panose|_Weight"), panweight }, { N_("_Aspect"), panaspect }, { N_("C_ontrast"), pancontrast3 }, { N_("_Serif Variant"), panserifvar }, { N_("T_reatment"), pantreatment }, { N_("_Lining"), panlining }, { N_("_Topology"), pantopology2 }, { N_("Char. _Range"), pancharrange }},
     804             :                                             /* Yup, really should be "unknown", no weights permitted, nor aspect ratios */
     805             :     /*LtnSym*/ {{ N_("_Kind"), pankind }, { N_("Panose|_Weight"), panunknown }, { N_("_Spacing"), panspacing }, { N_("_Aspect Ratio"), panunknown }, { N_("AR: Char 94"), panasprat2 }, { N_("AR: Char 119"), panasprat2 }, { N_("AR: Char 157"), panasprat2 }, { N_("AR: Char 163"), panasprat2 }, { N_("AR: Char 211"), panasprat2 }},
     806             :     /* 6 */    {{ N_("Class2"), panunknown }, { N_("Class3"), panunknown }, { N_("Class4"), panunknown }, { N_("Class5"), panunknown }, { N_("Class6"), panunknown }, { N_("Class7"), panunknown }, { N_("Class8"), panunknown }, { N_("Class9"), panunknown }, { N_("Class10"), panunknown }},
     807             :     {{NULL, NULL}}
     808             : };
     809             : 
     810             : /* There is a similar list at the end of python.c, untranslated strings for */
     811             : /*  scripting use */
     812             : static GTextInfo mslanguages[] = {
     813             :     { (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) 0x436, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     814             :     { (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) 0x41c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     815             : /* GT: See the long comment at "Property|New" */
     816             : /* GT: The msgstr should contain a translation of "Malayalam", ignore "Lang|" */
     817             :     { (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) 0x45e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     818             :     { (unichar_t *) N_("Arabic (Saudi Arabia)"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     819             :     { (unichar_t *) N_("Arabic (Iraq)"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     820             :     { (unichar_t *) N_("Arabic (Egypt)"), NULL, 0, 0, (void *) 0xc01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     821             :     { (unichar_t *) N_("Arabic (Libya)"), NULL, 0, 0, (void *) 0x1001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     822             :     { (unichar_t *) N_("Arabic (Algeria)"), NULL, 0, 0, (void *) 0x1401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     823             :     { (unichar_t *) N_("Arabic (Morocco)"), NULL, 0, 0, (void *) 0x1801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     824             :     { (unichar_t *) N_("Arabic (Tunisia)"), NULL, 0, 0, (void *) 0x1C01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     825             :     { (unichar_t *) N_("Arabic (Oman)"), NULL, 0, 0, (void *) 0x2001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     826             :     { (unichar_t *) N_("Arabic (Yemen)"), NULL, 0, 0, (void *) 0x2401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     827             :     { (unichar_t *) N_("Arabic (Syria)"), NULL, 0, 0, (void *) 0x2801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     828             :     { (unichar_t *) N_("Arabic (Jordan)"), NULL, 0, 0, (void *) 0x2c01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     829             :     { (unichar_t *) N_("Arabic (Lebanon)"), NULL, 0, 0, (void *) 0x3001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     830             :     { (unichar_t *) N_("Arabic (Kuwait)"), NULL, 0, 0, (void *) 0x3401, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     831             :     { (unichar_t *) N_("Arabic (U.A.E.)"), NULL, 0, 0, (void *) 0x3801, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     832             :     { (unichar_t *) N_("Arabic (Bahrain)"), NULL, 0, 0, (void *) 0x3c01, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     833             :     { (unichar_t *) N_("Arabic (Qatar)"), NULL, 0, 0, (void *) 0x4001, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     834             :     { (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) 0x42b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     835             :     { (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) 0x44d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     836             :     { (unichar_t *) N_("Azeri (Latin)"), NULL, 0, 0, (void *) 0x42c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     837             :     { (unichar_t *) N_("Azeri (Cyrillic)"), NULL, 0, 0, (void *) 0x82c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     838             :     { (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) 0x42d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     839             :     { (unichar_t *) N_("Byelorussian"), NULL, 0, 0, (void *) 0x423, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     840             :     { (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) 0x445, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     841             :     { (unichar_t *) N_("Bengali Bangladesh"), NULL, 0, 0, (void *) 0x845, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     842             :     { (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     843             :     { (unichar_t *) N_("Burmese"), NULL, 0, 0, (void *) 0x455, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     844             :     { (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     845             :     { (unichar_t *) N_("Cambodian"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     846             :     { (unichar_t *) N_("Lang|Cherokee"), NULL, 0, 0, (void *) 0x45c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     847             :     { (unichar_t *) N_("Chinese (Taiwan)"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     848             :     { (unichar_t *) N_("Chinese (PRC)"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     849             :     { (unichar_t *) N_("Chinese (Hong Kong)"), NULL, 0, 0, (void *) 0xc04, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     850             :     { (unichar_t *) N_("Chinese (Singapore)"), NULL, 0, 0, (void *) 0x1004, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     851             :     { (unichar_t *) N_("Chinese (Macau)"), NULL, 0, 0, (void *) 0x1404, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     852             :     { (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) 0x41a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     853             :     { (unichar_t *) N_("Croatian Bosnia/Herzegovina"), NULL, 0, 0, (void *) 0x101a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     854             :     { (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     855             :     { (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     856             :     { (unichar_t *) N_("Divehi"), NULL, 0, 0, (void *) 0x465, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     857             :     { (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) 0x413, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     858             :     { (unichar_t *) N_("Flemish (Belgian Dutch)"), NULL, 0, 0, (void *) 0x813, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     859             :     { (unichar_t *) N_("Edo"), NULL, 0, 0, (void *) 0x466, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     860             :     { (unichar_t *) N_("English (British)"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     861             :     { (unichar_t *) N_("English (US)"), NULL, 0, 0, (void *) 0x409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     862             :     { (unichar_t *) N_("English (Canada)"), NULL, 0, 0, (void *) 0x1009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     863             :     { (unichar_t *) N_("English (Australian)"), NULL, 0, 0, (void *) 0xc09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     864             :     { (unichar_t *) N_("English (New Zealand)"), NULL, 0, 0, (void *) 0x1409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     865             :     { (unichar_t *) N_("English (Irish)"), NULL, 0, 0, (void *) 0x1809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     866             :     { (unichar_t *) N_("English (South Africa)"), NULL, 0, 0, (void *) 0x1c09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     867             :     { (unichar_t *) N_("English (Jamaica)"), NULL, 0, 0, (void *) 0x2009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     868             :     { (unichar_t *) N_("English (Caribbean)"), NULL, 0, 0, (void *) 0x2409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     869             :     { (unichar_t *) N_("English (Belize)"), NULL, 0, 0, (void *) 0x2809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     870             :     { (unichar_t *) N_("English (Trinidad)"), NULL, 0, 0, (void *) 0x2c09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     871             :     { (unichar_t *) N_("English (Zimbabwe)"), NULL, 0, 0, (void *) 0x3009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     872             :     { (unichar_t *) N_("English (Philippines)"), NULL, 0, 0, (void *) 0x3409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     873             :     { (unichar_t *) N_("English (Indonesia)"), NULL, 0, 0, (void *) 0x3809, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     874             :     { (unichar_t *) N_("English (Hong Kong)"), NULL, 0, 0, (void *) 0x3c09, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     875             :     { (unichar_t *) N_("English (India)"), NULL, 0, 0, (void *) 0x4009, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     876             :     { (unichar_t *) N_("English (Malaysia)"), NULL, 0, 0, (void *) 0x4409, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     877             :     { (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) 0x425, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     878             :     { (unichar_t *) N_("Faeroese"), NULL, 0, 0, (void *) 0x438, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     879             :     { (unichar_t *) N_("Lang|Farsi"), NULL, 0, 0, (void *) 0x429, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     880             :     { (unichar_t *) N_("Filipino"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     881             :     { (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) 0x40b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     882             :     { (unichar_t *) N_("French French"), NULL, 0, 0, (void *) 0x40c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     883             :     { (unichar_t *) N_("French Belgium"), NULL, 0, 0, (void *) 0x80c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     884             :     { (unichar_t *) N_("French Canadian"), NULL, 0, 0, (void *) 0xc0c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     885             :     { (unichar_t *) N_("French Swiss"), NULL, 0, 0, (void *) 0x100c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     886             :     { (unichar_t *) N_("French Luxembourg"), NULL, 0, 0, (void *) 0x140c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     887             :     { (unichar_t *) N_("French Monaco"), NULL, 0, 0, (void *) 0x180c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     888             :     { (unichar_t *) N_("French West Indies"), NULL, 0, 0, (void *) 0x1c0c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     889             :     { (unichar_t *) NU_("French Réunion"), NULL, 0, 0, (void *) 0x200c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     890             :     { (unichar_t *) N_("French D.R. Congo"), NULL, 0, 0, (void *) 0x240c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     891             :     { (unichar_t *) N_("French Senegal"), NULL, 0, 0, (void *) 0x280c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     892             :     { (unichar_t *) N_("French Camaroon"), NULL, 0, 0, (void *) 0x2c0c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     893             :     { (unichar_t *) NU_("French Côte d'Ivoire"), NULL, 0, 0, (void *) 0x300c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     894             :     { (unichar_t *) N_("French Mali"), NULL, 0, 0, (void *) 0x340c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     895             :     { (unichar_t *) N_("French Morocco"), NULL, 0, 0, (void *) 0x380c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     896             :     { (unichar_t *) N_("French Haiti"), NULL, 0, 0, (void *) 0x3c0c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     897             :     { (unichar_t *) N_("French North Africa"), NULL, 0, 0, (void *) 0xe40c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     898             :     { (unichar_t *) N_("Frisian"), NULL, 0, 0, (void *) 0x462, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     899             :     { (unichar_t *) N_("Fulfulde"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     900             :     { (unichar_t *) N_("Gaelic (Scottish)"), NULL, 0, 0, (void *) 0x43c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     901             :     { (unichar_t *) N_("Gaelic (Irish)"), NULL, 0, 0, (void *) 0x83c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     902             :     { (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     903             :     { (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) 0x437, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     904             :     { (unichar_t *) N_("German German"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     905             :     { (unichar_t *) N_("German Swiss"), NULL, 0, 0, (void *) 0x807, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     906             :     { (unichar_t *) N_("German Austrian"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     907             :     { (unichar_t *) N_("German Luxembourg"), NULL, 0, 0, (void *) 0x1007, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     908             :     { (unichar_t *) N_("German Liechtenstein"), NULL, 0, 0, (void *) 0x1407, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     909             :     { (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) 0x408, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     910             :     { (unichar_t *) N_("Guarani"), NULL, 0, 0, (void *) 0x474, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     911             :     { (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) 0x447, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     912             :     { (unichar_t *) N_("Hausa"), NULL, 0, 0, (void *) 0x468, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     913             :     { (unichar_t *) N_("Hawaiian"), NULL, 0, 0, (void *) 0x475, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     914             :     { (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) 0x40d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     915             :     { (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) 0x439, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     916             :     { (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) 0x40e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     917             :     { (unichar_t *) N_("Ibibio"), NULL, 0, 0, (void *) 0x469, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     918             :     { (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     919             :     { (unichar_t *) N_("Igbo"), NULL, 0, 0, (void *) 0x470, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     920             :     { (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) 0x421, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     921             :     { (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) 0x45d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     922             :     { (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) 0x410, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     923             :     { (unichar_t *) N_("Italian Swiss"), NULL, 0, 0, (void *) 0x810, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     924             :     { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) 0x411, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     925             :     { (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) 0x44b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     926             :     { (unichar_t *) N_("Kanuri"), NULL, 0, 0, (void *) 0x471, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     927             :     { (unichar_t *) N_("Kashmiri (India)"), NULL, 0, 0, (void *) 0x860, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     928             :     { (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) 0x43f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     929             :     { (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     930             :     { (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) 0x440, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     931             :     { (unichar_t *) N_("Konkani"), NULL, 0, 0, (void *) 0x457, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     932             :     { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) 0x412, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     933             :     { (unichar_t *) N_("Korean (Johab)"), NULL, 0, 0, (void *) 0x812, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     934             :     { (unichar_t *) N_("Lao"), NULL, 0, 0, (void *) 0x454, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     935             :     { (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) 0x426, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     936             :     { (unichar_t *) N_("Lang|Latin"), NULL, 0, 0, (void *) 0x476, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     937             :     { (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) 0x427, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     938             :     { (unichar_t *) N_("Lithuanian (Classic)"), NULL, 0, 0, (void *) 0x827, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     939             :     { (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) 0x42f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     940             :     { (unichar_t *) N_("Malay"), NULL, 0, 0, (void *) 0x43e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     941             :     { (unichar_t *) N_("Malay (Brunei)"), NULL, 0, 0, (void *) 0x83e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     942             :     { (unichar_t *) N_("Lang|Malayalam"), NULL, 0, 0, (void *) 0x44c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     943             :     { (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) 0x43a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     944             :     { (unichar_t *) N_("Manipuri"), NULL, 0, 0, (void *) 0x458, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     945             :     { (unichar_t *) N_("Maori"), NULL, 0, 0, (void *) 0x481, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     946             :     { (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) 0x44e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     947             :     { (unichar_t *) N_("Mongolian (Cyrillic)"), NULL, 0, 0, (void *) 0x450, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     948             :     { (unichar_t *) N_("Mongolian (Mongolian)"), NULL, 0, 0, (void *) 0x850, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     949             :     { (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) 0x461, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     950             :     { (unichar_t *) N_("Nepali (India)"), NULL, 0, 0, (void *) 0x861, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     951             :     { (unichar_t *) N_("Norwegian (Bokmal)"), NULL, 0, 0, (void *) 0x414, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     952             :     { (unichar_t *) N_("Norwegian (Nynorsk)"), NULL, 0, 0, (void *) 0x814, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     953             :     { (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) 0x448, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     954             :     { (unichar_t *) N_("Oromo"), NULL, 0, 0, (void *) 0x472, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     955             :     { (unichar_t *) N_("Papiamentu"), NULL, 0, 0, (void *) 0x479, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     956             :     { (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) 0x463, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     957             :     { (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) 0x415, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     958             :     { (unichar_t *) N_("Portuguese (Portugal)"), NULL, 0, 0, (void *) 0x416, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     959             :     { (unichar_t *) N_("Portuguese (Brasil)"), NULL, 0, 0, (void *) 0x816, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     960             :     { (unichar_t *) N_("Punjabi (India)"), NULL, 0, 0, (void *) 0x446, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     961             :     { (unichar_t *) N_("Punjabi (Pakistan)"), NULL, 0, 0, (void *) 0x846, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     962             :     { (unichar_t *) N_("Quecha (Bolivia)"), NULL, 0, 0, (void *) 0x46b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     963             :     { (unichar_t *) N_("Quecha (Ecuador)"), NULL, 0, 0, (void *) 0x86b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     964             :     { (unichar_t *) N_("Quecha (Peru)"), NULL, 0, 0, (void *) 0xc6b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     965             :     { (unichar_t *) N_("Rhaeto-Romanic"), NULL, 0, 0, (void *) 0x417, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     966             :     { (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) 0x418, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     967             :     { (unichar_t *) N_("Romanian (Moldova)"), NULL, 0, 0, (void *) 0x818, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     968             :     { (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) 0x419, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     969             :     { (unichar_t *) N_("Russian (Moldova)"), NULL, 0, 0, (void *) 0x819, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     970             :     { (unichar_t *) N_("Sami (Lappish)"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     971             :     { (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     972             :     { (unichar_t *) N_("Sepedi"), NULL, 0, 0, (void *) 0x46c, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     973             :     { (unichar_t *) N_("Serbian (Cyrillic)"), NULL, 0, 0, (void *) 0xc1a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     974             :     { (unichar_t *) N_("Serbian (Latin)"), NULL, 0, 0, (void *) 0x81a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     975             :     { (unichar_t *) N_("Sindhi India"), NULL, 0, 0, (void *) 0x459, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     976             :     { (unichar_t *) N_("Sindhi Pakistan"), NULL, 0, 0, (void *) 0x859, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     977             :     { (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) 0x45b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     978             :     { (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) 0x41b, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     979             :     { (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) 0x424, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     980             :     { (unichar_t *) N_("Sorbian"), NULL, 0, 0, (void *) 0x42e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     981             :     { (unichar_t *) N_("Spanish (Traditional)"), NULL, 0, 0, (void *) 0x40a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     982             :     { (unichar_t *) N_("Spanish Mexico"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     983             :     { (unichar_t *) N_("Spanish (Modern)"), NULL, 0, 0, (void *) 0xc0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     984             :     { (unichar_t *) N_("Spanish (Guatemala)"), NULL, 0, 0, (void *) 0x100a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     985             :     { (unichar_t *) N_("Spanish (Costa Rica)"), NULL, 0, 0, (void *) 0x140a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     986             :     { (unichar_t *) N_("Spanish (Panama)"), NULL, 0, 0, (void *) 0x180a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     987             :     { (unichar_t *) N_("Spanish (Dominican Republic)"), NULL, 0, 0, (void *) 0x1c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     988             :     { (unichar_t *) N_("Spanish (Venezuela)"), NULL, 0, 0, (void *) 0x200a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     989             :     { (unichar_t *) N_("Spanish (Colombia)"), NULL, 0, 0, (void *) 0x240a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     990             :     { (unichar_t *) N_("Spanish (Peru)"), NULL, 0, 0, (void *) 0x280a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     991             :     { (unichar_t *) N_("Spanish (Argentina)"), NULL, 0, 0, (void *) 0x2c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     992             :     { (unichar_t *) N_("Spanish (Ecuador)"), NULL, 0, 0, (void *) 0x300a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     993             :     { (unichar_t *) N_("Spanish (Chile)"), NULL, 0, 0, (void *) 0x340a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     994             :     { (unichar_t *) N_("Spanish (Uruguay)"), NULL, 0, 0, (void *) 0x380a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     995             :     { (unichar_t *) N_("Spanish (Paraguay)"), NULL, 0, 0, (void *) 0x3c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     996             :     { (unichar_t *) N_("Spanish (Bolivia)"), NULL, 0, 0, (void *) 0x400a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     997             :     { (unichar_t *) N_("Spanish (El Salvador)"), NULL, 0, 0, (void *) 0x440a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     998             :     { (unichar_t *) N_("Spanish (Honduras)"), NULL, 0, 0, (void *) 0x480a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
     999             :     { (unichar_t *) N_("Spanish (Nicaragua)"), NULL, 0, 0, (void *) 0x4c0a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1000             :     { (unichar_t *) N_("Spanish (Puerto Rico)"), NULL, 0, 0, (void *) 0x500a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1001             :     { (unichar_t *) N_("Spanish (United States)"), NULL, 0, 0, (void *) 0x540a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1002             :     { (unichar_t *) N_("Spanish (Latin America)"), NULL, 0, 0, (void *) 0xe40a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1003             :     { (unichar_t *) N_("Sutu"), NULL, 0, 0, (void *) 0x430, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1004             :     { (unichar_t *) N_("Swahili (Kenyan)"), NULL, 0, 0, (void *) 0x441, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1005             :     { (unichar_t *) N_("Swedish (Sweden)"), NULL, 0, 0, (void *) 0x41d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1006             :     { (unichar_t *) N_("Swedish (Finland)"), NULL, 0, 0, (void *) 0x81d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1007             :     { (unichar_t *) N_("Lang|Syriac"), NULL, 0, 0, (void *) 0x45a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1008             :     { (unichar_t *) N_("Lang|Tagalog"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1009             :     { (unichar_t *) N_("Tajik"), NULL, 0, 0, (void *) 0x428, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1010             :     { (unichar_t *) N_("Tamazight (Arabic)"), NULL, 0, 0, (void *) 0x45f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1011             :     { (unichar_t *) N_("Tamazight (Latin)"), NULL, 0, 0, (void *) 0x85f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1012             :     { (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) 0x449, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1013             :     { (unichar_t *) N_("Tatar (Tatarstan)"), NULL, 0, 0, (void *) 0x444, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1014             :     { (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) 0x44a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1015             :     { (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) 0x41e, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1016             :     { (unichar_t *) N_("Tibetan (PRC)"), NULL, 0, 0, (void *) 0x451, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1017             :     { (unichar_t *) N_("Tibetan Bhutan"), NULL, 0, 0, (void *) 0x851, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1018             :     { (unichar_t *) N_("Tigrinya Ethiopia"), NULL, 0, 0, (void *) 0x473, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1019             :     { (unichar_t *) N_("Tigrinyan Eritrea"), NULL, 0, 0, (void *) 0x873, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1020             :     { (unichar_t *) N_("Tsonga"), NULL, 0, 0, (void *) 0x431, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1021             :     { (unichar_t *) N_("Tswana"), NULL, 0, 0, (void *) 0x432, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1022             :     { (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) 0x41f, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1023             :     { (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) 0x442, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1024             :     { (unichar_t *) N_("Lang|Uighur"), NULL, 0, 0, (void *) 0x480, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1025             :     { (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) 0x422, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1026             :     { (unichar_t *) N_("Urdu (Pakistan)"), NULL, 0, 0, (void *) 0x420, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1027             :     { (unichar_t *) N_("Urdu (India)"), NULL, 0, 0, (void *) 0x820, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1028             :     { (unichar_t *) N_("Uzbek (Latin)"), NULL, 0, 0, (void *) 0x443, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1029             :     { (unichar_t *) N_("Uzbek (Cyrillic)"), NULL, 0, 0, (void *) 0x843, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1030             :     { (unichar_t *) N_("Venda"), NULL, 0, 0, (void *) 0x433, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1031             :     { (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) 0x42a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1032             :     { (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) 0x452, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1033             :     { (unichar_t *) N_("Xhosa"), NULL, 0, 0, (void *) 0x434, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1034             :     { (unichar_t *) N_("Lang|Yi"), NULL, 0, 0, (void *) 0x478, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1035             :     { (unichar_t *) N_("Yiddish"), NULL, 0, 0, (void *) 0x43d, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1036             :     { (unichar_t *) N_("Yoruba"), NULL, 0, 0, (void *) 0x46a, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1037             :     { (unichar_t *) N_("Zulu"), NULL, 0, 0, (void *) 0x435, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1038             :     GTEXTINFO_EMPTY
    1039             : };
    1040             : /* There is a similar list at the end of python.c, untranslated strings for */
    1041             : /*  scripting use */
    1042             : static GTextInfo ttfnameids[] = {
    1043             : /* Put styles (docs call it subfamily) first because it is most likely to change */
    1044             :     { (unichar_t *) N_("Styles (SubFamily)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1045             :     { (unichar_t *) N_("Copyright"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1046             :     { (unichar_t *) N_("Family"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1047             :     { (unichar_t *) N_("Fullname"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1048             :     { (unichar_t *) N_("UniqueID"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1049             :     { (unichar_t *) N_("Version"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1050             : /* Don't give user access to PostScriptName, we set that elsewhere */
    1051             :     { (unichar_t *) N_("Trademark"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1052             :     { (unichar_t *) N_("Manufacturer"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1053             :     { (unichar_t *) N_("Designer"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1054             :     { (unichar_t *) N_("Descriptor"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1055             :     { (unichar_t *) N_("Vendor URL"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1056             :     { (unichar_t *) N_("Designer URL"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1057             :     { (unichar_t *) N_("License"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1058             :     { (unichar_t *) N_("License URL"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1059             : /* slot 15 is reserved */
    1060             :     { (unichar_t *) N_("Preferred Family"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1061             :     { (unichar_t *) N_("Preferred Styles"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1062             :     { (unichar_t *) N_("Compatible Full"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1063             :     { (unichar_t *) N_("Sample Text"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1064             :     { (unichar_t *) N_("CID findfont Name"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1065             :     { (unichar_t *) N_("WWS Family"), NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1066             :     { (unichar_t *) N_("WWS Subfamily"), NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1067             :     GTEXTINFO_EMPTY
    1068             : };
    1069             : static GTextInfo otfssfeattags[] = {
    1070             : /* These should not be translated. They are tags */
    1071             :     { (unichar_t *) "ss01", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1072             :     { (unichar_t *) "ss02", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1073             :     { (unichar_t *) "ss03", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1074             :     { (unichar_t *) "ss04", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1075             :     { (unichar_t *) "ss05", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1076             :     { (unichar_t *) "ss06", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1077             :     { (unichar_t *) "ss07", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1078             :     { (unichar_t *) "ss08", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1079             :     { (unichar_t *) "ss09", NULL, 0, 0, (void *) (intpt) CHR('s','s','0','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1080             :     { (unichar_t *) "ss10", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1081             :     { (unichar_t *) "ss11", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','1'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1082             :     { (unichar_t *) "ss12", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','2'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1083             :     { (unichar_t *) "ss13", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','3'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1084             :     { (unichar_t *) "ss14", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','4'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1085             :     { (unichar_t *) "ss15", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','5'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1086             :     { (unichar_t *) "ss16", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','6'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1087             :     { (unichar_t *) "ss17", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','7'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1088             :     { (unichar_t *) "ss18", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','8'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1089             :     { (unichar_t *) "ss19", NULL, 0, 0, (void *) (intpt) CHR('s','s','1','9'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1090             :     { (unichar_t *) "ss20", NULL, 0, 0, (void *) (intpt) CHR('s','s','2','0'), NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1091             :     GTEXTINFO_EMPTY
    1092             : };
    1093             : /* Put styles (docs call it subfamily) first because it is most likely to change */
    1094             : static GTextInfo unicoderangenames[] = {
    1095             :     { (unichar_t *) N_("Basic Latin"),                                NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1096             :     { (unichar_t *) N_("Latin-1 Supplement"),                 NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1097             :     { (unichar_t *) N_("Latin Extended-A"),                   NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1098             :     { (unichar_t *) N_("Latin Extended-B"),                   NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1099             :     { (unichar_t *) N_("IPA Extensions"),                     NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1100             :     { (unichar_t *) N_("Spacing Modifier Letters"),           NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1101             :     { (unichar_t *) N_("Combining Diacritical Marks"),                NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1102             :     { (unichar_t *) N_("Greek and Coptic"),                   NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1103             :     { (unichar_t *) N_("Coptic"),                             NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1104             :     { (unichar_t *) N_("Cyrillic & Supplement"),          NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1105             :     { (unichar_t *) N_("Armenian"),                           NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1106             :     { (unichar_t *) N_("Hebrew"),                             NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1107             :     { (unichar_t *) N_("Vai"),                                        NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1108             :     { (unichar_t *) N_("Arabic"),                             NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1109             :     { (unichar_t *) N_("N'Ko"),                                       NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1110             :     { (unichar_t *) N_("Devanagari"),                         NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1111             :     { (unichar_t *) N_("Bengali"),                            NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1112             :     { (unichar_t *) N_("Gurmukhi"),                           NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1113             :     { (unichar_t *) N_("Gujarati"),                           NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1114             :     { (unichar_t *) N_("Oriya"),                              NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1115             :     { (unichar_t *) N_("Tamil"),                              NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1116             :     { (unichar_t *) N_("Telugu"),                             NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1117             :     { (unichar_t *) N_("Kannada"),                            NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1118             :     { (unichar_t *) N_("Malayalam"),                          NULL, 0, 0, (void *) 23, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1119             :     { (unichar_t *) N_("Thai"),                                       NULL, 0, 0, (void *) 24, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1120             :     { (unichar_t *) N_("Lao"),                                        NULL, 0, 0, (void *) 25, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1121             :     { (unichar_t *) N_("Georgian"),                           NULL, 0, 0, (void *) 26, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1122             :     { (unichar_t *) N_("Balinese"),                           NULL, 0, 0, (void *) 27, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1123             :     { (unichar_t *) N_("Hangul Jamo"),                                NULL, 0, 0, (void *) 28, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1124             :     { (unichar_t *) N_("Latin Extended Additional"),          NULL, 0, 0, (void *) 29, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1125             :     { (unichar_t *) N_("Greek Extended"),                     NULL, 0, 0, (void *) 30, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1126             :     { (unichar_t *) N_("General Punctuation"),                        NULL, 0, 0, (void *) 31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1127             :     { (unichar_t *) N_("Subscripts and Superscripts"),                NULL, 0, 0, (void *) 32, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1128             :     { (unichar_t *) N_("Currency Symbols"),                   NULL, 0, 0, (void *) 33, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1129             :     { (unichar_t *) N_("Combining Diacritical Marks for Symbols"), NULL, 0, 0, (void *) 34, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1130             :     { (unichar_t *) N_("Letterlike Symbols"),                 NULL, 0, 0, (void *) 35, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1131             :     { (unichar_t *) N_("Numeric Forms"),                      NULL, 0, 0, (void *) 36, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1132             :     { (unichar_t *) N_("Arrows (& Supplements A&B)"),         NULL, 0, 0, (void *) 37, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1133             :     { (unichar_t *) N_("Mathematical Operators (Suppl. & Misc.)"), NULL, 0, 0, (void *) 38, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1134             :     { (unichar_t *) N_("Miscellaneous Technical"),            NULL, 0, 0, (void *) 39, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1135             :     { (unichar_t *) N_("Control Pictures"),                   NULL, 0, 0, (void *) 40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1136             :     { (unichar_t *) N_("Optical Character Recognition"),      NULL, 0, 0, (void *) 41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1137             :     { (unichar_t *) N_("Enclosed Alphanumerics"),             NULL, 0, 0, (void *) 42, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1138             :     { (unichar_t *) N_("Box Drawing"),                                NULL, 0, 0, (void *) 43, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1139             :     { (unichar_t *) N_("Block Elements"),                     NULL, 0, 0, (void *) 44, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1140             :     { (unichar_t *) N_("Geometric Shapes"),                   NULL, 0, 0, (void *) 45, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1141             :     { (unichar_t *) N_("Miscellaneous Symbols"),              NULL, 0, 0, (void *) 46, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1142             :     { (unichar_t *) N_("Dingbats"),                           NULL, 0, 0, (void *) 47, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1143             :     { (unichar_t *) N_("CJK Symbols and Punctuation"),                NULL, 0, 0, (void *) 48, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1144             :     { (unichar_t *) N_("Hiragana"),                           NULL, 0, 0, (void *) 49, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1145             :     { (unichar_t *) N_("Katakana & Phonetic Extensions"), NULL, 0, 0, (void *) 50, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1146             :     { (unichar_t *) N_("Bopomofo & Extended"),                    NULL, 0, 0, (void *) 51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1147             :     { (unichar_t *) N_("Hangul Compatibility Jamo"),          NULL, 0, 0, (void *) 52, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1148             :     { (unichar_t *) N_("Phags-pa"),                           NULL, 0, 0, (void *) 53, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1149             :     { (unichar_t *) N_("Enclosed CJK Letters and Months"),    NULL, 0, 0, (void *) 54, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1150             :     { (unichar_t *) N_("CJK Compatibility"),                  NULL, 0, 0, (void *) 55, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1151             :     { (unichar_t *) N_("Hangul Syllables"),                   NULL, 0, 0, (void *) 56, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1152             :     { (unichar_t *) N_("Non-Basic Multilingual Plane"),               NULL, 0, 0, (void *) 57, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1153             :     { (unichar_t *) N_("Phoenician"),                         NULL, 0, 0, (void *) 58, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1154             :     { (unichar_t *) N_("CJK Unified Ideographs"),             NULL, 0, 0, (void *) 59, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1155             :                 /* And too much other stuff to put in this string */
    1156             :     { (unichar_t *) N_("Private Use Area"),                   NULL, 0, 0, (void *) 60, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1157             :     { (unichar_t *) N_("CJK Compatibility Ideographs"),               NULL, 0, 0, (void *) 61, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1158             :     { (unichar_t *) N_("Alphabetic Presentation Forms"),      NULL, 0, 0, (void *) 62, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1159             :     { (unichar_t *) N_("Arabic Presentation Forms-A"),                NULL, 0, 0, (void *) 63, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1160             :     { (unichar_t *) N_("Combining Half Marks"),                       NULL, 0, 0, (void *) 64, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1161             :     { (unichar_t *) N_("CJK Compatibility Forms"),            NULL, 0, 0, (void *) 65, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1162             :     { (unichar_t *) N_("Small Form Variants"),                        NULL, 0, 0, (void *) 66, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1163             :     { (unichar_t *) N_("Arabic Presentation Forms-B"),                NULL, 0, 0, (void *) 67, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1164             :     { (unichar_t *) N_("Halfwidth and Fullwidth Forms"),      NULL, 0, 0, (void *) 68, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1165             :     { (unichar_t *) N_("Specials"),                           NULL, 0, 0, (void *) 69, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1166             :     { (unichar_t *) N_("Tibetan"),                            NULL, 0, 0, (void *) 70, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1167             :     { (unichar_t *) N_("Syriac"),                             NULL, 0, 0, (void *) 71, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1168             :     { (unichar_t *) N_("Thaana"),                             NULL, 0, 0, (void *) 72, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1169             :     { (unichar_t *) N_("Sinhala"),                            NULL, 0, 0, (void *) 73, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1170             :     { (unichar_t *) N_("Myanmar"),                            NULL, 0, 0, (void *) 74, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1171             :     { (unichar_t *) N_("Ethiopic"),                           NULL, 0, 0, (void *) 75, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1172             :     { (unichar_t *) N_("Cherokee"),                           NULL, 0, 0, (void *) 76, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1173             :     { (unichar_t *) N_("Unified Canadian Aboriginal Syllabics"),NULL, 0, 0, (void *) 77, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1174             :     { (unichar_t *) N_("Ogham"),                              NULL, 0, 0, (void *) 78, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1175             :     { (unichar_t *) N_("Runic"),                              NULL, 0, 0, (void *) 79, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1176             :     { (unichar_t *) N_("Khmer"),                              NULL, 0, 0, (void *) 80, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1177             :     { (unichar_t *) N_("Mongolian"),                          NULL, 0, 0, (void *) 81, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1178             :     { (unichar_t *) N_("Braille Patterns"),                   NULL, 0, 0, (void *) 82, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1179             :     { (unichar_t *) N_("Yi Syllables/Radicals"),              NULL, 0, 0, (void *) 83, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1180             :     { (unichar_t *) N_("Tagalog/Hanunno/Buhid/Tagbanwa"),     NULL, 0, 0, (void *) 84, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1181             :     { (unichar_t *) N_("Old Italic"),                         NULL, 0, 0, (void *) 85, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1182             :     { (unichar_t *) N_("Gothic"),                             NULL, 0, 0, (void *) 86, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1183             :     { (unichar_t *) N_("Deseret"),                            NULL, 0, 0, (void *) 87, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1184             :     { (unichar_t *) N_("Musical Symbols, Byzantine & Western"), NULL, 0, 0, (void *) 88, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1185             :     { (unichar_t *) N_("Mathematical Alphanumeric Symbols"),  NULL, 0, 0, (void *) 89, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1186             :     { (unichar_t *) N_("Private Use (planes 15&16)"),             NULL, 0, 0, (void *) 90, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1187             :     { (unichar_t *) N_("Variation Selectors"),                        NULL, 0, 0, (void *) 91, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1188             :     { (unichar_t *) N_("Tags"),                                       NULL, 0, 0, (void *) 92, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1189             :     { (unichar_t *) N_("Limbu"),                              NULL, 0, 0, (void *) 93, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1190             :     { (unichar_t *) N_("Tai Le"),                             NULL, 0, 0, (void *) 94, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1191             :     { (unichar_t *) N_("New Tai Lue"),                                NULL, 0, 0, (void *) 95, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1192             :     { (unichar_t *) N_("Buginese"),                           NULL, 0, 0, (void *) 96, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1193             :     { (unichar_t *) N_("Glagolitic"),                         NULL, 0, 0, (void *) 97, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1194             :     { (unichar_t *) N_("Tifinagh"),                           NULL, 0, 0, (void *) 98, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1195             :     { (unichar_t *) N_("Yijing Hexagram Symbols"),            NULL, 0, 0, (void *) 99, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1196             :     { (unichar_t *) N_("Syloti Nagri"),                               NULL, 0, 0, (void *) 100, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1197             :     { (unichar_t *) N_("Linear B Syllabary/Ideograms, Agean Num."),   NULL, 0, 0, (void *) 101, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1198             :     { (unichar_t *) N_("Ancient Greek Numbers"),              NULL, 0, 0, (void *) 102, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1199             :     { (unichar_t *) N_("Ugaritic"),                           NULL, 0, 0, (void *) 103, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1200             :     { (unichar_t *) N_("Old Persian"),                                NULL, 0, 0, (void *) 104, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1201             :     { (unichar_t *) N_("Shavian"),                            NULL, 0, 0, (void *) 105, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1202             :     { (unichar_t *) N_("Osmanya"),                            NULL, 0, 0, (void *) 106, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1203             :     { (unichar_t *) N_("Cypriot Syllabary"),                  NULL, 0, 0, (void *) 107, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1204             :     { (unichar_t *) N_("Kharoshthi"),                         NULL, 0, 0, (void *) 108, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1205             :     { (unichar_t *) N_("Tai Xuan Jing Symbols"),              NULL, 0, 0, (void *) 109, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1206             :     { (unichar_t *) N_("Cuneiform Numbers & Punctuation"),        NULL, 0, 0, (void *) 110, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1207             :     { (unichar_t *) N_("Counting Rod Numerals"),              NULL, 0, 0, (void *) 111, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1208             :     { (unichar_t *) N_("Sudanese"),                           NULL, 0, 0, (void *) 112, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1209             :     { (unichar_t *) N_("Lepcha"),                             NULL, 0, 0, (void *) 113, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1210             :     { (unichar_t *) N_("Ol Chiki"),                           NULL, 0, 0, (void *) 114, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1211             :     { (unichar_t *) N_("Saurashtra"),                         NULL, 0, 0, (void *) 115, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1212             :     { (unichar_t *) N_("Kayah Li"),                           NULL, 0, 0, (void *) 116, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1213             :     { (unichar_t *) N_("Rejang"),                             NULL, 0, 0, (void *) 117, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1214             :     { (unichar_t *) N_("Cham"),                                       NULL, 0, 0, (void *) 118, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1215             :     { (unichar_t *) N_("Ancient Symbols"),                    NULL, 0, 0, (void *) 119, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1216             :     { (unichar_t *) N_("Phaistos Disc"),                      NULL, 0, 0, (void *) 120, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1217             :     { (unichar_t *) N_("Carian/Lycian/Lydian"),                       NULL, 0, 0, (void *) 121, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1218             :     { (unichar_t *) N_("Mahjong & Domino Tiles"),         NULL, 0, 0, (void *) 122, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1219             :     { (unichar_t *) N_("Unassigned Bit 123"),                 NULL, 0, 0, (void *) 123, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1220             :     { (unichar_t *) N_("Unassigned Bit 124"),                 NULL, 0, 0, (void *) 124, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1221             :     { (unichar_t *) N_("Unassigned Bit 125"),                 NULL, 0, 0, (void *) 125, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1222             :     { (unichar_t *) N_("Unassigned Bit 126"),                 NULL, 0, 0, (void *) 126, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1223             :     { (unichar_t *) N_("Unassigned Bit 127"),                 NULL, 0, 0, (void *) 127, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1224             :     GTEXTINFO_EMPTY
    1225             : };
    1226             : static GTextInfo codepagenames[] = {
    1227             :     { (unichar_t *) N_("1252, Latin-1"),                      NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1228             :     { (unichar_t *) N_("1250, Latin-2 (Eastern Europe)"),     NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1229             :     { (unichar_t *) N_("1251, Cyrillic"),                     NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1230             :     { (unichar_t *) N_("1253, Greek"),                                NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1231             :     { (unichar_t *) N_("1254, Turkish"),                      NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1232             :     { (unichar_t *) N_("1255, Hebrew"),                               NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1233             :     { (unichar_t *) N_("1256, Arabic"),                               NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1234             :     { (unichar_t *) N_("1257, Windows Baltic"),                       NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1235             :     { (unichar_t *) N_("1258, Vietnamese"),                   NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1236             :     { (unichar_t *) N_("Reserved Bit 9"),                     NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1237             :     { (unichar_t *) N_("Reserved Bit 10"),                    NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1238             :     { (unichar_t *) N_("Reserved Bit 11"),                    NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1239             :     { (unichar_t *) N_("Reserved Bit 12"),                    NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1240             :     { (unichar_t *) N_("Reserved Bit 13"),                    NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1241             :     { (unichar_t *) N_("Reserved Bit 14"),                    NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1242             :     { (unichar_t *) N_("Reserved Bit 15"),                    NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1243             :     { (unichar_t *) N_("874, Thai"),                          NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1244             :     { (unichar_t *) N_("932, JIS/Japan"),                     NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1245             :     { (unichar_t *) N_("936, Simplified Chinese"),            NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1246             :     { (unichar_t *) N_("949, Korean Wansung"),                        NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1247             :     { (unichar_t *) N_("950, Traditional Chinese"),           NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1248             :     { (unichar_t *) N_("1361, Korean Johab"),                 NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1249             :     { (unichar_t *) N_("Reserved Bit 22"),                    NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1250             :     { (unichar_t *) N_("Reserved Bit 23"),                    NULL, 0, 0, (void *) 23, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1251             :     { (unichar_t *) N_("Reserved Bit 24"),                    NULL, 0, 0, (void *) 24, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1252             :     { (unichar_t *) N_("Reserved Bit 25"),                    NULL, 0, 0, (void *) 25, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1253             :     { (unichar_t *) N_("Reserved Bit 26"),                    NULL, 0, 0, (void *) 26, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1254             :     { (unichar_t *) N_("Reserved Bit 27"),                    NULL, 0, 0, (void *) 27, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1255             :     { (unichar_t *) N_("Reserved Bit 28"),                    NULL, 0, 0, (void *) 28, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1256             :     { (unichar_t *) N_("Mac Roman"),                          NULL, 0, 0, (void *) 29, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1257             :     { (unichar_t *) N_("OEM Charset"),                                NULL, 0, 0, (void *) 30, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1258             :     { (unichar_t *) N_("Symbol Charset"),                     NULL, 0, 0, (void *) 31, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1259             :     { (unichar_t *) N_("Reserved Bit 32"),                    NULL, 0, 0, (void *) 32, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1260             :     { (unichar_t *) N_("Reserved Bit 33"),                    NULL, 0, 0, (void *) 33, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1261             :     { (unichar_t *) N_("Reserved Bit 34"),                    NULL, 0, 0, (void *) 34, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1262             :     { (unichar_t *) N_("Reserved Bit 35"),                    NULL, 0, 0, (void *) 35, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1263             :     { (unichar_t *) N_("Reserved Bit 36"),                    NULL, 0, 0, (void *) 36, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1264             :     { (unichar_t *) N_("Reserved Bit 37"),                    NULL, 0, 0, (void *) 37, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1265             :     { (unichar_t *) N_("Reserved Bit 38"),                    NULL, 0, 0, (void *) 38, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1266             :     { (unichar_t *) N_("Reserved Bit 39"),                    NULL, 0, 0, (void *) 39, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1267             :     { (unichar_t *) N_("Reserved Bit 40"),                    NULL, 0, 0, (void *) 40, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1268             :     { (unichar_t *) N_("Reserved Bit 41"),                    NULL, 0, 0, (void *) 41, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1269             :     { (unichar_t *) N_("Reserved Bit 42"),                    NULL, 0, 0, (void *) 42, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1270             :     { (unichar_t *) N_("Reserved Bit 43"),                    NULL, 0, 0, (void *) 43, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1271             :     { (unichar_t *) N_("Reserved Bit 44"),                    NULL, 0, 0, (void *) 44, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1272             :     { (unichar_t *) N_("Reserved Bit 45"),                    NULL, 0, 0, (void *) 45, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1273             :     { (unichar_t *) N_("Reserved Bit 46"),                    NULL, 0, 0, (void *) 46, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1274             :     { (unichar_t *) N_("Reserved Bit 47"),                    NULL, 0, 0, (void *) 47, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1275             :     { (unichar_t *) N_("869, IBM Greek"),                     NULL, 0, 0, (void *) 48, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1276             :     { (unichar_t *) N_("866, MS-DOS Russian"),                        NULL, 0, 0, (void *) 49, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1277             :     { (unichar_t *) N_("865, MS_DOS Nordic"),                 NULL, 0, 0, (void *) 50, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1278             :     { (unichar_t *) N_("864, Arabic"),                                NULL, 0, 0, (void *) 51, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1279             :     { (unichar_t *) N_("863, MS-DOS Canadian French"),                NULL, 0, 0, (void *) 52, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1280             :     { (unichar_t *) N_("862, Hebrew"),                                NULL, 0, 0, (void *) 53, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1281             :     { (unichar_t *) N_("861, MS-DOS Icelandic"),              NULL, 0, 0, (void *) 54, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1282             :     { (unichar_t *) N_("860, MS-DOS Portuguese"),             NULL, 0, 0, (void *) 55, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1283             :     { (unichar_t *) N_("857, IBM Turkish"),                   NULL, 0, 0, (void *) 56, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1284             :     { (unichar_t *) N_("855, IBM Cyrillic; primarily Russian"),       NULL, 0, 0, (void *) 57, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1285             :     { (unichar_t *) N_("852, Latin 2"),                               NULL, 0, 0, (void *) 58, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1286             :     { (unichar_t *) N_("775, MS-DOS Baltic"),                 NULL, 0, 0, (void *) 59, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1287             :     { (unichar_t *) N_("737, Greek; former 437 G"),           NULL, 0, 0, (void *) 60, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1288             :     { (unichar_t *) N_("708, Arabic ASMO 708"),                       NULL, 0, 0, (void *) 61, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1289             :     { (unichar_t *) N_("850, WE/Latin 1"),                    NULL, 0, 0, (void *) 62, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1290             :     { (unichar_t *) N_("437, US"),                            NULL, 0, 0, (void *) 63, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1291             :     GTEXTINFO_EMPTY
    1292             : };
    1293             : static char *TN_DefaultName(GGadget *g, int r, int c);
    1294             : static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c);
    1295             : static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c);
    1296             : static struct col_init ci[] = {
    1297             :     { me_enum, NULL, mslanguages, TN_LangEnable, N_("Language") },
    1298             :     { me_enum, NULL, ttfnameids, TN_StrIDEnable, N_("String ID") },
    1299             :     { me_func, TN_DefaultName, NULL, NULL, N_("String") }
    1300             : };
    1301             : static struct col_init ssci[] = {
    1302             :     { me_enum, NULL, mslanguages, NULL, N_("Language") },
    1303             :     { me_enum, NULL, otfssfeattags, NULL, N_("Feature Tags") },
    1304             :     { me_string, NULL, NULL, NULL, N_("Friendly Name") }
    1305             : };
    1306             : static struct col_init sizeci[] = {
    1307             :     { me_enum, NULL, mslanguages, NULL, N_("Language") },
    1308             :     { me_string, NULL, NULL, NULL, N_("Name") }
    1309             : };
    1310             : static GTextInfo gridfit[] = {
    1311             :     { (unichar_t *) N_("No Grid Fit"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1312             :     { (unichar_t *) N_("Grid Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1313             :     GTEXTINFO_EMPTY
    1314             : };
    1315             : static GTextInfo antialias[] = {
    1316             :     { (unichar_t *) N_("No Anti-Alias"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1317             :     { (unichar_t *) N_("Anti-Alias"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1318             :     GTEXTINFO_EMPTY
    1319             : };
    1320             : static GTextInfo symsmooth[] = {
    1321             :     { (unichar_t *) N_("No Symmetric-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1322             :     { (unichar_t *) N_("Symmetric-Smoothing"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1323             :     GTEXTINFO_EMPTY
    1324             : };
    1325             : static GTextInfo gfsymsmooth[] = {
    1326             :     { (unichar_t *) N_("No Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1327             :     { (unichar_t *) N_("Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1328             :     GTEXTINFO_EMPTY
    1329             : };
    1330             : static struct col_init gaspci[] = {
    1331             :     { me_int , NULL, NULL, NULL, N_("Gasp|For Pixels Per EM <= Value") },
    1332             :     { me_enum, NULL, gridfit, NULL, N_("Gasp|Grid Fit") },                    /* 1 */
    1333             :     { me_enum, NULL, antialias, NULL, N_("Gasp|Anti-Alias") },                        /* 2 */
    1334             :     { me_enum, NULL, symsmooth, NULL, N_("Gasp|Symmetric Smoothing") },               /* 8 */
    1335             :     { me_enum, NULL, gfsymsmooth, NULL, N_("Gasp|Grid Fit w/ Sym Smooth") }   /* 4 */
    1336             : };
    1337             : static GTextInfo splineorder[] = {
    1338             :     { (unichar_t *) N_("Cubic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1339             :     { (unichar_t *) N_("Quadratic"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1340             :     GTEXTINFO_EMPTY
    1341             : };
    1342             : static GTextInfo layertype[] = {
    1343             :     { (unichar_t *) N_("Layer|Foreground"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 0, '\0'},
    1344             :     { (unichar_t *) N_("Layer|Background"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1345             :     GTEXTINFO_EMPTY
    1346             : };
    1347             : static void Layers_BackgroundEnable(GGadget *g,GMenuItem *mi, int r, int c);
    1348             : static struct col_init layersci[] = {
    1349             :     { me_string, NULL, NULL, NULL, N_("Layer Name") },
    1350             :     { me_enum  , NULL, splineorder, NULL, N_("Curve Type") },
    1351             :     { me_enum  , NULL, layertype, Layers_BackgroundEnable, N_("Type") },
    1352             :     { me_int   , NULL, NULL, NULL, N_("Orig layer") }
    1353             : };
    1354             : static char *GFI_Mark_PickGlyphsForClass(GGadget *g,int r, int c);
    1355             : static struct col_init marks_ci[] = {
    1356             :     { me_string, NULL, NULL, NULL, N_("Set Name") },
    1357             :     { me_funcedit, GFI_Mark_PickGlyphsForClass, NULL, NULL, N_("Glyphs in the set") },
    1358             : };
    1359             : static struct col_init markc_ci[] = {
    1360             :     { me_string, NULL, NULL, NULL, N_("Class Name") },
    1361             :     { me_funcedit, GFI_Mark_PickGlyphsForClass, NULL, NULL, N_("Glyphs in the class") },
    1362             : };
    1363             : 
    1364             : struct langstyle { int lang; const char *str; };
    1365             : #define LANGSTYLE_EMPTY { 0, NULL }
    1366             : 
    1367             : static const char regulareng[] = "Regular";
    1368             : static const char demiboldeng[] = "DemiBold";
    1369             : static const char demiboldeng3[] = "Demi";
    1370             : static const char demiboldeng5[] = "SemiBold";
    1371             : static const char boldeng[] = "Bold";
    1372             : static const char thineng[] = "Thin";
    1373             : static const char lighteng[] = "Light";
    1374             : static const char extralighteng[] = "ExtraLight";
    1375             : static const char extralighteng2[] = "VeryLight";
    1376             : static const char mediumeng[] = "Medium";
    1377             : static const char bookeng[] = "Book";
    1378             : static const char heavyeng[] = "Heavy";
    1379             : static const char blackeng[] = "Black";
    1380             : static const char italiceng[] = "Italic";
    1381             : static const char obliqueeng[] = "Oblique";
    1382             : static const char condensedeng[] = "Condensed";
    1383             : static const char expandedeng[] = "Expanded";
    1384             : static const char outlineeng[] = "Outline";
    1385             : 
    1386             : static const char regularfren[] = "Normal";
    1387             : static const char boldfren[] = "Gras";
    1388             : static const char demiboldfren[] = "DemiGras";
    1389             : static const char demiboldfren2[] = "Demi";
    1390             : static const char mediumfren[] = "Normal";
    1391             : static const char lightfren[] = "Maigre";
    1392             : static const char blackfren[] = "ExtraGras";
    1393             : static const char italicfren[] = "Italique";
    1394             : static const char obliquefren[] = "Oblique";
    1395             : static const char condensedfren[] = "Etroite";
    1396             : static const char expandedfren[] = "Elargi";
    1397             : static const char outlinefren[] = "Contour";
    1398             : 
    1399             : static const char regulargerm[] = "Standard";
    1400             : static const char demiboldgerm[] = "Halbfett";
    1401             : static const char demiboldgerm2[] = "Schmallfett";
    1402             : static const char boldgerm[] = "Fett";
    1403             : static const char boldgerm2[] = "Dick";
    1404             : static const char blackgerm[] = "Schwarz";
    1405             : static const char lightgerm[] = "Mager";
    1406             : static const char mediumgerm[] = "Mittel";
    1407             : static const char bookgerm[] = "Buchschrift";
    1408             : static const char italicgerm[] = "Kursiv";
    1409             : static const char obliquegerm[] = "Schräg";
    1410             : static const char condensedgerm[] = "Schmal";
    1411             : static const char expandedgerm[] = "Breit";
    1412             : static const char outlinegerm[] = "Konturert";
    1413             : 
    1414             : static const char regularspan[] = "Normal";
    1415             : static const char boldspan[] = "Negrita";
    1416             : static const char lightspan[] = "Fina";
    1417             : static const char blackspan[] = "Supernegra";
    1418             : static const char italicspan[] = "Cursiva";
    1419             : static const char condensedspan[] = "Condensada";
    1420             : static const char expandedspan[] = "Amplida";
    1421             : 
    1422             : static const char regulardutch[] = "Normaal";
    1423             : static const char mediumdutch[] = "Gemiddeld";
    1424             : static const char bookdutch[] = "Boek";
    1425             : static const char bolddutch[] = "Vet";
    1426             : static const char demibolddutch[] = "Dik";
    1427             : /*static const char demibolddutch[] = "Halfvet";*/
    1428             : static const char lightdutch[] = "Licht";
    1429             : /*static const char lightdutch[] = "Licht mager";*/
    1430             : static const char blackdutch[] = "Extra vet";
    1431             : static const char italicdutch[] = "Cursief";
    1432             : static const char italicdutch2[] = "italiek";
    1433             : static const char obliquedutch2[] = "oblique";
    1434             : static const char obliquedutch[] = "Schuin";
    1435             : static const char condenseddutch[] = "Smal";
    1436             : static const char expandeddutch[] = "Breed";
    1437             : static const char outlinedutch[] = "Uitlijning";
    1438             : /*static const char outlinedutch[] = "Contour";*/
    1439             : 
    1440             : static const char regularswed[] = "Mager";
    1441             : static const char boldswed[] = "Fet";
    1442             : static const char lightswed[] = "Extrafin";
    1443             : static const char blackswed[] = "Extrafet";
    1444             : static const char italicswed[] = "Kursiv";
    1445             : static const char condensedswed[] = "Smal";
    1446             : static const char expandedswed[] = "Bred";
    1447             : 
    1448             : static const char regulardanish[] = "Normal";
    1449             : static const char bolddanish[] = "Fed";
    1450             : static const char demibolddanish[] = "Halvfed";
    1451             : static const char lightdanish[] = "Fin";
    1452             : static const char mediumdanish[] = "Medium";
    1453             : static const char blackdanish[] = "Extrafed";
    1454             : static const char italicdanish[] = "Kursiv";
    1455             : static const char condenseddanish[] = "Smal";
    1456             : static const char expandeddanish[] = "Bred";
    1457             : static const char outlinedanish[] = "Kontour";
    1458             : 
    1459             : static const char regularnor[] = "Vanlig";
    1460             : static const char boldnor[] = "Halvfet";
    1461             : static const char lightnor[] = "Mager";
    1462             : static const char blacknor[] = "Fet";
    1463             : static const char italicnor[] = "Kursiv";
    1464             : static const char condensednor[] = "Smal";
    1465             : static const char expandednor[] = "Sperret";
    1466             : 
    1467             : static const char regularital[] = "Normale";
    1468             : static const char demiboldital[] = "Nerretto";
    1469             : static const char boldital[] = "Nero";
    1470             : static const char thinital[] = "Fine";
    1471             : static const char lightital[] = "Chiaro";
    1472             : static const char mediumital[] = "Medio";
    1473             : static const char bookital[] = "Libro";
    1474             : static const char heavyital[] = "Nerissimo";
    1475             : static const char blackital[] = "ExtraNero";
    1476             : static const char italicital[] = "Cursivo";
    1477             : static const char obliqueital[] = "Obliquo";
    1478             : static const char condensedital[] = "Condensato";
    1479             : static const char expandedital[] = "Allargato";
    1480             : 
    1481             : static const char regularru[] = "Обычный";
    1482             : static const char demiboldru[] = "Полужирный";
    1483             : static const char boldru[] = "Обычный";
    1484             : static const char heavyru[] = "Сверхжирный";
    1485             : static const char blackru[] = "Чёрный";
    1486             : static const char thinru[] = "Тонкий";
    1487             : static const char lightru[] = "Светлый";
    1488             : static const char italicru[] = "Курсив";
    1489             : static const char obliqueru[] = "Наклон";
    1490             : static const char condensedru[] = "Узкий";
    1491             : static const char expandedru[] = "Широкий";
    1492             : 
    1493             : static const char regularhu[] = "Normál";
    1494             : static const char demiboldhu[] = "Negyedkövér";
    1495             : static const char demiboldhu2[] = "Félkövér";
    1496             : static const char boldhu[] = "Félkövér";
    1497             : static const char boldhu2[] = "Háromnegyedkövér";
    1498             : static const char thinhu[] = "Sovány";
    1499             : static const char lighthu[] = "Világos";
    1500             : static const char mediumhu[] = "Közepes";
    1501             : static const char bookhu[] = "Halvány";
    1502             : static const char bookhu2[] = "Könyv";
    1503             : static const char heavyhu[] = "Kövér";
    1504             : static const char heavyhu2[] = "Extrakövér";
    1505             : static const char blackhu[] = "Fekete";
    1506             : static const char blackhu2[] = "Sötét";
    1507             : static const char italichu[] = "Dőlt";
    1508             : static const char obliquehu[] = "Döntött";
    1509             : static const char obliquehu2[] = "Ferde";
    1510             : static const char condensedhu[] = "Keskeny";
    1511             : static const char expandedhu[] = "Széles";
    1512             : static const char outlinehu[] = "Kontúros";
    1513             : 
    1514             : static const char regularpl[] = "podstawowa";
    1515             : static const char demiboldpl[] = "półgruba";
    1516             : static const char boldpl[] = "pogrubiona";
    1517             : static const char thinpl[] = "cienka";
    1518             : static const char lightpl[] = "bardzo cienka";
    1519             : static const char heavypl[] = "bardzo gruba";
    1520             : static const char italicpl[] = "pochyła";
    1521             : static const char obliquepl[] = "pochyła";
    1522             : static const char condensedpl[] = "wąska";
    1523             : static const char expandedpl[] = "szeroka";
    1524             : static const char outlinepl[] = "konturowa";
    1525             : static const char mediumpl[] = "zwykła";
    1526             : static const char bookpl[] = "zwykła";
    1527             : 
    1528             : static struct langstyle regs[] = { {0x409, regulareng}, { 0x40c, regularfren }, { 0x410, regularital }, { 0x407, regulargerm }, { 0x40a, regularspan }, { 0x419, regularru }, { 0x40e, regularhu },
    1529             :         { 0x413, regulardutch}, { 0x41d, regularswed }, { 0x414, regularnor },
    1530             :         { 0x406, regulardanish}, {0x415, regularpl }, { 0x804, "正常"},
    1531             :         { 0x408, "κανονική"}, { 0x42a, "Chuẩn"}, { 0x418, "Normal"}, LANGSTYLE_EMPTY};
    1532             : static struct langstyle meds[] = { {0x409, mediumeng}, { 0x410, mediumital },
    1533             :         { 0x40c, mediumfren }, { 0x407, mediumgerm }, { 0x40e, mediumhu },
    1534             :         { 0x406, mediumdanish}, {0x415, mediumpl }, { 0x804, "中等"},
    1535             :         { 0x408, "µεσαία"}, { 0x42a, "Vừa"}, { 0x413, mediumdutch},
    1536             :         { 0x418, "Mediu"}, LANGSTYLE_EMPTY};
    1537             : static struct langstyle books[] = { {0x409, bookeng}, { 0x410, bookital },
    1538             :         { 0x407, bookgerm }, { 0x40e, bookhu }, { 0x40e, bookhu2 },
    1539             :         { 0x415, bookpl}, { 0x804, "书体"}, { 0x408, "ßιßλίου"},
    1540             :         { 0x42a, "Sách"}, { 0x413, bookdutch}, { 0x418, "Carte"}, LANGSTYLE_EMPTY};
    1541             : static struct langstyle bolds[] = { {0x409, boldeng}, { 0x410, boldital }, { 0x40c, boldfren }, { 0x407, boldgerm }, { 0x407, boldgerm2 }, { 0x40a, boldspan}, { 0x419, boldru }, { 0x40e, boldhu }, { 0x40e, boldhu2 },
    1542             :         { 0x413, bolddutch}, { 0x41d, boldswed }, { 0x414, boldnor },
    1543             :         { 0x406, bolddanish}, { 0x415, boldpl}, { 0x804, "粗体"},
    1544             :         { 0x408, "έντονη"}, { 0x42a, "Đậm"}, {0x418,"Aldin"}, LANGSTYLE_EMPTY};
    1545             : static struct langstyle italics[] = { {0x409, italiceng}, { 0x410, italicital }, { 0x40c, italicfren }, { 0x407, italicgerm }, { 0x40a, italicspan}, { 0x419, italicru }, { 0x40e, italichu },
    1546             :         { 0x413, italicdutch}, { 0x413, italicdutch2}, { 0x41d, italicswed }, { 0x414, italicnor },
    1547             :         { 0x406, italicdanish}, { 0x415, italicpl}, { 0x804, "斜体"},
    1548             :         { 0x408, "Λειψίας"}, { 0x42a, "Nghiêng" }, { 0x418, "Cursiv"},  LANGSTYLE_EMPTY};
    1549             : static struct langstyle obliques[] = { {0x409, obliqueeng}, { 0x410, obliqueital },
    1550             :         { 0x40c, obliquefren }, { 0x407, obliquegerm }, { 0x419, obliqueru },
    1551             :         { 0x40e, obliquehu }, { 0x40e, obliquehu2 }, {0x415, obliquepl},
    1552             :         { 0x804, "斜体"}, { 0x408, "πλάγια"},
    1553             :         { 0x42a, "Xiên" }, { 0x413, obliquedutch}, { 0x413, obliquedutch2},
    1554             :         { 0x418, "Înclinat"}, LANGSTYLE_EMPTY};
    1555             : static struct langstyle demibolds[] = { {0x409, demiboldeng}, {0x409, demiboldeng3}, {0x409, demiboldeng5},
    1556             :         { 0x410, demiboldital }, { 0x40c, demiboldfren }, { 0x40c, demiboldfren2 }, { 0x407, demiboldgerm }, { 0x407, demiboldgerm2 },
    1557             :         { 0x419, demiboldru }, { 0x40e, demiboldhu }, { 0x40e, demiboldhu2 },
    1558             :         { 0x406, demibolddanish}, { 0x415, demiboldpl },
    1559             :         { 0x804, "略粗"}, { 0x408, "ηµιέντονη"},
    1560             :         { 0x42a, "Nửa đậm"}, { 0x413, demibolddutch},
    1561             :         {0x418, "Semialdin"}, LANGSTYLE_EMPTY};
    1562             : static struct langstyle heavys[] = { {0x409, heavyeng}, { 0x410, heavyital },
    1563             :         { 0x419, heavyru }, { 0x40e, heavyhu }, { 0x40e, heavyhu2 },
    1564             :         { 0x415, heavypl }, { 0x804, "粗"}, LANGSTYLE_EMPTY};
    1565             : static struct langstyle blacks[] = { {0x409, blackeng}, { 0x410, blackital }, { 0x40c, blackfren }, { 0x407, blackgerm }, { 0x419, blackru }, { 0x40e, blackhu }, { 0x40e, blackhu2 }, { 0x40a, blackspan },
    1566             :         { 0x413, blackdutch}, { 0x41d, blackswed }, { 0x414, blacknor }, { 0x406, blackdanish},
    1567             :         { 0x415, heavypl }, { 0x804, "黑"},  { 0x408, "µαύρα"},
    1568             :         { 0x42a, "Đen"}, { 0x418, "Negru"}, LANGSTYLE_EMPTY };
    1569             : static struct langstyle thins[] = { {0x409, thineng}, { 0x410, thinital },
    1570             :         { 0x419, thinru }, { 0x40e, thinhu }, { 0x415, thinpl},
    1571             :         { 0x804, "细"}, LANGSTYLE_EMPTY};
    1572             : static struct langstyle extralights[] = { {0x409, extralighteng}, {0x409, extralighteng2},
    1573             :         { 0x804, "极细"}, LANGSTYLE_EMPTY};
    1574             : static struct langstyle lights[] = { {0x409, lighteng}, {0x410, lightital}, {0x40c, lightfren}, {0x407, lightgerm}, { 0x419, lightru }, { 0x40e, lighthu }, { 0x40a, lightspan },
    1575             :         { 0x413, lightdutch}, { 0x41d, lightswed }, { 0x414, lightnor },
    1576             :         { 0x406, lightdanish}, { 0x415, lightpl}, { 0x804, "细"},
    1577             :         { 0x408, "λεπτή"}, { 0x42a, "Nhẹ" }, { 0x418, "Subțire"}, LANGSTYLE_EMPTY};
    1578             : static struct langstyle condenseds[] = { {0x409, condensedeng}, {0x410, condensedital}, {0x40c, condensedfren}, {0x407, condensedgerm}, { 0x419, condensedru }, { 0x40e, condensedhu }, { 0x40a, condensedspan },
    1579             :         { 0x413, condenseddutch}, { 0x41d, condensedswed },
    1580             :         { 0x414, condensednor }, { 0x406, condenseddanish},
    1581             :         { 0x415, condensedpl }, { 0x804, "压缩"},
    1582             :         { 0x408, "πυκνή"}, { 0x42a, "Hẹp" }, { 0x418, "Îngust"}, LANGSTYLE_EMPTY};
    1583             : static struct langstyle expandeds[] = { {0x409, expandedeng}, {0x410, expandedital}, {0x40c, expandedfren}, {0x407, expandedgerm}, { 0x419, expandedru }, { 0x40e, expandedhu }, { 0x40a, expandedspan },
    1584             :         { 0x413, expandeddutch}, { 0x41d, expandedswed }, { 0x414, expandednor },
    1585             :         { 0x406, expandeddanish}, { 0x415, expandedpl }, { 0x804, "加宽"},
    1586             :         { 0x408, "αραιή"}, { 0x42a, "Rộng" }, { 0x418, "Expandat"}, LANGSTYLE_EMPTY};
    1587             : static struct langstyle outlines[] = { {0x409, outlineeng}, {0x40c, outlinefren},
    1588             :         {0x407, outlinegerm}, {0x40e, outlinehu}, { 0x406, outlinedanish},
    1589             :         {0x415, outlinepl}, { 0x804, "轮廓"}, { 0x408, "περιγράμματος"},
    1590             :         {0x42a, "Nét ngoài" }, { 0x413, outlinedutch}, {0x418, "Contur"}, LANGSTYLE_EMPTY};
    1591             : static struct langstyle *stylelist[] = {regs, meds, books, demibolds, bolds, heavys, blacks,
    1592             :         extralights, lights, thins, italics, obliques, condenseds, expandeds, outlines, NULL };
    1593             : 
    1594             : #define CID_Features    101             /* Mac stuff */
    1595             : #define CID_FeatureDel  103
    1596             : #define CID_FeatureEdit 105
    1597             : 
    1598             : #define CID_Family      1002
    1599             : #define CID_Weight      1003
    1600             : #define CID_ItalicAngle 1004
    1601             : #define CID_UPos        1005
    1602             : #define CID_UWidth      1006
    1603             : #define CID_Ascent      1007
    1604             : #define CID_Descent     1008
    1605             : #define CID_Notice      1010
    1606             : #define CID_Version     1011
    1607             : #define CID_UniqueID    1012
    1608             : #define CID_HasVerticalMetrics  1013
    1609             : #define CID_Fontname    1016
    1610             : #define CID_Em          1017
    1611             : #define CID_Scale       1018
    1612             : #define CID_Interpretation      1021
    1613             : #define CID_Namelist    1024
    1614             : #define CID_Revision    1025
    1615             : 
    1616             : #define CID_WoffMajor   1050
    1617             : #define CID_WoffMinor   1051
    1618             : #define CID_WoffMetadata        1052
    1619             : 
    1620             : #define CID_XUID        1113
    1621             : #define CID_Human       1114
    1622             : #define CID_SameAsFontname      1115
    1623             : #define CID_HasDefBase  1116
    1624             : #define CID_DefBaseName 1117
    1625             : #define CID_UseXUID     1118
    1626             : #define CID_UseUniqueID 1119
    1627             : 
    1628             : #define CID_GuideOrder2         1200
    1629             : #define CID_IsMixed             1217
    1630             : #define CID_IsOrder3            1218
    1631             : #define CID_IsOrder2            1219
    1632             : #define CID_IsMultiLayer        1220
    1633             : #define CID_IsStrokedFont       1222
    1634             : #define CID_StrokeWidth         1223
    1635             : #define CID_Backgrounds         1226
    1636             : 
    1637             : #define CID_Private             2001
    1638             : #define CID_Guess               2004
    1639             : #define CID_Hist                2006
    1640             : 
    1641             : #define CID_TTFTabs             3000
    1642             : #define CID_WeightClass         3001
    1643             : #define CID_WidthClass          3002
    1644             : #define CID_PFMFamily           3003
    1645             : #define CID_FSType              3004
    1646             : #define CID_NoSubsetting        3005
    1647             : #define CID_OnlyBitmaps         3006
    1648             : #define CID_LineGap             3007
    1649             : #define CID_VLineGap            3008
    1650             : #define CID_VLineGapLab         3009
    1651             : #define CID_WinAscent           3010
    1652             : #define CID_WinAscentLab        3011
    1653             : #define CID_WinAscentIsOff      3012
    1654             : #define CID_WinDescent          3013
    1655             : #define CID_WinDescentLab       3014
    1656             : #define CID_WinDescentIsOff     3015
    1657             : #define CID_TypoAscent          3016
    1658             : #define CID_TypoAscentLab       3017
    1659             : #define CID_TypoAscentIsOff     3018
    1660             : #define CID_TypoDescent         3019
    1661             : #define CID_TypoDescentLab      3020
    1662             : #define CID_TypoDescentIsOff    3021
    1663             : #define CID_TypoLineGap         3022
    1664             : #define CID_HHeadAscent         3023
    1665             : #define CID_HHeadAscentLab      3024
    1666             : #define CID_HHeadAscentIsOff    3025
    1667             : #define CID_HHeadDescent        3026
    1668             : #define CID_HHeadDescentLab     3027
    1669             : #define CID_HHeadDescentIsOff   3028
    1670             : #define CID_Vendor              3029
    1671             : #define CID_IBMFamily           3030
    1672             : #define CID_OS2Version          3031
    1673             : #define CID_UseTypoMetrics      3032
    1674             : #define CID_WeightWidthSlopeOnly        3033
    1675             : // Maybe we could insert these above and change the numbering.
    1676             : #define CID_CapHeight           3034
    1677             : #define CID_CapHeightLab                3035
    1678             : #define CID_XHeight             3036
    1679             : #define CID_XHeightLab          3037
    1680             : #define CID_StyleMap            3038
    1681             : 
    1682             : #define CID_SubSuperDefault     3100
    1683             : #define CID_SubXSize            3101
    1684             : #define CID_SubYSize            3102
    1685             : #define CID_SubXOffset          3103
    1686             : #define CID_SubYOffset          3104
    1687             : #define CID_SuperXSize          3105
    1688             : #define CID_SuperYSize          3106
    1689             : #define CID_SuperXOffset        3107
    1690             : #define CID_SuperYOffset        3108
    1691             : #define CID_StrikeoutSize       3109
    1692             : #define CID_StrikeoutPos        3110
    1693             : 
    1694             : #define CID_PanFamily           4001
    1695             : #define CID_PanSerifs           4002
    1696             : #define CID_PanWeight           4003
    1697             : #define CID_PanProp             4004
    1698             : #define CID_PanContrast         4005
    1699             : #define CID_PanStrokeVar        4006
    1700             : #define CID_PanArmStyle         4007
    1701             : #define CID_PanLetterform       4008
    1702             : #define CID_PanMidLine          4009
    1703             : #define CID_PanXHeight          4010
    1704             : #define CID_PanDefault          4011
    1705             : #define CID_PanFamilyLab        4021
    1706             : #define CID_PanSerifsLab        4022
    1707             : #define CID_PanWeightLab        4023
    1708             : #define CID_PanPropLab          4024
    1709             : #define CID_PanContrastLab      4025
    1710             : #define CID_PanStrokeVarLab     4026
    1711             : #define CID_PanArmStyleLab      4027
    1712             : #define CID_PanLetterformLab    4028
    1713             : #define CID_PanMidLineLab       4029
    1714             : #define CID_PanXHeightLab       4030
    1715             : 
    1716             : #define CID_TNLangSort          5001
    1717             : #define CID_TNStringSort        5002
    1718             : #define CID_TNVScroll           5003
    1719             : #define CID_TNHScroll           5004
    1720             : #define CID_TNames              5005
    1721             : 
    1722             : #define CID_Language            5006    /* Used by AskForLangNames */
    1723             : 
    1724             : #define CID_SSNames             5050
    1725             : 
    1726             : #define CID_Gasp                5100
    1727             : #define CID_GaspVersion         5101
    1728             : #define CID_HeadClearType       5102
    1729             : 
    1730             : #define CID_Comment             6001
    1731             : #define CID_FontLog             6002
    1732             : 
    1733             : #define CID_MarkClasses         7101
    1734             : 
    1735             : #define CID_MarkSets            7201
    1736             : 
    1737             : #define CID_TeXText             8001
    1738             : #define CID_TeXMathSym          8002
    1739             : #define CID_TeXMathExt          8003
    1740             : #define CID_MoreParams          8005
    1741             : #define CID_TeXExtraSpLabel     8006
    1742             : #define CID_TeX                 8007    /* through 8014 */
    1743             : #define CID_TeXBox              8030
    1744             : 
    1745             : #define CID_DesignSize          8301
    1746             : #define CID_DesignBottom        8302
    1747             : #define CID_DesignTop           8303
    1748             : #define CID_StyleID             8304
    1749             : #define CID_StyleName           8305
    1750             : 
    1751             : #define CID_Tabs                10001
    1752             : #define CID_OK                  10002
    1753             : #define CID_Cancel              10003
    1754             : #define CID_MainGroup           10004
    1755             : #define CID_TopBox              10005
    1756             : 
    1757             : #define CID_Lookups             11000
    1758             : #define CID_LookupTop           11001
    1759             : #define CID_LookupUp            11002
    1760             : #define CID_LookupDown          11003
    1761             : #define CID_LookupBottom        11004
    1762             : #define CID_AddLookup           11005
    1763             : #define CID_AddSubtable         11006
    1764             : #define CID_EditMetadata        11007
    1765             : #define CID_EditSubtable        11008
    1766             : #define CID_DeleteLookup        11009
    1767             : #define CID_MergeLookup         11010
    1768             : #define CID_RevertLookups       11011
    1769             : #define CID_LookupSort          11012
    1770             : #define CID_ImportLookups       11013
    1771             : #define CID_LookupWin           11020           /* (GSUB, add 1 for GPOS) */
    1772             : #define CID_LookupVSB           11022           /* (GSUB, add 1 for GPOS) */
    1773             : #define CID_LookupHSB           11024           /* (GSUB, add 1 for GPOS) */
    1774             : #define CID_SaveLookup          11026
    1775             : #define CID_SaveFeat            11027
    1776             : #define CID_AddAllAlternates    11028
    1777             : #define CID_AddDFLT             11029
    1778             : #define CID_AddLanguage         11030
    1779             : #define CID_RmLanguage          11031
    1780             : 
    1781             : #define CID_MacAutomatic        16000
    1782             : #define CID_MacStyles           16001
    1783             : #define CID_MacFOND             16002
    1784             : 
    1785             : #define CID_Unicode             16100
    1786             : #define CID_UnicodeEmpties      16101
    1787             : #define CID_UnicodeTab          16102
    1788             : #define CID_URangesDefault      16110
    1789             : #define CID_UnicodeRanges       16111
    1790             : #define CID_UnicodeList         16112
    1791             : #define CID_CPageDefault        16120
    1792             : #define CID_CodePageRanges      16121
    1793             : #define CID_CodePageList        16122
    1794             : 
    1795           3 : const char *UI_TTFNameIds(int id) {
    1796             :     int i;
    1797             : 
    1798           3 :     FontInfoInit();
    1799          54 :     for ( i=0; ttfnameids[i].text!=NULL; ++i )
    1800          54 :         if ( ttfnameids[i].userdata == (void *) (intpt) id )
    1801           3 : return( (char *) ttfnameids[i].text );
    1802             : 
    1803           0 :     if ( id==6 )
    1804           0 : return( "PostScript" );
    1805             : 
    1806           0 : return( _("Unknown") );
    1807             : }
    1808             : 
    1809           3 : const char *UI_MSLangString(int language) {
    1810             :     int i;
    1811             : 
    1812           3 :     FontInfoInit();
    1813         141 :     for ( i=0; mslanguages[i].text!=NULL; ++i )
    1814         141 :         if ( mslanguages[i].userdata == (void *) (intpt) language )
    1815           3 : return( (char *) mslanguages[i].text );
    1816             : 
    1817           0 :     language &= 0xff;
    1818           0 :     for ( i=0; mslanguages[i].text!=NULL; ++i )
    1819           0 :         if ( ((intpt) mslanguages[i].userdata & 0xff) == language )
    1820           0 : return( (char *) mslanguages[i].text );
    1821             : 
    1822           0 : return( _("Unknown") );
    1823             : }
    1824             : 
    1825             : /* These are PostScript names, and as such should not be translated */
    1826             : enum { pt_number, pt_boolean, pt_array, pt_code };
    1827             : static struct { const char *name; short type, arr_size, present; } KnownPrivates[] = {
    1828             :     { "BlueValues", pt_array, 14, 0 },
    1829             :     { "OtherBlues", pt_array, 10, 0 },
    1830             :     { "BlueFuzz", pt_number, 0, 0 },
    1831             :     { "FamilyBlues", pt_array, 14, 0 },
    1832             :     { "FamilyOtherBlues", pt_array, 10, 0 },
    1833             :     { "BlueScale", pt_number, 0, 0 },
    1834             :     { "BlueShift", pt_number, 0, 0 },
    1835             :     { "StdHW", pt_array, 1, 0 },
    1836             :     { "StdVW", pt_array, 1, 0 },
    1837             :     { "StemSnapH", pt_array, 12, 0 },
    1838             :     { "StemSnapV", pt_array, 12, 0 },
    1839             :     { "ForceBold", pt_boolean, 0, 0 },
    1840             :     { "LanguageGroup", pt_number, 0, 0 },
    1841             :     { "RndStemUp", pt_number, 0, 0 },
    1842             :     { "lenIV", pt_number, 0, 0 },
    1843             :     { "ExpansionFactor", pt_number, 0, 0 },
    1844             :     { "Erode", pt_code, 0, 0 },
    1845             : /* I am deliberately not including Subrs and OtherSubrs */
    1846             : /* The first could not be entered (because it's a set of binary strings) */
    1847             : /* And the second has special meaning to us and must be handled with care */
    1848             :     { NULL, 0, 0, 0 }
    1849             : };
    1850             : 
    1851             : static GTextInfo psprivate_nameids[] = {
    1852             : /* Don't translate these here either */
    1853             :     { (unichar_t *) "BlueValues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1854             :     { (unichar_t *) "OtherBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1855             :     { (unichar_t *) "BlueFuzz", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1856             :     { (unichar_t *) "FamilyBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1857             :     { (unichar_t *) "FamilyOtherBlues", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1858             :     { (unichar_t *) "BlueScale", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1859             :     { (unichar_t *) "BlueShift", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1860             :     { (unichar_t *) "StdHW", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1861             :     { (unichar_t *) "StdVW", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1862             :     { (unichar_t *) "StemSnapH", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1863             :     { (unichar_t *) "StemSnapV", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1864             :     { (unichar_t *) "ForceBold", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1865             :     { (unichar_t *) "LanguageGroup", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1866             :     { (unichar_t *) "RndStemUp", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1867             :     { (unichar_t *) "lenIV", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1868             :     { (unichar_t *) "ExpansionFactor", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1869             :     { (unichar_t *) "Erode", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 0, 0, '\0'},
    1870             :     GTEXTINFO_EMPTY
    1871             : };
    1872             : 
    1873           0 : static void PI_KeyEnable(GGadget *g,GMenuItem *mi, int r, int c) {
    1874             :     int i,j, rows;
    1875           0 :     struct matrix_data *strings = _GMatrixEditGet(g, &rows);
    1876           0 :     int cols = GMatrixEditGetColCnt(g);
    1877             :     int found;
    1878             : 
    1879           0 :     for ( i=0; mi[i].ti.text!=NULL; ++i ) {
    1880           0 :         found = 0;
    1881           0 :         for ( j=0; j<rows; ++j ) {
    1882           0 :             if ( strcmp((char *) mi[i].ti.text,strings[j*cols+0].u.md_str)==0 ) {
    1883           0 :                 found=1;
    1884           0 :         break;
    1885             :             }
    1886             :         }
    1887           0 :         if ( j==r && found ) {
    1888           0 :             mi[i].ti.disabled = false;
    1889           0 :             mi[i].ti.selected = true;
    1890             :         } else {
    1891           0 :             mi[i].ti.disabled = found;
    1892           0 :             mi[i].ti.selected = false;
    1893             :         }
    1894             :     }
    1895           0 : }
    1896             : 
    1897             : static struct col_init psprivate_ci[] = {
    1898             :     { me_stringchoice, NULL, psprivate_nameids, PI_KeyEnable, N_("Key") },
    1899             :     { me_string, NULL, NULL, NULL, N_("Value") }
    1900             :     };
    1901             : 
    1902           0 : static char *rpldecimal(const char *orig,const char *decimal_point, locale_t tmplocale) {
    1903             :     char *end;
    1904             :     char *new, *npt; const char *pt;
    1905             :     int dlen;
    1906             :     double dval;
    1907             :     char buffer[40];
    1908             :     locale_t oldlocale;
    1909             : 
    1910             :     /* if the current locale uses a "." for a decimal point the we don't need */
    1911             :     /*  to translate the number, just check that it is valid */
    1912           0 :     if ( strcmp(decimal_point,".")==0 ) {
    1913           0 :         strtod(orig,&end);
    1914           0 :         while ( isspace(*end)) ++end;
    1915           0 :         if ( *end!='\0' )
    1916           0 : return( NULL );
    1917           0 : return( copy(orig));
    1918             :     }
    1919             : 
    1920           0 :     npt = new = malloc(2*strlen(orig)+10);
    1921           0 :     dlen = strlen(decimal_point);
    1922             :     /* now I want to change the number as little as possible. So if they use */
    1923             :     /*  arabic numerals we can get by with just switching the decimal point */
    1924             :     /*  If they use some other number convention, then parse in the old locale*/
    1925             :     /*  and sprintf in the PostScript ("C") locale. This might lose some */
    1926             :     /*  precision but the basic idea will get across */
    1927           0 :     for ( pt=orig; *pt; ) {
    1928           0 :         if ( strncmp(pt,decimal_point,dlen)==0 ) {
    1929           0 :             pt += dlen;
    1930           0 :             *npt++ = '.';
    1931             :         } else
    1932           0 :             *npt++ = *pt++;
    1933             :     }
    1934           0 :     *npt = '\0';
    1935             : 
    1936           0 :     oldlocale = uselocale_hack(tmplocale);
    1937           0 :     strtod(new,&end);
    1938           0 :     uselocale_hack(oldlocale);
    1939           0 :     while ( isspace(*end)) ++end;
    1940           0 :     if ( *end=='\0' ) {
    1941           0 :         char *ret = copy(new);
    1942           0 :         free(new);
    1943           0 : return( ret );
    1944             :     }
    1945             : 
    1946             :     /* OK, can we parse the number in the original local? */
    1947           0 :     dval = strtod(new,&end);
    1948           0 :     while ( isspace(*end)) ++end;
    1949           0 :     if ( *end!='\0' ) {
    1950           0 :         free(new);
    1951           0 : return( NULL );
    1952             :     }
    1953           0 :     free(new);
    1954           0 :     oldlocale = uselocale_hack(tmplocale);
    1955           0 :     sprintf( buffer, "%g", dval );
    1956           0 :     uselocale_hack(oldlocale);
    1957           0 : return( copy(buffer));
    1958             : }
    1959             : 
    1960           0 : static char *rplarraydecimal(const char *orig,const char *decimal_point, locale_t tmplocale) {
    1961             :     char *new, *npt, *rpl;
    1962             :     int nlen;
    1963             :     const char *start, *pt; int ch;
    1964             : 
    1965           0 :     nlen = 2*strlen(orig)+10;
    1966           0 :     npt = new = calloc(1,nlen+1);
    1967           0 :     *npt++ = '[';
    1968             : 
    1969           0 :     for ( pt=orig; isspace(*pt) || *pt=='['; ++pt );
    1970           0 :     while ( *pt!=']' && *pt!='\0' ) {
    1971           0 :         start=pt;
    1972           0 :         while ( *pt!=']' && *pt!=' ' && *pt!='\0' ) ++pt;
    1973           0 :         ch = *pt; *(char *) pt = '\0';
    1974           0 :         rpl = rpldecimal(start,decimal_point,tmplocale);
    1975           0 :         *(char *) pt = ch;
    1976           0 :         if ( rpl==NULL ) {
    1977           0 :             gwwv_post_notice(_("Bad type"),_("Expected array of numbers.\nFailed to parse \"%.*s\" as a number."),
    1978             :                     pt-start, start);
    1979           0 :             free(new);
    1980           0 : return( NULL );
    1981             :         }
    1982           0 :         if ( npt-new + strlen(rpl) + 2 >nlen ) {
    1983           0 :             int noff = npt-new;
    1984           0 :             new = realloc(new,nlen += strlen(rpl)+100);
    1985           0 :             npt = new+noff;
    1986             :         }
    1987           0 :         if ( npt[-1]!='[' )
    1988           0 :             *npt++ = ' ';
    1989           0 :         strcpy(npt,rpl);
    1990           0 :         free(rpl);
    1991           0 :         npt += strlen(npt);
    1992           0 :         while ( isspace(*pt)) ++pt;
    1993             :     }
    1994           0 :     *npt++ =']';
    1995           0 :     *npt = '\0';
    1996           0 :     rpl = copy(new);
    1997           0 :     free(new);
    1998           0 : return( rpl );
    1999             : }
    2000             : 
    2001           0 : static void PSPrivate_FinishEdit(GGadget *g,int r, int c, int wasnew) {
    2002           0 :     int rows, cols = GMatrixEditGetColCnt(g);
    2003           0 :     struct matrix_data *strings = _GMatrixEditGet(g, &rows);
    2004           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2005           0 :     char *key = strings[r*cols+0].u.md_str;
    2006           0 :     char *val = strings[r*cols+1].u.md_str;
    2007             :     char *pt, *ept, *newval;
    2008             :     locale_t tmplocale;
    2009             :     struct psdict *tempdict;
    2010             : 
    2011           0 :     if ( key==NULL )
    2012           0 : return;
    2013             : 
    2014           0 :     if ( c==0 && (wasnew || val==NULL || *val=='\0')) {
    2015           0 :         tempdict = calloc(1,sizeof(*tempdict));
    2016           0 :         SFPrivateGuess(d->sf,ly_fore,tempdict,key,true);
    2017           0 :         strings[r*cols+1].u.md_str = copy(PSDictHasEntry(tempdict,key));
    2018           0 :         PSDictFree(tempdict);
    2019           0 :     } else if ( c==1 && val!=NULL ) {
    2020           0 :         struct lconv *loc = localeconv();
    2021             :         int i;
    2022           0 :         for ( i=0; KnownPrivates[i].name!=NULL; ++i )
    2023           0 :             if ( strcmp(KnownPrivates[i].name,key)==0 )
    2024           0 :         break;
    2025           0 :         if ( KnownPrivates[i].name==NULL )      /* If we don't recognize it, leave it be */
    2026           0 : return;
    2027             : 
    2028           0 :         tmplocale = newlocale_hack(LC_NUMERIC_MASK, "C", NULL);
    2029           0 :         if (tmplocale == NULL) fprintf(stderr, "Locale error.\n");
    2030             : 
    2031           0 :         for ( pt=val; isspace(*pt); ++pt );
    2032           0 :         for ( ept = val+strlen(val-1); ept>pt && isspace(*ept); --ept );
    2033           0 :         if ( KnownPrivates[i].type==pt_boolean ) {
    2034           0 :             if ( strcasecmp(val,"true")==0 || strcasecmp(val,"t")==0 || strtol(val,NULL,10)!=0 ) {
    2035             :                 /* If they make a mistake about case, correct it */
    2036           0 :                 strings[r*cols+1].u.md_str = copy("true");
    2037           0 :                 free(val);
    2038           0 :                 GGadgetRedraw(g);
    2039           0 :             } else if ( strcasecmp(val,"false")==0 || strcasecmp(val,"f")==0 || (*val=='0' && strtol(val,NULL,10)==0) ) {
    2040           0 :                 strings[r*cols+1].u.md_str = copy("false");
    2041           0 :                 free(val);
    2042           0 :                 GGadgetRedraw(g);
    2043             :             } else
    2044             : /* GT: The words "true" and "false" should be left untranslated. We are restricted */
    2045             : /* GT: here by what PostScript understands, and it only understands the English */
    2046             : /* GT: words. You may, of course, change it to something like ("true" (vrai) ou "false" (faux)) */
    2047           0 :                 gwwv_post_notice(_("Bad type"),_("Expected boolean value.\n(\"true\" or \"false\")"));
    2048           0 :         } else if ( KnownPrivates[i].type==pt_code ) {
    2049           0 :             if ( *pt!='\0' && (*pt!='{' || (ept>=pt && *ept!='}')) )
    2050           0 :                 gwwv_post_notice(_("Bad type"),_("Expected PostScript code.\nWhich usually begins with a \"{\" and ends with a \"}\"."));
    2051           0 :         } else if ( KnownPrivates[i].type==pt_number ) {
    2052           0 :             newval = rpldecimal(val,loc->decimal_point,tmplocale);
    2053           0 :             if ( newval==NULL )
    2054           0 :                 gwwv_post_notice(_("Bad type"),_("Expected number."));
    2055           0 :             else if ( strcmp(newval,val)==0 )
    2056           0 :                 free(newval);           /* No change */
    2057             :             else {
    2058           0 :                 strings[r*cols+1].u.md_str = newval;
    2059           0 :                 free(val);
    2060           0 :                 GGadgetRedraw(g);
    2061             :             }
    2062           0 :         } else if ( KnownPrivates[i].type==pt_array ) {
    2063           0 :             newval = rplarraydecimal(val,loc->decimal_point,tmplocale);
    2064           0 :             if ( newval==NULL )
    2065           0 :                 gwwv_post_notice(_("Bad type"),_("Expected number."));
    2066           0 :             else if ( strcmp(newval,val)==0 )
    2067           0 :                 free(newval);           /* No change */
    2068             :             else {
    2069           0 :                 strings[r*cols+1].u.md_str = newval;
    2070           0 :                 free(val);
    2071           0 :                 GGadgetRedraw(g);
    2072             :             }
    2073             :         }
    2074           0 :         if (tmplocale != NULL) { freelocale_hack(tmplocale); tmplocale = NULL; }
    2075             :     }
    2076             : }
    2077             : 
    2078           0 : static void PSPrivate_MatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    2079           0 :     SplineFont *sf = d->sf;
    2080             :     int i,j;
    2081             :     struct matrix_data *md;
    2082             : 
    2083           0 :     memset(mi,0,sizeof(*mi));
    2084           0 :     mi->col_cnt = 2;
    2085           0 :     mi->col_init = psprivate_ci;
    2086             : 
    2087           0 :     mi->initial_row_cnt = sf->private==NULL?0:sf->private->next;
    2088           0 :     md = calloc(2*(mi->initial_row_cnt+1),sizeof(struct matrix_data));
    2089           0 :     if ( sf->private!=NULL ) {
    2090           0 :         for ( i=j=0; i<sf->private->next; ++i ) {
    2091           0 :             md[2*j  ].u.md_str = copy(sf->private->keys[i]);
    2092           0 :             md[2*j+1].u.md_str = copy(sf->private->values[i]);
    2093           0 :             ++j;
    2094             :         }
    2095             :     }
    2096           0 :     mi->matrix_data = md;
    2097             : 
    2098           0 :     mi->finishedit = PSPrivate_FinishEdit;
    2099           0 : }
    2100             : 
    2101           0 : static struct psdict *GFI_ParsePrivate(struct gfi_data *d) {
    2102           0 :     struct psdict *ret = calloc(1,sizeof(struct psdict));
    2103           0 :     GGadget *private = GWidgetGetControl(d->gw,CID_Private);
    2104           0 :     int rows, cols = GMatrixEditGetColCnt(private);
    2105           0 :     struct matrix_data *strings = GMatrixEditGet(private, &rows);
    2106             :     int i,j;
    2107             : 
    2108           0 :     ret->cnt = rows;
    2109           0 :     ret->keys = malloc(rows*sizeof(char *));
    2110           0 :     ret->values = malloc(rows*sizeof(char *));
    2111           0 :     for ( i=j=0; i<rows; ++i ) {
    2112           0 :         if ( strings[i*cols+0].u.md_str!=NULL && strings[i*cols+1].u.md_str!=NULL ) {
    2113           0 :             ret->keys[j] = copy(strings[i*cols+0].u.md_str);
    2114           0 :             ret->values[j++] = copy(strings[i*cols+1].u.md_str);
    2115             :         }
    2116             :     }
    2117           0 :     ret->next = j;
    2118           0 : return( ret );
    2119             : }
    2120             : 
    2121           0 : static void PSPrivate_EnableButtons(GGadget *g, int r, int c) {
    2122           0 :     int rows, cols = GMatrixEditGetColCnt(g);
    2123           0 :     struct matrix_data *strings = _GMatrixEditGet(g, &rows);
    2124           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2125           0 :     char *key = r>=0 && r<rows ? strings[r*cols+0].u.md_str : NULL;
    2126           0 :     int has_hist = key!=NULL && (
    2127           0 :                     strcmp(key,"BlueValues")==0 ||
    2128           0 :                     strcmp(key,"OtherBlues")==0 ||
    2129           0 :                     strcmp(key,"StdHW")==0 ||
    2130           0 :                     strcmp(key,"StemSnapH")==0 ||
    2131           0 :                     strcmp(key,"StdVW")==0 ||
    2132           0 :                     strcmp(key,"StemSnapV")==0);
    2133           0 :     int has_guess = key!=NULL && (has_hist ||
    2134           0 :                     strcmp(key,"BlueScale")==0 ||
    2135           0 :                     strcmp(key,"BlueShift")==0 ||
    2136           0 :                     strcmp(key,"BlueFuzz")==0 ||
    2137           0 :                     strcmp(key,"ForceBold")==0 ||
    2138           0 :                     strcmp(key,"LanguageGroup")==0 ||
    2139           0 :                     strcmp(key,"ExpansionFactor")==0);
    2140           0 :     GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess), has_guess);
    2141           0 :     GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist ), has_hist );
    2142           0 : }
    2143             : 
    2144           0 : static int PI_Guess(GGadget *g, GEvent *e) {
    2145             :     GWindow gw;
    2146             :     struct gfi_data *d;
    2147             :     GGadget *private;
    2148             :     struct psdict *tempdict;
    2149             :     struct matrix_data *strings;
    2150             :     int rows, cols, r;
    2151             :     char *key, *ret;
    2152             : 
    2153           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    2154           0 :         gw = GGadgetGetWindow(g);
    2155           0 :         d = GDrawGetUserData(gw);
    2156           0 :         private = GWidgetGetControl(gw,CID_Private);
    2157           0 :         strings = GMatrixEditGet(private, &rows);   /* Commit any changes made thus far */
    2158           0 :         cols = GMatrixEditGetColCnt(private);
    2159           0 :         r = GMatrixEditGetActiveRow(private);
    2160           0 :         key = strings[r*cols+0].u.md_str;
    2161           0 :         tempdict = calloc(1,sizeof(*tempdict));
    2162           0 :         SFPrivateGuess(d->sf,ly_fore,tempdict,key,true);
    2163           0 :         ret = copy(PSDictHasEntry(tempdict,key));
    2164           0 :         if ( ret!=NULL ) {
    2165           0 :             free(strings[r*cols+1].u.md_str);
    2166           0 :             strings[r*cols+1].u.md_str = ret;
    2167           0 :             GGadgetRedraw(private);
    2168             :         }
    2169           0 :         PSDictFree(tempdict);
    2170             :     }
    2171           0 : return( true );
    2172             : }
    2173             : 
    2174           0 : static int PI_Hist(GGadget *g, GEvent *e) {
    2175             :     GWindow gw;
    2176             :     struct gfi_data *d;
    2177             :     GGadget *private;
    2178             :     struct psdict *tempdict;
    2179             :     enum hist_type h;
    2180             :     struct matrix_data *strings;
    2181             :     int rows, cols, r;
    2182             :     char *key, *ret;
    2183             : 
    2184           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    2185           0 :         gw = GGadgetGetWindow(g);
    2186           0 :         d = GDrawGetUserData(gw);
    2187           0 :         private = GWidgetGetControl(gw,CID_Private);
    2188           0 :         strings = _GMatrixEditGet(private, &rows);
    2189           0 :         cols = GMatrixEditGetColCnt(private);
    2190           0 :         r = GMatrixEditGetActiveRow(private);
    2191           0 :         key = strings[r*cols+0].u.md_str;
    2192           0 :         if ( strcmp(key,"BlueValues")==0 ||
    2193           0 :                 strcmp(key,"OtherBlues")==0 )
    2194           0 :             h = hist_blues;
    2195           0 :         else if ( strcmp(key,"StdHW")==0 ||
    2196           0 :                 strcmp(key,"StemSnapH")==0 )
    2197           0 :             h = hist_hstem;
    2198           0 :         else if ( strcmp(key,"StdVW")==0 ||
    2199           0 :                 strcmp(key,"StemSnapV")==0 )
    2200           0 :             h = hist_vstem;
    2201             :         else
    2202           0 : return( true );         /* can't happen */
    2203           0 :         tempdict = GFI_ParsePrivate(d);
    2204           0 :         SFHistogram(d->sf,ly_fore,tempdict,NULL,NULL,h);
    2205           0 :         ret = copy(PSDictHasEntry(tempdict,key));
    2206           0 :         if ( ret!=NULL ) {
    2207           0 :             free(strings[r*cols+1].u.md_str);
    2208           0 :             strings[r*cols+1].u.md_str = ret;
    2209           0 :             GGadgetRedraw(private);
    2210             :         }
    2211           0 :         PSDictFree(tempdict);
    2212             :     }
    2213           0 : return( true );
    2214             : }
    2215             : 
    2216           0 : static int GFI_NameChange(GGadget *g, GEvent *e) {
    2217           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
    2218           0 :         GWindow gw = GGadgetGetWindow(g);
    2219           0 :         struct gfi_data *gfi = GDrawGetUserData(gw);
    2220           0 :         const unichar_t *uname = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
    2221             :         unichar_t ubuf[50];
    2222             :         int i,j;
    2223           0 :         for ( j=0; noticeweights[j]!=NULL; ++j ) {
    2224           0 :             for ( i=0; noticeweights[j][i]!=NULL; ++i ) {
    2225           0 :                 if ( uc_strstrmatch(uname,noticeweights[j][i])!=NULL ) {
    2226           0 :                     uc_strcpy(ubuf, noticeweights[j]==knownweights ?
    2227           0 :                             realweights[i] : noticeweights[j][i]);
    2228           0 :                     GGadgetSetTitle(GWidgetGetControl(gw,CID_Weight),ubuf);
    2229           0 :             break;
    2230             :                 }
    2231             :             }
    2232           0 :             if ( noticeweights[j][i]!=NULL )
    2233           0 :         break;
    2234             :         }
    2235             : 
    2236             :         /* If the user didn't set the full name yet, we guess it from the
    2237             :          * postrscript name */
    2238           0 :         if ( gfi->human_untitled ) {
    2239           0 :             unichar_t *cp = u_copy(uname);
    2240           0 :             int i=0;
    2241             :             /* replace the last hyphen with space */
    2242           0 :             for( i=u_strlen(cp); i>=0; i-- ) {
    2243           0 :                 if( cp[i] == '-' ) {
    2244           0 :                     cp[i] = ' ';
    2245           0 :                     break;
    2246             :                 }
    2247             :             }
    2248             :             /* If the postscript name ends with "Regular" it is recommended not
    2249             :              * to include it in the full name */
    2250           0 :             if(u_endswith(cp,c_to_u(" Regular")) || u_endswith(cp,c_to_u(" regular"))) {
    2251           0 :                 cp[u_strlen(cp) - strlen(" Regular")] ='\0';
    2252             :             }
    2253           0 :             GGadgetSetTitle(GWidgetGetControl(gw,CID_Human),cp);
    2254           0 :             free(cp);
    2255             :         }
    2256           0 :         if ( gfi->family_untitled ) {
    2257           0 :             const unichar_t *ept = uname+u_strlen(uname); unichar_t *temp;
    2258           0 :             for ( i=0; knownweights[i]!=NULL; ++i ) {
    2259           0 :                 if (( temp = uc_strstrmatch(uname,knownweights[i]))!=NULL && temp<ept && temp!=uname )
    2260           0 :                     ept = temp;
    2261             :             }
    2262           0 :             if (( temp = uc_strstrmatch(uname,"ital"))!=NULL && temp<ept && temp!=uname )
    2263           0 :                 ept = temp;
    2264           0 :             if (( temp = uc_strstrmatch(uname,"obli"))!=NULL && temp<ept && temp!=uname )
    2265           0 :                 ept = temp;
    2266           0 :             if (( temp = uc_strstrmatch(uname,"kurs"))!=NULL && temp<ept && temp!=uname )
    2267           0 :                 ept = temp;
    2268           0 :             if (( temp = uc_strstrmatch(uname,"slanted"))!=NULL && temp<ept && temp!=uname )
    2269           0 :                 ept = temp;
    2270           0 :             if (( temp = u_strchr(uname,'-'))!=NULL && temp!=uname )
    2271           0 :                 ept = temp;
    2272           0 :             temp = u_copyn(uname,ept-uname);
    2273           0 :             GGadgetSetTitle(GWidgetGetControl(gw,CID_Family),temp);
    2274             :         }
    2275             :     }
    2276           0 : return( true );
    2277             : }
    2278             : 
    2279           0 : static int GFI_FamilyChange(GGadget *g, GEvent *e) {
    2280           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
    2281           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    2282           0 :         gfi->family_untitled = false;
    2283             :     }
    2284           0 : return( true );
    2285             : }
    2286             : 
    2287           0 : static int GFI_DefBaseChange(GGadget *g, GEvent *e) {
    2288           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
    2289           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    2290           0 :         GGadgetSetChecked(GWidgetGetControl(gfi->gw,*_GGadgetGetTitle(g)!='\0'?CID_HasDefBase:CID_SameAsFontname),
    2291             :                 true);
    2292             :     }
    2293           0 : return( true );
    2294             : }
    2295             : 
    2296           0 : static int GFI_HumanChange(GGadget *g, GEvent *e) {
    2297           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
    2298           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    2299           0 :         gfi->human_untitled = false;
    2300             :     }
    2301           0 : return( true );
    2302             : }
    2303             : 
    2304           0 : static int GFI_VMetricsCheck(GGadget *g, GEvent *e) {
    2305           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    2306           0 :         GWindow gw = GGadgetGetWindow(g);
    2307           0 :         int checked = GGadgetIsChecked(g);
    2308           0 :         GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGap),checked);
    2309           0 :         GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGapLab),checked);
    2310             :     }
    2311           0 : return( true );
    2312             : }
    2313             : 
    2314           0 : static int GFI_EmChanged(GGadget *g, GEvent *e) {
    2315           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
    2316             :         char buf[20]; unichar_t ubuf[20];
    2317           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2318           0 :         const unichar_t *ret = _GGadgetGetTitle(g); unichar_t *end;
    2319           0 :         int val = u_strtol(ret,&end,10), ascent, descent;
    2320           0 :         if ( *end )
    2321           0 : return( true );
    2322           0 :         switch ( GGadgetGetCid(g)) {
    2323             :           case CID_Em:
    2324           0 :             ascent = rint( ((double) val)*d->sf->ascent/(d->sf->ascent+d->sf->descent) );
    2325           0 :             descent = val - ascent;
    2326           0 :           break;
    2327             :           case CID_Ascent:
    2328           0 :             ascent = val;
    2329           0 :             ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
    2330           0 :             descent = u_strtol(ret,&end,10);
    2331           0 :             if ( *end )
    2332           0 : return( true );
    2333           0 :           break;
    2334             :           case CID_Descent:
    2335           0 :             descent = val;
    2336           0 :             ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
    2337           0 :             ascent = u_strtol(ret,&end,10);
    2338           0 :             if ( *end )
    2339           0 : return( true );
    2340           0 :           break;
    2341             :         }
    2342           0 :         sprintf( buf, "%d", ascent ); if ( ascent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
    2343           0 :         GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Ascent),ubuf);
    2344           0 :         sprintf( buf, "%d", descent ); if ( descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
    2345           0 :         GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Descent),ubuf);
    2346           0 :         sprintf( buf, "%d", ascent+descent ); if ( ascent+descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
    2347           0 :         GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Em),ubuf);
    2348             :     }
    2349           0 : return( true );
    2350             : }
    2351             : 
    2352           0 : static int GFI_GuessItalic(GGadget *g, GEvent *e) {
    2353           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    2354           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2355           0 :         double val = SFGuessItalicAngle(d->sf);
    2356             :         char buf[30]; unichar_t ubuf[30];
    2357           0 :         sprintf( buf, "%.1f", val);
    2358           0 :         uc_strcpy(ubuf,buf);
    2359           0 :         GGadgetSetTitle(GWidgetGetControl(d->gw,CID_ItalicAngle),ubuf);
    2360             :     }
    2361           0 : return( true );
    2362             : }
    2363             : 
    2364           0 : static void GFI_Close(struct gfi_data *d) {
    2365             : 
    2366           0 :     GDrawDestroyWindow(d->gw);
    2367           0 :     if ( d->sf->fontinfo == d )
    2368           0 :         d->sf->fontinfo = NULL;
    2369           0 :     FVRefreshAll(d->sf);
    2370           0 :     d->done = true;
    2371             :     /* d will be freed by destroy event */;
    2372           0 : }
    2373             : 
    2374           0 : static void GFI_Mark_FinishEdit(GGadget *g,int r, int c, int wasnew) {
    2375           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2376           0 :     int is_markclass = GGadgetGetCid(g) == CID_MarkClasses;
    2377             : 
    2378           0 :     if ( c==0 ) {
    2379             :         /* Name can't be null. No spaces. No duplicates */
    2380           0 :         int rows, cols = GMatrixEditGetColCnt(g);
    2381           0 :         struct matrix_data *classes = _GMatrixEditGet(g,&rows);
    2382             :         char *pt;
    2383             :         int i;
    2384             : 
    2385           0 :         if ( classes[r*cols+c].u.md_str==NULL || *classes[r*cols+c].u.md_str=='\0' ) {
    2386           0 :             ff_post_error(_("No Name"), _("Please specify a name for this mark class or set"));
    2387           0 : return;
    2388             :         }
    2389           0 :         for ( pt = classes[r*cols+c].u.md_str; *pt!='\0'; ++pt ) {
    2390           0 :             if ( *pt==' ' ) {
    2391           0 :                 ff_post_error(_("Bad Name"), _("Mark class/set names should not contain spaces."));
    2392           0 : return;
    2393             :             }
    2394             :         }
    2395           0 :         for ( i=0; i<rows; ++i ) if ( i!=r ) {
    2396           0 :             if ( strcmp(classes[r*cols+c].u.md_str,classes[i*cols+c].u.md_str)==0 ) {
    2397           0 :                 ff_post_error(_("Duplicate Name"), _("This name was previously used to identify mark class/set #%d."), i+1);
    2398           0 : return;
    2399             :             }
    2400             :         }
    2401             :     } else {
    2402           0 :         if ( is_markclass )
    2403           0 :             ME_ClassCheckUnique(g, r, c, d->sf);
    2404             :         else
    2405           0 :             ME_SetCheckUnique(g, r, c, d->sf);
    2406             :     }
    2407             : }
    2408             : 
    2409           0 : static char *GFI_Mark_PickGlyphsForClass(GGadget *g,int r, int c) {
    2410           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2411           0 :     int rows, cols = GMatrixEditGetColCnt(g);
    2412           0 :     struct matrix_data *classes = _GMatrixEditGet(g,&rows);
    2413           0 :     char *new = GlyphSetFromSelection(d->sf,d->def_layer,classes[r*cols+c].u.md_str);
    2414           0 : return( new );
    2415             : }
    2416             : 
    2417           0 : static void GFI_Mark_DeleteClass(GGadget *g,int whichclass) {
    2418           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2419             :     int rows/*, cols = GMatrixEditGetColCnt(g)*/;
    2420           0 :     struct matrix_data *classes = _GMatrixEditGet(g,&rows);
    2421           0 :     int is_markclass = GGadgetGetCid(g) == CID_MarkClasses;
    2422           0 :     SplineFont *sf = d->sf;
    2423             :     OTLookup *otl;
    2424             :     int isgpos;
    2425             : 
    2426           0 :     whichclass += is_markclass;         /* Classes begin at 1, Sets begin at 0 */
    2427           0 :     for ( isgpos=0; isgpos<2; ++isgpos ) {
    2428           0 :         for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
    2429           0 :             if ( is_markclass ) {
    2430           0 :                 int old = (otl->lookup_flags & pst_markclass)>>8;
    2431           0 :                 if ( old==whichclass ) {
    2432           0 :                     ff_post_notice(_("Mark Class was in use"),_("This mark class (%s) was used in lookup %s"),
    2433           0 :                             classes[2*whichclass-2].u.md_str,otl->lookup_name);
    2434           0 :                     otl->lookup_flags &= ~ pst_markclass;
    2435           0 :                 } else if ( old>whichclass ) {
    2436           0 :                     otl->lookup_flags &= ~ pst_markclass;
    2437           0 :                     otl->lookup_flags |= (old-1)<<8;
    2438             :                 }
    2439           0 :             } else if ( otl->lookup_flags&pst_usemarkfilteringset ) {
    2440           0 :                 int old = (otl->lookup_flags & pst_markset)>>16;
    2441           0 :                 if ( old==whichclass ) {
    2442           0 :                     ff_post_notice(_("Mark Set was in use"),_("This mark set (%s) was used in lookup %s"),
    2443           0 :                             classes[2*whichclass+0].u.md_str,otl->lookup_name);
    2444           0 :                     otl->lookup_flags &= ~ pst_markset;
    2445           0 :                     otl->lookup_flags &= ~pst_usemarkfilteringset;
    2446           0 :                 } else if ( old>whichclass ) {
    2447           0 :                     otl->lookup_flags &= ~ pst_markset;
    2448           0 :                     otl->lookup_flags |= (old-1)<<16;
    2449             :                 }
    2450             :             }
    2451             :         }
    2452             :     }
    2453           0 : }
    2454             : 
    2455           0 : static unichar_t **GFI_GlyphListCompletion(GGadget *t,int from_tab) {
    2456           0 :     struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(GGadgetGetWindow(t)));
    2457           0 :     SplineFont *sf = d->sf;
    2458             : 
    2459           0 : return( SFGlyphNameCompletion(sf,t,from_tab,true));
    2460             : }
    2461             : 
    2462           0 : static void GFI_CancelClose(struct gfi_data *d) {
    2463             :     int isgpos,i,j;
    2464             : 
    2465           0 :     MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(
    2466             :             d->gw,CID_Features))));
    2467           0 :     for ( isgpos=0; isgpos<2; ++isgpos ) {
    2468           0 :         struct lkdata *lk = &d->tables[isgpos];
    2469           0 :         for ( i=0; i<lk->cnt; ++i ) {
    2470           0 :             if ( lk->all[i].new )
    2471           0 :                 SFRemoveLookup(d->sf,lk->all[i].lookup,0);
    2472           0 :             else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    2473           0 :                 if ( lk->all[i].subtables[j].new )
    2474           0 :                     SFRemoveLookupSubTable(d->sf,lk->all[i].subtables[j].subtable,0);
    2475             :             }
    2476           0 :             free(lk->all[i].subtables);
    2477             :         }
    2478           0 :         free(lk->all);
    2479             :     }
    2480           0 :     GFI_Close(d);
    2481           0 : }
    2482             : 
    2483           0 : static struct otfname *OtfNameFromStyleNames(GGadget *me) {
    2484             :     int i;
    2485             :     int rows;
    2486           0 :     struct matrix_data *strings = GMatrixEditGet(me, &rows);
    2487           0 :     struct otfname *head=NULL, *last, *cur;
    2488             : 
    2489           0 :     for ( i=0; i<rows; ++i ) {
    2490           0 :         cur = chunkalloc(sizeof(struct otfname));
    2491           0 :         cur->lang = strings[2*i  ].u.md_ival;
    2492           0 :         cur->name = copy(strings[2*i+1].u.md_str);
    2493           0 :         if ( head==NULL )
    2494           0 :             head = cur;
    2495             :         else
    2496           0 :             last->next = cur;
    2497           0 :         last = cur;
    2498             :     }
    2499           0 : return( head );
    2500             : }
    2501             : 
    2502           0 : void GListMoveSelected(GGadget *list,int offset) {
    2503             :     int32 len; int i,j;
    2504             :     GTextInfo **old, **new;
    2505             : 
    2506           0 :     old = GGadgetGetList(list,&len);
    2507           0 :     new = calloc(len+1,sizeof(GTextInfo *));
    2508           0 :     j = (offset<0 ) ? 0 : len-1;
    2509           0 :     for ( i=0; i<len; ++i ) if ( old[i]->selected ) {
    2510           0 :         if ( offset==0x80000000 || offset==0x7fffffff )
    2511             :             /* Do Nothing */;
    2512           0 :         else if ( offset<0 ) {
    2513           0 :             if ( (j= i+offset)<0 ) j=0;
    2514           0 :             while ( new[j] ) ++j;
    2515             :         } else {
    2516           0 :             if ( (j= i+offset)>=len ) j=len-1;
    2517           0 :             while ( new[j] ) --j;
    2518             :         }
    2519           0 :         new[j] = malloc(sizeof(GTextInfo));
    2520           0 :         *new[j] = *old[i];
    2521           0 :         new[j]->text = u_copy(new[j]->text);
    2522           0 :         if ( offset<0 ) ++j; else --j;
    2523             :     }
    2524           0 :     for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
    2525           0 :         while ( new[j] ) ++j;
    2526           0 :         new[j] = malloc(sizeof(GTextInfo));
    2527           0 :         *new[j] = *old[i];
    2528           0 :         new[j]->text = u_copy(new[j]->text);
    2529           0 :         ++j;
    2530             :     }
    2531           0 :     new[len] = calloc(1,sizeof(GTextInfo));
    2532           0 :     GGadgetSetList(list,new,false);
    2533           0 : }
    2534             : 
    2535           0 : void GListDelSelected(GGadget *list) {
    2536             :     int32 len; int i,j;
    2537             :     GTextInfo **old, **new;
    2538             : 
    2539           0 :     old = GGadgetGetList(list,&len);
    2540           0 :     new = calloc(len+1,sizeof(GTextInfo *));
    2541           0 :     for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
    2542           0 :         new[j] = malloc(sizeof(GTextInfo));
    2543           0 :         *new[j] = *old[i];
    2544           0 :         new[j]->text = u_copy(new[j]->text);
    2545           0 :         ++j;
    2546             :     }
    2547           0 :     new[j] = calloc(1,sizeof(GTextInfo));
    2548           0 :     GGadgetSetList(list,new,false);
    2549           0 : }
    2550             : 
    2551           0 : GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line) {
    2552             :     GTextInfo **old, **new;
    2553             :     int32 i,len;
    2554             : 
    2555           0 :     old = GGadgetGetList(list,&len);
    2556           0 :     new = calloc(len+1,sizeof(GTextInfo *));
    2557           0 :     for ( i=0; i<len; ++i ) {
    2558           0 :         new[i] = malloc(sizeof(GTextInfo));
    2559           0 :         *new[i] = *old[i];
    2560           0 :         if ( i!=pos )
    2561           0 :             new[i]->text = u_copy(new[i]->text);
    2562             :         else
    2563           0 :             new[i]->text = u_copy(line);
    2564             :     }
    2565           0 :     new[i] = calloc(1,sizeof(GTextInfo));
    2566           0 :     GGadgetSetList(list,new,false);
    2567           0 :     GGadgetScrollListToPos(list,pos);
    2568           0 : return( new[pos]);
    2569             : }
    2570             : 
    2571           0 : GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select) {
    2572             :     GTextInfo **old, **new;
    2573             :     int32 i,len;
    2574             : 
    2575           0 :     old = GGadgetGetList(list,&len);
    2576           0 :     new = calloc(len+2,sizeof(GTextInfo *));
    2577           0 :     for ( i=0; i<len; ++i ) {
    2578           0 :         new[i] = malloc(sizeof(GTextInfo));
    2579           0 :         *new[i] = *old[i];
    2580           0 :         new[i]->text = u_copy(new[i]->text);
    2581           0 :         if ( select ) new[i]->selected = false;
    2582             :     }
    2583           0 :     new[i] = calloc(1,sizeof(GTextInfo));
    2584           0 :     new[i]->fg = new[i]->bg = COLOR_DEFAULT;
    2585           0 :     new[i]->userdata = NULL;
    2586           0 :     new[i]->text = u_copy(line);
    2587           0 :     new[i]->selected = select;
    2588           0 :     new[i+1] = calloc(1,sizeof(GTextInfo));
    2589           0 :     GGadgetSetList(list,new,false);
    2590           0 :     GGadgetScrollListToPos(list,i);
    2591           0 : return( new[i]);
    2592             : }
    2593             : 
    2594           0 : GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line) {
    2595             :     GTextInfo **old, **new;
    2596             :     int32 i,len;
    2597             : 
    2598           0 :     old = GGadgetGetList(list,&len);
    2599           0 :     new = calloc(len+1,sizeof(GTextInfo *));
    2600           0 :     for ( i=0; i<len; ++i ) {
    2601           0 :         new[i] = malloc(sizeof(GTextInfo));
    2602           0 :         *new[i] = *old[i];
    2603           0 :         if ( i!=pos )
    2604           0 :             new[i]->text = u_copy(new[i]->text);
    2605             :         else
    2606           0 :             new[i]->text = utf82u_copy(line);
    2607             :     }
    2608           0 :     new[i] = calloc(1,sizeof(GTextInfo));
    2609           0 :     GGadgetSetList(list,new,false);
    2610           0 :     GGadgetScrollListToPos(list,pos);
    2611           0 : return( new[pos]);
    2612             : }
    2613             : 
    2614           0 : GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select) {
    2615             :     GTextInfo **old, **new;
    2616             :     int32 i,len;
    2617             : 
    2618           0 :     old = GGadgetGetList(list,&len);
    2619           0 :     new = calloc(len+2,sizeof(GTextInfo *));
    2620           0 :     for ( i=0; i<len; ++i ) {
    2621           0 :         new[i] = malloc(sizeof(GTextInfo));
    2622           0 :         *new[i] = *old[i];
    2623           0 :         new[i]->text = u_copy(new[i]->text);
    2624           0 :         if ( select ) new[i]->selected = false;
    2625             :     }
    2626           0 :     new[i] = calloc(1,sizeof(GTextInfo));
    2627           0 :     new[i]->fg = new[i]->bg = COLOR_DEFAULT;
    2628           0 :     new[i]->userdata = NULL;
    2629           0 :     new[i]->text = utf82u_copy(line);
    2630           0 :     new[i]->selected = select;
    2631           0 :     new[i+1] = calloc(1,sizeof(GTextInfo));
    2632           0 :     GGadgetSetList(list,new,false);
    2633           0 :     GGadgetScrollListToPos(list,i);
    2634           0 : return( new[i]);
    2635             : }
    2636             : 
    2637           0 : static int GFI_Cancel(GGadget *g, GEvent *e) {
    2638           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    2639           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    2640           0 :         GFI_CancelClose(d);
    2641             :     }
    2642           0 : return( true );
    2643             : }
    2644             : 
    2645           0 : static void BadFamily() {
    2646           0 :     ff_post_error(_("Bad Family Name"),_("Bad Family Name, must begin with an alphabetic character."));
    2647           0 : }
    2648             : 
    2649           0 : static int SetFontName(GWindow gw, SplineFont *sf) {
    2650           0 :     const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
    2651           0 :     const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
    2652           0 :     const unichar_t *uweight = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Weight));
    2653           0 :     const unichar_t *uhum = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Human));
    2654           0 :     int diff = uc_strcmp(ufont,sf->fontname)!=0;
    2655             : 
    2656           0 :     free(sf->familyname);
    2657           0 :     free(sf->fontname);
    2658           0 :     free(sf->weight);
    2659           0 :     free(sf->fullname);
    2660           0 :     sf->familyname = cu_copy(ufamily);
    2661           0 :     sf->fontname = cu_copy(ufont);
    2662           0 :     sf->weight = cu_copy(uweight);
    2663           0 :     sf->fullname = cu_copy(uhum);
    2664           0 : return( diff );
    2665             : }
    2666             : 
    2667           0 : static int CheckNames(struct gfi_data *d) {
    2668           0 :     const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family));
    2669           0 :     const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname));
    2670             :     unichar_t *end; const unichar_t *pt;
    2671             :     char *buts[3];
    2672           0 :     buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
    2673             : 
    2674           0 :     if ( u_strlen(ufont)>63 ) {
    2675           0 :         ff_post_error(_("Bad Font Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"));
    2676           0 : return( false );
    2677             :     }
    2678             : 
    2679           0 :     if ( *ufamily=='\0' ) {
    2680           0 :         ff_post_error(_("A Font Family name is required"),_("A Font Family name is required"));
    2681           0 : return( false );
    2682             :     }
    2683             :     /* A postscript name cannot be a number. There are two ways it can be a */
    2684             :     /*  number, it can be a real (which we can check for with strtod) or */
    2685             :     /*  it can be a "radix number" which is <intval>'#'<intval>. I'll only */
    2686             :     /*  do a cursory test for that */
    2687           0 :     u_strtod(ufamily,&end);
    2688           0 :     if ( *end=='\0' || (isdigit(ufamily[0]) && u_strchr(ufamily,'#')!=NULL) ) {
    2689           0 :         ff_post_error(_("Bad Font Family Name"),_("A PostScript name may not be a number"));
    2690           0 : return( false );
    2691             :     }
    2692           0 :     if ( u_strlen(ufamily)>31 ) {
    2693           0 :         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 )
    2694           0 : return( false );
    2695             :     } else {
    2696           0 :         if ( u_strlen(ufont)>31 ) {
    2697           0 :             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 )
    2698           0 : return( false );
    2699           0 :         } else if ( u_strlen(ufont)>29 ) {
    2700           0 :             if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Adobe's fontname spec (5088.FontNames.pdf) says that fontnames should not be longer than 29 characters. Do you want to continue anyway?"))==1 )
    2701           0 : return( false );
    2702             :         }
    2703             :     }
    2704           0 :     while ( *ufamily ) {
    2705           0 :         if ( *ufamily<' ' || *ufamily>=0x7f ) {
    2706           0 :             ff_post_error(_("Bad Font Family Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
    2707           0 : return( false );
    2708             :         }
    2709           0 :         ++ufamily;
    2710             :     }
    2711             : 
    2712           0 :     u_strtod(ufont,&end);
    2713           0 :     if ( (*end=='\0' || (isdigit(ufont[0]) && u_strchr(ufont,'#')!=NULL)) &&
    2714           0 :             *ufont!='\0' ) {
    2715           0 :         ff_post_error(_("Bad Font Name"),_("A PostScript name may not be a number"));
    2716           0 : return( false );
    2717             :     }
    2718           0 :     for ( pt=ufont; *pt; ++pt ) {
    2719           0 :         if ( *pt<=' ' || *pt>=0x7f ||
    2720           0 :                 *pt=='(' || *pt=='[' || *pt=='{' || *pt=='<' ||
    2721           0 :                 *pt==')' || *pt==']' || *pt=='}' || *pt=='>' ||
    2722           0 :                 *pt=='%' || *pt=='/' ) {
    2723           0 :             ff_post_error(_("Bad Font Name"),_("A PostScript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
    2724           0 : return( false );
    2725             :         }
    2726             :     }
    2727           0 : return( true );
    2728             : }
    2729             : 
    2730             : static int ttfspecials[] = { ttf_copyright, ttf_family, ttf_fullname,
    2731             :         ttf_subfamily, ttf_version, -1 };
    2732             : 
    2733           0 : static char *tn_recalculatedef(struct gfi_data *d,int cur_id) {
    2734             :     char versionbuf[40], *v;
    2735             : 
    2736           0 :     switch ( cur_id ) {
    2737             :       case ttf_copyright:
    2738           0 : return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Notice)));
    2739             :       case ttf_family:
    2740           0 : return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Family)));
    2741             :       case ttf_fullname:
    2742           0 : return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Human)));
    2743             :       case ttf_subfamily:
    2744           0 : return( u2utf8_copy(_uGetModifiers(
    2745           0 :                 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)),
    2746           0 :                 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family)),
    2747           0 :                 _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Weight)))));
    2748             :       case ttf_version:
    2749           0 :         sprintf(versionbuf,_("Version %.20s"),
    2750           0 :                 v=GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Version)));
    2751           0 :         free(v);
    2752           0 : return( copy(versionbuf));
    2753             :       default:
    2754           0 : return( NULL );
    2755             :     }
    2756             : }
    2757             : 
    2758           0 : static char *TN_DefaultName(GGadget *g, int r, int c) {
    2759           0 :     struct gfi_data *d = GGadgetGetUserData(g);
    2760             :     int rows;
    2761           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    2762             : 
    2763           0 :     if ( strings==NULL || !strings[3*r+2].user_bits )
    2764           0 : return( NULL );
    2765             : 
    2766           0 : return( tn_recalculatedef(d,strings[3*r+1].u.md_ival ));
    2767             : }
    2768             : 
    2769           0 : static const char *langname(int lang,char *buffer) {
    2770             :     int i;
    2771           0 :     for ( i=0; mslanguages[i].text!=NULL; ++i )
    2772           0 :         if ( mslanguages[i].userdata == (void *) (intpt) lang )
    2773           0 : return( (char *) mslanguages[i].text );
    2774             : 
    2775           0 :     sprintf( buffer, "%04X", lang );
    2776           0 : return( buffer );
    2777             : }
    2778             : 
    2779           0 : static int strid_sorter(const void *pt1, const void *pt2) {
    2780           0 :     const struct matrix_data *n1 = pt1, *n2 = pt2;
    2781             :     char buf1[20], buf2[20];
    2782             :     const char *l1, *l2;
    2783             : 
    2784           0 :     if ( n1[1].u.md_ival!=n2[1].u.md_ival )
    2785           0 : return( n1[1].u.md_ival - n2[1].u.md_ival );
    2786             : 
    2787           0 :     l1 = langname(n1[0].u.md_ival,buf1);
    2788           0 :     l2 = langname(n2[0].u.md_ival,buf2);
    2789           0 : return( strcoll(l1,l2));
    2790             : }
    2791             : 
    2792           0 : static int lang_sorter(const void *pt1, const void *pt2) {
    2793           0 :     const struct matrix_data *n1 = pt1, *n2 = pt2;
    2794             :     char buf1[20], buf2[20];
    2795             :     const char *l1, *l2;
    2796             : 
    2797           0 :     if ( n1[0].u.md_ival==n2[0].u.md_ival )
    2798           0 : return( n1[1].u.md_ival - n2[1].u.md_ival );
    2799             : 
    2800           0 :     l1 = langname(n1[0].u.md_ival,buf1);
    2801           0 :     l2 = langname(n2[0].u.md_ival,buf2);
    2802           0 : return( strcoll(l1,l2));
    2803             : }
    2804             : 
    2805             : static int ms_thislocale = 0;
    2806           0 : static int specialvals(const struct matrix_data *n) {
    2807           0 :     if ( n[0].u.md_ival == ms_thislocale )
    2808           0 : return( -10000000 );
    2809           0 :     else if ( (n[0].u.md_ival&0x3ff) == (ms_thislocale&0x3ff) )
    2810           0 : return( -10000000 + (n[0].u.md_ival&~0x3ff) );
    2811           0 :     if ( n[0].u.md_ival == 0x409 )      /* English */
    2812           0 : return( -1000000 );
    2813           0 :     else if ( (n[0].u.md_ival&0x3ff) == 9 )
    2814           0 : return( -1000000 + (n[0].u.md_ival&~0x3ff) );
    2815             : 
    2816           0 : return( 1 );
    2817             : }
    2818             : 
    2819           0 : static int speciallang_sorter(const void *pt1, const void *pt2) {
    2820           0 :     const struct matrix_data *n1 = pt1, *n2 = pt2;
    2821             :     char buf1[20], buf2[20];
    2822             :     const char *l1, *l2;
    2823           0 :     int pos1=1, pos2=1;
    2824             : 
    2825             :     /* sort so that entries for the current language are first, then English */
    2826             :     /*  then alphabetical order */
    2827           0 :     if ( n1[0].u.md_ival==n2[0].u.md_ival )
    2828           0 : return( n1[1].u.md_ival - n2[1].u.md_ival );
    2829             : 
    2830           0 :     pos1 = specialvals(n1); pos2 = specialvals(n2);
    2831           0 :     if ( pos1<0 || pos2<0 )
    2832           0 : return( pos1-pos2 );
    2833           0 :     l1 = langname(n1[0].u.md_ival,buf1);
    2834           0 :     l2 = langname(n2[0].u.md_ival,buf2);
    2835           0 : return( strcoll(l1,l2));
    2836             : }
    2837             : 
    2838           0 : static void TTFNames_Resort(struct gfi_data *d) {
    2839             :     int(*compar)(const void *, const void *);
    2840           0 :     GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
    2841             :     int rows;
    2842           0 :     struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    2843             : 
    2844           0 :     if ( strings==NULL )
    2845           0 : return;
    2846             : 
    2847           0 :     if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNLangSort)) )
    2848           0 :         compar = lang_sorter;
    2849           0 :     else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNStringSort)) )
    2850           0 :         compar = strid_sorter;
    2851             :     else
    2852           0 :         compar = speciallang_sorter;
    2853           0 :     ms_thislocale = d->langlocalecode;
    2854           0 :     qsort(strings,rows,3*sizeof(struct matrix_data),compar);
    2855             : }
    2856             : 
    2857           0 : static int GFI_Char(struct gfi_data *d,GEvent *event) {
    2858           0 :     if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
    2859           0 :         help("fontinfo.html");
    2860           0 : return( true );
    2861           0 :     } else if ( GMenuIsCommand(event,H_("Save All|Alt+Ctl+S") )) {
    2862           0 :         MenuSaveAll(NULL,NULL,NULL);
    2863           0 : return( true );
    2864           0 :     } else if ( GMenuIsCommand(event,H_("Quit|Ctl+Q") )) {
    2865           0 :         MenuExit(NULL,NULL,NULL);
    2866           0 : return( true );
    2867           0 :     } else if ( GMenuIsCommand(event,H_("Close|Ctl+Shft+Q") )) {
    2868           0 :         GFI_CancelClose(d);
    2869           0 : return( true );
    2870             :     }
    2871           0 : return( false );
    2872             : }
    2873             : 
    2874           0 : static int CheckActiveStyleTranslation(struct gfi_data *d,
    2875             :         struct matrix_data *strings,int r, int rows, int iswws ) {
    2876             :     int i,j, eng_pos, other_pos;
    2877           0 :     char *english, *new=NULL, *temp, *pt;
    2878           0 :     int other_lang = strings[3*r].u.md_ival;
    2879           0 :     int changed = false;
    2880           0 :     int search_sid = iswws ? ttf_wwssubfamily : ttf_subfamily;
    2881             : 
    2882           0 :     for ( i=rows-1; i>=0 ; --i )
    2883           0 :         if ( strings[3*i+1].u.md_ival==search_sid &&
    2884           0 :                 strings[3*i].u.md_ival == 0x409 )
    2885           0 :     break;
    2886           0 :     if ( i<0 && iswws ) {
    2887           0 :         for ( i=rows-1; i>=0; --i )
    2888           0 :             if ( strings[3*i+1].u.md_ival==ttf_subfamily &&
    2889           0 :                     strings[3*i].u.md_ival == other_lang ) {
    2890           0 :                 new = copy(strings[3*i+2].u.md_str);
    2891           0 :                 changed = true;
    2892           0 :         break;
    2893             :             }
    2894             :     } else {
    2895           0 :         if ( i<0 || (english = strings[3*i+2].u.md_str)==NULL )
    2896           0 :             new = tn_recalculatedef(d,ttf_subfamily);
    2897             :         else
    2898           0 :             new = copy(english);
    2899           0 :         for ( i=0; stylelist[i]!=NULL; ++i ) {
    2900           0 :             eng_pos = other_pos = -1;
    2901           0 :             for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
    2902           0 :                 if ( stylelist[i][j].lang == other_lang ) {
    2903           0 :                     other_pos = j;
    2904           0 :             break;
    2905             :                 }
    2906             :             }
    2907           0 :             if ( other_pos==-1 )
    2908           0 :         continue;
    2909           0 :             for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
    2910           0 :                 if ( stylelist[i][j].lang == 0x409 &&
    2911           0 :                         (pt = strstrmatch(new,stylelist[i][j].str))!=NULL ) {
    2912           0 :                     if ( pt==new && strlen(stylelist[i][j].str)==strlen(new) ) {
    2913           0 :                         free(new);
    2914           0 :                         free(strings[3*r+2].u.md_str);
    2915           0 :                         if ( other_lang==0x415 ) {
    2916             :                             /* polish needs a word before the translation */
    2917           0 :                             strings[3*r+2].u.md_str = malloc(strlen("odmiana ")+strlen(stylelist[i][other_pos].str)+1);
    2918           0 :                             strcpy(strings[3*r+2].u.md_str,"odmiana ");
    2919           0 :                             strcat(strings[3*r+2].u.md_str,stylelist[i][other_pos].str);
    2920             :                         } else
    2921           0 :                             strings[3*r+2].u.md_str = copy(stylelist[i][other_pos].str);
    2922           0 :     return( true );
    2923             :                     }
    2924           0 :                     temp = malloc((strlen(new)
    2925           0 :                             + strlen(stylelist[i][other_pos].str)
    2926           0 :                             - strlen(stylelist[i][j].str)
    2927             :                             +1));
    2928           0 :                     strncpy(temp,new,pt-new);
    2929           0 :                     strcpy(temp+(pt-new),stylelist[i][other_pos].str);
    2930           0 :                     strcat(temp+(pt-new),pt+strlen(stylelist[i][j].str));
    2931           0 :                     free(new);
    2932           0 :                     new = temp;
    2933           0 :                     changed = true;
    2934           0 :             continue;
    2935             :                 }
    2936             :             }
    2937             :         }
    2938             :     }
    2939           0 :     if ( changed ) {
    2940           0 :         free(strings[3*r+2].u.md_str);
    2941           0 :         if ( other_lang==0x415 ) {
    2942             :             /* polish needs a word before the translation */
    2943           0 :             strings[3*r+2].u.md_str = malloc(strlen("odmiana ")+strlen(new)+1);
    2944           0 :             strcpy(strings[3*r+2].u.md_str,"odmiana ");
    2945           0 :             strcat(strings[3*r+2].u.md_str,new);
    2946           0 :             free(new);
    2947             :         } else
    2948           0 :             strings[3*r+2].u.md_str = new;
    2949             :     } else
    2950           0 :         free(new);
    2951           0 : return( changed );
    2952             : }
    2953             : 
    2954             : #define MID_ToggleBase  1
    2955             : #define MID_MultiEdit   2
    2956             : #define MID_Delete      3
    2957             : 
    2958           0 : static void TN_StrPopupDispatch(GWindow gw, GMenuItem *mi, GEvent *e) {
    2959           0 :     struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(gw));
    2960           0 :     GGadget *g = GWidgetGetControl(d->gw,CID_TNames);
    2961             : 
    2962           0 :     switch ( mi->mid ) {
    2963             :       case MID_ToggleBase: {
    2964             :         int rows;
    2965           0 :         struct matrix_data *strings = GMatrixEditGet(g, &rows);
    2966           0 :         strings[3*d->tn_active+2].frozen = !strings[3*d->tn_active+2].frozen;
    2967           0 :         if ( strings[3*d->tn_active+2].frozen ) {
    2968           0 :             free( strings[3*d->tn_active+2].u.md_str );
    2969           0 :             strings[3*d->tn_active+2].u.md_str = NULL;
    2970             :         } else {
    2971           0 :             strings[3*d->tn_active+2].u.md_str = tn_recalculatedef(d,strings[3*d->tn_active+1].u.md_ival);
    2972             :         }
    2973           0 :         GGadgetRedraw(g);
    2974           0 :       } break;
    2975             :       case MID_MultiEdit:
    2976           0 :         GMatrixEditStringDlg(g,d->tn_active,2);
    2977           0 :       break;
    2978             :       case MID_Delete:
    2979           0 :         GMatrixEditDeleteRow(g,d->tn_active);
    2980           0 :       break;
    2981             :     }
    2982           0 : }
    2983             : 
    2984           0 : static int menusort(const void *m1, const void *m2) {
    2985           0 :     const GMenuItem *mi1 = m1, *mi2 = m2;
    2986             : 
    2987             :     /* Should do a strcoll here, but I never wrote one */
    2988           0 :     if ( mi1->ti.text_is_1byte && mi2->ti.text_is_1byte )
    2989           0 : return( strcoll( (char *) (mi1->ti.text), (char *) (mi2->ti.text)) );
    2990             :     else
    2991           0 : return( u_strcmp(mi1->ti.text,mi2->ti.text));
    2992             : }
    2993             : 
    2994           0 : static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c) {
    2995             :     int rows, i, j;
    2996           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    2997             : 
    2998           0 :     for ( i=0; mi[i].ti.text!=NULL; ++i ) {
    2999           0 :         int strid = (intpt) mi[i].ti.userdata;
    3000           0 :         for ( j=0; j<rows; ++j ) if ( j!=r )
    3001           0 :             if ( strings[3*j].u.md_ival == strings[3*r].u.md_ival &&
    3002           0 :                     strings[3*j+1].u.md_ival == strid ) {
    3003           0 :                 mi[i].ti.disabled = true;
    3004           0 :         break;
    3005             :             }
    3006             :     }
    3007           0 :     qsort(mi,i,sizeof(mi[0]),menusort);
    3008           0 : }
    3009             : 
    3010           0 : static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c) {
    3011             :     int i;
    3012             : 
    3013           0 :     for ( i=0; mi[i].ti.text!=NULL; ++i );
    3014           0 :     qsort(mi,i,sizeof(mi[0]),menusort);
    3015           0 : }
    3016             : 
    3017           0 : static void TN_NewName(GGadget *g,int row) {
    3018             :     int rows;
    3019           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    3020             : 
    3021           0 :     strings[3*row+1].u.md_ival = ttf_subfamily;
    3022           0 : }
    3023             : 
    3024           0 : static void TN_FinishEdit(GGadget *g,int row,int col,int wasnew) {
    3025             :     int i,rows;
    3026           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    3027             :     uint8 found[ttf_namemax];
    3028           0 :     struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
    3029           0 :     int ret = false;
    3030             : 
    3031           0 :     if ( col==2 ) {
    3032           0 :         if ( strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0' ) {
    3033           0 :             GMatrixEditDeleteRow(g,row);
    3034           0 :             ret = true;
    3035             :         }
    3036             :     } else {
    3037           0 :         if ( col==0 ) {
    3038           0 :             memset(found,0,sizeof(found));
    3039           0 :             found[ttf_idontknow] = true;        /* reserved name id */
    3040           0 :             for ( i=0; i<rows; ++i ) if ( i!=row ) {
    3041           0 :                 if ( strings[3*i].u.md_ival == strings[3*row].u.md_ival )       /* Same language */
    3042           0 :                     found[strings[3*i+1].u.md_ival] = true;
    3043             :             }
    3044           0 :             if ( found[ strings[3*row+1].u.md_ival ] ) {
    3045             :                 /* This language already has an entry for this strid */
    3046             :                 /* pick another */
    3047           0 :                 if ( !found[ttf_subfamily] ) {
    3048           0 :                     strings[3*row+1].u.md_ival = ttf_subfamily;
    3049           0 :                     ret = true;
    3050             :                 } else {
    3051           0 :                     for ( i=0; i<ttf_namemax; ++i )
    3052           0 :                         if ( !found[i] ) {
    3053           0 :                             strings[3*row+1].u.md_ival = i;
    3054           0 :                             ret = true;
    3055           0 :                     break;
    3056             :                         }
    3057             :                 }
    3058             :             }
    3059             :         }
    3060           0 :         if ( (strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0') ) {
    3061           0 :             for ( i=0; i<rows; ++i ) if ( i!=row ) {
    3062           0 :                 if ( strings[3*row+1].u.md_ival == strings[3*i+1].u.md_ival &&
    3063           0 :                         (strings[3*row].u.md_ival&0xff) == (strings[3*i].u.md_ival&0xff)) {
    3064             :                     /* Same string, same language, different locale */
    3065             :                     /* first guess is the same as the other string. */
    3066           0 :                     if ( strings[3*i+2].u.md_str==NULL )
    3067           0 :                         strings[3*row+2].u.md_str = tn_recalculatedef(d,strings[3*row+1].u.md_ival );
    3068             :                     else
    3069           0 :                         strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
    3070           0 :                     ret = true;
    3071           0 :             break;
    3072             :                 }
    3073             :             }
    3074           0 :             if ( i==rows ) {
    3075             :             /* If we didn't find anything above, and if we've got a style */
    3076             :             /*  (subfamily) see if we can guess a translation from the english */
    3077           0 :                 if ( strings[3*row+1].u.md_ival == ttf_subfamily )
    3078           0 :                     ret |= CheckActiveStyleTranslation(d,strings,row,rows,false);
    3079           0 :                 else if ( strings[3*row+1].u.md_ival == ttf_wwssubfamily ) {
    3080             :                     /* First see if there is a wwssubfamily we can translate */
    3081             :                     /* then see if there is a subfamily we can copy */
    3082           0 :                     ret |= CheckActiveStyleTranslation(d,strings,row,rows,true);
    3083           0 :                 } else if ( strings[3*row+1].u.md_ival == ttf_wwsfamily ) {
    3084             :                     /* Copy the normal family */
    3085           0 :                     for ( i=rows-1; i>=0; --i )
    3086           0 :                         if ( strings[3*i+1].u.md_ival==ttf_family &&
    3087           0 :                                 strings[3*i].u.md_ival == strings[3*row].u.md_ival ) {
    3088           0 :                             strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
    3089           0 :                             ret = true;
    3090           0 :                     break;
    3091             :                         }
    3092           0 :                     if ( (i<0 || strings[3*i+2].u.md_str==NULL) &&
    3093           0 :                             strings[3*row].u.md_ival == 0x409 ) {
    3094           0 :                         strings[3*row+2].u.md_str = tn_recalculatedef(d,ttf_family);
    3095           0 :                         ret = true;
    3096             :                     }
    3097             :                 }
    3098             :             }
    3099             :         }
    3100             :     }
    3101           0 :     if ( ret )
    3102           0 :         GGadgetRedraw(g);
    3103           0 : }
    3104             : 
    3105           0 : static int TN_CanDelete(GGadget *g,int row) {
    3106             :     int rows;
    3107           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    3108           0 :     if ( strings==NULL )
    3109           0 : return( false );
    3110             : 
    3111           0 : return( !strings[3*row+2].user_bits );
    3112             : }
    3113             : 
    3114           0 : static void TN_PopupMenu(GGadget *g,GEvent *event,int r,int c) {
    3115           0 :     struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
    3116             :     int rows;
    3117           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    3118             :     GMenuItem mi[5];
    3119             :     int i;
    3120             : 
    3121           0 :     if ( strings==NULL )
    3122           0 : return;
    3123             : 
    3124           0 :     d->tn_active = r;
    3125             : 
    3126           0 :     memset(mi,'\0',sizeof(mi));
    3127           0 :     for ( i=0; i<3; ++i ) {
    3128           0 :         mi[i].ti.fg = COLOR_DEFAULT;
    3129           0 :         mi[i].ti.bg = COLOR_DEFAULT;
    3130           0 :         mi[i].mid = i+1;
    3131           0 :         mi[i].invoke = TN_StrPopupDispatch;
    3132           0 :         mi[i].ti.text_is_1byte = true;
    3133             :     }
    3134           0 :     mi[MID_Delete-1].ti.disabled = strings[3*r+2].user_bits;
    3135           0 :     mi[MID_ToggleBase-1].ti.disabled = !strings[3*r+2].user_bits;
    3136           0 :     if ( strings[3*r+2].frozen ) {
    3137           0 :         mi[MID_MultiEdit-1].ti.disabled = true;
    3138           0 :         mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Detach from PostScript Names");
    3139             :     } else {
    3140             :         char *temp;
    3141           0 :         mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Same as PostScript Names");
    3142           0 :         temp = tn_recalculatedef(d,strings[3*r+1].u.md_ival);
    3143           0 :         mi[MID_ToggleBase-1].ti.disabled = (temp==NULL);
    3144           0 :         free(temp);
    3145             :     }
    3146           0 :     if ( c!=2 )
    3147           0 :         mi[MID_MultiEdit-1].ti.disabled = true;
    3148           0 :     mi[MID_MultiEdit-1].ti.text = (unichar_t *) _("Multi-line edit");
    3149           0 :     mi[MID_Delete-1].ti.text = (unichar_t *) _("Delete");
    3150           0 :     GMenuCreatePopupMenu(event->w,event, mi);
    3151             : }
    3152             : 
    3153           0 : static int TN_PassChar(GGadget *g,GEvent *e) {
    3154           0 : return( GFI_Char(GGadgetGetUserData(g),e));
    3155             : }
    3156             : 
    3157           0 : static char *TN_BigEditTitle(GGadget *g,int r, int c) {
    3158             :     char buf[100], buf2[20];
    3159             :     const char *lang;
    3160             :     int k;
    3161             :     int rows;
    3162           0 :     struct matrix_data *strings = GMatrixEditGet(g, &rows);
    3163             : 
    3164           0 :     lang = langname(strings[3*r].u.md_ival,buf2);
    3165           0 :     for ( k=0; ttfnameids[k].text!=NULL && ttfnameids[k].userdata!=(void *) (intpt) strings[3*r+1].u.md_ival;
    3166           0 :             ++k );
    3167           0 :     snprintf(buf,sizeof(buf),_("%1$.30s string for %2$.30s"),
    3168           0 :             lang, (char *) ttfnameids[k].text );
    3169           0 : return( copy( buf ));
    3170             : }
    3171             : 
    3172           0 : static void TNMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    3173           0 :     SplineFont *sf = d->sf;
    3174             :     int i,j,k,cnt;
    3175             :     uint8 sawEnglishUS[ttf_namemax];
    3176             :     struct ttflangname *tln;
    3177             :     struct matrix_data *md;
    3178             : 
    3179           0 :     d->langlocalecode = MSLanguageFromLocale();
    3180             : 
    3181           0 :     memset(mi,0,sizeof(*mi));
    3182           0 :     mi->col_cnt = 3;
    3183           0 :     mi->col_init = ci;
    3184             : 
    3185           0 :     md = NULL;
    3186           0 :     for ( k=0; k<2; ++k ) {
    3187           0 :         memset(sawEnglishUS,0,sizeof(sawEnglishUS));
    3188           0 :         cnt = 0;
    3189           0 :         for ( tln = sf->names; tln!=NULL; tln = tln->next ) {
    3190           0 :             for ( i=0; i<ttf_namemax; ++i ) if ( i!=ttf_postscriptname && tln->names[i]!=NULL ) {
    3191           0 :                 if ( md!=NULL ) {
    3192           0 :                     md[3*cnt  ].u.md_ival = tln->lang;
    3193           0 :                     md[3*cnt+1].u.md_ival = i;
    3194           0 :                     md[3*cnt+2].u.md_str = copy(tln->names[i]);
    3195             :                 }
    3196           0 :                 ++cnt;
    3197           0 :                 if ( tln->lang==0x409 )
    3198           0 :                     sawEnglishUS[i] = true;
    3199             :             }
    3200             :         }
    3201           0 :         for ( i=0; ttfspecials[i]!=-1; ++i ) if ( !sawEnglishUS[ttfspecials[i]] ) {
    3202           0 :             if ( md!=NULL ) {
    3203           0 :                 md[3*cnt  ].u.md_ival = 0x409;
    3204           0 :                 md[3*cnt+1].u.md_ival = ttfspecials[i];
    3205           0 :                 md[3*cnt+2].u.md_str = NULL;
    3206             : /* if frozen is set then can't remove or edit. (old basedon bit) */
    3207           0 :                 md[3*cnt].frozen = md[3*cnt+1].frozen = md[3*cnt+2].frozen = true;
    3208             : /* if user_bits is set then can't remove. (old cantremove bit) */
    3209           0 :                 md[3*cnt].user_bits = md[3*cnt+1].user_bits = md[3*cnt+2].user_bits = true;
    3210             :             }
    3211           0 :             ++cnt;
    3212             :         }
    3213           0 :         if ( md==NULL )
    3214           0 :             md = calloc(3*(cnt+10),sizeof(struct matrix_data));
    3215             :     }
    3216           0 :     for ( i=0; i<cnt; ++i ) if ( md[3*cnt].u.md_ival==0x409 ) {
    3217           0 :         for ( j=0; ttfspecials[j]!=-1 && ttfspecials[j]!=md[3*cnt+1].u.md_ival; ++j );
    3218           0 :         md[3*i].user_bits = md[3*i+1].user_bits = md[3*i+2].user_bits =
    3219           0 :                 ( ttfspecials[j]!=-1 );
    3220             :     }
    3221           0 :     mi->matrix_data = md;
    3222           0 :     mi->initial_row_cnt = cnt;
    3223             : 
    3224           0 :     mi->initrow = TN_NewName;
    3225           0 :     mi->finishedit = TN_FinishEdit;
    3226           0 :     mi->candelete = TN_CanDelete;
    3227           0 :     mi->popupmenu = TN_PopupMenu;
    3228           0 :     mi->handle_key = TN_PassChar;
    3229           0 :     mi->bigedittitle = TN_BigEditTitle;
    3230           0 : }
    3231             : 
    3232           0 : static int GFI_SortBy(GGadget *g, GEvent *e) {
    3233           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    3234           0 :         struct gfi_data *d = (struct gfi_data *) GDrawGetUserData(GGadgetGetWindow(g));
    3235           0 :         TTFNames_Resort(d);
    3236           0 :         GGadgetRedraw(GWidgetGetControl(d->gw,CID_TNames));
    3237             :     }
    3238           0 : return( true );
    3239             : }
    3240             : 
    3241           0 : static int GFI_HelpOFL(GGadget *g, GEvent *e) {
    3242             : /* F1 Help to open a browser to sil.org Open Source License and FAQ */
    3243           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    3244           0 :         help("http://scripts.sil.org/OFL");
    3245             :     }
    3246           0 : return( true );
    3247             : }
    3248             : 
    3249           0 : static int GFI_AddOFL(GGadget *g, GEvent *e) {
    3250             : /* Add sil.org Open Source License (see ofl.c), and modify with current date */
    3251             : /* Author, and Font Family Name for rows[0,1] of the license. You can access */
    3252             : /* this routine from GUI at Element->Font_Info->TTF_Names. info at PS_Names. */
    3253           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    3254           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    3255           0 :         GGadget *tng = GWidgetGetControl(GGadgetGetWindow(g),CID_TNames);
    3256             :         int rows;
    3257             :         struct matrix_data *tns, *newtns;
    3258             :         int i,j,k,l,m, extras, len;
    3259             :         char *all, *pt, **data;
    3260             :         char buffer[1024], *bpt;
    3261           0 :         const char *author = GetAuthor();
    3262             :         char *reservedname, *fallback;
    3263             :         time_t now;
    3264             :         struct tm *tm;
    3265             : 
    3266           0 :         time(&now);
    3267           0 :         tm = localtime(&now);
    3268             : 
    3269           0 :         tns = GMatrixEditGet(tng, &rows); newtns = NULL;
    3270           0 :         for ( k=0; k<2; ++k ) {
    3271           0 :             extras = 0;
    3272           0 :             for ( i=0; ofl_str_lang_data[i].data!=NULL; ++i ) {
    3273           0 :                 for ( j=rows-1; j>=0; --j ) {
    3274           0 :                     if ( tns[j*3+1].u.md_ival==ofl_str_lang_data[i].strid &&
    3275           0 :                             tns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang ) {
    3276           0 :                         if ( k ) {
    3277           0 :                             free(newtns[j*3+2].u.md_str);
    3278           0 :                             newtns[j*3+2].u.md_str = NULL;
    3279             :                         }
    3280           0 :                 break;
    3281             :                     }
    3282             :                 }
    3283           0 :                 if ( j<0 )
    3284           0 :                     j = rows + extras++;
    3285           0 :                 if ( k ) {
    3286           0 :                     newtns[j*3+1].u.md_ival = ofl_str_lang_data[i].strid;
    3287           0 :                     newtns[j*3+0].u.md_ival = ofl_str_lang_data[i].lang;
    3288           0 :                     data = ofl_str_lang_data[i].data;
    3289           0 :                     reservedname = fallback = NULL;
    3290           0 :                     for ( m=0; m<rows; ++m ) {
    3291           0 :                         if ( newtns[j*3+1].u.md_ival==ttf_family ) {
    3292           0 :                             if ( newtns[j*3+0].u.md_ival==0x409 )
    3293           0 :                                 fallback = newtns[3*j+2].u.md_str;
    3294           0 :                             else if ( newtns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang )
    3295           0 :                                 reservedname = newtns[3*j+2].u.md_str;
    3296             :                         }
    3297             :                     }
    3298           0 :                     if ( reservedname==NULL )
    3299           0 :                         reservedname = fallback;
    3300           0 :                     if ( reservedname==NULL )
    3301           0 :                         reservedname = d->sf->familyname;
    3302           0 :                     for ( m=0; m<2; ++m ) {
    3303           0 :                         len = 0;
    3304           0 :                         for ( l=0; data[l]!=NULL; ++l ) {
    3305           0 :                             if ( l==0 ) {
    3306           0 :                                 sprintf( buffer, data[l], tm->tm_year+1900, author );
    3307           0 :                                 bpt = buffer;
    3308           0 :                             } else if ( l==1 ) {
    3309           0 :                                 sprintf( buffer, data[l], reservedname );
    3310           0 :                                 bpt = buffer;
    3311             :                             } else
    3312           0 :                                 bpt = data[l];
    3313           0 :                             if ( m ) {
    3314           0 :                                 strcpy( pt, bpt );
    3315           0 :                                 pt += strlen( bpt );
    3316           0 :                                 *pt++ = '\n';
    3317             :                             } else
    3318           0 :                                 len += strlen( bpt ) + 1;               /* for a new line */
    3319             :                         }
    3320           0 :                         if ( !m )
    3321           0 :                             newtns[j*3+2].u.md_str = all = pt = malloc(len+2);
    3322             :                     }
    3323           0 :                     if ( pt>all ) pt[-1] = '\0';
    3324           0 :                     else *pt = '\0';
    3325             :                 }
    3326             :             }
    3327           0 :             if ( !k ) {
    3328           0 :                 newtns = calloc((rows+extras)*3,sizeof(struct matrix_data));
    3329           0 :                 memcpy(newtns,tns,rows*3*sizeof(struct matrix_data));
    3330           0 :                 for ( i=0; i<rows; ++i )
    3331           0 :                     newtns[3*i+2].u.md_str = copy(newtns[3*i+2].u.md_str);
    3332             :             }
    3333             :         }
    3334           0 :         GMatrixEditSet(tng, newtns, rows+extras, false);
    3335           0 :         ff_post_notice(_("Using the OFL for your open fonts"),_(
    3336             :             "The OFL is a community-approved software license designed for libre/open font projects. \n"
    3337             :             "Fonts under the OFL can be used, studied, copied, modified, embedded, merged and redistributed while giving authors enough control and artistic integrity. For more details including an FAQ see http://scripts.sil.org/OFL. \n\n"
    3338             :             "This font metadata will help users, designers and distribution channels to know who you are, how to contact you and what rights you are granting. \n" 
    3339             :         "When releasing modified versions, remember to add your additional notice, including any extra Reserved Font Name(s). \n\n" 
    3340             :             "Have fun designing open fonts!" ));
    3341             :     }
    3342           0 : return( true );
    3343             : }
    3344             : 
    3345           0 : static int ss_cmp(const void *_md1, const void *_md2) {
    3346           0 :     const struct matrix_data *md1 = _md1, *md2 = _md2;
    3347             : 
    3348             :     char buf1[20], buf2[20];
    3349             :     const char *l1, *l2;
    3350             : 
    3351           0 :     if ( md1[1].u.md_ival == md2[1].u.md_ival ) {
    3352           0 :        l1 = langname(md1[0].u.md_ival,buf1);
    3353           0 :        l2 = langname(md2[0].u.md_ival,buf2);
    3354           0 : return( strcoll(l1,l2));
    3355             :     }
    3356           0 : return( md1[1].u.md_ival - md2[1].u.md_ival );
    3357             : }
    3358             : 
    3359           0 : static void SSMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    3360           0 :     SplineFont *sf = d->sf;
    3361             :     struct matrix_data *md;
    3362             :     struct otffeatname *fn;
    3363             :     struct otfname *on;
    3364             :     int cnt;
    3365             : 
    3366           0 :     memset(mi,0,sizeof(*mi));
    3367           0 :     mi->col_cnt = 3;
    3368           0 :     mi->col_init = ssci;
    3369             : 
    3370           0 :     for ( cnt=0, fn=sf->feat_names; fn!=NULL; fn=fn->next ) {
    3371           0 :         for ( on=fn->names; on!=NULL; on=on->next, ++cnt );
    3372             :     }
    3373           0 :     md = calloc(3*(cnt+10),sizeof(struct matrix_data));
    3374           0 :     for ( cnt=0, fn=sf->feat_names; fn!=NULL; fn=fn->next ) {
    3375           0 :         for ( on=fn->names; on!=NULL; on=on->next, ++cnt ) {
    3376           0 :             md[3*cnt  ].u.md_ival = on->lang;
    3377           0 :             md[3*cnt+1].u.md_ival = fn->tag;
    3378           0 :             md[3*cnt+2].u.md_str = copy(on->name);
    3379             :         }
    3380             :     }
    3381           0 :     qsort( md, cnt, 3*sizeof(struct matrix_data), ss_cmp );
    3382           0 :     mi->matrix_data = md;
    3383           0 :     mi->initial_row_cnt = cnt;
    3384           0 : }
    3385             : 
    3386           0 : static int size_cmp(const void *_md1, const void *_md2) {
    3387           0 :     const struct matrix_data *md1 = _md1, *md2 = _md2;
    3388             : 
    3389             :     char buf1[20], buf2[20];
    3390             :     const char *l1, *l2;
    3391             : 
    3392           0 :    l1 = langname(md1[0].u.md_ival,buf1);
    3393           0 :    l2 = langname(md2[0].u.md_ival,buf2);
    3394           0 : return( strcoll(l1,l2));
    3395             : }
    3396             : 
    3397           0 : static void SizeMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    3398           0 :     SplineFont *sf = d->sf;
    3399             :     struct matrix_data *md;
    3400             :     struct otfname *on;
    3401             :     int cnt;
    3402             : 
    3403           0 :     memset(mi,0,sizeof(*mi));
    3404           0 :     mi->col_cnt = 2;
    3405           0 :     mi->col_init = sizeci;
    3406             : 
    3407           0 :     for ( cnt=0, on=sf->fontstyle_name; on!=NULL; on=on->next )
    3408           0 :         ++cnt;
    3409           0 :     md = calloc(2*(cnt+10),sizeof(struct matrix_data));
    3410           0 :     for ( cnt=0, on=sf->fontstyle_name; on!=NULL; on=on->next, ++cnt ) {
    3411           0 :         md[2*cnt  ].u.md_ival = on->lang;
    3412           0 :         md[2*cnt+1].u.md_str = copy(on->name);
    3413             :     }
    3414           0 :     qsort( md, cnt, 2*sizeof(struct matrix_data), size_cmp );
    3415           0 :     mi->matrix_data = md;
    3416           0 :     mi->initial_row_cnt = cnt;
    3417           0 : }
    3418             : 
    3419           0 : static int Gasp_Default(GGadget *g, GEvent *e) {
    3420           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    3421           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    3422           0 :         GGadget *gg = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
    3423             :         int rows;
    3424             :         struct matrix_data *gasp;
    3425             : 
    3426           0 :         if ( !SFHasInstructions(d->sf)) {
    3427           0 :             rows = 1;
    3428           0 :             gasp = calloc(rows*5,sizeof(struct matrix_data));
    3429           0 :             gasp[0].u.md_ival = 65535;
    3430           0 :             gasp[1].u.md_ival = 0;      /* no grid fit (we have no instructions, we can't grid fit) */
    3431           0 :             gasp[2].u.md_ival = 1;      /* do anti-alias */
    3432           0 :             gasp[3].u.md_ival = 0;      /* do symmetric smoothing */
    3433           0 :             gasp[4].u.md_ival = 0;      /* do no grid fit w/ sym smooth */
    3434             :         } else {
    3435           0 :             rows = 3;
    3436           0 :             gasp = calloc(rows*5,sizeof(struct matrix_data));
    3437           0 :             gasp[0].u.md_ival = 8;     gasp[1].u.md_ival = 0; gasp[2].u.md_ival = 1;
    3438           0 :                     gasp[3].u.md_ival = 0; gasp[4].u.md_ival = 0;
    3439           0 :             gasp[5].u.md_ival = 16;    gasp[6].u.md_ival = 1; gasp[7].u.md_ival = 0;
    3440           0 :                     gasp[8].u.md_ival = 0; gasp[9].u.md_ival = 0;
    3441           0 :             gasp[10].u.md_ival = 65535; gasp[11].u.md_ival = 1; gasp[12].u.md_ival = 1;
    3442           0 :                     gasp[13].u.md_ival = 0; gasp[14].u.md_ival = 0;
    3443             :         }
    3444           0 :         GMatrixEditSet(gg,gasp,rows,false);
    3445             :     }
    3446           0 : return( true );
    3447             : }
    3448             : 
    3449           0 : static int Gasp_CanDelete(GGadget *g,int row) {
    3450             :     int rows;
    3451           0 :     struct matrix_data *gasp = GMatrixEditGet(g, &rows);
    3452           0 :     if ( gasp==NULL )
    3453           0 : return( false );
    3454             : 
    3455             :     /* Only allow them to delete the sentinal entry if that would give us an */
    3456             :     /* empty gasp table */
    3457           0 : return( gasp[5*row].u.md_ival!=0xffff || rows==1 );
    3458             : }
    3459             : 
    3460           0 : static int gasp_comp(const void *_md1, const void *_md2) {
    3461           0 :     const struct matrix_data *md1 = _md1, *md2 = _md2;
    3462           0 : return( md1->u.md_ival - md2->u.md_ival );
    3463             : }
    3464             : 
    3465           0 : static void Gasp_FinishEdit(GGadget *g,int row,int col,int wasnew) {
    3466             :     int rows;
    3467           0 :     struct matrix_data *gasp = GMatrixEditGet(g, &rows);
    3468             : 
    3469           0 :     if ( col==0 ) {
    3470           0 :         qsort(gasp,rows,5*sizeof(struct matrix_data),gasp_comp);
    3471           0 :         GGadgetRedraw(g);
    3472             :     }
    3473           0 : }
    3474             : 
    3475           0 : static void GaspMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    3476           0 :     SplineFont *sf = d->sf;
    3477             :     int i;
    3478             :     struct matrix_data *md;
    3479             : 
    3480           0 :     memset(mi,0,sizeof(*mi));
    3481           0 :     mi->col_cnt = 5;
    3482           0 :     mi->col_init = gaspci;
    3483             : 
    3484           0 :     if ( sf->gasp_cnt==0 ) {
    3485           0 :         md = calloc(5,sizeof(struct matrix_data));
    3486           0 :         mi->initial_row_cnt = 0;
    3487             :     } else {
    3488           0 :         md = calloc(5*sf->gasp_cnt,sizeof(struct matrix_data));
    3489           0 :         for ( i=0; i<sf->gasp_cnt; ++i ) {
    3490           0 :             md[5*i  ].u.md_ival = sf->gasp[i].ppem;
    3491           0 :             md[5*i+1].u.md_ival = (sf->gasp[i].flags&1)?1:0;
    3492           0 :             md[5*i+2].u.md_ival = (sf->gasp[i].flags&2)?1:0;
    3493           0 :             md[5*i+3].u.md_ival = (sf->gasp[i].flags&8)?1:0;
    3494           0 :             md[5*i+4].u.md_ival = (sf->gasp[i].flags&4)?1:0;
    3495             :         }
    3496           0 :         mi->initial_row_cnt = sf->gasp_cnt;
    3497             :     }
    3498           0 :     mi->matrix_data = md;
    3499             : 
    3500           0 :     mi->finishedit = Gasp_FinishEdit;
    3501           0 :     mi->candelete = Gasp_CanDelete;
    3502           0 :     mi->handle_key = TN_PassChar;
    3503           0 : }
    3504             : 
    3505           0 : static int GFI_GaspVersion(GGadget *g, GEvent *e) {
    3506           0 :     if ( e->u.control.subtype == et_listselected ) {
    3507           0 :         int version = GGadgetGetFirstListSelectedItem(g);
    3508           0 :         GGadget *gasp = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
    3509           0 :         if ( version == 0 ) {
    3510           0 :             GMatrixEditShowColumn(gasp,3,false);
    3511           0 :             GMatrixEditShowColumn(gasp,4,false);
    3512             :         } else {
    3513           0 :             GMatrixEditShowColumn(gasp,3,true);
    3514           0 :             GMatrixEditShowColumn(gasp,4,true);
    3515             :         }
    3516           0 :         GGadgetRedraw(gasp);
    3517             :     }
    3518           0 : return( true );
    3519             : }
    3520             : 
    3521           0 : static void Layers_BackgroundEnable(GGadget *g,GMenuItem *mi, int r, int c) {
    3522           0 :     int disable = r<=ly_fore;
    3523           0 :     mi[0].ti.disabled = disable;
    3524           0 :     mi[1].ti.disabled = disable;
    3525           0 : }
    3526             : 
    3527           0 : static int Layers_CanDelete(GGadget *g,int row) {
    3528           0 : return( row>ly_fore );
    3529             : }
    3530             : 
    3531           0 : static void Layers_InitRow(GGadget *g,int row) {
    3532           0 :     int rows, cols = GMatrixEditGetColCnt(g);
    3533           0 :     struct matrix_data *layers = GMatrixEditGet(g, &rows);
    3534           0 :     int isquadratic = GGadgetIsChecked(GWidgetGetControl(GGadgetGetWindow(g),CID_IsOrder2));
    3535             : 
    3536           0 :     layers[row*cols+1].u.md_ival = isquadratic;
    3537           0 : }
    3538             : 
    3539           0 : static void LayersMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
    3540           0 :     SplineFont *sf = d->sf;
    3541             :     int i,j;
    3542             :     struct matrix_data *md;
    3543             : 
    3544           0 :     memset(mi,0,sizeof(*mi));
    3545           0 :     mi->col_cnt = 4;
    3546           0 :     mi->col_init = layersci;
    3547             : 
    3548           0 :     md = calloc(4*(sf->layer_cnt+1),sizeof(struct matrix_data));
    3549           0 :     for ( i=j=0; i<sf->layer_cnt; ++i ) {
    3550           0 :         md[4*j  ].u.md_str  = copy(sf->layers[i].name);
    3551           0 :         md[4*j+1].u.md_ival = sf->layers[i].order2;
    3552           0 :         md[4*j+2].u.md_ival = sf->layers[i].background;
    3553           0 :         md[4*j+3].u.md_ival = i+1;
    3554           0 :         ++j;
    3555             :     }
    3556           0 :     mi->initial_row_cnt = sf->layer_cnt;
    3557           0 :     mi->matrix_data = md;
    3558             : 
    3559           0 :     mi->initrow   = Layers_InitRow;
    3560           0 :     mi->candelete = Layers_CanDelete;
    3561           0 : }
    3562             : 
    3563           0 : static int GFI_Type3Change(GGadget *g, GEvent *e) {
    3564           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    3565           0 :         GWindow gw = GGadgetGetWindow(g);
    3566           0 :         int type3 = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
    3567           0 :         int mixed = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMixed));
    3568           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsMixed), !type3);
    3569           0 :         if ( type3 )
    3570           0 :             GGadgetSetChecked(GWidgetGetControl(gw,CID_IsMixed), false );
    3571           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsOrder2), !type3);
    3572           0 :         if ( type3 )
    3573           0 :             GGadgetSetChecked(GWidgetGetControl(gw,CID_IsOrder2), false );
    3574           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsOrder3), !type3);
    3575           0 :         if ( type3 )
    3576           0 :             GGadgetSetChecked(GWidgetGetControl(gw,CID_IsOrder3), true );
    3577           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_GuideOrder2), !type3 && mixed);
    3578           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_Backgrounds), !type3);
    3579             :     }
    3580           0 : return( true );
    3581             : }
    3582             : 
    3583           0 : static int GFI_OrderChange(GGadget *g, GEvent *e) {
    3584           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    3585           0 :         GWindow gw = GGadgetGetWindow(g);
    3586           0 :         GGadget *backs = GWidgetGetControl(gw,CID_Backgrounds);
    3587           0 :         int mixed = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMixed));
    3588           0 :         int cubic = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsOrder3));
    3589           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_IsMultiLayer), cubic);
    3590           0 :         GGadgetSetEnabled(GWidgetGetControl(gw,CID_GuideOrder2), mixed);
    3591           0 :         if ( !mixed ) {
    3592           0 :             GGadgetSetChecked(GWidgetGetControl(gw,CID_GuideOrder2), !cubic );
    3593             :         }
    3594           0 :         GGadgetSetEnabled(backs, true);
    3595           0 :         GMatrixEditEnableColumn(backs, 1, mixed);
    3596           0 :         if ( !mixed ) {
    3597           0 :             int col = GMatrixEditGetColCnt(backs), rows, i;
    3598           0 :             struct matrix_data *md = GMatrixEditGet(backs, &rows);
    3599           0 :             for ( i=0; i<rows; ++i )
    3600           0 :                 md[i*col+1].u.md_ival = !cubic;
    3601             :         }
    3602           0 :         GGadgetRedraw(backs);
    3603             :     }
    3604           0 : return( true );
    3605             : }
    3606             : 
    3607           0 : static void BDFsSetAsDs(SplineFont *sf) {
    3608             :     BDFFont *bdf;
    3609             :     real scale;
    3610             : 
    3611           0 :     for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
    3612           0 :         scale = bdf->pixelsize / (real) (sf->ascent+sf->descent);
    3613           0 :         bdf->ascent = rint(sf->ascent*scale);
    3614           0 :         bdf->descent = bdf->pixelsize-bdf->ascent;
    3615             :     }
    3616           0 : }
    3617             : 
    3618             : static char *texparams[] = { N_("Slant:"), N_("Space:"), N_("Stretch:"),
    3619             :         N_("Shrink:"), N_("XHeight:"), N_("Quad:"),
    3620             : /* GT: Extra Space, see below for a full comment */
    3621             :         N_("Extra Sp:"), NULL };
    3622             : static char *texpopups[] = { N_("In an italic font the horizontal change per unit vertical change"),
    3623             :     N_("The amount of space between words when using this font"),
    3624             :     N_("The amount of stretchable space between words when using this font"),
    3625             :     N_("The amount the space between words may shrink when using this font"),
    3626             :     N_("The height of the lower case letters with flat tops"),
    3627             :     N_("The width of one em"),
    3628             :     N_("Either:\nThe amount of extra space to be added after a sentence\nOr the space to be used within math formulae"),
    3629             :     NULL};
    3630             : 
    3631           0 : static int ParseTeX(struct gfi_data *d) {
    3632           0 :     int i, err=false;
    3633           0 :     double em = (d->sf->ascent+d->sf->descent), val;
    3634             : 
    3635           0 :     for ( i=0; texparams[i]!=0 ; ++i ) {
    3636           0 :         val = GetReal8(d->gw,CID_TeX+i,texparams[i],&err);
    3637           0 :         d->texdata.params[i] = rint( val/em * (1<<20) );
    3638             :     }
    3639           0 :     if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
    3640           0 :         d->texdata.type = tex_text;
    3641           0 :     else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
    3642           0 :         d->texdata.type = tex_math;
    3643             :     else
    3644           0 :         d->texdata.type = tex_mathext;
    3645           0 : return( !err );
    3646             : }
    3647             : 
    3648           0 : static int ttfmultuniqueids(SplineFont *sf,struct gfi_data *d) {
    3649             :     struct ttflangname *tln;
    3650           0 :     int found = false;
    3651             :     int i;
    3652             : 
    3653           0 :     if ( d->names_set ) {
    3654           0 :         GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
    3655             :         int rows;
    3656           0 :         struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3657           0 :         for ( i=0; i<rows; ++i )
    3658           0 :             if ( strings[3*i+1].u.md_ival==ttf_uniqueid ) {
    3659           0 :                 if ( found )
    3660           0 : return( true );
    3661           0 :                 found = true;
    3662             :             }
    3663             :     } else {
    3664           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next )
    3665           0 :             if ( tln->names[ttf_uniqueid]!=NULL ) {
    3666           0 :                 if ( found )
    3667           0 : return( true );
    3668           0 :                 found = true;
    3669             :             }
    3670             :     }
    3671           0 : return( false );
    3672             : }
    3673             : 
    3674           0 : static int ttfuniqueidmatch(SplineFont *sf,struct gfi_data *d) {
    3675             :     struct ttflangname *tln;
    3676             :     int i;
    3677             : 
    3678           0 :     if ( sf->names==NULL )
    3679           0 : return( false );
    3680             : 
    3681           0 :     if ( !d->names_set ) {
    3682           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next )
    3683           0 :             if ( tln->names[ttf_uniqueid]!=NULL )
    3684           0 : return( true );
    3685             :     } else {
    3686           0 :         GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
    3687             :         int rows;
    3688           0 :         struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3689             : 
    3690           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
    3691           0 :             if ( tln->names[ttf_uniqueid]==NULL )
    3692           0 :         continue;               /* Not set, so if it has been given a new value */
    3693             :                                 /*  that's a change, and if it hasn't that's ok */
    3694           0 :             for ( i=0; i<rows; ++i )
    3695           0 :                 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
    3696           0 :             break;
    3697           0 :             if ( i==rows )
    3698           0 :         continue;               /* removed. That's a change */
    3699           0 :             if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )==0 )
    3700           0 : return( true );         /* name unchanged */
    3701             :         }
    3702             :     }
    3703           0 : return( false );
    3704             : }
    3705             : 
    3706           0 : static void ttfuniqueidfixup(SplineFont *sf,struct gfi_data *d) {
    3707             :     struct ttflangname *tln;
    3708           0 :     char *changed = NULL;
    3709             :     int i;
    3710             : 
    3711           0 :     if ( sf->names==NULL )
    3712           0 : return;
    3713             : 
    3714           0 :     if ( !d->names_set ) {
    3715           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
    3716           0 :             free( tln->names[ttf_uniqueid]);
    3717           0 :             tln->names[ttf_uniqueid] = NULL;
    3718             :         }
    3719             :     } else {
    3720           0 :         GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
    3721             :         int rows;
    3722           0 :         struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3723             : 
    3724             :         /* see if any instances of the name have changed */
    3725           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
    3726           0 :             if ( tln->names[ttf_uniqueid]==NULL )
    3727           0 :         continue;
    3728           0 :             for ( i=0; i<rows; ++i )
    3729           0 :                 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
    3730           0 :             break;
    3731           0 :             if ( i==rows )
    3732           0 :         continue;
    3733           0 :             if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )!=0 )
    3734           0 :                 changed = copy(strings[3*i+2].u.md_str );
    3735           0 :         break;
    3736             :         }
    3737             :         /* All unique ids should be the same, if any changed set the unchanged */
    3738             :         /*  ones to the one that did (or the first of many if several changed) */
    3739           0 :         for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
    3740           0 :             if ( tln->names[ttf_uniqueid]==NULL )
    3741           0 :         continue;
    3742           0 :             for ( i=0; i<rows; ++i )
    3743           0 :                 if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
    3744           0 :             break;
    3745           0 :             if ( i==rows )
    3746           0 :         continue;
    3747           0 :             if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str)==0 ) {
    3748           0 :                 free(strings[3*i+2].u.md_str);
    3749           0 :                 strings[3*i+2].u.md_str = changed!=NULL
    3750             :                         ? copy( changed )
    3751           0 :                         : NULL;
    3752             :             }
    3753             :         }
    3754             :     }
    3755             : }
    3756             : 
    3757           0 : static void StoreTTFNames(struct gfi_data *d) {
    3758             :     struct ttflangname *tln;
    3759           0 :     SplineFont *sf = d->sf;
    3760             :     int i;
    3761           0 :     GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
    3762             :     int rows;
    3763           0 :     struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3764             : 
    3765           0 :     TTFLangNamesFree(sf->names); sf->names = NULL;
    3766             : 
    3767           0 :     for ( i=0; i<rows; ++i ) {
    3768           0 :         for ( tln=sf->names; tln!=NULL && tln->lang!=strings[3*i].u.md_ival; tln=tln->next );
    3769           0 :         if ( tln==NULL ) {
    3770           0 :             tln = chunkalloc(sizeof(struct ttflangname));
    3771           0 :             tln->lang = strings[3*i].u.md_ival;
    3772           0 :             tln->next = sf->names;
    3773           0 :             sf->names = tln;
    3774             :         }
    3775           0 :         tln->names[strings[3*i+1].u.md_ival] = copy(strings[3*i+2].u.md_str );
    3776             :     }
    3777             : 
    3778           0 :     TTF_PSDupsDefault(sf);
    3779           0 : }
    3780             : 
    3781           0 : static int SSNameValidate(struct gfi_data *d) {
    3782           0 :     GGadget *edit = GWidgetGetControl(d->gw,CID_SSNames);
    3783             :     int rows;
    3784           0 :     struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3785             :     int i, j, k;
    3786             : 
    3787           0 :     for ( i=0; i<rows; ++i ) {
    3788           0 :         if ( strings[3*i+2].u.md_str == NULL )
    3789           0 :     continue;
    3790           0 :         for ( j=i+1; j<rows; ++j ) {
    3791           0 :             if ( strings[3*j+2].u.md_str == NULL )
    3792           0 :         continue;
    3793           0 :             if ( strings[3*i  ].u.md_ival == strings[3*j  ].u.md_ival &&
    3794           0 :                     strings[3*i+1].u.md_ival == strings[3*j+1].u.md_ival ) {
    3795           0 :                 uint32 tag = strings[3*i+1].u.md_ival;
    3796           0 :                 for ( k=0; mslanguages[k].text!=NULL &&
    3797           0 :                         ((intpt) mslanguages[k].userdata)!=strings[3*i].u.md_ival; ++k );
    3798           0 :                 if ( mslanguages[k].text==NULL ) k=0;
    3799           0 :                 ff_post_error(_("Duplicate StyleSet Name"),_("The feature '%c%c%c%c' is named twice in language %s\n%.80s\n%.80s"),
    3800             :                         tag>>24, tag>>16, tag>>8, tag,
    3801             :                         mslanguages[k].text,
    3802           0 :                         strings[3*i+2].u.md_str,
    3803           0 :                         strings[3*j+2].u.md_str
    3804             :                         );
    3805           0 : return( false );
    3806             :             }
    3807             :         }
    3808             :     }
    3809           0 : return( true );
    3810             : }
    3811             : 
    3812           0 : static void StoreSSNames(struct gfi_data *d) {
    3813           0 :     GGadget *edit = GWidgetGetControl(d->gw,CID_SSNames);
    3814             :     int rows;
    3815           0 :     struct matrix_data *strings = GMatrixEditGet(edit, &rows);
    3816             :     int i;
    3817             :     uint32 tag, lang;
    3818             :     struct otffeatname *fn;
    3819             :     struct otfname *on;
    3820           0 :     SplineFont *sf = d->sf;
    3821             : 
    3822           0 :     OtfFeatNameListFree(sf->feat_names);
    3823           0 :     sf->feat_names = NULL;
    3824             : 
    3825           0 :     qsort( strings, rows, 3*sizeof(struct matrix_data), ss_cmp );
    3826           0 :     for ( i=rows-1; i>=0; --i ) {
    3827           0 :         if ( strings[3*i+2].u.md_str == NULL )
    3828           0 :     continue;
    3829           0 :         tag = strings[3*i+1].u.md_ival;
    3830           0 :         lang = strings[3*i].u.md_ival;
    3831           0 :         for ( fn=sf->feat_names; fn!=NULL && fn->tag!=tag; fn=fn->next );
    3832           0 :         if ( fn==NULL ) {
    3833           0 :             fn = chunkalloc(sizeof(*fn));
    3834           0 :             fn->tag = tag;
    3835           0 :             fn->next = sf->feat_names;
    3836           0 :             sf->feat_names = fn;
    3837             :         }
    3838           0 :         on = chunkalloc(sizeof(*on));
    3839           0 :         on->next = fn->names;
    3840           0 :         fn->names = on;
    3841           0 :         on->lang = lang;
    3842           0 :         on->name = copy(strings[3*i+2].u.md_str );
    3843             :     }
    3844           0 : }
    3845             : 
    3846           0 : static void GFI_ApplyLookupChanges(struct gfi_data *gfi) {
    3847             :     int i,j, isgpos;
    3848             :     OTLookup *last;
    3849           0 :     SplineFont *sf = gfi->sf;
    3850             :     struct lookup_subtable *sublast;
    3851             : 
    3852           0 :     for ( isgpos=0; isgpos<2; ++isgpos ) {
    3853           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    3854           0 :         for ( i=0; i<lk->cnt; ++i ) {
    3855           0 :             if ( lk->all[i].deleted )
    3856           0 :                 SFRemoveLookup(gfi->sf,lk->all[i].lookup,0);
    3857           0 :             else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    3858           0 :                 if ( lk->all[i].subtables[j].deleted )
    3859           0 :                     SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable,0);
    3860             :             }
    3861             :         }
    3862           0 :         last = NULL;
    3863           0 :         for ( i=0; i<lk->cnt; ++i ) {
    3864           0 :             if ( !lk->all[i].deleted ) {
    3865           0 :                 if ( last!=NULL )
    3866           0 :                     last->next = lk->all[i].lookup;
    3867           0 :                 else if ( isgpos )
    3868           0 :                     sf->gpos_lookups = lk->all[i].lookup;
    3869             :                 else
    3870           0 :                     sf->gsub_lookups = lk->all[i].lookup;
    3871           0 :                 last = lk->all[i].lookup;
    3872           0 :                 sublast = NULL;
    3873           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    3874           0 :                     if ( !lk->all[i].subtables[j].deleted ) {
    3875           0 :                         if ( sublast!=NULL )
    3876           0 :                             sublast->next = lk->all[i].subtables[j].subtable;
    3877             :                         else
    3878           0 :                             last->subtables = lk->all[i].subtables[j].subtable;
    3879           0 :                         sublast = lk->all[i].subtables[j].subtable;
    3880           0 :                         sublast->lookup = last;
    3881             :                     }
    3882             :                 }
    3883           0 :                 if ( sublast!=NULL )
    3884           0 :                     sublast->next = NULL;
    3885             :                 else
    3886           0 :                     last->subtables = NULL;
    3887             :             }
    3888           0 :             free(lk->all[i].subtables);
    3889             :         }
    3890           0 :         if ( last!=NULL )
    3891           0 :             last->next = NULL;
    3892           0 :         else if ( isgpos )
    3893           0 :             sf->gpos_lookups = NULL;
    3894             :         else
    3895           0 :             sf->gsub_lookups = NULL;
    3896           0 :         free(lk->all);
    3897             :     }
    3898           0 : }
    3899             : 
    3900           0 : static void hexparse(GWindow gw, int cid, char *name, uint32 *data, int len, int *err) {
    3901             :     int i;
    3902             :     const unichar_t *ret;
    3903             :     unichar_t *end;
    3904             : 
    3905           0 :     ret = _GGadgetGetTitle(GWidgetGetControl(gw,cid));
    3906           0 :     end = (unichar_t *) ret;
    3907           0 :     for ( i=0; i<len; ++i ) {
    3908           0 :         if ( i!=0 ) {
    3909           0 :             if ( *end=='.' )
    3910           0 :                 ++end;
    3911             :             else {
    3912           0 :                 *err = true;
    3913           0 :                 ff_post_error(_("Bad hex number"), _("Bad hex number in %s"), name);
    3914           0 : return;
    3915             :             }
    3916             :         }
    3917           0 :         data[len-1-i] = u_strtoul(end,&end,16);
    3918             :     }
    3919           0 :     if ( *end!='\0' ) {
    3920           0 :         *err = true;
    3921           0 :         ff_post_error(_("Bad hex number"), _("Bad hex number in %s"), name);
    3922           0 : return;
    3923             :     }
    3924             : }
    3925             : 
    3926           0 : static int GFI_AnyLayersRemoved(struct gfi_data *d) {
    3927           0 :     GGadget *backs = GWidgetGetControl(d->gw,CID_Backgrounds);
    3928           0 :     int rows, cols = GMatrixEditGetColCnt(backs), r, origr, l;
    3929           0 :     struct matrix_data *layers = GMatrixEditGet(backs, &rows);
    3930           0 :     SplineFont *sf = d->sf;
    3931             :     int anytrue_before, anytrue_after;
    3932             : 
    3933           0 :     for ( l=0; l<sf->layer_cnt; ++l )
    3934           0 :         sf->layers[l].ticked = false;
    3935             : 
    3936           0 :     anytrue_before = anytrue_after = false;
    3937           0 :     for ( r=ly_fore; r<sf->layer_cnt; ++r ) {
    3938           0 :         if ( sf->layers[r].order2 )
    3939           0 :             anytrue_before = true;
    3940             :     }
    3941           0 :     for ( r=0; r<rows; ++r ) if ( (origr = layers[r*cols+3].u.md_ival)!=0 ) {
    3942           0 :         --origr;
    3943           0 :         sf->layers[origr].ticked = true;
    3944           0 :         if ( origr>=ly_fore && layers[r*cols+1].u.md_ival )
    3945           0 :             anytrue_after = true;
    3946             :     }
    3947             : 
    3948           0 :     for ( l=sf->layer_cnt-1; l>ly_fore; --l ) if ( !sf->layers[l].ticked )
    3949           0 : return( 1 | (anytrue_before && !anytrue_after? 2 : 0) );
    3950             : 
    3951           0 : return( 0 | (anytrue_before && !anytrue_after? 2 : 0) );
    3952             : }
    3953             : 
    3954           0 : static int GFI_SetLayers(struct gfi_data *d) {
    3955           0 :     GGadget *backs = GWidgetGetControl(d->gw,CID_Backgrounds);
    3956           0 :     int rows, cols = GMatrixEditGetColCnt(backs), r, origr, l;
    3957           0 :     struct matrix_data *layers = GMatrixEditGet(backs, &rows);
    3958           0 :     SplineFont *sf = d->sf;
    3959           0 :     int changed = false;
    3960             : 
    3961           0 :     for ( l=0; l<sf->layer_cnt; ++l )
    3962           0 :         sf->layers[l].ticked = false;
    3963             : 
    3964           0 :     for ( r=0; r<rows; ++r ) if ( (origr = layers[r*cols+3].u.md_ival)!=0 ) {
    3965             :         /* It's an old layer. Do we need to change anything? */
    3966           0 :         --origr;
    3967           0 :         sf->layers[origr].ticked = true;
    3968           0 :         if ( sf->layers[origr].order2 != layers[r*cols+1].u.md_ival ) {
    3969           0 :             if ( layers[r*cols+1].u.md_ival )
    3970           0 :                 SFConvertLayerToOrder2(sf,origr);
    3971             :             else
    3972           0 :                 SFConvertLayerToOrder3(sf,origr);
    3973           0 :             changed = true;
    3974             :         }
    3975           0 :         if ( sf->layers[origr].background != layers[r*cols+2].u.md_ival ) {
    3976           0 :             SFLayerSetBackground(sf,origr,layers[r*cols+2].u.md_ival);
    3977           0 :             changed = true;
    3978             :         }
    3979           0 :         if ( layers[r*cols+0].u.md_str!=NULL && *layers[r*cols+0].u.md_str!='\0' &&
    3980           0 :                 strcmp( sf->layers[origr].name, layers[r*cols+0].u.md_str)!=0 ) {
    3981           0 :             free( sf->layers[origr].name );
    3982           0 :             sf->layers[origr].name = copy( layers[r*cols+0].u.md_str );
    3983           0 :             changed = true;
    3984             :         }
    3985             :     }
    3986             : 
    3987           0 :     for ( l=sf->layer_cnt-1; l>ly_fore; --l ) if ( !sf->layers[l].ticked ) {
    3988           0 :         SFRemoveLayer(sf,l);
    3989           0 :         changed = true;
    3990             :     }
    3991             : 
    3992           0 :     l = 0;
    3993           0 :     for ( r=0; r<rows; ++r ) if ( layers[r*cols+3].u.md_ival==0 ) {
    3994           0 :         SFAddLayer(sf,layers[r*cols+0].u.md_str,layers[r*cols+1].u.md_ival, layers[r*cols+2].u.md_ival);
    3995           0 :         changed = true;
    3996             :     }
    3997           0 :     if ( changed )
    3998           0 :         CVLayerPaletteCheck(sf);
    3999           0 : return( changed );
    4000             : }
    4001             : 
    4002             : 
    4003           0 : char* DumpSplineFontMetadata(SplineFont *sf) {
    4004             :     FILE *sfd;
    4005           0 :     if ( (sfd=MakeTemporaryFile()) ) {
    4006           0 :         SFD_DumpSplineFontMetadata( sfd, sf );
    4007           0 :         char *str = FileToAllocatedString( sfd );
    4008           0 :         fclose(sfd);
    4009           0 :         return( str );
    4010             :     }
    4011           0 :     return( 0 );
    4012             : }
    4013             : 
    4014           0 : static int GFI_OK(GGadget *g, GEvent *e) {
    4015           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate )
    4016             :     {
    4017           0 :         GWindow gw = GGadgetGetWindow(g);
    4018           0 :         struct gfi_data *d = GDrawGetUserData(gw);
    4019           0 :         SplineFont *sf = d->sf, *_sf;
    4020             : 
    4021           0 :         printf("at top of GFI_OK\n");
    4022             : 
    4023           0 :         char* sfdfrag  = DumpSplineFontMetadata( sf );
    4024           0 :         SFUndoes* undo = SFUndoCreateSFD( sfut_fontinfo,
    4025             :                                           _("Font Information Dialog"),
    4026             :                                           sfdfrag );
    4027           0 :         SFUndoPushFront( &sf->undoes, undo );
    4028             : 
    4029             : 
    4030             : 
    4031             :         int interp;
    4032           0 :         int reformat_fv=0, retitle_fv=false;
    4033           0 :         int upos, uwid, as, des, err = false, weight=0;
    4034           0 :         int uniqueid, linegap=0, vlinegap=0, winascent=0, windescent=0;
    4035           0 :         int tlinegap=0, tascent=0, tdescent=0, hascent=0, hdescent=0;
    4036           0 :         int capheight=0, xheight=0;
    4037           0 :         int winaoff=true, windoff=true;
    4038           0 :         int taoff=true, tdoff=true, haoff = true, hdoff = true;
    4039             :         real ia, cidversion;
    4040             :         const unichar_t *txt, *fond; unichar_t *end;
    4041             :         int i,j, mcs;
    4042             :         int vmetrics, namechange, guideorder2;
    4043           0 :         int xuidchanged = false, usexuid, useuniqueid;
    4044             :         GTextInfo *pfmfam, *ibmfam, *fstype, *nlitem, *stylemap;
    4045             :         int32 len;
    4046             :         GTextInfo **ti;
    4047             :         int subs[4], super[4], strike[2];
    4048             :         struct otfname *fontstyle_name;
    4049             :         int design_size, size_top, size_bottom, styleid;
    4050           0 :         int strokedfont = false;
    4051             :         real strokewidth;
    4052           0 :         int multilayer = false;
    4053             :         char os2_vendor[4];
    4054             :         NameList *nl;
    4055             :         extern int allow_utf8_glyphnames;
    4056             :         int os2version;
    4057             :         int rows, gasprows, mc_rows, ms_rows;
    4058           0 :         struct matrix_data *strings     = GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
    4059           0 :         struct matrix_data *gasp        = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Gasp), &gasprows);
    4060           0 :         struct matrix_data *markclasses = GMatrixEditGet(GWidgetGetControl(d->gw,CID_MarkClasses), &mc_rows);
    4061           0 :         struct matrix_data *marksets    = GMatrixEditGet(GWidgetGetControl(d->gw,CID_MarkSets), &ms_rows);
    4062           0 :         int was_ml = sf->multilayer, was_stroke = sf->strokedfont;
    4063             :         uint32 codepages[2], uranges[4];
    4064             :         int layer_cnt;
    4065           0 :         struct matrix_data *layers = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Backgrounds), &layer_cnt);
    4066             :         int layer_flags;
    4067           0 :         int sfntRevision=sfntRevisionUnset, woffMajor=woffUnset, woffMinor=woffUnset;
    4068             : 
    4069           0 :         if ( strings==NULL || gasp==NULL || layers==NULL )
    4070           0 : return( true );
    4071           0 :         if ( gasprows>0 && gasp[5*gasprows-5].u.md_ival!=65535 ) {
    4072           0 :             ff_post_error(_("Bad Grid Fitting table"),_("The 'gasp' (Grid Fit) table must end with a pixel entry of 65535"));
    4073           0 : return( true );
    4074             :         }
    4075             :         {
    4076             :             int i;
    4077             :             static struct {
    4078             :                 int cid;
    4079             :                 char *tit, *msg;
    4080             :             } msgs[] = {
    4081             :                 { CID_Notice, N_("Bad Copyright"), NU_("Copyright text (in the Names pane) must be entirely ASCII. So, use (c) instead of ©.")},
    4082             :                 { CID_Human, N_("Bad Human Fontname"), N_("The human-readable fontname text (in the Names pane) must be entirely ASCII.")},
    4083             :                 { CID_Weight, N_("Bad Weight"), N_("The weight text (in the Names pane) must be entirely ASCII.")},
    4084             :                 { CID_Version, N_("Bad Version"), N_("The version text (in the Names pane) must be entirely ASCII.")},
    4085             :                 { 0, NULL, NULL }
    4086             :             };
    4087           0 :             for ( i = 0; msgs[i].cid!=0 ; ++i )
    4088           0 :                     if ( !uAllAscii(_GGadgetGetTitle(GWidgetGetControl(d->gw,msgs[i].cid))) ) {
    4089           0 :                 ff_post_error(_(msgs[i].tit),_(msgs[i].msg));
    4090           0 : return( true );
    4091             :             }
    4092             :         }
    4093           0 :         if ( (layer_flags = GFI_AnyLayersRemoved(d))!=0 ) {
    4094             :             char *buts[3];
    4095           0 :             buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
    4096           0 :             if ( layer_flags & 1 ) {
    4097           0 :                 if ( gwwv_ask(_("Deleting a layer cannot be UNDONE!"),(const char **) buts,0,1,_(
    4098             :                         "You are about to delete a layer.\n"
    4099             :                         "This will lose all contours in that layer.\n"
    4100             :                         "If this is the last quadratic layer it will\n"
    4101             :                         "lose all truetype instructions.\n\n"
    4102             :                         "Deleting a layer cannot be undone.\n\n"
    4103             :                         "Is this really your intent?"))==1 )
    4104           0 : return( true );
    4105           0 :             } else if ( layer_flags & 2 ) {
    4106           0 :                 if ( gwwv_ask(_("Removing instructions cannot be UNDONE!"),(const char **) buts,0,1,_(
    4107             :                         "You are about to change the last quadratic\n"
    4108             :                         "layer to cubic. When this happens FontForge\n"
    4109             :                         "will remove all truetype instructions.\n\n"
    4110             :                         "This cannot be undone.\n\n"
    4111             :                         "Is this really your intent?"))==1 )
    4112           0 : return( true );
    4113             :             }
    4114             :         }
    4115           0 :         if ( layer_cnt>=BACK_LAYER_MAX-2 ) {
    4116           0 :             ff_post_error(_("Too many layers"),_("FontForge supports at most %d layers"),BACK_LAYER_MAX-2);
    4117             :             /* This can be increased in configure-fontforge.h */
    4118           0 : return( true );
    4119             :         }
    4120           0 :         if ( !CheckNames(d))
    4121           0 : return( true );
    4122             : 
    4123           0 :         if ( ttfmultuniqueids(sf,d)) {
    4124             :             char *buts[3];
    4125           0 :             buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
    4126           0 :             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 )
    4127           0 : return( true );
    4128             :         }
    4129           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
    4130           0 :         if ( !isalpha(*txt)) {
    4131           0 :             BadFamily();
    4132           0 : return( true );
    4133             :         }
    4134           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ItalicAngle));
    4135           0 :         ia = u_strtod(txt,&end);
    4136           0 :         if ( *end!='\0' ) {
    4137           0 :             GGadgetProtest8(_("_Italic Angle:"));
    4138           0 : return(true);
    4139             :         }
    4140           0 :         guideorder2 = GGadgetIsChecked(GWidgetGetControl(gw,CID_GuideOrder2));
    4141           0 :         strokedfont = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsStrokedFont));
    4142           0 :         strokewidth = GetReal8(gw,CID_StrokeWidth,_("Stroke _Width:"),&err);
    4143           0 :         multilayer = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
    4144           0 :         vmetrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_HasVerticalMetrics));
    4145           0 :         upos = GetReal8(gw,CID_UPos, _("Underline _Position:"),&err);
    4146           0 :         uwid = GetReal8(gw,CID_UWidth,S_("Underline|_Height:"),&err);
    4147           0 :         GetInt8(gw,CID_Em,_("_Em Size:"),&err);   /* just check for errors. redundant info */
    4148           0 :         as = GetInt8(gw,CID_Ascent,_("_Ascent:"),&err);
    4149           0 :         des = GetInt8(gw,CID_Descent,_("_Descent:"),&err);
    4150           0 :         uniqueid = GetInt8(gw,CID_UniqueID,_("UniqueID"),&err);
    4151           0 :         design_size = rint(10*GetReal8(gw,CID_DesignSize,_("De_sign Size:"),&err));
    4152           0 :         size_bottom = rint(10*GetReal8(gw,CID_DesignBottom,_("_Bottom"),&err));
    4153           0 :         size_top = rint(10*GetReal8(gw,CID_DesignTop,_("_Top"),&err));
    4154           0 :         styleid = GetInt8(gw,CID_StyleID,_("Style _ID:"),&err);
    4155           0 :         fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
    4156           0 :         OtfNameListFree(fontstyle_name);
    4157           0 :         if ( design_size==0 && ( size_bottom!=0 || size_top!=0 || styleid!=0 || fontstyle_name!=NULL )) {
    4158           0 :             ff_post_error(_("Bad Design Size Info"),_("If the design size is 0, then all other fields on that pane must be zero (or unspecified) too."));
    4159           0 : return( true );
    4160           0 :         } else if ( styleid!=0 && fontstyle_name==NULL ) {
    4161           0 :             ff_post_error(_("Bad Design Size Info"),_("If you specify a style id for the design size, then you must specify a style name"));
    4162           0 : return( true );
    4163           0 :         } else if ( fontstyle_name!=NULL && styleid==0 ) {
    4164           0 :             ff_post_error(_("Bad Design Size Info"),_("If you specify a style name for the design size, then you must specify a style id"));
    4165           0 : return( true );
    4166           0 :         } else if ( design_size<0 ) {
    4167           0 :             ff_post_error(_("Bad Design Size Info"),_("If you specify a design size, it must be positive"));
    4168           0 : return( true );
    4169           0 :         } else if ( size_bottom!=0 && size_bottom>design_size ) {
    4170           0 :             ff_post_error(_("Bad Design Size Info"),_("In the design size range, the bottom field must be less than the design size."));
    4171           0 : return( true );
    4172           0 :         } else if ( size_top!=0 && size_top<design_size ) {
    4173           0 :             ff_post_error(_("Bad Design Size Info"),_("In the design size range, the bottom top must be more than the design size."));
    4174           0 : return( true );
    4175           0 :         } else if ( styleid!=0 && size_top==0 ) {
    4176           0 :             ff_post_error(_("Bad Design Size Info"),_("If you specify a style id for the design size, then you must specify a size range"));
    4177           0 : return( true );
    4178           0 :         } else if ( size_top!=0 && styleid==0 ) {
    4179           0 :             ff_post_notice(_("Bad Design Size Info"),_("If you specify a design size range, then you are supposed to specify a style id and style name too. FontForge will allow you to leave those fields blank, but other applications may not."));
    4180             :             /* no return, this is just a warning */
    4181             :         }
    4182             : 
    4183           0 :         if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_Revision))!='\0' )
    4184           0 :             sfntRevision = rint(65536.*GetReal8(gw,CID_Revision,_("sfnt Revision:"),&err));
    4185           0 :         if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMajor))!='\0' ) {
    4186           0 :             woffMajor = GetInt8(gw,CID_WoffMajor,_("Woff Major Version:"),&err);
    4187           0 :             woffMinor = 0;
    4188           0 :             if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMinor))!='\0' )
    4189           0 :                 woffMinor = GetInt8(gw,CID_WoffMinor,_("Woff Minor Version:"),&err);
    4190             :         }
    4191           0 :         if ( err )
    4192           0 : return(true);
    4193             : 
    4194           0 :         memset(codepages,0,sizeof(codepages));
    4195           0 :         memset(uranges,0,sizeof(uranges));
    4196           0 :         if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_CPageDefault)) )
    4197           0 :             hexparse(gw,CID_CodePageRanges,_("MS Code Pages"),codepages,2,&err );
    4198           0 :         if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_URangesDefault)) )
    4199           0 :             hexparse(gw,CID_UnicodeRanges,_("Unicode Ranges"),uranges,4,&err );
    4200           0 :         if ( err )
    4201           0 : return( true );
    4202             : 
    4203           0 :         if ( sf->subfontcnt!=0 ) {
    4204           0 :             cidversion = GetReal8(gw,CID_Version,_("_Version"),&err);
    4205           0 :             if ( err )
    4206           0 : return(true);
    4207             :         }
    4208           0 :         os2version = sf->os2_version;
    4209           0 :         if ( d->ttf_set ) {
    4210           0 :             char *os2v = GGadgetGetTitle8(GWidgetGetControl(gw,CID_OS2Version));
    4211           0 :             if ( strcasecmp(os2v,(char *) os2versions[0].text )== 0 )
    4212           0 :                 os2version = 0;
    4213             :             else
    4214           0 :                 os2version = GetInt8(gw,CID_OS2Version,_("Weight, Width, Slope Only"),&err);
    4215           0 :             free(os2v);
    4216             :             /* Only use the normal routine if we get no value, because */
    4217             :             /*  "400 Book" is a reasonable setting, but would cause GetInt */
    4218             :             /*  to complain */
    4219           0 :             weight = u_strtol(_GGadgetGetTitle(GWidgetGetControl(gw,CID_WeightClass)),NULL,10);
    4220           0 :             if ( weight == 0 ) {
    4221             :                 int i;
    4222           0 :                 char *wc = GGadgetGetTitle8(GWidgetGetControl(gw,CID_WeightClass));
    4223           0 :                 for ( i=0; widthclass[i].text!=NULL; ++i ) {
    4224           0 :                     if ( strcmp(wc,(char *) widthclass[i].text)==0 ) {
    4225           0 :                         weight = (intpt) widthclass[i].userdata;
    4226           0 :                 break;
    4227             :                     }
    4228             :                 }
    4229           0 :                 free(wc);
    4230             :             }
    4231           0 :             if ( weight == 0 )
    4232           0 :                 weight = GetInt8(gw,CID_WeightClass,_("_Weight Class"),&err);
    4233           0 :             linegap = GetInt8(gw,CID_LineGap,_("HHead _Line Gap:"),&err);
    4234           0 :             tlinegap = GetInt8(gw,CID_TypoLineGap,_("Typo Line _Gap:"),&err);
    4235           0 :             if ( vmetrics )
    4236           0 :                 vlinegap = GetInt8(gw,CID_VLineGap,_("VHead _Column Spacing:"),&err);
    4237           0 :             winaoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinAscentIsOff));
    4238           0 :             windoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinDescentIsOff));
    4239           0 :             winascent  = GetInt8(gw,CID_WinAscent,winaoff ? _("Win _Ascent Offset:") : _("Win Ascent:"),&err);
    4240           0 :             windescent = GetInt8(gw,CID_WinDescent,windoff ? _("Win _Descent Offset:") : _("Win Descent:"),&err);
    4241           0 :             taoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoAscentIsOff));
    4242           0 :             tdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoDescentIsOff));
    4243           0 :             tascent  = GetInt8(gw,CID_TypoAscent,taoff ? _("_Typo Ascent Offset:") : _("Typo Ascent:"),&err);
    4244           0 :             tdescent = GetInt8(gw,CID_TypoDescent,tdoff ? _("T_ypo Descent Offset:") : _("Typo Descent:"),&err);
    4245           0 :             haoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadAscentIsOff));
    4246           0 :             hdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadDescentIsOff));
    4247           0 :             hascent  = GetInt8(gw,CID_HHeadAscent,haoff ? _("_HHead Ascent Offset:") : _("HHead Ascent:"),&err);
    4248           0 :             hdescent = GetInt8(gw,CID_HHeadDescent,hdoff ? _("HHead De_scent Offset:") : _("HHead Descent:"),&err);
    4249           0 :             capheight = GetInt8(gw,CID_CapHeight, _("Ca_pital Height:"),&err);
    4250           0 :             xheight = GetInt8(gw,CID_XHeight, _("_X Height:"),&err);
    4251           0 :             if ( err )
    4252           0 : return(true);
    4253             : 
    4254           0 :             if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault)) ) {
    4255           0 :                 for ( i=0; i<4; ++i )
    4256           0 :                     subs[i] = GetInt8(gw,CID_SubXSize+i,_("Subscript"),&err);
    4257           0 :                 for ( i=0; i<4; ++i )
    4258           0 :                     super[i] = GetInt8(gw,CID_SuperXSize+i,_("Superscript"),&err);
    4259           0 :                 for ( i=0; i<2; ++i )
    4260           0 :                     strike[i] = GetInt8(gw,CID_StrikeoutSize+i,_("Strikeout"),&err);
    4261             :             }
    4262           0 :             txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Vendor));
    4263           0 :             if ( u_strlen(txt)>4 || txt[0]>0x7e || (txt[0]!='\0' && (txt[1]>0x7e ||
    4264           0 :                     (txt[1]!='\0' && (txt[2]>0x7e || (txt[2]!='\0' && txt[3]>0x7e))))) ) {
    4265           0 :                 if ( u_strlen(txt)>4 )
    4266           0 :                     ff_post_error(_("Bad IBM Family"),_("Tag must be 4 characters long"));
    4267             :                 else
    4268           0 :                     ff_post_error(_("Bad IBM Family"),_("A tag must be 4 ASCII characters"));
    4269           0 : return( true );
    4270             :             }
    4271           0 :             os2_vendor[0] = txt[0]==0 ? ' ' : txt[0];
    4272           0 :             os2_vendor[1] = txt[0]==0 || txt[1]=='\0' ? ' ' : txt[1];
    4273           0 :             os2_vendor[2] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' ? ' ' : txt[2];
    4274           0 :             os2_vendor[3] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' || txt[3]=='\0' ? ' ' : txt[3];
    4275             :         }
    4276           0 :         if ( err )
    4277           0 : return(true);
    4278           0 :         if ( d->tex_set ) {
    4279           0 :             if ( !ParseTeX(d))
    4280           0 : return( true );
    4281             :         }
    4282           0 :         if ( as+des>16384 || des<0 || as<0 ) {
    4283           0 :             ff_post_error(_("Bad Ascent/Descent"),_("Ascent and Descent must be positive and their sum less than 16384"));
    4284           0 : return( true );
    4285             :         }
    4286           0 :         mcs = -1;
    4287           0 :         if ( !GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic)) ) {
    4288           0 :             mcs = 0;
    4289           0 :             ti = GGadgetGetList(GWidgetGetControl(d->gw,CID_MacStyles),&len);
    4290           0 :             for ( i=0; i<len; ++i )
    4291           0 :                 if ( ti[i]->selected )
    4292           0 :                     mcs |= (int) (intpt) ti[i]->userdata;
    4293           0 :             if ( (mcs&sf_condense) && (mcs&sf_extend)) {
    4294           0 :                 ff_post_error(_("Bad Style"),_("A style may not have both condense and extend set (it makes no sense)"));
    4295           0 : return( true );
    4296             :             }
    4297             :         }
    4298             : 
    4299           0 :         nlitem = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_Namelist));
    4300           0 :         if ( nlitem==NULL )
    4301           0 :             nl = DefaultNameListForNewFonts();
    4302             :         else {
    4303           0 :             char *name = u2utf8_copy(nlitem->text);
    4304           0 :             nl = NameListByName(name);
    4305           0 :             free(name);
    4306             :         }
    4307           0 :         if ( nl->uses_unicode && !allow_utf8_glyphnames ) {
    4308           0 :             ff_post_error(_("Namelist contains non-ASCII names"),_("Glyph names should be limited to characters in the ASCII character set,\nbut there are names in this namelist which use characters outside\nthat range."));
    4309           0 : return(true);
    4310             :         }
    4311           0 :         if ( !SSNameValidate(d))
    4312           0 : return( true );
    4313           0 :         if ( strokedfont!=sf->strokedfont || multilayer!=sf->multilayer ) {
    4314           0 :             if ( sf->strokedfont && multilayer )
    4315           0 :                 SFSetLayerWidthsStroked(sf,sf->strokewidth);
    4316           0 :             else if ( sf->multilayer )
    4317           0 :                 SFSplinesFromLayers(sf,strokedfont);
    4318           0 :             SFReinstanciateRefs(sf);
    4319           0 :             if ( multilayer!=sf->multilayer ) {
    4320           0 :                 sf->multilayer = multilayer;
    4321           0 :                 SFLayerChange(sf);
    4322             :             }
    4323           0 :             for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
    4324           0 :                 sf->glyphs[i]->changedsincelasthinted = !strokedfont && !multilayer;
    4325             :         }
    4326           0 :         sf->strokedfont = strokedfont;
    4327           0 :         sf->strokewidth = strokewidth;
    4328           0 :         GDrawSetCursor(gw,ct_watch);
    4329           0 :         namechange = SetFontName(gw,sf);
    4330           0 :         if ( namechange ) retitle_fv = true;
    4331           0 :         usexuid = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseXUID));
    4332           0 :         useuniqueid = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseUniqueID));
    4333           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_XUID));
    4334           0 :         xuidchanged = (sf->xuid==NULL && *txt!='\0') ||
    4335           0 :                         (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0);
    4336           0 :         if ( namechange &&
    4337           0 :                 ((uniqueid!=0 && uniqueid==sf->uniqueid && useuniqueid) ||
    4338           0 :                  (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 && usexuid) ||
    4339           0 :                  ttfuniqueidmatch(sf,d)) ) {
    4340             :             char *buts[4];
    4341             :             int ans;
    4342           0 :             buts[0] = _("Change");
    4343           0 :             buts[1] = _("Retain");
    4344           0 :             buts[2] = _("_Cancel");
    4345           0 :             buts[3] = NULL;
    4346           0 :             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?"));
    4347           0 :             if ( ans==2 ) {
    4348           0 :                 GDrawSetCursor(gw,ct_pointer);
    4349           0 : return(true);
    4350             :             }
    4351           0 :             if ( ans==0 ) {
    4352           0 :                 if ( uniqueid!=0 && uniqueid==sf->uniqueid )
    4353           0 :                     uniqueid = 4000000 + (rand()&0x3ffff);
    4354           0 :                 if ( sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 ) {
    4355           0 :                     SFRandomChangeXUID(sf);
    4356           0 :                     xuidchanged = true;
    4357             :                 }
    4358             :             }
    4359           0 :             if ( ttfuniqueidmatch(sf,d))
    4360           0 :                 ttfuniqueidfixup(sf,d);
    4361             :         } else {
    4362           0 :             free(sf->xuid);
    4363           0 :             sf->xuid = *txt=='\0'?NULL:cu_copy(txt);
    4364             :         }
    4365           0 :         sf->use_xuid = usexuid;
    4366           0 :         sf->use_uniqueid = useuniqueid;
    4367             : 
    4368           0 :         sf->sfntRevision = sfntRevision;
    4369             : 
    4370           0 :         free(sf->woffMetadata);
    4371           0 :         sf->woffMetadata = NULL;
    4372           0 :         if ( *_GGadgetGetTitle(GWidgetGetControl(gw,CID_WoffMetadata))!='\0' )
    4373           0 :             sf->woffMetadata = GGadgetGetTitle8(GWidgetGetControl(gw,CID_WoffMetadata));
    4374           0 :         sf->woffMajor = woffMajor;
    4375           0 :         sf->woffMinor = woffMinor;
    4376             : 
    4377           0 :         free(sf->gasp);
    4378           0 :         sf->gasp_cnt = gasprows;
    4379           0 :         if ( gasprows==0 )
    4380           0 :             sf->gasp = NULL;
    4381             :         else {
    4382           0 :             sf->gasp = malloc(gasprows*sizeof(struct gasp));
    4383           0 :             sf->gasp_version = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_GaspVersion));
    4384           0 :             for ( i=0; i<gasprows; ++i ) {
    4385           0 :                 sf->gasp[i].ppem = gasp[5*i].u.md_ival;
    4386           0 :                 if ( sf->gasp_version==0 )
    4387           0 :                     sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
    4388           0 :                             (gasp[5*i+2].u.md_ival<<1);
    4389             :                 else
    4390           0 :                     sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
    4391           0 :                             (gasp[5*i+2].u.md_ival<<1) |
    4392           0 :                             (gasp[5*i+4].u.md_ival<<2) |
    4393           0 :                             (gasp[5*i+3].u.md_ival<<3);
    4394             :             }
    4395             :         }
    4396           0 :         sf->head_optimized_for_cleartype = GGadgetIsChecked(GWidgetGetControl(gw,CID_HeadClearType));
    4397             : 
    4398           0 :         OtfNameListFree(sf->fontstyle_name);
    4399           0 :         sf->fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
    4400           0 :         sf->design_size = design_size;
    4401           0 :         sf->design_range_bottom = size_bottom;
    4402           0 :         sf->design_range_top = size_top;
    4403           0 :         sf->fontstyle_id = styleid;
    4404             : 
    4405           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Notice));
    4406           0 :         free(sf->copyright); sf->copyright = cu_copy(txt);
    4407           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Comment));
    4408           0 :         free(sf->comments); sf->comments = u2utf8_copy(*txt?txt:NULL);
    4409           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_FontLog));
    4410           0 :         free(sf->fontlog); sf->fontlog = u2utf8_copy(*txt?txt:NULL);
    4411           0 :         txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_DefBaseName));
    4412           0 :         if ( *txt=='\0' || GGadgetIsChecked(GWidgetGetControl(gw,CID_SameAsFontname)) )
    4413           0 :             txt = NULL;
    4414           0 :         free(sf->defbasefilename); sf->defbasefilename = u2utf8_copy(txt);
    4415           0 :         if ( sf->subfontcnt!=0 ) {
    4416           0 :             sf->cidversion = cidversion;
    4417             :         } else {
    4418           0 :             txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Version));
    4419           0 :             free(sf->version); sf->version = cu_copy(txt);
    4420             :         }
    4421           0 :         fond = _GGadgetGetTitle(GWidgetGetControl(gw,CID_MacFOND));
    4422           0 :         free(sf->fondname); sf->fondname = NULL;
    4423           0 :         if ( *fond )
    4424           0 :             sf->fondname = cu_copy(fond);
    4425           0 :         sf->macstyle = mcs;
    4426           0 :         sf->italicangle = ia;
    4427           0 :         sf->upos = upos;
    4428           0 :         sf->uwidth = uwid;
    4429           0 :         sf->uniqueid = uniqueid;
    4430           0 :         sf->texdata = d->texdata;
    4431           0 :         if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_CPageDefault)) ) {
    4432           0 :             memcpy(sf->pfminfo.codepages,codepages,sizeof(codepages));
    4433           0 :             sf->pfminfo.hascodepages = true;
    4434             :         } else
    4435           0 :             sf->pfminfo.hascodepages = false;
    4436           0 :         if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_URangesDefault)) ) {
    4437           0 :             memcpy(sf->pfminfo.unicoderanges,uranges,sizeof(uranges));
    4438           0 :             sf->pfminfo.hasunicoderanges = true;
    4439             :         } else
    4440           0 :             sf->pfminfo.hasunicoderanges = false;
    4441             : 
    4442           0 :         interp = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_Interpretation));
    4443           0 :         if ( interp==-1 ) sf->uni_interp = ui_none;
    4444           0 :         else sf->uni_interp = (intpt) interpretations[interp].userdata;
    4445             : 
    4446           0 :         sf->for_new_glyphs = nl;
    4447             : 
    4448           0 :         if ( sf->hasvmetrics!=vmetrics )
    4449           0 :             CVPaletteDeactivate();              /* Force a refresh later */
    4450           0 :         _sf = sf->cidmaster?sf->cidmaster:sf;
    4451           0 :         _sf->hasvmetrics = vmetrics;
    4452           0 :         for ( j=0; j<_sf->subfontcnt; ++j )
    4453           0 :             _sf->subfonts[j]->hasvmetrics = vmetrics;
    4454             : 
    4455           0 :         PSDictFree(sf->private);
    4456           0 :         sf->private = GFI_ParsePrivate(d);
    4457             : 
    4458           0 :         if ( d->names_set )
    4459           0 :             StoreTTFNames(d);
    4460           0 :         StoreSSNames(d);
    4461           0 :         if ( d->ttf_set ) {
    4462           0 :             sf->os2_version = os2version;
    4463           0 :             sf->use_typo_metrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseTypoMetrics));
    4464           0 :             sf->weight_width_slope_only = GGadgetIsChecked(GWidgetGetControl(gw,CID_WeightWidthSlopeOnly));
    4465           0 :             sf->pfminfo.weight = weight;
    4466           0 :             sf->pfminfo.width = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_WidthClass))+1;
    4467           0 :             pfmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PFMFamily));
    4468           0 :             if ( pfmfam!=NULL )
    4469           0 :                 sf->pfminfo.pfmfamily = (intpt) (pfmfam->userdata);
    4470             :             else
    4471           0 :                 sf->pfminfo.pfmfamily = 0x11;
    4472           0 :             ibmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_IBMFamily));
    4473           0 :             if ( ibmfam!=NULL )
    4474           0 :                 sf->pfminfo.os2_family_class = (intpt) (ibmfam->userdata);
    4475             :             else
    4476           0 :                 sf->pfminfo.os2_family_class = 0x00;
    4477           0 :         stylemap = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_StyleMap));
    4478           0 :         if ( stylemap!=NULL )
    4479           0 :         sf->pfminfo.stylemap = (intpt) (stylemap->userdata);
    4480             :         else
    4481           0 :         sf->pfminfo.stylemap = -1;
    4482           0 :             memcpy(sf->pfminfo.os2_vendor,os2_vendor,sizeof(os2_vendor));
    4483           0 :             fstype = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_FSType));
    4484           0 :             if ( fstype!=NULL )
    4485           0 :                 sf->pfminfo.fstype = (intpt) (fstype->userdata);
    4486             :             else
    4487           0 :                 sf->pfminfo.fstype = 0xc;
    4488           0 :             if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_NoSubsetting)))
    4489           0 :                 sf->pfminfo.fstype |=0x100;
    4490           0 :             if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_OnlyBitmaps)))
    4491           0 :                 sf->pfminfo.fstype |=0x200;
    4492           0 :             for ( i=0; i<10; ++i )
    4493           0 :                 sf->pfminfo.panose[i] = (intpt) (GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PanFamily+i))->userdata);
    4494           0 :             sf->pfminfo.panose_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
    4495           0 :             sf->pfminfo.os2_typolinegap = tlinegap;
    4496           0 :             sf->pfminfo.linegap = linegap;
    4497           0 :             if ( vmetrics )
    4498           0 :                 sf->pfminfo.vlinegap = vlinegap;
    4499           0 :             sf->pfminfo.os2_winascent = winascent;
    4500           0 :             sf->pfminfo.os2_windescent = windescent;
    4501           0 :             sf->pfminfo.winascent_add = winaoff;
    4502           0 :             sf->pfminfo.windescent_add = windoff;
    4503           0 :             sf->pfminfo.os2_typoascent = tascent;
    4504           0 :             sf->pfminfo.os2_typodescent = tdescent;
    4505           0 :             sf->pfminfo.typoascent_add = taoff;
    4506           0 :             sf->pfminfo.typodescent_add = tdoff;
    4507           0 :             sf->pfminfo.hhead_ascent = hascent;
    4508           0 :             sf->pfminfo.hhead_descent = hdescent;
    4509           0 :             sf->pfminfo.hheadascent_add = haoff;
    4510           0 :             sf->pfminfo.hheaddescent_add = hdoff;
    4511           0 :             sf->pfminfo.os2_capheight = capheight;
    4512           0 :             sf->pfminfo.os2_xheight = xheight;
    4513           0 :             sf->pfminfo.pfmset = true;
    4514             : 
    4515           0 :             sf->pfminfo.subsuper_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault));
    4516           0 :             if ( sf->pfminfo.subsuper_set ) {
    4517           0 :                 sf->pfminfo.os2_subxsize = subs[0];
    4518           0 :                 sf->pfminfo.os2_subysize = subs[1];
    4519           0 :                 sf->pfminfo.os2_subxoff = subs[2];
    4520           0 :                 sf->pfminfo.os2_subyoff = subs[3];
    4521           0 :                 sf->pfminfo.os2_supxsize = super[0];
    4522           0 :                 sf->pfminfo.os2_supysize = super[1];
    4523           0 :                 sf->pfminfo.os2_supxoff = super[2];
    4524           0 :                 sf->pfminfo.os2_supyoff = super[3];
    4525           0 :                 sf->pfminfo.os2_strikeysize = strike[0];
    4526           0 :                 sf->pfminfo.os2_strikeypos = strike[1];
    4527             :             }
    4528             :         }
    4529             :         /* must come after all scaleable fields (linegap, etc.) */
    4530           0 :         if ( as!=sf->ascent || des!=sf->descent ) {
    4531           0 :             if ( as+des != sf->ascent+sf->descent && GGadgetIsChecked(GWidgetGetControl(gw,CID_Scale)) )
    4532           0 :                 SFScaleToEm(sf,as,des);
    4533             :             else {
    4534           0 :                 sf->ascent = as;
    4535           0 :                 sf->descent = des;
    4536             :             }
    4537           0 :             BDFsSetAsDs(sf);
    4538           0 :             reformat_fv = true;
    4539           0 :             CIDMasterAsDes(sf);
    4540             :         }
    4541           0 :         GFI_SetLayers(d);
    4542           0 :         if ( guideorder2!=sf->grid.order2 ) {
    4543           0 :             if ( guideorder2 )
    4544           0 :                 SFConvertGridToOrder2(sf);
    4545             :             else
    4546           0 :                 SFConvertGridToOrder3(sf);
    4547             :         }
    4548           0 :         GFI_ApplyLookupChanges(d);
    4549           0 :         if ( retitle_fv )
    4550           0 :             FVSetTitles(sf);
    4551           0 :         if ( reformat_fv || was_ml!=sf->multilayer || was_stroke!=sf->strokedfont )
    4552           0 :             FontViewReformatAll(sf);
    4553           0 :         sf->changed = true;
    4554           0 :         SFSetModTime(sf);
    4555           0 :         sf->changed_since_autosave = true;
    4556           0 :         sf->changed_since_xuidchanged = !xuidchanged;
    4557             :         /* Just in case they changed the blue values and we are showing blues */
    4558             :         /*  in outline views... */
    4559           0 :         for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
    4560             :             CharView *cv;
    4561           0 :             for ( cv = (CharView *) (sf->glyphs[i]->views); cv!=NULL; cv=(CharView *) (cv->b.next) ) {
    4562           0 :                 cv->back_img_out_of_date = true;
    4563           0 :                 GDrawRequestExpose(cv->v,NULL,false);
    4564             :             }
    4565             :         }
    4566           0 :         MacFeatListFree(sf->features);
    4567           0 :         sf->features = GGadgetGetUserData(GWidgetGetControl(d->gw,CID_Features));
    4568           0 :         last_aspect = d->old_aspect;
    4569             : 
    4570             :         /* Class 0 is unused */
    4571           0 :         MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
    4572           0 :         sf->mark_class_cnt = mc_rows + 1;
    4573           0 :         sf->mark_classes     = malloc((mc_rows+1)*sizeof(char *));
    4574           0 :         sf->mark_class_names = malloc((mc_rows+1)*sizeof(char *));
    4575           0 :         sf->mark_classes[0] = sf->mark_class_names[0] = NULL;
    4576           0 :         for ( i=0; i<mc_rows; ++i ) {
    4577           0 :             sf->mark_class_names[i+1] = copy(markclasses[2*i+0].u.md_str);
    4578           0 :             sf->mark_classes[i+1]     = GlyphNameListDeUnicode(markclasses[2*i+1].u.md_str);
    4579             :         }
    4580             : 
    4581             :         /* Set 0 is used */
    4582           0 :         MarkSetFree(sf->mark_set_cnt,sf->mark_sets,sf->mark_set_names);
    4583           0 :         sf->mark_set_cnt = ms_rows;
    4584           0 :         sf->mark_sets      = malloc((ms_rows)*sizeof(char *));
    4585           0 :         sf->mark_set_names = malloc((ms_rows)*sizeof(char *));
    4586           0 :         for ( i=0; i<ms_rows; ++i ) {
    4587           0 :             sf->mark_set_names[i] = copy(marksets[2*i+0].u.md_str);
    4588           0 :             sf->mark_sets[i]      = GlyphNameListDeUnicode(marksets[2*i+1].u.md_str);
    4589             :         }
    4590             : 
    4591           0 :         GFI_Close(d);
    4592             : 
    4593           0 :         SFReplaceFontnameBDFProps(sf);
    4594           0 :         MVReFeatureAll(sf);
    4595           0 :         MVReKernAll(sf);
    4596             : 
    4597           0 :         collabclient_sendFontLevelRedo( sf );
    4598             : 
    4599             :     }
    4600           0 : return( true );
    4601             : }
    4602             : 
    4603           0 : static void GFI_AsDsLab(struct gfi_data *d, int cid, int onlylabel) {
    4604           0 :     int isoffset = GGadgetIsChecked(GWidgetGetControl(d->gw,cid));
    4605             :     DBounds b;
    4606             :     int ocid, labcid;
    4607             :     double val;
    4608             :     char buf[40];
    4609             :     char *offt, *baret;
    4610           0 :     int ismax=0;
    4611             :     unichar_t *end;
    4612             : 
    4613           0 :     switch ( cid ) {
    4614             :       case CID_WinAscentIsOff:
    4615           0 :         offt = _("Win Ascent Offset:"); baret = _("Win Ascent:");
    4616           0 :         ocid = CID_WinAscent; labcid = CID_WinAscentLab;
    4617           0 :         ismax = true;
    4618           0 :       break;
    4619             :       case CID_WinDescentIsOff:
    4620           0 :         offt = _("Win Descent Offset:"); baret = _("Win Descent:");
    4621           0 :         ocid = CID_WinDescent; labcid = CID_WinDescentLab;
    4622           0 :       break;
    4623             :       case CID_TypoAscentIsOff:
    4624           0 :         offt = _("Typo Ascent Offset:"); baret = _("Typo Ascent:");
    4625           0 :         ocid = CID_TypoAscent; labcid = CID_TypoAscentLab;
    4626           0 :         ismax = true;
    4627           0 :       break;
    4628             :       case CID_TypoDescentIsOff:
    4629           0 :         offt = _("Typo Descent Offset:"); baret = _("Typo Descent:");
    4630           0 :         ocid = CID_TypoDescent; labcid = CID_TypoDescentLab;
    4631           0 :       break;
    4632             :       case CID_HHeadAscentIsOff:
    4633           0 :         offt = _("HHead Ascent Offset:"); baret = _("HHead Ascent:");
    4634           0 :         ocid = CID_HHeadAscent; labcid = CID_HHeadAscentLab;
    4635           0 :         ismax = true;
    4636           0 :       break;
    4637             :       case CID_HHeadDescentIsOff:
    4638           0 :         offt = _("HHead Descent Offset:"); baret = _("HHead Descent:");
    4639           0 :         ocid = CID_HHeadDescent; labcid = CID_HHeadDescentLab;
    4640           0 :       break;
    4641             :       default:
    4642           0 : return;
    4643             :     }
    4644             : 
    4645           0 :     GGadgetSetTitle8(GWidgetGetControl(d->gw,labcid),
    4646             :             isoffset?offt:baret);
    4647           0 :     if ( onlylabel )
    4648           0 : return;
    4649             : 
    4650           0 :     if ( cid == CID_TypoAscentIsOff ) {
    4651           0 :         const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
    4652           0 :         double av=u_strtod(as,&end);
    4653           0 :         b.maxy = *end=='\0' ? av : d->sf->ascent;
    4654           0 :     } else if ( cid == CID_TypoDescentIsOff ) {
    4655           0 :         const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
    4656           0 :         double dv=u_strtod(ds,&end);
    4657           0 :         b.miny = *end=='\0' ? -dv : -d->sf->descent;
    4658             :     } else {
    4659           0 :         CIDLayerFindBounds(d->sf,ly_fore,&b);
    4660           0 :         if ( cid == CID_WinDescentIsOff ) b.miny = -b.miny;
    4661             :     }
    4662             : 
    4663           0 :     val = u_strtod(_GGadgetGetTitle(GWidgetGetControl(d->gw,ocid)),NULL);
    4664           0 :     if ( isoffset )
    4665           0 :         sprintf( buf,"%g",rint( val-(ismax ? b.maxy : b.miny)) );
    4666             :     else
    4667           0 :         sprintf( buf,"%g",rint( val+(ismax ? b.maxy : b.miny)) );
    4668           0 :     GGadgetSetTitle8(GWidgetGetControl(d->gw,ocid),buf);
    4669             : }
    4670             : 
    4671           0 : static int GFI_AsDesIsOff(GGadget *g, GEvent *e) {
    4672           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    4673           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    4674           0 :         GFI_AsDsLab(d,GGadgetGetCid(g),false);
    4675             :     }
    4676           0 : return( true );
    4677             : }
    4678             : 
    4679           0 : static void _GFI_PanoseDefault(struct gfi_data *d) {
    4680             :     int i;
    4681           0 :     int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_PanDefault));
    4682             : 
    4683           0 :     for ( i=0; i<10; ++i ) {
    4684           0 :         GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamily+i),!isdefault);
    4685           0 :         GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamilyLab+i),!isdefault);
    4686             :     }
    4687           0 :     if ( isdefault ) {
    4688           0 :         char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
    4689             :         struct pfminfo info;
    4690             :         int old1, old2;
    4691           0 :         memset(&info,0,sizeof(info));
    4692           0 :         old1 = d->sf->pfminfo.pfmset; old2 = d->sf->pfminfo.panose_set;
    4693           0 :         d->sf->pfminfo.pfmset = false; d->sf->pfminfo.panose_set = false;
    4694           0 :         SFDefaultOS2Info(&info,d->sf,n);
    4695           0 :         d->sf->pfminfo.pfmset = old1; d->sf->pfminfo.panose_set = old2;
    4696           0 :         free(n);
    4697           0 :         for ( i=0; i<10; ++i )
    4698           0 :             GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
    4699             :     }
    4700           0 : }
    4701             : 
    4702           0 : static int GFI_PanoseDefault(GGadget *g, GEvent *e) {
    4703           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    4704           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    4705           0 :         _GFI_PanoseDefault(d);
    4706             :     }
    4707           0 : return( true );
    4708             : }
    4709             : 
    4710           0 : static int GFI_ShowPanoseDocs(GGadget *g, GEvent *e) {
    4711           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    4712           0 :         help("http://panose.com/");
    4713             :     }
    4714           0 : return( true );
    4715             : }
    4716             : 
    4717           0 : static void GFI_SetPanoseLists(struct gfi_data *d) {
    4718           0 :     int kind = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_PanFamily));
    4719             :     int i;
    4720             : 
    4721           0 :     if ( kind>=0 && kind!=d->last_panose_family ) {
    4722           0 :         if ( kind>6 ) kind=6;        /* No data for any kinds beyond 5, so anything bigger is just undefined, and that's 6 */
    4723           0 :         for ( i=1; i<10; ++i ) {
    4724           0 :             GGadget *lab = GWidgetGetControl(d->gw,CID_PanFamilyLab+i);
    4725           0 :             GGadget *list = GWidgetGetControl(d->gw,CID_PanFamily+i);
    4726           0 :             int temp = GGadgetGetFirstListSelectedItem(list);
    4727           0 :             if ( kind==5 && i==2 ) temp=1;
    4728           0 :             if ( temp>=16 && (kind!=4 || i!=5)) temp=15;
    4729           0 :             else if ( temp>16 ) temp=16;     /* Decorative.serifvar has 17 elements */
    4730           0 :             GGadgetSetTitle8WithMn(lab,panoses[kind][i-1].name);
    4731           0 :             GGadgetSetList(list,GTextInfoArrayFromList(panoses[kind][i-1].variants,NULL),false);
    4732           0 :             GGadgetSelectOneListItem(list,temp);
    4733             :         }
    4734             :     }
    4735           0 : }
    4736             : 
    4737           0 : static int GFI_ChangePanoseFamily(GGadget *g, GEvent *e) {
    4738           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
    4739           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    4740           0 :         GFI_SetPanoseLists(d);
    4741             :     }
    4742           0 : return( true );
    4743             : }
    4744             : 
    4745           0 : static void GFI_SubSuperSet(struct gfi_data *d, struct pfminfo *info) {
    4746             :     char buffer[40];
    4747             :     unichar_t ubuf[40];
    4748             : 
    4749           0 :     sprintf( buffer, "%d", info->os2_subxsize );
    4750           0 :     uc_strcpy(ubuf,buffer);
    4751           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXSize),ubuf);
    4752             : 
    4753           0 :     sprintf( buffer, "%d", info->os2_subysize );
    4754           0 :     uc_strcpy(ubuf,buffer);
    4755           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYSize),ubuf);
    4756             : 
    4757           0 :     sprintf( buffer, "%d", info->os2_subxoff );
    4758           0 :     uc_strcpy(ubuf,buffer);
    4759           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXOffset),ubuf);
    4760             : 
    4761           0 :     sprintf( buffer, "%d", info->os2_subyoff );
    4762           0 :     uc_strcpy(ubuf,buffer);
    4763           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYOffset),ubuf);
    4764             : 
    4765             : 
    4766           0 :     sprintf( buffer, "%d", info->os2_supxsize );
    4767           0 :     uc_strcpy(ubuf,buffer);
    4768           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXSize),ubuf);
    4769             : 
    4770           0 :     sprintf( buffer, "%d", info->os2_supysize );
    4771           0 :     uc_strcpy(ubuf,buffer);
    4772           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYSize),ubuf);
    4773             : 
    4774           0 :     sprintf( buffer, "%d", info->os2_supxoff );
    4775           0 :     uc_strcpy(ubuf,buffer);
    4776           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXOffset),ubuf);
    4777             : 
    4778           0 :     sprintf( buffer, "%d", info->os2_supyoff );
    4779           0 :     uc_strcpy(ubuf,buffer);
    4780           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYOffset),ubuf);
    4781             : 
    4782             : 
    4783           0 :     sprintf( buffer, "%d", info->os2_strikeysize );
    4784           0 :     uc_strcpy(ubuf,buffer);
    4785           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutSize),ubuf);
    4786             : 
    4787           0 :     sprintf( buffer, "%d", info->os2_strikeypos );
    4788           0 :     uc_strcpy(ubuf,buffer);
    4789           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutPos),ubuf);
    4790           0 : }
    4791             : 
    4792           0 : static void _GFI_SubSuperDefault(struct gfi_data *d) {
    4793             :     int i;
    4794           0 :     int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault));
    4795             : 
    4796           0 :     for ( i=0; i<10; ++i )
    4797           0 :         GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_SubXSize+i),!isdefault);
    4798           0 :     if ( isdefault ) {
    4799           0 :         const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
    4800           0 :         const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
    4801           0 :         const unichar_t *ia = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
    4802             :         unichar_t *aend, *dend, *iend;
    4803           0 :         double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend),iav=u_strtod(ia,&iend);
    4804             :         struct pfminfo info;
    4805           0 :         if ( *aend!='\0' ) av = d->sf->ascent;
    4806           0 :         if ( *dend!='\0' ) dv = d->sf->descent;
    4807           0 :         if ( *iend!='\0' ) iav = d->sf->italicangle;
    4808           0 :         memset(&info,0,sizeof(info));
    4809           0 :         SFDefaultOS2SubSuper(&info,(int) (dv+av), iav);
    4810           0 :         GFI_SubSuperSet(d,&info);
    4811             :     }
    4812           0 : }
    4813             : 
    4814           0 : static int GFI_SubSuperDefault(GGadget *g, GEvent *e) {
    4815           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    4816           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    4817           0 :         _GFI_SubSuperDefault(d);
    4818             :     }
    4819           0 : return( true );
    4820             : }
    4821             : 
    4822           0 : static void TTFSetup(struct gfi_data *d) {
    4823             :     struct pfminfo info;
    4824             :     char buffer[10]; unichar_t ubuf[10];
    4825             :     int i, lg, vlg, tlg;
    4826           0 :     const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
    4827           0 :     const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
    4828             :     unichar_t *aend, *dend;
    4829           0 :     double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend);
    4830             : 
    4831           0 :     info = d->sf->pfminfo;
    4832           0 :     if ( !info.pfmset ) {
    4833             :         /* Base this stuff on the CURRENT name */
    4834             :         /* if the user just created a font, and named it *Bold, then the sf */
    4835             :         /*  won't yet have Bold in its name, and basing the weight on it would*/
    4836             :         /*  give the wrong answer. That's why we don't do this init until we */
    4837             :         /*  get to one of the ttf aspects, it gives the user time to set the */
    4838             :         /*  name properly */
    4839             :         /* And on CURRENT values of ascent and descent */
    4840           0 :         char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
    4841           0 :         if ( *aend=='\0' && *dend=='\0' ) {
    4842           0 :             if ( info.linegap==0 )
    4843           0 :                 info.linegap = rint(.09*(av+dv));
    4844           0 :             if ( info.vlinegap==0 )
    4845           0 :                 info.vlinegap = info.linegap;
    4846           0 :             if ( info.os2_typolinegap==0 )
    4847           0 :                 info.os2_typolinegap = info.linegap;
    4848             :         }
    4849           0 :         lg = info.linegap; vlg = info.vlinegap; tlg = info.os2_typolinegap;
    4850           0 :         SFDefaultOS2Info(&info,d->sf,n);
    4851           0 :         if ( lg != 0 )
    4852           0 :             info.linegap = lg;
    4853           0 :         if ( vlg!= 0 )
    4854           0 :             info.vlinegap = vlg;
    4855           0 :         if ( tlg!=0 )
    4856           0 :             info.os2_typolinegap = tlg;
    4857           0 :         free(n);
    4858             :     }
    4859             : 
    4860           0 :     if ( info.weight>0 && info.weight<=900 && info.weight%100==0 )
    4861           0 :         GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),
    4862           0 :                 (char *) weightclass[info.weight/100-1].text);
    4863             :     else {
    4864           0 :         sprintf( buffer, "%d", info.weight );
    4865           0 :         GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),buffer);
    4866             :     }
    4867           0 :     GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_WidthClass),info.width-1);
    4868           0 :     for ( i=0; pfmfamily[i].text!=NULL; ++i )
    4869           0 :         if ( (intpt) (pfmfamily[i].userdata)==info.pfmfamily ) {
    4870           0 :             GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PFMFamily),i);
    4871           0 :     break;
    4872             :         }
    4873             : 
    4874           0 :     if ( d->sf->os2_version>=0 && d->sf->os2_version<=4 )
    4875           0 :         GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_OS2Version),d->sf->os2_version);
    4876             :     else {
    4877           0 :         sprintf( buffer,"%d", d->sf->os2_version );
    4878           0 :         GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_OS2Version),buffer);
    4879             :     }
    4880           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_UseTypoMetrics),d->sf->use_typo_metrics);
    4881           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WeightWidthSlopeOnly),d->sf->weight_width_slope_only);
    4882             : 
    4883           0 :     for ( i=0; ibmfamily[i].text!=NULL; ++i )
    4884           0 :         if ( (intpt) (ibmfamily[i].userdata)==info.os2_family_class ) {
    4885           0 :             GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_IBMFamily),i);
    4886           0 :     break;
    4887             :         }
    4888           0 :     if ( info.os2_vendor[0]!='\0' ) {
    4889           0 :         ubuf[0] = info.os2_vendor[0];
    4890           0 :         ubuf[1] = info.os2_vendor[1];
    4891           0 :         ubuf[2] = info.os2_vendor[2];
    4892           0 :         ubuf[3] = info.os2_vendor[3];
    4893           0 :         ubuf[4] = 0;
    4894           0 :     } else if ( TTFFoundry!=NULL )
    4895           0 :         uc_strncpy(ubuf,TTFFoundry,4);
    4896             :     else
    4897           0 :         uc_strcpy(ubuf,"PfEd");
    4898           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Vendor),ubuf);
    4899             : 
    4900           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_PanDefault),!info.panose_set);
    4901           0 :     _GFI_PanoseDefault(d);
    4902           0 :     if ( info.panose_set ) {
    4903           0 :         for ( i=0; i<10; ++i ) {
    4904           0 :             int v = info.panose[i];
    4905           0 :             if ( v>=16 && (info.panose[0]!=4 || i!=5 )) v=15;
    4906           0 :             else if ( v>16 ) v=16;   /* Sigh Decorative.SerifVar has 17 elements */
    4907           0 :             GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),v);
    4908           0 :             if ( i==0 )
    4909           0 :                 GFI_SetPanoseLists(d);
    4910             :         }
    4911             :     }
    4912             : 
    4913           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault),!info.subsuper_set);
    4914           0 :     if ( info.subsuper_set )
    4915           0 :         GFI_SubSuperSet(d,&info);
    4916           0 :     _GFI_SubSuperDefault(d);
    4917             : 
    4918           0 :     d->ttf_set = true;
    4919             :     /* FSType is already set */
    4920           0 :     sprintf( buffer, "%d", info.linegap );
    4921           0 :     uc_strcpy(ubuf,buffer);
    4922           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_LineGap),ubuf);
    4923           0 :     sprintf( buffer, "%d", info.vlinegap );
    4924           0 :     uc_strcpy(ubuf,buffer);
    4925           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_VLineGap),ubuf);
    4926           0 :     sprintf( buffer, "%d", info.os2_typolinegap );
    4927           0 :     uc_strcpy(ubuf,buffer);
    4928           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoLineGap),ubuf);
    4929             : 
    4930           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinAscentIsOff),info.winascent_add);
    4931           0 :     GFI_AsDsLab(d,CID_WinAscentIsOff,true);
    4932           0 :     sprintf( buffer, "%d", info.os2_winascent );
    4933           0 :     uc_strcpy(ubuf,buffer);
    4934           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinAscent),ubuf);
    4935           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinDescentIsOff),info.windescent_add);
    4936           0 :     GFI_AsDsLab(d,CID_WinDescentIsOff,true);
    4937           0 :     sprintf( buffer, "%d", info.os2_windescent );
    4938           0 :     uc_strcpy(ubuf,buffer);
    4939           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinDescent),ubuf);
    4940             : 
    4941           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoAscentIsOff),info.typoascent_add);
    4942           0 :     GFI_AsDsLab(d,CID_TypoAscentIsOff,true);
    4943           0 :     sprintf( buffer, "%d", info.os2_typoascent );
    4944           0 :     uc_strcpy(ubuf,buffer);
    4945           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoAscent),ubuf);
    4946           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoDescentIsOff),info.typodescent_add);
    4947           0 :     GFI_AsDsLab(d,CID_TypoDescentIsOff,true);
    4948           0 :     sprintf( buffer, "%d", info.os2_typodescent );
    4949           0 :     uc_strcpy(ubuf,buffer);
    4950           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoDescent),ubuf);
    4951             : 
    4952           0 :     sprintf( buffer, "%d", info.os2_capheight );
    4953           0 :     uc_strcpy(ubuf,buffer);
    4954           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_CapHeight),ubuf);
    4955           0 :     sprintf( buffer, "%d", info.os2_xheight );
    4956           0 :     uc_strcpy(ubuf,buffer);
    4957           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_XHeight),ubuf);
    4958             : 
    4959           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadAscentIsOff),info.hheadascent_add);
    4960           0 :     GFI_AsDsLab(d,CID_HHeadAscentIsOff,true);
    4961           0 :     sprintf( buffer, "%d", info.hhead_ascent );
    4962           0 :     uc_strcpy(ubuf,buffer);
    4963           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadAscent),ubuf);
    4964           0 :     GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadDescentIsOff),info.hheaddescent_add);
    4965           0 :     GFI_AsDsLab(d,CID_HHeadDescentIsOff,true);
    4966           0 :     sprintf( buffer, "%d", info.hhead_descent );
    4967           0 :     uc_strcpy(ubuf,buffer);
    4968           0 :     GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadDescent),ubuf);
    4969           0 : }
    4970             : 
    4971             : static char *mathparams[] = {
    4972             : /* GT: TeX parameters for math fonts. "Num" means numerator, "Denom" */
    4973             : /* GT: means denominator, "Sup" means superscript, "Sub" means subscript */
    4974             :     N_("Num1:"),
    4975             :     N_("Num2:"),  N_("Num3:"), N_("Denom1:"),
    4976             :     N_("Denom2:"), N_("Sup1:"), N_("Sup2:"), N_("Sup3:"), N_("Sub1:"), N_("Sub2:"),
    4977             :     N_("SupDrop:"), N_("SubDrop:"), N_("Delim1:"), N_("Delim2:"), N_("Axis Ht:"),
    4978             :     0 };
    4979             : static char *mathpopups[] = { N_("Amount to raise baseline for numerators in display styles"),
    4980             :     N_("Amount to raise baseline for numerators in non-display styles"),
    4981             :     N_("Amount to raise baseline for numerators in non-display atop styles"),
    4982             :     N_("Amount to lower baseline for denominators in display styles"),
    4983             :     N_("Amount to lower baseline for denominators in non-display styles"),
    4984             :     N_("Amount to raise baseline for superscripts in display styles"),
    4985             :     N_("Amount to raise baseline for superscripts in non-display styles"),
    4986             :     N_("Amount to raise baseline for superscripts in modified styles"),
    4987             :     N_("Amount to lower baseline for subscripts in display styles"),
    4988             :     N_("Amount to lower baseline for subscripts in non-display styles"),
    4989             :     N_("Amount above top of large box to place baseline of superscripts"),
    4990             :     N_("Amount below bottom of large box to place baseline of subscripts"),
    4991             :     N_("Size of comb delimiters in display styles"),
    4992             :     N_("Size of comb delimiters in non-display styles"),
    4993             :     N_("Height of fraction bar above base line"),
    4994             :     0 };
    4995             : /* GT: Default Rule Thickness. A rule being a typographic term for a straight */
    4996             : /* GT: black line on a printed page. */
    4997             : static char *extparams[] = { N_("Def Rule Thick:"),
    4998             : /* GT: I don't really understand these "Big Op Space" things. They have */
    4999             : /* GT: something to do with TeX and are roughly defined a few strings down */
    5000             :         N_("Big Op Space1:"),
    5001             :         N_("Big Op Space2:"),
    5002             :         N_("Big Op Space3:"),
    5003             :         N_("Big Op Space4:"),
    5004             :         N_("Big Op Space5:"), 0 };
    5005             : static char *extpopups[] = { N_("Default thickness of over and overline bars"),
    5006             :         N_("The minimum glue space above a large displayed operator"),
    5007             :         N_("The minimum glue space below a large displayed operator"),
    5008             :         N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is above the operator"),
    5009             :         N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is below the operator"),
    5010             :         N_("The extra glue place above and below displayed limits"),
    5011             :         0 };
    5012             : 
    5013           0 : static int mp_e_h(GWindow gw, GEvent *event) {
    5014             :     int i;
    5015             : 
    5016           0 :     if ( event->type==et_close ) {
    5017           0 :         struct gfi_data *d = GDrawGetUserData(gw);
    5018           0 :         d->mpdone = true;
    5019           0 :     } else if ( event->type == et_char ) {
    5020           0 : return( false );
    5021           0 :     } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
    5022           0 :         struct gfi_data *d = GDrawGetUserData(gw);
    5023           0 :         if ( GGadgetGetCid(event->u.control.g)) {
    5024           0 :             int err=false;
    5025           0 :             double em = (d->sf->ascent+d->sf->descent), val;
    5026             :             char **params;
    5027           0 :             if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
    5028           0 :                 params = mathparams;
    5029             :             else
    5030           0 :                 params = extparams;
    5031           0 :             for ( i=0; params[i]!=0 && !err; ++i ) {
    5032           0 :                 val = GetReal8(gw,CID_TeX+i,params[i],&err);
    5033           0 :                 if ( !err )
    5034           0 :                     d->texdata.params[i+7] = rint( val/em * (1<<20) );
    5035             :             }
    5036           0 :             if ( !err )
    5037           0 :                 d->mpdone = true;
    5038             :         } else
    5039           0 :             d->mpdone = true;
    5040             :     }
    5041           0 : return( true );
    5042             : }
    5043             : 
    5044           0 : static int GFI_MoreParams(GGadget *g, GEvent *e) {
    5045             :     int tot;
    5046             :     GRect pos;
    5047             :     GWindow gw;
    5048             :     GWindowAttrs wattrs;
    5049             :     GGadgetCreateData txgcd[35], boxes[3], *txarray[18][3], *barray[9];
    5050             :     GTextInfo txlabel[35];
    5051             :     int i,y,k,j;
    5052             :     char **params, **popups;
    5053             :     char values[20][20];
    5054             : 
    5055           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    5056           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5057           0 :         if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
    5058           0 : return( true );
    5059           0 :         else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) ) {
    5060           0 :             tot = 22-7;
    5061           0 :             params = mathparams;
    5062           0 :             popups = mathpopups;
    5063             :         } else {
    5064           0 :             tot = 13-7;
    5065           0 :             params = extparams;
    5066           0 :             popups = extpopups;
    5067             :         }
    5068             : 
    5069           0 :         memset(&wattrs,0,sizeof(wattrs));
    5070           0 :         wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
    5071           0 :         wattrs.event_masks = ~(1<<et_charup);
    5072           0 :         wattrs.is_dlg = true;
    5073           0 :         wattrs.restrict_input_to_me = 1;
    5074           0 :         wattrs.undercursor = 1;
    5075           0 :         wattrs.cursor = ct_pointer;
    5076             : /* GT: More Parameters */
    5077           0 :         wattrs.utf8_window_title = _("More Params");
    5078           0 :         pos.x = pos.y = 0;
    5079           0 :         pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
    5080           0 :         pos.height = GDrawPointsToPixels(NULL,tot*26+60);
    5081           0 :         gw = GDrawCreateTopWindow(NULL,&pos,mp_e_h,d,&wattrs);
    5082             : 
    5083           0 :         memset(&txlabel,0,sizeof(txlabel));
    5084           0 :         memset(&txgcd,0,sizeof(txgcd));
    5085             : 
    5086           0 :         k=j=0; y = 10;
    5087           0 :         for ( i=0; params[i]!=0; ++i ) {
    5088           0 :             txlabel[k].text = (unichar_t *) params[i];
    5089           0 :             txlabel[k].text_is_1byte = true;
    5090           0 :             txgcd[k].gd.label = &txlabel[k];
    5091           0 :             txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = y+4;
    5092           0 :             txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    5093           0 :             txgcd[k].gd.popup_msg = (unichar_t *) popups[i];
    5094           0 :             txgcd[k++].creator = GLabelCreate;
    5095           0 :             txarray[j][0] = &txgcd[k-1];
    5096             : 
    5097           0 :             sprintf( values[i], "%g", d->texdata.params[i+7]*(double) (d->sf->ascent+d->sf->descent)/(double) (1<<20));
    5098           0 :             txlabel[k].text = (unichar_t *) values[i];
    5099           0 :             txlabel[k].text_is_1byte = true;
    5100           0 :             txgcd[k].gd.label = &txlabel[k];
    5101           0 :             txgcd[k].gd.pos.x = 85; txgcd[k].gd.pos.y = y;
    5102           0 :             txgcd[k].gd.pos.width = 75;
    5103           0 :             txgcd[k].gd.flags = gg_visible | gg_enabled;
    5104           0 :             txgcd[k].gd.cid = CID_TeX + i;
    5105           0 :             txgcd[k++].creator = GTextFieldCreate;
    5106           0 :             txarray[j][1] = &txgcd[k-1]; txarray[j++][2] = NULL;
    5107           0 :             y += 26;
    5108             :         }
    5109           0 :         txarray[j][0] = GCD_Glue; txarray[j][1] = GCD_Glue; txarray[j++][2] = NULL;
    5110             : 
    5111           0 :         txgcd[k].gd.pos.x = 30-3; txgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
    5112           0 :         txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
    5113           0 :         txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
    5114           0 :         txlabel[k].text = (unichar_t *) _("_OK");
    5115           0 :         txlabel[k].text_is_1byte = true;
    5116           0 :         txlabel[k].text_in_resource = true;
    5117           0 :         txgcd[k].gd.label = &txlabel[k];
    5118           0 :         txgcd[k].gd.cid = true;
    5119           0 :         txgcd[k++].creator = GButtonCreate;
    5120             : 
    5121           0 :         txgcd[k].gd.pos.x = -30; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+3;
    5122           0 :         txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
    5123           0 :         txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
    5124           0 :         txlabel[k].text = (unichar_t *) _("_Cancel");
    5125           0 :         txlabel[k].text_is_1byte = true;
    5126           0 :         txlabel[k].text_in_resource = true;
    5127           0 :         txgcd[k].gd.label = &txlabel[k];
    5128           0 :         txgcd[k].gd.cid = false;
    5129           0 :         txgcd[k++].creator = GButtonCreate;
    5130             : 
    5131           0 :         barray[0] = barray[2] = barray[3] = barray[4] = barray[6] = GCD_Glue; barray[7] = NULL;
    5132           0 :         barray[1] = &txgcd[k-2]; barray[5] = &txgcd[k-1];
    5133           0 :         txarray[j][0] = &boxes[2]; txarray[j][1] = GCD_ColSpan; txarray[j++][2] = NULL;
    5134           0 :         txarray[j][0] = NULL;
    5135             : 
    5136           0 :         memset(boxes,0,sizeof(boxes));
    5137           0 :         boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
    5138           0 :         boxes[0].gd.flags = gg_enabled|gg_visible;
    5139           0 :         boxes[0].gd.u.boxelements = txarray[0];
    5140           0 :         boxes[0].creator = GHVGroupCreate;
    5141             : 
    5142           0 :         boxes[2].gd.flags = gg_enabled|gg_visible;
    5143           0 :         boxes[2].gd.u.boxelements = barray;
    5144           0 :         boxes[2].creator = GHBoxCreate;
    5145             : 
    5146           0 :         GGadgetsCreate(gw,boxes);
    5147           0 :         GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
    5148           0 :         GHVBoxSetExpandableRow(boxes[0].ret,gb_expandglue);
    5149           0 :         GHVBoxFitWindow(boxes[0].ret);
    5150           0 :         d->mpdone = false;
    5151           0 :         GDrawSetVisible(gw,true);
    5152             : 
    5153           0 :         while ( !d->mpdone )
    5154           0 :             GDrawProcessOneEvent(NULL);
    5155           0 :         GDrawDestroyWindow(gw);
    5156             :     }
    5157           0 : return( true );
    5158             : }
    5159             : 
    5160           0 : static int GFI_TeXChanged(GGadget *g, GEvent *e) {
    5161           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5162           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5163           0 :         GGadget *extrasp = GWidgetGetControl(d->gw,CID_TeXExtraSpLabel);
    5164             : 
    5165           0 :         if ( GGadgetGetCid(g)==CID_TeXText ) {
    5166           0 :             GGadgetSetTitle8(extrasp,
    5167             : /* GT: Extra Space */
    5168           0 :                     _("Extra Sp:"));
    5169           0 :             GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
    5170             :         } else {
    5171           0 :             GGadgetSetTitle8(extrasp, _("Math Sp:"));
    5172           0 :             GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),true);
    5173             :         }
    5174             :         /* In Polish we need to reflow the text after changing the label */
    5175           0 :         GHVBoxReflow(GWidgetGetControl(d->gw,CID_TeXBox));
    5176             :     }
    5177           0 : return( true );
    5178             : }
    5179             : 
    5180           0 : static void DefaultTeX(struct gfi_data *d) {
    5181             :     char buffer[20];
    5182             :     int i;
    5183           0 :     SplineFont *sf = d->sf;
    5184             : 
    5185           0 :     d->tex_set = true;
    5186             : 
    5187           0 :     if ( sf->texdata.type==tex_unset ) {
    5188           0 :         TeXDefaultParams(sf);
    5189           0 :         d->texdata = sf->texdata;
    5190             :     }
    5191             : 
    5192           0 :     for ( i=0; i<7; ++i ) {
    5193           0 :         sprintf( buffer,"%g", d->texdata.params[i]*(sf->ascent+sf->descent)/(double) (1<<20));
    5194           0 :         GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeX+i),buffer);
    5195             :     }
    5196           0 :     if ( sf->texdata.type==tex_math )
    5197           0 :         GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathSym), true);
    5198           0 :     else if ( sf->texdata.type == tex_mathext )
    5199           0 :         GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathExt), true);
    5200             :     else {
    5201           0 :         GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXText), true);
    5202           0 :         GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
    5203             : /* GT: Extra Space */
    5204           0 :                 _("Extra Sp:"));
    5205           0 :         GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
    5206             :     }
    5207           0 : }
    5208             : 
    5209           0 : static int GFI_MacAutomatic(GGadget *g, GEvent *e) {
    5210           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5211           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5212           0 :         int autom = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic));
    5213           0 :         GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MacStyles),!autom);
    5214             :     }
    5215           0 : return( true );
    5216             : }
    5217             : 
    5218           0 : static void FigureUnicode(struct gfi_data *d) {
    5219           0 :     int includeempties = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_UnicodeEmpties));
    5220           0 :     GGadget *list = GWidgetGetControl(d->gw,CID_Unicode);
    5221             :     struct rangeinfo *ri;
    5222             :     int cnt, i;
    5223             :     GTextInfo **ti;
    5224             :     char buffer[200];
    5225             : 
    5226           0 :     GGadgetClearList(list);
    5227           0 :     ri = SFUnicodeRanges(d->sf,(includeempties?ur_includeempty:0)|ur_sortbyunicode);
    5228           0 :     if ( ri==NULL ) cnt=0;
    5229             :     else
    5230           0 :         for ( cnt=0; ri[cnt].range!=NULL; ++cnt );
    5231             : 
    5232           0 :     ti = malloc((cnt+1) * sizeof( GTextInfo * ));
    5233           0 :     for ( i=0; i<cnt; ++i ) {
    5234           0 :         if ( ri[i].range->first==-1 )
    5235           0 :             snprintf( buffer, sizeof(buffer),
    5236           0 :                     "%s  %d/0", _(ri[i].range->name), ri[i].cnt);
    5237             :         else
    5238           0 :             snprintf( buffer, sizeof(buffer),
    5239             :                     "%s  U+%04X-U+%04X %d/%d",
    5240           0 :                     _(ri[i].range->name),
    5241           0 :                     (int) ri[i].range->first, (int) ri[i].range->last,
    5242           0 :                     ri[i].cnt, ri[i].range->actual );
    5243           0 :         ti[i] = calloc(1,sizeof(GTextInfo));
    5244           0 :         ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
    5245           0 :         ti[i]->text = utf82u_copy(buffer);
    5246           0 :         ti[i]->userdata = ri[i].range;
    5247             :     }
    5248           0 :     ti[i] = calloc(1,sizeof(GTextInfo));
    5249           0 :     GGadgetSetList(list,ti,false);
    5250           0 :     free(ri);
    5251           0 : }
    5252             : 
    5253           0 : static int GFI_UnicodeRangeChange(GGadget *g, GEvent *e) {
    5254           0 :     struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5255           0 :     GTextInfo *ti = GGadgetGetListItemSelected(g);
    5256             :     struct unicoderange *r;
    5257           0 :     int gid, first=-1;
    5258           0 :     SplineFont *sf = d->sf;
    5259           0 :     FontView *fv = (FontView *) (sf->fv);
    5260           0 :     EncMap *map = fv->b.map;
    5261             :     int i, enc;
    5262             : 
    5263           0 :     if ( ti==NULL )
    5264           0 : return( true );
    5265           0 :     if ( e->type!=et_controlevent ||
    5266           0 :             (e->u.control.subtype != et_listselected &&e->u.control.subtype != et_listdoubleclick))
    5267           0 : return( true );
    5268             : 
    5269           0 :     r = ti->userdata;
    5270             : 
    5271           0 :     for ( i=0; i<map->enccount; ++i )
    5272           0 :         fv->b.selected[i] = 0;
    5273             : 
    5274           0 :     if ( e->u.control.subtype == et_listselected ) {
    5275           0 :         for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
    5276           0 :             enc = map->backmap[gid];
    5277           0 :             if ( sf->glyphs[gid]->unicodeenc>=r->first && sf->glyphs[gid]->unicodeenc<=r->last &&
    5278             :                     enc!=-1 ) {
    5279           0 :                 if ( first==-1 || enc<first ) first = enc;
    5280           0 :                 fv->b.selected[enc] = true;
    5281             :             }
    5282             :         }
    5283           0 :     } else if ( e->u.control.subtype == et_listdoubleclick && !r->unassigned ) {
    5284           0 :         char *found = calloc(r->last-r->first+1,1);
    5285           0 :         for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
    5286           0 :             int u = sf->glyphs[gid]->unicodeenc;
    5287           0 :             if ( u>=r->first && u<=r->last ) {
    5288           0 :                 found[u-r->first] = true;
    5289             :             }
    5290             :         }
    5291           0 :         for ( i=0; i<=r->last-r->first; ++i ) {
    5292           0 :             if ( isunicodepointassigned(i+r->first) && !found[i] ) {
    5293           0 :                 enc = EncFromUni(i+r->first,map->enc);
    5294           0 :                 if ( enc!=-1 ) {
    5295           0 :                     if ( first==-1 || enc<first ) first = enc;
    5296           0 :                     fv->b.selected[enc] = true;
    5297             :                 }
    5298             :             }
    5299             :         }
    5300           0 :         free(found);
    5301             :     }
    5302           0 :     if ( first==-1 ) {
    5303           0 :         GDrawBeep(NULL);
    5304             :     } else {
    5305           0 :         FVScrollToChar(fv,first);
    5306             :     }
    5307           0 :     GDrawRequestExpose(fv->v,NULL,false);
    5308           0 : return( true );
    5309             : }
    5310             : 
    5311           0 : static int GFI_UnicodeEmptiesChange(GGadget *g, GEvent *e) {
    5312           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5313           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5314           0 :         FigureUnicode(d);
    5315             :     }
    5316           0 : return( true );
    5317             : }
    5318             : 
    5319           0 : static int GFI_AspectChange(GGadget *g, GEvent *e) {
    5320           0 :     if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_radiochanged )) {
    5321           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5322           0 :         int new_aspect = GTabSetGetSel(g);
    5323             :         int rows;
    5324             : 
    5325           0 :         if ( d->old_aspect == d->tn_aspect )
    5326           0 :             GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
    5327           0 :         if ( !d->ttf_set && new_aspect == d->ttfv_aspect )
    5328           0 :             TTFSetup(d);
    5329           0 :         else if ( !d->names_set && new_aspect == d->tn_aspect ) {
    5330           0 :             TTFNames_Resort(d);
    5331           0 :             d->names_set = true;
    5332           0 :         } else if ( !d->tex_set && new_aspect == d->tx_aspect )
    5333           0 :             DefaultTeX(d);
    5334           0 :         else if ( new_aspect == d->unicode_aspect )
    5335           0 :             FigureUnicode(d);
    5336           0 :         d->old_aspect = new_aspect;
    5337             :     }
    5338           0 : return( true );
    5339             : }
    5340             : 
    5341           0 : static int GFI_URangeAspectChange(GGadget *g, GEvent *e) {
    5342           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    5343           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5344           0 :         GTabSetSetSel(GWidgetGetControl(d->gw,CID_Tabs),d->ttfv_aspect);
    5345           0 :         GFI_AspectChange(GWidgetGetControl(d->gw,CID_Tabs),NULL);
    5346           0 :         GTabSetSetSel(GWidgetGetControl(d->gw,CID_TTFTabs),4);
    5347             :     }
    5348           0 : return( true );
    5349             : }
    5350             : 
    5351           0 : static int e_h(GWindow gw, GEvent *event) {
    5352           0 :     if ( event->type==et_close ) {
    5353           0 :         struct gfi_data *d = GDrawGetUserData(gw);
    5354           0 :         GFI_CancelClose(d);
    5355           0 :     } else if ( event->type==et_destroy ) {
    5356           0 :         struct gfi_data *d = GDrawGetUserData(gw);
    5357           0 :         free(d);
    5358           0 :     } else if ( event->type==et_char ) {
    5359           0 : return( GFI_Char(GDrawGetUserData(gw),event));
    5360             :     }
    5361           0 : return( true );
    5362             : }
    5363             : 
    5364           0 : static int OS2_UnicodeChange(GGadget *g, GEvent *e) {
    5365             :     int32 flags[4];
    5366             :     int len,i,bit,set;
    5367             : 
    5368           0 :     if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_textchanged )) {
    5369             :         const unichar_t *ret;
    5370             :         unichar_t *end;
    5371           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5372           0 :         GWindow gw = d->gw;
    5373             :         GGadget *list;
    5374             : 
    5375           0 :         ret = _GGadgetGetTitle(g);
    5376           0 :         flags[3] = u_strtoul(ret,&end,16);
    5377           0 :         while ( !ishexdigit(*end) && *end!='\0' ) ++end;
    5378           0 :         flags[2] = u_strtoul(end,&end,16);
    5379           0 :         while ( !ishexdigit(*end) && *end!='\0' ) ++end;
    5380           0 :         flags[1] = u_strtoul(end,&end,16);
    5381           0 :         while ( !ishexdigit(*end) && *end!='\0' ) ++end;
    5382           0 :         flags[0] = u_strtoul(end,&end,16);
    5383             : 
    5384           0 :         list = GWidgetGetControl(gw,CID_UnicodeList);
    5385             : 
    5386           0 :         for ( i=0; unicoderangenames[i].text!=NULL; ++i ) {
    5387           0 :             bit = (intpt) (unicoderangenames[i].userdata);
    5388           0 :             set = (flags[bit>>5]&(1<<(bit&31)))?1 : 0;
    5389           0 :             GGadgetSelectListItem(list,i,set);
    5390             :         }
    5391           0 :     } else if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
    5392           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5393           0 :         GWindow gw = d->gw;
    5394             :         char ranges[40];
    5395           0 :         GTextInfo **list = GGadgetGetList(g,&len);
    5396           0 :         GGadget *field = GWidgetGetControl(gw,CID_UnicodeRanges);
    5397             : 
    5398           0 :         flags[0] = flags[1] = flags[2] = flags[3] = 0;
    5399           0 :         for ( i=0; i<len; ++i )
    5400           0 :             if ( list[i]->selected ) {
    5401           0 :                 bit = ((intpt) (list[i]->userdata));
    5402           0 :                 flags[bit>>5] |= (1<<(bit&31));
    5403             :             }
    5404             : 
    5405           0 :         sprintf( ranges, "%08x.%08x.%08x.%08x", flags[3], flags[2], flags[1], flags[0]);
    5406           0 :         GGadgetSetTitle8(field,ranges);
    5407             :     }
    5408           0 : return( true );
    5409             : }
    5410             : 
    5411           0 : static int OS2_URangesDefault(GGadget *g, GEvent *e) {
    5412             : 
    5413           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5414           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5415           0 :         int def = GGadgetIsChecked(g);
    5416           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),!def);
    5417           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UnicodeList),!def);
    5418           0 :         if ( def ) {
    5419           0 :             SplineFont *sf = gfi->sf;
    5420             :             char ranges[40];
    5421           0 :             OS2FigureUnicodeRanges(sf,sf->pfminfo.unicoderanges);
    5422           0 :             sprintf( ranges, "%08x.%08x.%08x.%08x",
    5423             :                     sf->pfminfo.unicoderanges[3], sf->pfminfo.unicoderanges[2],
    5424             :                     sf->pfminfo.unicoderanges[1], sf->pfminfo.unicoderanges[0]);
    5425           0 :             GGadgetSetTitle8(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),ranges);
    5426           0 :             OS2_UnicodeChange(GWidgetGetControl(gfi->gw,CID_UnicodeRanges),NULL);
    5427             :         }
    5428             :     }
    5429           0 : return( true );
    5430             : }
    5431             : 
    5432           0 : static int OS2_CodePageChange(GGadget *g, GEvent *e) {
    5433             :     int32 flags[2];
    5434             :     int len,i,bit,set;
    5435             : 
    5436           0 :     if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_textchanged )) {
    5437             :         const unichar_t *ret;
    5438             :         unichar_t *end;
    5439           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5440           0 :         GWindow gw = d->gw;
    5441             :         GGadget *list;
    5442             : 
    5443           0 :         ret = _GGadgetGetTitle(g);
    5444           0 :         flags[1] = u_strtoul(ret,&end,16);
    5445           0 :         while ( !ishexdigit(*end) && *end!='\0' ) ++end;
    5446           0 :         flags[0] = u_strtoul(end,&end,16);
    5447             : 
    5448           0 :         list = GWidgetGetControl(gw,CID_CodePageList);
    5449             : 
    5450           0 :         for ( i=0; codepagenames[i].text!=NULL; ++i ) {
    5451           0 :             bit = (intpt) (codepagenames[i].userdata);
    5452           0 :             set = (flags[bit>>5]&(1<<(bit&31)))?1 : 0;
    5453           0 :             GGadgetSelectListItem(list,i,set);
    5454             :         }
    5455           0 :     } else if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
    5456           0 :         struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
    5457           0 :         GWindow gw = d->gw;
    5458             :         char ranges[40];
    5459           0 :         GTextInfo **list = GGadgetGetList(g,&len);
    5460           0 :         GGadget *field = GWidgetGetControl(gw,CID_CodePageRanges);
    5461             : 
    5462           0 :         flags[0] = flags[1] = 0;
    5463           0 :         for ( i=0; i<len; ++i )
    5464           0 :             if ( list[i]->selected ) {
    5465           0 :                 bit = ((intpt) (list[i]->userdata));
    5466           0 :                 flags[bit>>5] |= (1<<(bit&31));
    5467             :             }
    5468             : 
    5469           0 :         sprintf( ranges, "%08x.%08x", flags[1], flags[0]);
    5470           0 :         GGadgetSetTitle8(field,ranges);
    5471             :     }
    5472           0 : return( true );
    5473             : }
    5474             : 
    5475           0 : static int OS2_CPageDefault(GGadget *g, GEvent *e) {
    5476             : 
    5477           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5478           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5479           0 :         int def = GGadgetIsChecked(g);
    5480           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_CodePageRanges),!def);
    5481           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_CodePageList),!def);
    5482           0 :         if ( def ) {
    5483           0 :             SplineFont *sf = gfi->sf;
    5484             :             char codepages[40];
    5485           0 :             OS2FigureCodePages(sf,sf->pfminfo.codepages);
    5486           0 :             sprintf( codepages, "%08x.%08x",
    5487             :                     sf->pfminfo.codepages[1], sf->pfminfo.codepages[0]);
    5488           0 :             GGadgetSetTitle8(GWidgetGetControl(gfi->gw,CID_CodePageRanges),codepages);
    5489           0 :             OS2_CodePageChange(GWidgetGetControl(gfi->gw,CID_CodePageRanges),NULL);
    5490             :         }
    5491             :     }
    5492           0 : return( true );
    5493             : }
    5494             : 
    5495           0 : static int GFI_UseUniqueIDChanged(GGadget *g, GEvent *e) {
    5496             : 
    5497           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5498           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5499           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_UniqueID),
    5500             :                 GGadgetIsChecked(g));
    5501             :     }
    5502           0 : return( true );
    5503             : }
    5504             : 
    5505           0 : static int GFI_UseXUIDChanged(GGadget *g, GEvent *e) {
    5506             : 
    5507           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    5508           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5509           0 :         GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_XUID),
    5510             :                 GGadgetIsChecked(g));
    5511             :     }
    5512           0 : return( true );
    5513             : }
    5514             : 
    5515           0 : static void LookupSetup(struct lkdata *lk,OTLookup *lookups) {
    5516             :     int cnt, subcnt;
    5517             :     OTLookup *otl;
    5518             :     struct lookup_subtable *sub;
    5519             : 
    5520           0 :     for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next );
    5521           0 :     lk->cnt = cnt; lk->max = cnt+10;
    5522           0 :     lk->all = calloc(lk->max,sizeof(struct lkinfo));
    5523           0 :     for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next ) {
    5524           0 :         lk->all[cnt].lookup = otl;
    5525           0 :         for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next );
    5526           0 :         lk->all[cnt].subtable_cnt = subcnt; lk->all[cnt].subtable_max = subcnt+10;
    5527           0 :         lk->all[cnt].subtables = calloc(lk->all[cnt].subtable_max,sizeof(struct lksubinfo));
    5528           0 :         for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next )
    5529           0 :             lk->all[cnt].subtables[subcnt].subtable = sub;
    5530             :     }
    5531           0 : }
    5532             : 
    5533           0 : static void LookupInfoFree(struct lkdata *lk) {
    5534             :     int cnt;
    5535             : 
    5536           0 :     for ( cnt=0; cnt<lk->cnt; ++cnt )
    5537           0 :         free(lk->all[cnt].subtables);
    5538           0 :     free(lk->all);
    5539           0 : }
    5540             : 
    5541             : #define LK_MARGIN 2
    5542             : 
    5543             : struct selection_bits {
    5544             :     int lookup_cnt, sub_cnt;    /* Number of selected lookups, and selected sub tables */
    5545             :     int a_lookup, a_sub;        /* The index of one of those lookups, or subtables */
    5546             :     int a_sub_lookup;           /*  the index of the lookup containing a_sub */
    5547             :     int any_first, any_last;    /* Whether any of the selected items is first or last in its catagory */
    5548             :     int sub_table_mergeable;    /* Can we merge the selected subtables? */
    5549             :     int lookup_mergeable;       /* Can we merge the selected lookups? */
    5550             : };
    5551             : 
    5552           0 : static void LookupParseSelection(struct lkdata *lk, struct selection_bits *sel) {
    5553             :     int lookup_cnt, sub_cnt, any_first, any_last, all_one_lookup;
    5554             :     int a_lookup, a_sub, a_sub_lookup;
    5555             :     int sub_mergeable, lookup_mergeable;
    5556             :     int i,j;
    5557             : 
    5558           0 :     lookup_cnt = sub_cnt = any_first = any_last = 0;
    5559           0 :     all_one_lookup = a_lookup = a_sub = a_sub_lookup = -1;
    5560           0 :     sub_mergeable = lookup_mergeable = true;
    5561           0 :     for ( i=0; i<lk->cnt; ++i ) {
    5562           0 :         if ( lk->all[i].deleted )
    5563           0 :     continue;
    5564           0 :         if ( lk->all[i].selected ) {
    5565           0 :             ++lookup_cnt;
    5566           0 :             if ( a_lookup==-1 )
    5567           0 :                 a_lookup = i;
    5568           0 :             else if ( lk->all[i].lookup->lookup_type!=lk->all[a_lookup].lookup->lookup_type ||
    5569           0 :                     lk->all[i].lookup->lookup_flags!=lk->all[a_lookup].lookup->lookup_flags )
    5570           0 :                 lookup_mergeable = false;
    5571           0 :             if ( i==0 ) any_first=true;
    5572           0 :             if ( i==lk->cnt-1 ) any_last=true;
    5573             :         }
    5574           0 :         if ( lk->all[i].open ) {
    5575           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    5576           0 :                 if ( lk->all[i].subtables[j].deleted )
    5577           0 :             continue;
    5578           0 :                 if ( lk->all[i].subtables[j].selected ) {
    5579           0 :                     ++sub_cnt;
    5580           0 :                     if ( a_sub==-1 ) {
    5581           0 :                         a_sub = j; a_sub_lookup = i;
    5582             :                     }
    5583           0 :                     if ( j==0 ) any_first = true;
    5584           0 :                     if ( j==lk->all[i].subtable_cnt-1 ) any_last = true;
    5585           0 :                     if ( lk->all[i].subtables[j].subtable->kc!=NULL ||
    5586           0 :                             lk->all[i].subtables[j].subtable->fpst!=NULL ||
    5587           0 :                             lk->all[i].subtables[j].subtable->sm!=NULL )
    5588           0 :                         sub_mergeable = false;
    5589           0 :                     if ( all_one_lookup==-1 )
    5590           0 :                         all_one_lookup = i;
    5591           0 :                     else if ( all_one_lookup!=i )
    5592           0 :                         all_one_lookup = -2;
    5593             :                 }
    5594             :             }
    5595             :         }
    5596             :     }
    5597             : 
    5598           0 :     sel->lookup_cnt = lookup_cnt;
    5599           0 :     sel->sub_cnt = sub_cnt;
    5600           0 :     sel->a_lookup = a_lookup;
    5601           0 :     sel->a_sub = a_sub;
    5602           0 :     sel->a_sub_lookup = a_sub_lookup;
    5603           0 :     sel->any_first = any_first;
    5604           0 :     sel->any_last = any_last;
    5605           0 :     sel->sub_table_mergeable = sub_mergeable && all_one_lookup>=0 && sub_cnt>=2 && lookup_cnt==0;
    5606           0 :     sel->lookup_mergeable = lookup_mergeable && lookup_cnt>=2 && sub_cnt==0;
    5607           0 : }
    5608             : 
    5609           0 : static int LookupsImportable(SplineFont *sf,int isgpos) {
    5610             :     FontView *ofv;
    5611             : 
    5612           0 :     for ( ofv=fv_list; ofv!=NULL; ofv = (FontView *) (ofv->b.next) ) {
    5613           0 :         SplineFont *osf = ofv->b.sf;
    5614           0 :         if ( osf->cidmaster ) osf = osf->cidmaster;
    5615           0 :         if ( osf==sf || sf->cidmaster==osf )
    5616           0 :     continue;
    5617           0 :         if ( (isgpos && osf->gpos_lookups!=NULL) || (!isgpos && osf->gsub_lookups!=NULL) )
    5618             :     break;
    5619             :     }
    5620           0 : return( ofv!=NULL );
    5621             : }
    5622             : 
    5623           0 : void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos) {
    5624           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    5625             :     struct selection_bits sel;
    5626             : 
    5627           0 :     LookupParseSelection(lk,&sel);
    5628             : 
    5629           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupTop),!sel.any_first &&
    5630           0 :             sel.lookup_cnt+sel.sub_cnt==1);
    5631           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupUp),!sel.any_first &&
    5632           0 :             sel.lookup_cnt+sel.sub_cnt!=0);
    5633           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupDown),!sel.any_last &&
    5634           0 :             sel.lookup_cnt+sel.sub_cnt!=0);
    5635           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupBottom),!sel.any_last &&
    5636           0 :             sel.lookup_cnt+sel.sub_cnt==1);
    5637           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddLookup),
    5638           0 :             (sel.lookup_cnt+sel.sub_cnt<=1));
    5639           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddSubtable),
    5640           0 :             (sel.lookup_cnt==1 && sel.sub_cnt<=1) || (sel.lookup_cnt==0 && sel.sub_cnt==1));
    5641           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditMetadata),
    5642           0 :             (sel.lookup_cnt==1 && sel.sub_cnt==0) ||
    5643           0 :             (sel.lookup_cnt==0 && sel.sub_cnt==1));
    5644           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditSubtable),sel.lookup_cnt==0 &&
    5645           0 :             sel.sub_cnt==1);
    5646           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_DeleteLookup),sel.lookup_cnt!=0 ||
    5647           0 :             sel.sub_cnt!=0);
    5648           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_MergeLookup),
    5649           0 :             (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
    5650           0 :             (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable));
    5651           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_RevertLookups),true);
    5652           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupSort),lk->cnt>1 );
    5653             : 
    5654           0 :     GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_ImportLookups),
    5655             :             LookupsImportable(gfi->sf,isgpos));
    5656           0 : }
    5657             : 
    5658           0 : void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh) {
    5659             :     int lcnt, i,j;
    5660           0 :     int width=0, wmax;
    5661           0 :     GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
    5662           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    5663           0 :     GGadget *vsb = GWidgetGetControl(gfi->gw,CID_LookupVSB+isgpos);
    5664           0 :     GGadget *hsb = GWidgetGetControl(gfi->gw,CID_LookupHSB+isgpos);
    5665             :     int off_top, off_left;
    5666             : 
    5667           0 :     GDrawSetFont(gw,gfi->font);
    5668           0 :     lcnt = 0;
    5669           0 :     for ( i=0; i<lk->cnt; ++i ) {
    5670           0 :         if ( lk->all[i].deleted )
    5671           0 :     continue;
    5672           0 :         ++lcnt;
    5673           0 :         wmax = GDrawGetText8Width(gw,lk->all[i].lookup->lookup_name,-1);
    5674           0 :         if ( wmax > width ) width = wmax;
    5675           0 :         if ( lk->all[i].open ) {
    5676           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    5677           0 :                 if ( lk->all[i].subtables[j].deleted )
    5678           0 :             continue;
    5679           0 :                 ++lcnt;
    5680           0 :                 wmax = gfi->fh+GDrawGetText8Width(gw,lk->all[i].subtables[j].subtable->subtable_name,-1);
    5681           0 :                 if ( wmax > width ) width = wmax;
    5682             :             }
    5683             :         }
    5684             :     }
    5685           0 :     width += gfi->fh;
    5686           0 :     GScrollBarSetBounds(vsb,0,lcnt,(gfi->lkheight-2*LK_MARGIN)/gfi->fh);
    5687           0 :     GScrollBarSetBounds(hsb,0,width,gfi->lkwidth-2*LK_MARGIN);
    5688           0 :     off_top = lk->off_top;
    5689           0 :     if ( off_top+((gfi->lkheight-2*LK_MARGIN)/gfi->fh) > lcnt )
    5690           0 :         off_top = lcnt - (gfi->lkheight-2*LK_MARGIN)/gfi->fh;
    5691           0 :     if ( off_top<0 )
    5692           0 :         off_top  = 0;
    5693           0 :     off_left = lk->off_left;
    5694           0 :     if ( off_left+gfi->lkwidth-2*LK_MARGIN > width )
    5695           0 :         off_left = width-(gfi->lkwidth-2*LK_MARGIN);
    5696           0 :     if ( off_left<0 )
    5697           0 :         off_left  = 0;
    5698           0 :     if ( off_top!=lk->off_top || off_left!=lk->off_left ) {
    5699           0 :         lk->off_top = off_top; lk->off_left = off_left;
    5700           0 :         GScrollBarSetPos(vsb,off_top);
    5701           0 :         GScrollBarSetPos(hsb,off_left);
    5702           0 :         refresh = true;
    5703             :     }
    5704           0 :     if ( refresh )
    5705           0 :         GDrawRequestExpose(gw,NULL,false);
    5706           0 : }
    5707             : 
    5708           0 : static int LookupsHScroll(GGadget *g,GEvent *event) {
    5709           0 :     struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5710           0 :     int isgpos = GGadgetGetCid(g)-CID_LookupHSB;
    5711           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    5712           0 :     int newpos = lk->off_left;
    5713             :     int32 sb_min, sb_max, sb_pagesize;
    5714             : 
    5715           0 :     if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
    5716           0 : return( true );
    5717             : 
    5718           0 :     GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
    5719           0 :     switch( event->u.control.u.sb.type ) {
    5720             :       case et_sb_top:
    5721           0 :         newpos = 0;
    5722           0 :       break;
    5723             :       case et_sb_uppage:
    5724           0 :         newpos -= 9*sb_pagesize/10;
    5725           0 :       break;
    5726             :       case et_sb_up:
    5727           0 :         newpos -= sb_pagesize/15;
    5728           0 :       break;
    5729             :       case et_sb_down:
    5730           0 :         newpos += sb_pagesize/15;
    5731           0 :       break;
    5732             :       case et_sb_downpage:
    5733           0 :         newpos += 9*sb_pagesize/10;
    5734           0 :       break;
    5735             :       case et_sb_bottom:
    5736           0 :         newpos = sb_max-sb_pagesize;
    5737           0 :       break;
    5738             :       case et_sb_thumb:
    5739             :       case et_sb_thumbrelease:
    5740           0 :         newpos = event->u.control.u.sb.pos;
    5741           0 :       break;
    5742             :       case et_sb_halfup:
    5743           0 :         newpos -= sb_pagesize/30;
    5744           0 :       break;
    5745             :       case et_sb_halfdown:
    5746           0 :         newpos += sb_pagesize/30;
    5747           0 :       break;
    5748             :     }
    5749           0 :     if ( newpos>sb_max-sb_pagesize )
    5750           0 :         newpos = sb_max-sb_pagesize;
    5751           0 :     if ( newpos<0 ) newpos = 0;
    5752           0 :     if ( newpos!=lk->off_left ) {
    5753           0 :         lk->off_left = newpos;
    5754           0 :         GScrollBarSetPos(event->u.control.g,newpos);
    5755           0 :         GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
    5756             :     }
    5757           0 : return( true );
    5758             : }
    5759             : 
    5760           0 : static int LookupsVScroll(GGadget *g,GEvent *event) {
    5761           0 :     struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5762           0 :     int isgpos = GGadgetGetCid(g)-CID_LookupVSB;
    5763           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    5764           0 :     int newpos = lk->off_top;
    5765             :     int32 sb_min, sb_max, sb_pagesize;
    5766             : 
    5767           0 :     if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
    5768           0 : return( true );
    5769             : 
    5770           0 :     GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
    5771           0 :     switch( event->u.control.u.sb.type ) {
    5772             :       case et_sb_top:
    5773           0 :         newpos = 0;
    5774           0 :       break;
    5775             :       case et_sb_uppage:
    5776           0 :         newpos -= 9*sb_pagesize/10;
    5777           0 :       break;
    5778             :       case et_sb_up:
    5779           0 :         --newpos;
    5780           0 :       break;
    5781             :       case et_sb_down:
    5782           0 :         ++newpos;
    5783           0 :       break;
    5784             :       case et_sb_downpage:
    5785           0 :         newpos += 9*sb_pagesize/10;
    5786           0 :       break;
    5787             :       case et_sb_bottom:
    5788           0 :         newpos = (sb_max-sb_pagesize);
    5789           0 :       break;
    5790             :       case et_sb_thumb:
    5791             :       case et_sb_thumbrelease:
    5792           0 :         newpos = event->u.control.u.sb.pos;
    5793           0 :       break;
    5794             :     }
    5795           0 :     if ( newpos>(sb_max-sb_pagesize) )
    5796           0 :         newpos = (sb_max-sb_pagesize);
    5797           0 :     if ( newpos<0 ) newpos = 0;
    5798           0 :     if ( newpos!=lk->off_top ) {
    5799             :         /*int diff = newpos-lk->off_top;*/
    5800           0 :         lk->off_top = newpos;
    5801           0 :         GScrollBarSetPos(event->u.control.g,newpos);
    5802             :         /*GDrawScroll(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,0,diff*gfi->fh);*/
    5803           0 :         GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
    5804             :     }
    5805           0 : return( true );
    5806             : }
    5807             : 
    5808           0 : static int GFI_LookupOrder(GGadget *g, GEvent *e) {
    5809             : 
    5810           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    5811           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5812           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    5813           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    5814             :         int i,j,k;
    5815             :         struct lkinfo temp;
    5816             :         struct lksubinfo temp2;
    5817           0 :         int cid = GGadgetGetCid(g);
    5818           0 :         GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
    5819             : 
    5820           0 :         if ( cid==CID_LookupTop ) {
    5821           0 :             for ( i=0; i<lk->cnt; ++i ) {
    5822           0 :                 if ( lk->all[i].deleted )
    5823           0 :             continue;
    5824           0 :                 if ( lk->all[i].selected ) {
    5825           0 :                     temp = lk->all[i];
    5826           0 :                     for ( k=i-1; k>=0; --k )
    5827           0 :                         lk->all[k+1] = lk->all[k];
    5828           0 :                     lk->all[0] = temp;
    5829           0 :     goto done;
    5830             :                 }
    5831           0 :                 if ( lk->all[i].open ) {
    5832           0 :                     for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    5833           0 :                         if ( lk->all[i].subtables[j].deleted )
    5834           0 :                     continue;
    5835           0 :                         if ( lk->all[i].subtables[j].selected ) {
    5836           0 :                             temp2 = lk->all[i].subtables[j];
    5837           0 :                             for ( k=j-1; k>=0; --k )
    5838           0 :                                 lk->all[i].subtables[k+1] = lk->all[i].subtables[k];
    5839           0 :                             lk->all[i].subtables[0] = temp2;
    5840           0 :     goto done;
    5841             :                         }
    5842             :                     }
    5843             :                 }
    5844             :             }
    5845           0 :         } else if ( cid==CID_LookupBottom ) {
    5846           0 :             for ( i=0; i<lk->cnt; ++i ) {
    5847           0 :                 if ( lk->all[i].deleted )
    5848           0 :             continue;
    5849           0 :                 if ( lk->all[i].selected ) {
    5850           0 :                     temp = lk->all[i];
    5851           0 :                     for ( k=i; k<lk->cnt-1; ++k )
    5852           0 :                         lk->all[k] = lk->all[k+1];
    5853           0 :                     lk->all[lk->cnt-1] = temp;
    5854           0 :     goto done;
    5855             :                 }
    5856           0 :                 if ( lk->all[i].open ) {
    5857           0 :                     for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    5858           0 :                         if ( lk->all[i].subtables[j].deleted )
    5859           0 :                     continue;
    5860           0 :                         if ( lk->all[i].subtables[j].selected ) {
    5861           0 :                             temp2 = lk->all[i].subtables[j];
    5862           0 :                             for ( k=j; k<lk->all[i].subtable_cnt-1; ++k )
    5863           0 :                                 lk->all[i].subtables[k] = lk->all[i].subtables[k+1];
    5864           0 :                             lk->all[i].subtables[lk->all[i].subtable_cnt-1] = temp2;
    5865           0 :     goto done;
    5866             :                         }
    5867             :                     }
    5868             :                 }
    5869             :             }
    5870           0 :         } else if ( cid==CID_LookupUp ) {
    5871           0 :             for ( i=0; i<lk->cnt; ++i ) {
    5872           0 :                 if ( lk->all[i].deleted )
    5873           0 :             continue;
    5874           0 :                 if ( lk->all[i].selected && i!=0 ) {
    5875           0 :                     temp = lk->all[i];
    5876           0 :                     lk->all[i] = lk->all[i-1];
    5877           0 :                     lk->all[i-1] = temp;
    5878             :                 }
    5879           0 :                 if ( lk->all[i].open ) {
    5880           0 :                     for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    5881           0 :                         if ( lk->all[i].subtables[j].deleted )
    5882           0 :                     continue;
    5883           0 :                         if ( lk->all[i].subtables[j].selected && j!=0 ) {
    5884           0 :                             temp2 = lk->all[i].subtables[j];
    5885           0 :                             lk->all[i].subtables[j] = lk->all[i].subtables[j-1];
    5886           0 :                             lk->all[i].subtables[j-1] = temp2;
    5887             :                         }
    5888             :                     }
    5889             :                 }
    5890             :             }
    5891           0 :         } else if ( cid==CID_LookupDown ) {
    5892           0 :             for ( i=lk->cnt-1; i>=0; --i ) {
    5893           0 :                 if ( lk->all[i].deleted )
    5894           0 :             continue;
    5895           0 :                 if ( lk->all[i].selected && i!=lk->cnt-1 ) {
    5896           0 :                     temp = lk->all[i];
    5897           0 :                     lk->all[i] = lk->all[i+1];
    5898           0 :                     lk->all[i+1] = temp;
    5899             :                 }
    5900           0 :                 if ( lk->all[i].open ) {
    5901           0 :                     for ( j=lk->all[i].subtable_cnt-1; j>=0; --j ) {
    5902           0 :                         if ( lk->all[i].subtables[j].deleted )
    5903           0 :                     continue;
    5904           0 :                         if ( lk->all[i].subtables[j].selected && j!=lk->all[i].subtable_cnt-1 ) {
    5905           0 :                             temp2 = lk->all[i].subtables[j];
    5906           0 :                             lk->all[i].subtables[j] = lk->all[i].subtables[j+1];
    5907           0 :                             lk->all[i].subtables[j+1] = temp2;
    5908             :                         }
    5909             :                     }
    5910             :                 }
    5911             :             }
    5912             :         }
    5913             :     done:
    5914           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    5915           0 :         GDrawRequestExpose(gw,NULL,false);
    5916             :     }
    5917           0 : return( true );
    5918             : }
    5919             : 
    5920           0 : static int GFI_LookupSort(GGadget *g, GEvent *e) {
    5921             : 
    5922           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    5923           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    5924           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    5925           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    5926             :         struct lkinfo temp;
    5927             :         int i,j;
    5928             : 
    5929           0 :         for ( i=0; i<lk->cnt; ++i ) {
    5930           0 :             int order = FeatureOrderId(isgpos,lk->all[i].lookup->features);
    5931           0 :             for ( j=i+1; j<lk->cnt; ++j ) {
    5932           0 :                 int jorder = FeatureOrderId(isgpos,lk->all[j].lookup->features);
    5933           0 :                 if ( order>jorder) {
    5934           0 :                     temp = lk->all[i];
    5935           0 :                     lk->all[i] = lk->all[j];
    5936           0 :                     lk->all[j] = temp;
    5937           0 :                     order = jorder;
    5938             :                 }
    5939             :             }
    5940             :         }
    5941           0 :         GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
    5942           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    5943             :     }
    5944           0 : return( true );
    5945             : }
    5946             : 
    5947             : /* ??? *//* How about a series of buttons to show only by lookup_type, feat-tag, script-tag */
    5948             : 
    5949           0 : void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success) {
    5950             :     OTLookup *otl;
    5951             :     struct lookup_subtable *sub, *prev;
    5952             :     FPST *ftest, *fprev;
    5953             : 
    5954           0 :     if ( !success ) {
    5955             :         /* We can't allow incomplete FPSTs to float around */
    5956             :         /* If they didn't fill it in, delete it */
    5957           0 :         otl = fpst->subtable->lookup;
    5958           0 :         prev = NULL;
    5959           0 :         for ( sub=otl->subtables; sub!=NULL && sub!=fpst->subtable; prev = sub, sub=sub->next );
    5960           0 :         if ( sub!=NULL ) {
    5961           0 :             if ( prev==NULL )
    5962           0 :                 otl->subtables = sub->next;
    5963             :             else
    5964           0 :                 prev->next = sub->next;
    5965           0 :             free(sub->subtable_name);
    5966           0 :             chunkfree(sub,sizeof(struct lookup_subtable));
    5967             :         }
    5968           0 :         fprev = NULL;
    5969           0 :         for ( ftest=d->sf->possub; ftest!=NULL && ftest!=fpst; fprev = ftest, ftest=ftest->next );
    5970           0 :         if ( ftest!=NULL ) {
    5971           0 :             if ( fprev==NULL )
    5972           0 :                 d->sf->possub = fpst->next;
    5973             :             else
    5974           0 :                 fprev->next = fpst->next;
    5975             :         }
    5976             : 
    5977           0 :         chunkfree(fpst,sizeof(FPST));
    5978             :     }
    5979           0 : }
    5980             : 
    5981           0 : void GFI_FinishSMNew(struct gfi_data *d,ASM *sm, int success, int isnew) {
    5982             :     OTLookup *otl;
    5983             :     struct lookup_subtable *sub, *prev;
    5984             :     ASM *smtest, *smprev;
    5985             : 
    5986           0 :     if ( !success && isnew ) {
    5987             :         /* We can't allow incomplete state machines floating around */
    5988             :         /* If they didn't fill it in, delete it */
    5989           0 :         otl = sm->subtable->lookup;
    5990           0 :         prev = NULL;
    5991           0 :         for ( sub=otl->subtables; sub!=NULL && sub!=sm->subtable; prev = sub, sub=sub->next );
    5992           0 :         if ( sub!=NULL ) {
    5993           0 :             if ( prev==NULL )
    5994           0 :                 otl->subtables = sub->next;
    5995             :             else
    5996           0 :                 prev->next = sub->next;
    5997           0 :             free(sub->subtable_name);
    5998           0 :             chunkfree(sub,sizeof(struct lookup_subtable));
    5999             :         }
    6000           0 :         smprev = NULL;
    6001           0 :         for ( smtest=d->sf->sm; smtest!=NULL && smtest!=sm; smprev = smtest, smtest=smtest->next );
    6002           0 :         if ( smtest!=NULL ) {
    6003           0 :             if ( smprev==NULL )
    6004           0 :                 d->sf->sm = sm->next;
    6005             :             else
    6006           0 :                 smprev->next = sm->next;
    6007             :         }
    6008           0 :         chunkfree(sm,sizeof(ASM));
    6009             :     }
    6010           0 : }
    6011             : 
    6012           0 : static void LookupSubtableContents(struct gfi_data *gfi,int isgpos) {
    6013           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    6014             :     int i,j;
    6015             : 
    6016           0 :     for ( i=0; i<lk->cnt; ++i ) {
    6017           0 :         if ( lk->all[i].deleted )
    6018           0 :     continue;
    6019           0 :         if ( lk->all[i].open ) {
    6020           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6021           0 :                 if ( lk->all[i].subtables[j].deleted )
    6022           0 :             continue;
    6023           0 :                 if ( lk->all[i].subtables[j].selected ) {
    6024           0 :                     _LookupSubtableContents(gfi->sf,lk->all[i].subtables[j].subtable,NULL,gfi->def_layer);
    6025           0 : return;
    6026             :                 }
    6027             :             }
    6028             :         }
    6029             :     }
    6030             : }
    6031             : 
    6032           0 : static int GFI_LookupEditSubtableContents(GGadget *g, GEvent *e) {
    6033             : 
    6034           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6035           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6036           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6037           0 :         LookupSubtableContents(gfi,isgpos);
    6038             :     }
    6039           0 : return( true );
    6040             : }
    6041             : 
    6042           0 : static int GFI_LookupAddLookup(GGadget *g, GEvent *e) {
    6043             : 
    6044           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6045           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6046           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6047           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6048             :         int i,j,k,lcnt;
    6049           0 :         OTLookup *otl = chunkalloc(sizeof(OTLookup)), *test;
    6050             : 
    6051           0 :         k = 0;
    6052           0 :         for ( test = isgpos ? gfi->sf->gpos_lookups : gfi->sf->gsub_lookups;
    6053           0 :                 test!=NULL; test = test->next )
    6054           0 :             ++k;
    6055           0 :         otl->lookup_index = k;
    6056             : 
    6057           0 :         if ( !EditLookup(otl,isgpos,gfi->sf)) {
    6058           0 :             chunkfree(otl,sizeof(OTLookup));
    6059           0 : return( true );
    6060             :         }
    6061           0 :         for ( i=lk->cnt-1; i>=0; --i ) {
    6062           0 :             if ( !lk->all[i].deleted && lk->all[i].selected ) {
    6063           0 :                 lk->all[i].selected = false;
    6064           0 :         break;
    6065             :             }
    6066           0 :             if ( !lk->all[i].deleted && lk->all[i].open ) {
    6067           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
    6068           0 :                     if ( !lk->all[i].subtables[j].deleted &&
    6069           0 :                             lk->all[i].subtables[j].selected ) {
    6070           0 :                         lk->all[i].subtables[j].selected = false;
    6071           0 :                 break;
    6072             :                     }
    6073           0 :                 if ( j<lk->all[i].subtable_cnt )
    6074           0 :         break;
    6075             :             }
    6076             :         }
    6077           0 :         if ( lk->cnt>=lk->max )
    6078           0 :             lk->all = realloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
    6079           0 :         for ( k=lk->cnt; k>i+1; --k )
    6080           0 :             lk->all[k] = lk->all[k-1];
    6081           0 :         memset(&lk->all[k],0,sizeof(struct lkinfo));
    6082           0 :         lk->all[k].lookup = otl;
    6083           0 :         lk->all[k].new = true;
    6084           0 :         lk->all[k].selected = true;
    6085           0 :         ++lk->cnt;
    6086           0 :         if ( isgpos ) {
    6087           0 :             otl->next = gfi->sf->gpos_lookups;
    6088           0 :             gfi->sf->gpos_lookups = otl;
    6089             :         } else {
    6090           0 :             otl->next = gfi->sf->gsub_lookups;
    6091           0 :             gfi->sf->gsub_lookups = otl;
    6092             :         }
    6093             : 
    6094             :         /* Make sure the window is scrolled to display the new lookup */
    6095           0 :         lcnt=0;
    6096           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6097           0 :             if ( lk->all[i].deleted )
    6098           0 :         continue;
    6099           0 :             if ( i==k )
    6100           0 :         break;
    6101           0 :             ++lcnt;
    6102           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6103           0 :                 if ( lk->all[i].subtables[j].deleted )
    6104           0 :             continue;
    6105           0 :                 ++lcnt;
    6106             :             }
    6107             :         }
    6108           0 :         if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
    6109           0 :             lk->off_top = lcnt;
    6110             : 
    6111           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6112           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6113             :     }
    6114           0 : return( true );
    6115             : }
    6116             : 
    6117           0 : static int GFI_LookupAddSubtable(GGadget *g, GEvent *e) {
    6118             : 
    6119           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6120           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6121           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6122           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6123             :         int i,j,k,lcnt;
    6124             :         struct lookup_subtable *sub;
    6125             : 
    6126           0 :         lcnt = 0;
    6127           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6128           0 :             if ( lk->all[i].deleted )
    6129           0 :         continue;
    6130           0 :             j = -1;
    6131           0 :             ++lcnt;
    6132           0 :             if ( lk->all[i].selected )
    6133           0 :         break;
    6134           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6135           0 :                 if ( lk->all[i].subtables[j].deleted )
    6136           0 :             continue;
    6137           0 :                 ++lcnt;
    6138           0 :                 if ( lk->all[i].subtables[j].selected )
    6139           0 :         goto break_2_loops;
    6140             :             }
    6141             :         }
    6142             :         break_2_loops:
    6143           0 :         if ( i==lk->cnt )
    6144           0 : return( true );
    6145             : 
    6146           0 :         sub = chunkalloc(sizeof(struct lookup_subtable));
    6147           0 :         sub->lookup = lk->all[i].lookup;
    6148           0 :         if ( !EditSubtable(sub,isgpos,gfi->sf,NULL,gfi->def_layer)) {
    6149           0 :             chunkfree(sub,sizeof(struct lookup_subtable));
    6150           0 : return( true );
    6151             :         }
    6152           0 :         if ( lk->all[i].subtable_cnt>=lk->all[i].subtable_max )
    6153           0 :             lk->all[i].subtables = realloc(lk->all[i].subtables,(lk->all[i].subtable_max+=10)*sizeof(struct lksubinfo));
    6154           0 :         for ( k=lk->all[i].subtable_cnt; k>j+1; --k )
    6155           0 :             lk->all[i].subtables[k] = lk->all[i].subtables[k-1];
    6156           0 :         memset(&lk->all[i].subtables[k],0,sizeof(struct lksubinfo));
    6157           0 :         lk->all[i].subtables[k].subtable = sub;
    6158           0 :         lk->all[i].subtables[k].new = true;
    6159           0 :         sub->next = lk->all[i].lookup->subtables;
    6160           0 :         lk->all[i].lookup->subtables = sub;
    6161           0 :         ++lk->all[i].subtable_cnt;
    6162             : 
    6163             :         /* Make sure the window is scrolled to display the new subtable */
    6164           0 :         if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
    6165           0 :             lk->off_top = lcnt;
    6166             : 
    6167           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6168           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6169             :     }
    6170           0 : return( true );
    6171             : }
    6172             : 
    6173           0 : static int GFI_LookupEditMetadata(GGadget *g, GEvent *e) {
    6174             : 
    6175           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6176           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6177           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6178           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6179             :         int i,j;
    6180             : 
    6181           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6182           0 :             if ( lk->all[i].deleted )
    6183           0 :         continue;
    6184           0 :             if ( lk->all[i].selected ) {
    6185           0 :                 EditLookup(lk->all[i].lookup,isgpos,gfi->sf);
    6186           0 :                 GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
    6187           0 : return( true );
    6188           0 :             } else if ( lk->all[i].open ) {
    6189           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6190           0 :                     if ( lk->all[i].subtables[j].deleted )
    6191           0 :                 continue;
    6192           0 :                     if ( lk->all[i].subtables[j].selected ) {
    6193           0 :                         EditSubtable(lk->all[i].subtables[j].subtable,isgpos,gfi->sf,NULL,gfi->def_layer);
    6194           0 :                         GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,false);
    6195           0 : return( true );
    6196             :                     }
    6197             :                 }
    6198             :             }
    6199             :         }
    6200             :     }
    6201           0 : return( true );
    6202             : }
    6203             : 
    6204           0 : static int GFI_LookupMergeLookup(GGadget *g, GEvent *e) {
    6205             : 
    6206           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6207           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6208             :         char *buts[3];
    6209           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6210           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6211             :         struct selection_bits sel;
    6212             :         int i,j;
    6213             :         struct lkinfo *lkfirst;
    6214             :         struct lksubinfo *sbfirst;
    6215             :         struct lookup_subtable *sub;
    6216             : 
    6217           0 :         LookupParseSelection(lk,&sel);
    6218           0 :         if ( !sel.sub_table_mergeable && !sel.lookup_mergeable )
    6219           0 : return( true );
    6220             : 
    6221           0 :         buts[0] = _("Do it");
    6222           0 :         buts[1] = _("_Cancel");
    6223           0 :         buts[2] = NULL;
    6224           0 :         if ( gwwv_ask(_("Cannot be Undone"),(const char **) buts,0,1,_("The Merge operation cannot be reverted.\nDo it anyway?"))==1 )
    6225           0 : return( true );
    6226           0 :         if ( sel.lookup_mergeable ) {
    6227           0 :             lkfirst = NULL;
    6228           0 :             for ( i=0; i<lk->cnt; ++i ) {
    6229           0 :                 if ( lk->all[i].selected && !lk->all[i].deleted ) {
    6230           0 :                     if ( lkfirst==NULL )
    6231           0 :                         lkfirst = &lk->all[i];
    6232             :                     else {
    6233           0 :                         FLMerge(lkfirst->lookup,lk->all[i].lookup);
    6234           0 :                         if ( lkfirst->subtable_cnt+lk->all[i].subtable_cnt >= lkfirst->subtable_max )
    6235           0 :                             lkfirst->subtables = realloc(lkfirst->subtables,(lkfirst->subtable_max+=lk->all[i].subtable_cnt)*sizeof(struct lksubinfo));
    6236           0 :                         memcpy(lkfirst->subtables+lkfirst->subtable_cnt,
    6237           0 :                                 lk->all[i].subtables,lk->all[i].subtable_cnt*sizeof(struct lksubinfo));
    6238           0 :                         lkfirst->subtable_cnt += lk->all[i].subtable_cnt;
    6239           0 :                         for ( j=0; j<lk->all[i].subtable_cnt; ++j )
    6240           0 :                             lk->all[i].subtables[j].subtable->lookup = lkfirst->lookup;
    6241           0 :                         if ( lk->all[i].lookup->subtables!=NULL ) {
    6242           0 :                             for ( sub = lk->all[i].lookup->subtables; sub->next!=NULL; sub = sub->next );
    6243           0 :                             sub->next = lkfirst->lookup->subtables;
    6244           0 :                             lkfirst->lookup->subtables = lk->all[i].lookup->subtables;
    6245           0 :                             lk->all[i].lookup->subtables = NULL;
    6246             :                         }
    6247           0 :                         lk->all[i].subtable_cnt = 0;
    6248           0 :                         lk->all[i].deleted = true;
    6249           0 :                         lk->all[i].open = false;
    6250           0 :                         lk->all[i].selected = false;
    6251             :                     }
    6252             :                 }
    6253             :             }
    6254           0 :         } else if ( sel.sub_table_mergeable ) {
    6255           0 :             sbfirst = NULL;
    6256           0 :             for ( i=0; i<lk->cnt; ++i ) if ( !lk->all[i].deleted && lk->all[i].open ) {
    6257           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) if ( !lk->all[i].subtables[j].deleted ) {
    6258           0 :                     if ( lk->all[i].subtables[j].selected ) {
    6259           0 :                         if ( sbfirst == NULL )
    6260           0 :                             sbfirst = &lk->all[i].subtables[j];
    6261             :                         else {
    6262           0 :                             SFSubTablesMerge(gfi->sf,sbfirst->subtable,lk->all[i].subtables[j].subtable);
    6263           0 :                             lk->all[i].subtables[j].deleted = true;
    6264           0 :                             lk->all[i].subtables[j].selected = false;
    6265             :                         }
    6266             :                     }
    6267             :                 }
    6268           0 :                 if ( sbfirst!=NULL )    /* Can only merge subtables within a lookup, so if we found anything, in a lookup that's everything */
    6269           0 :             break;
    6270             :             }
    6271             :         }
    6272           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6273           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6274             :     }
    6275           0 : return( true );
    6276             : }
    6277             : 
    6278           0 : static int GFI_LookupDeleteLookup(GGadget *g, GEvent *e) {
    6279             : 
    6280           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6281           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6282           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6283           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6284             :         int i,j;
    6285             : 
    6286           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6287           0 :             if ( lk->all[i].deleted )
    6288           0 :         continue;
    6289           0 :             if ( lk->all[i].selected )
    6290           0 :                 lk->all[i].deleted = true;
    6291           0 :             else if ( lk->all[i].open ) {
    6292           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6293           0 :                     if ( lk->all[i].subtables[j].deleted )
    6294           0 :                 continue;
    6295           0 :                     if ( lk->all[i].subtables[j].selected )
    6296           0 :                         lk->all[i].subtables[j].deleted = true;
    6297             :                 }
    6298             :             }
    6299             :         }
    6300             : 
    6301           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6302           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6303             :     }
    6304             : 
    6305           0 : return( true );
    6306             : }
    6307             : 
    6308           0 : static int GFI_LookupRevertLookup(GGadget *g, GEvent *e) {
    6309             : 
    6310           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6311           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6312           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6313           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6314             :         int i,j;
    6315             : 
    6316             :         /* First remove any new lookups, subtables */
    6317           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6318           0 :             if ( lk->all[i].new )
    6319           0 :                 SFRemoveLookup(gfi->sf,lk->all[i].lookup,0);
    6320             :             else {
    6321           0 :                 for ( j=0; j<lk->all[i].subtable_cnt; ++j )
    6322           0 :                     if ( lk->all[i].subtables[j].new )
    6323           0 :                         SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable,0);
    6324             :             }
    6325             :         }
    6326             : 
    6327             :         /* Now since we didn't actually delete anything we don't need to do */
    6328             :         /*  anything to resurrect them */
    6329             : 
    6330             :         /* Finally we need to restore the original order. */
    6331             :         /* But that just means regenerating the lk structure. So free it and */
    6332             :         /*  regenerate it */
    6333             : 
    6334           0 :         LookupInfoFree(lk);
    6335           0 :         LookupSetup(lk,isgpos?gfi->sf->gpos_lookups:gfi->sf->gsub_lookups);
    6336             : 
    6337           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6338           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6339             :     }
    6340           0 : return( true );
    6341             : }
    6342             : 
    6343           0 : static int import_e_h(GWindow gw, GEvent *event) {
    6344           0 :     int *done = GDrawGetUserData(gw);
    6345             : 
    6346           0 :     if ( event->type==et_close ) {
    6347           0 :         *done = true;
    6348           0 :     } else if ( event->type==et_char ) {
    6349           0 :         if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
    6350           0 :             help("fontinfo.html#Lookups");
    6351           0 : return( true );
    6352             :         }
    6353           0 : return( false );
    6354           0 :     } else if ( event->type==et_controlevent ) {
    6355           0 :         if ( event->u.control.subtype == et_buttonactivate ) {
    6356           0 :             switch ( GGadgetGetCid(event->u.control.g)) {
    6357             :               case CID_OK:
    6358           0 :                 *done = 2;
    6359           0 :               break;
    6360             :               case CID_Cancel:
    6361           0 :                 *done = true;
    6362           0 :               break;
    6363             :             }
    6364           0 :         } else if ( event->u.control.subtype == et_listdoubleclick )
    6365           0 :             *done = 2;
    6366             :     }
    6367           0 : return( true );
    6368             : }
    6369             : 
    6370           0 : static int GFI_LookupImportLookup(GGadget *g, GEvent *e) {
    6371             : 
    6372           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
    6373           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6374           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6375             :         FontView *ofv;
    6376             :         SplineFont *osf;
    6377             :         OTLookup *otl;
    6378             :         int i, j, cnt;
    6379             :         GTextInfo *ti;
    6380             :         GGadgetCreateData gcd[7], *varray[8], *harray[7];
    6381             :         GTextInfo label[7];
    6382             :         GWindowAttrs wattrs;
    6383             :         GRect pos;
    6384             :         GWindow gw;
    6385           0 :         int done = 0;
    6386             : 
    6387             :         /* Figure out what lookups can be imported from which (open) fonts */
    6388           0 :         ti = NULL;
    6389           0 :         for ( j=0; j<2; ++j ) {
    6390           0 :             for ( ofv=fv_list; ofv!=NULL; ofv=(FontView *) (ofv->b.next) ) {
    6391           0 :                 osf = ofv->b.sf;
    6392           0 :                 if ( osf->cidmaster ) osf = osf->cidmaster;
    6393           0 :                 osf->ticked = false;
    6394             :             }
    6395           0 :             cnt = 0;
    6396           0 :             for ( ofv=fv_list; ofv!=NULL; ofv=(FontView *) (ofv->b.next) ) {
    6397           0 :                 osf = ofv->b.sf;
    6398           0 :                 if ( osf->cidmaster ) osf = osf->cidmaster;
    6399           0 :                 if ( osf->ticked || osf==gfi->sf || osf==gfi->sf->cidmaster ||
    6400           0 :                         ( isgpos && osf->gpos_lookups==NULL) ||
    6401           0 :                         (!isgpos && osf->gsub_lookups==NULL) )
    6402           0 :             continue;
    6403           0 :                 osf->ticked = true;
    6404           0 :                 if ( cnt!=0 ) {
    6405           0 :                     if ( ti )
    6406           0 :                         ti[cnt].line = true;
    6407           0 :                     ++cnt;
    6408             :                 }
    6409           0 :                 if ( ti ) {
    6410           0 :                     ti[cnt].text = (unichar_t *) copy( osf->fontname );
    6411           0 :                     ti[cnt].text_is_1byte = true;
    6412           0 :                     ti[cnt].disabled = true;
    6413           0 :                     ti[cnt].userdata = osf;
    6414             :                 }
    6415           0 :                 ++cnt;
    6416           0 :                 for ( otl = isgpos ? osf->gpos_lookups : osf->gsub_lookups; otl!=NULL; otl=otl->next ) {
    6417           0 :                     if ( ti ) {
    6418           0 :                         ti[cnt].text = (unichar_t *) strconcat( " ", otl->lookup_name );
    6419           0 :                         ti[cnt].text_is_1byte = true;
    6420           0 :                         ti[cnt].userdata = otl;
    6421             :                     }
    6422           0 :                     ++cnt;
    6423             :                 }
    6424             :             }
    6425           0 :             if ( ti==NULL )
    6426           0 :                 ti = calloc((cnt+1),sizeof(GTextInfo));
    6427             :         }
    6428             : 
    6429           0 :         memset(gcd,0,sizeof(gcd));
    6430           0 :         memset(label,0,sizeof(label));
    6431             : 
    6432           0 :         i = 0;
    6433           0 :         label[i].text = (unichar_t *) _("Select lookups from other fonts");
    6434           0 :         label[i].text_is_1byte = true;
    6435           0 :         label[i].text_in_resource = true;
    6436           0 :         gcd[i].gd.label = &label[i];
    6437           0 :         gcd[i].gd.pos.x = 12; gcd[i].gd.pos.y = 6+6;
    6438           0 :         gcd[i].gd.flags = gg_visible | gg_enabled;
    6439           0 :         gcd[i].creator = GLabelCreate;
    6440           0 :         varray[0] = &gcd[i++]; varray[1] = NULL;
    6441             : 
    6442           0 :         gcd[i].gd.pos.height = 12*12+6;
    6443           0 :         gcd[i].gd.flags = gg_enabled|gg_visible|gg_list_multiplesel|gg_utf8_popup;
    6444           0 :         gcd[i].gd.u.list = ti;
    6445           0 :         gcd[i].creator = GListCreate;
    6446           0 :         varray[2] = &gcd[i++]; varray[3] = NULL;
    6447             : 
    6448           0 :         gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
    6449           0 :         label[i].text = (unichar_t *) _("_Import");
    6450           0 :         label[i].text_is_1byte = true;
    6451           0 :         label[i].text_in_resource = true;
    6452           0 :         gcd[i].gd.label = &label[i];
    6453           0 :         gcd[i].gd.cid = CID_OK;
    6454           0 :         harray[0] = GCD_Glue; harray[1] = &gcd[i]; harray[2] = GCD_Glue;
    6455           0 :         gcd[i++].creator = GButtonCreate;
    6456             : 
    6457           0 :         gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
    6458           0 :         label[i].text = (unichar_t *) _("_Cancel");
    6459           0 :         label[i].text_is_1byte = true;
    6460           0 :         label[i].text_in_resource = true;
    6461           0 :         gcd[i].gd.label = &label[i];
    6462           0 :         gcd[i].gd.cid = CID_Cancel;
    6463           0 :         harray[3] = GCD_Glue; harray[4] = &gcd[i]; harray[5] = GCD_Glue; harray[6] = NULL;
    6464           0 :         gcd[i++].creator = GButtonCreate;
    6465             : 
    6466           0 :         gcd[i].gd.flags = gg_enabled|gg_visible;
    6467           0 :         gcd[i].gd.u.boxelements = harray;
    6468           0 :         gcd[i].creator = GHBoxCreate;
    6469           0 :         varray[4] = &gcd[i++]; varray[5] = NULL; varray[6] = NULL;
    6470             : 
    6471           0 :         gcd[i].gd.pos.x = gcd[i].gd.pos.y = 2;
    6472           0 :         gcd[i].gd.flags = gg_enabled|gg_visible;
    6473           0 :         gcd[i].gd.u.boxelements = varray;
    6474           0 :         gcd[i].creator = GHVGroupCreate;
    6475             : 
    6476           0 :         memset(&wattrs,0,sizeof(wattrs));
    6477           0 :         wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
    6478           0 :         wattrs.event_masks = ~(1<<et_charup);
    6479           0 :         wattrs.restrict_input_to_me = 1;
    6480           0 :         wattrs.undercursor = 1;
    6481           0 :         wattrs.cursor = ct_pointer;
    6482           0 :         wattrs.utf8_window_title =  _("Import Lookup");
    6483           0 :         wattrs.is_dlg = true;
    6484           0 :         pos.x = pos.y = 0;
    6485           0 :         pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
    6486           0 :         pos.height = GDrawPointsToPixels(NULL,193);
    6487           0 :         gw = GDrawCreateTopWindow(NULL,&pos,import_e_h,&done,&wattrs);
    6488             : 
    6489           0 :         GGadgetsCreate(gw,&gcd[i]);
    6490           0 :         GHVBoxSetExpandableRow(gcd[i].ret,1);
    6491           0 :         GHVBoxSetExpandableCol(gcd[i-1].ret,gb_expandgluesame);
    6492           0 :         GHVBoxFitWindow(gcd[i].ret);
    6493           0 :         GTextInfoListFree(ti);
    6494           0 :         GDrawSetVisible(gw,true);
    6495             : 
    6496           0 :         while ( !done )
    6497           0 :             GDrawProcessOneEvent(NULL);
    6498           0 :         if ( done==2 ) {
    6499             :             int32 len;
    6500           0 :             GTextInfo **ti = GGadgetGetList(gcd[1].ret,&len);
    6501           0 :             OTLookup **list = malloc((len+1)*sizeof(OTLookup*));
    6502           0 :             struct lkdata *lk = &gfi->tables[isgpos];
    6503           0 :             OTLookup *before = NULL;
    6504             : 
    6505           0 :             for ( i=0; i<lk->cnt; ++i ) {
    6506           0 :                 if ( lk->all[i].deleted )
    6507           0 :             continue;
    6508           0 :                 if ( lk->all[i].selected ) {
    6509           0 :                     before = lk->all[i].lookup;
    6510           0 :             break;
    6511             :                 }
    6512             :             }
    6513           0 :             osf = NULL;
    6514           0 :             for ( i=0; i<len; ++i ) {
    6515           0 :                 if ( ti[i]->disabled )
    6516           0 :                     osf = ti[i]->userdata;
    6517           0 :                 else if ( ti[i]->selected && ti[i]->text!=NULL ) {
    6518           0 :                     for ( j=0; i+j<len && !ti[i+j]->disabled &&
    6519           0 :                             ti[i+j]->selected && ti[i+j]->text; ++j )
    6520           0 :                         list[j] = (OTLookup *) ti[i+j]->userdata;
    6521           0 :                     list[j] = NULL;
    6522           0 :                     OTLookupsCopyInto(gfi->sf,osf,list,before);
    6523           0 :                     i += j-1;
    6524             :                 }
    6525             :             }
    6526           0 :             free(list);
    6527             :         }
    6528           0 :         GDrawDestroyWindow(gw);
    6529             : 
    6530           0 :         GFI_LookupScrollbars(gfi,isgpos, true);
    6531           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6532             :     }
    6533           0 : return( true );
    6534             : }
    6535             : 
    6536           0 : static int GFI_LookupAspectChange(GGadget *g, GEvent *e) {
    6537             : 
    6538           0 :     if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
    6539           0 :         struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
    6540           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6541           0 :         GFI_LookupEnableButtons(gfi,isgpos);
    6542             :     }
    6543           0 : return( true );
    6544             : }
    6545             : 
    6546           0 : static void LookupExpose(GWindow pixmap, struct gfi_data *gfi, int isgpos) {
    6547             :     int lcnt, i,j;
    6548           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    6549             :     GRect r, old;
    6550             :     extern GBox _ggadget_Default_Box;
    6551             : 
    6552           0 :     r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
    6553           0 :     r.y = LK_MARGIN; r.height = gfi->lkheight-2*LK_MARGIN;
    6554           0 :     GDrawPushClip(pixmap,&r,&old);
    6555           0 :     GDrawSetFont(pixmap,gfi->font);
    6556             : 
    6557           0 :     lcnt = 0;
    6558           0 :     for ( i=0; i<lk->cnt; ++i ) {
    6559           0 :         if ( lk->all[i].deleted )
    6560           0 :     continue;
    6561           0 :         if ( lcnt>=lk->off_top ) {
    6562           0 :             if ( lk->all[i].selected ) {
    6563           0 :                 r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
    6564           0 :                 r.y = (lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
    6565           0 :                 GDrawFillRect(pixmap,&r,ACTIVE_BORDER);
    6566             :             }
    6567           0 :             r.x = LK_MARGIN-lk->off_left; r.width = (gfi->as&~1);
    6568           0 :             r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = r.width;
    6569           0 :             GDrawDrawRect(pixmap,&r,0x000000);
    6570           0 :             GDrawDrawLine(pixmap,r.x+2,r.y+(r.height/2), r.x+r.width-2,r.y+(r.height/2), 0x000000);
    6571           0 :             if ( !lk->all[i].open )
    6572           0 :                 GDrawDrawLine(pixmap,r.x+(r.width/2),r.y+2, r.x+(r.width/2),r.y+r.height-2, 0x000000);
    6573           0 :             GDrawDrawText8(pixmap,r.x+gfi->fh, r.y+gfi->as,
    6574           0 :                     lk->all[i].lookup->lookup_name,-1,MAIN_FOREGROUND);
    6575             :         }
    6576           0 :         ++lcnt;
    6577           0 :         if ( lk->all[i].open ) {
    6578           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    6579           0 :                 if ( lk->all[i].subtables[j].deleted )
    6580           0 :             continue;
    6581           0 :                 if ( lcnt>=lk->off_top ) {
    6582           0 :                     if ( lk->all[i].subtables[j].selected ) {
    6583           0 :                         r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
    6584           0 :                         r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
    6585           0 :                         GDrawFillRect(pixmap,&r,ACTIVE_BORDER);
    6586             :                     }
    6587           0 :                     r.x = LK_MARGIN+2*gfi->fh-lk->off_left;
    6588           0 :                     r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh;
    6589           0 :                     GDrawDrawText8(pixmap,r.x, r.y+gfi->as,
    6590           0 :                             lk->all[i].subtables[j].subtable->subtable_name,-1,MAIN_FOREGROUND);
    6591             :                 }
    6592           0 :                 ++lcnt;
    6593             :             }
    6594             :         }
    6595             :     }
    6596           0 :     GDrawPopClip(pixmap,&old);
    6597           0 : }
    6598             : 
    6599           0 : static void LookupDeselect(struct lkdata *lk) {
    6600             :     int i,j;
    6601             : 
    6602           0 :     for ( i=0; i<lk->cnt; ++i ) {
    6603           0 :         lk->all[i].selected = false;
    6604           0 :         for ( j=0; j<lk->all[i].subtable_cnt; ++j )
    6605           0 :             lk->all[i].subtables[j].selected = false;
    6606             :     }
    6607           0 : }
    6608             : 
    6609           0 : static void LookupPopup(GWindow gw,OTLookup *otl,struct lookup_subtable *sub,
    6610             :         struct lkdata *lk) {
    6611             :     static char popup_msg[600];
    6612             :     int pos;
    6613             :     char *lookuptype;
    6614             :     FeatureScriptLangList *fl;
    6615             :     struct scriptlanglist *sl;
    6616             :     int l;
    6617             : 
    6618           0 :     if ( (otl->lookup_type&0xff)>= 0xf0 ) {
    6619           0 :         if ( otl->lookup_type==kern_statemachine )
    6620           0 :             lookuptype = _("Kerning State Machine");
    6621           0 :         else if ( otl->lookup_type==morx_indic )
    6622           0 :             lookuptype = _("Indic State Machine");
    6623           0 :         else if ( otl->lookup_type==morx_context )
    6624           0 :             lookuptype = _("Contextual State Machine");
    6625             :         else
    6626           0 :             lookuptype = _("Contextual State Machine");
    6627           0 :     } else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
    6628           0 :         lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
    6629             :     else
    6630           0 :         lookuptype = S_("LookupType|Unknown");
    6631           0 :     snprintf(popup_msg,sizeof(popup_msg), "%s\n", lookuptype);
    6632           0 :     pos = strlen(popup_msg);
    6633             : 
    6634           0 :     if ( sub!=NULL && otl->lookup_type==gpos_pair && sub->kc!=NULL ) {
    6635           0 :         snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%s",_("(kerning class)\n") );
    6636           0 :         pos += strlen( popup_msg+pos );
    6637             :     }
    6638             : 
    6639           0 :     if ( otl->features==NULL )
    6640           0 :         snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%s",_("Not attached to a feature"));
    6641             :     else {
    6642           0 :         for ( fl=otl->features; fl!=NULL && pos<sizeof(popup_msg)-2; fl=fl->next ) {
    6643           0 :             snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c: ",
    6644           0 :                     fl->featuretag>>24, fl->featuretag>>16,
    6645           0 :                     fl->featuretag>>8, fl->featuretag&0xff );
    6646           0 :             pos += strlen( popup_msg+pos );
    6647           0 :             for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
    6648           0 :                 snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c{",
    6649           0 :                         sl->script>>24, sl->script>>16,
    6650           0 :                         sl->script>>8, sl->script&0xff );
    6651           0 :                 pos += strlen( popup_msg+pos );
    6652           0 :                 for ( l=0; l<sl->lang_cnt; ++l ) {
    6653           0 :                     uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
    6654           0 :                     snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c,",
    6655             :                             lang>>24, lang>>16,
    6656             :                             lang>>8, lang&0xff );
    6657           0 :                     pos += strlen( popup_msg+pos );
    6658             :                 }
    6659           0 :                 if ( popup_msg[pos-1]==',' )
    6660           0 :                     popup_msg[pos-1] = '}';
    6661           0 :                 else if ( pos<sizeof(popup_msg)-2 )
    6662           0 :                     popup_msg[pos++] = '}';
    6663           0 :                 if ( pos<sizeof(popup_msg)-2 )
    6664           0 :                     popup_msg[pos++] = ' ';
    6665             :             }
    6666           0 :             if ( pos<sizeof(popup_msg)-2 )
    6667           0 :                 popup_msg[pos++] = '\n';
    6668             :         }
    6669             :     }
    6670             : 
    6671             :     /* Find out if any other lookups invoke it (ie. a context lookup invokes */
    6672             :     /*  does it invoke ME?) */
    6673           0 :     for ( l=0; l<lk->cnt; ++l ) {
    6674           0 :         int j, r, used = false;
    6675           0 :         if ( lk->all[l].deleted )
    6676           0 :     continue;
    6677           0 :         for ( j=0; j<lk->all[l].subtable_cnt && !used; ++j ) {
    6678           0 :             struct lookup_subtable *sub = lk->all[l].subtables[j].subtable;
    6679           0 :             if ( lk->all[l].subtables[j].deleted )
    6680           0 :     continue;
    6681           0 :             if ( sub->fpst!=NULL ) {
    6682           0 :                 for ( r=0; r<sub->fpst->rule_cnt && !used; ++r ) {
    6683           0 :                     struct fpst_rule *rule = &sub->fpst->rules[r];
    6684             :                     int ls;
    6685           0 :                     for ( ls = 0; ls<rule->lookup_cnt; ++ls ) {
    6686           0 :                         if ( rule->lookups[ls].lookup == otl ) {
    6687           0 :                             used = true;
    6688           0 :                     break;
    6689             :                         }
    6690             :                     }
    6691             :                 }
    6692             :             }
    6693             :         }
    6694           0 :         if ( used ) {
    6695           0 :             snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_(" Used in %s\n"),
    6696           0 :                     lk->all[l].lookup->lookup_name );
    6697           0 :             pos += strlen( popup_msg+pos );
    6698             :         }
    6699             :     }
    6700             : 
    6701           0 :     if ( pos>=sizeof(popup_msg) )
    6702           0 :         pos = sizeof(popup_msg)-1;
    6703           0 :     popup_msg[pos]='\0';
    6704           0 :     GGadgetPreparePopup8(gw,popup_msg);
    6705           0 : }
    6706             : 
    6707           0 : static void AddDFLT(OTLookup *otl) {
    6708             :     FeatureScriptLangList *fl;
    6709             :     struct scriptlanglist *sl;
    6710             :     int l;
    6711             : 
    6712           0 :     for ( fl = otl->features; fl!=NULL; fl=fl->next ) {
    6713           0 :         int hasDFLT = false, hasdflt=false;
    6714           0 :         for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
    6715           0 :             if ( sl->script == DEFAULT_SCRIPT )
    6716           0 :                 hasDFLT = true;
    6717           0 :             for ( l=0; l<sl->lang_cnt; ++l ) {
    6718           0 :                 uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
    6719           0 :                 if ( lang==DEFAULT_LANG ) {
    6720           0 :                     hasdflt = true;
    6721           0 :             break;
    6722             :                 }
    6723             :             }
    6724           0 :             if ( hasdflt && hasDFLT )
    6725           0 :         break;
    6726             :         }
    6727           0 :         if ( hasDFLT    /* Already there */ ||
    6728             :                 !hasdflt /* Shouldn't add it */ )
    6729           0 :     continue;
    6730           0 :         sl = chunkalloc(sizeof(struct scriptlanglist));
    6731           0 :         sl->script = DEFAULT_SCRIPT;
    6732           0 :         sl->lang_cnt = 1;
    6733           0 :         sl->langs[0] = DEFAULT_LANG;
    6734           0 :         sl->next = fl->scripts;
    6735           0 :         fl->scripts = sl;
    6736             :     }
    6737           0 : }
    6738             : 
    6739           0 : static void AALTRemoveOld(SplineFont *sf,struct lkdata *lk) {
    6740             :     int i;
    6741             :     FeatureScriptLangList *fl, *prev;
    6742             : 
    6743           0 :     for ( i=0; i<lk->cnt; ++i ) {
    6744           0 :         if ( lk->all[i].deleted )
    6745           0 :     continue;
    6746           0 :         prev = NULL;
    6747           0 :         for ( fl = lk->all[i].lookup->features; fl!=NULL; prev=fl, fl=fl->next ) {
    6748           0 :             if ( fl->featuretag==CHR('a','a','l','t') ) {
    6749           0 :                 if ( fl==lk->all[i].lookup->features && fl->next==NULL && !LookupUsedNested(sf,lk->all[i].lookup) )
    6750           0 :                     lk->all[i].deleted = true;
    6751             :                 else {
    6752           0 :                     if ( prev==NULL )
    6753           0 :                         lk->all[i].lookup->features = fl->next;
    6754             :                     else
    6755           0 :                         prev->next = fl->next;
    6756           0 :                     fl->next = NULL;
    6757           0 :                     FeatureScriptLangListFree(fl);
    6758             :                 }
    6759           0 :         break;
    6760             :             }
    6761             :         }
    6762             :     }
    6763           0 : }
    6764             : 
    6765           0 : static void AALTCreateNew(SplineFont *sf, struct lkdata *lk) {
    6766             :     /* different script/lang combinations may need different 'aalt' lookups */
    6767             :     /*  well, let's just say different script combinations */
    6768             :     /* for each script/lang combo find all single/alternate subs for each */
    6769             :     /*  glyph. Merge those choices and create new lookup with that info */
    6770           0 :     struct sllk *sllk = NULL;
    6771           0 :     int sllk_cnt=0, sllk_max = 0;
    6772             :     int i,k;
    6773             :     OTLookup *otl;
    6774             : 
    6775             :     /* Find all scripts, and all the single/alternate lookups for each */
    6776             :     /*  and all the languages used for these in each script */
    6777           0 :     for ( i=0; i<lk->cnt; ++i ) {
    6778           0 :         if ( lk->all[i].deleted )
    6779           0 :     continue;
    6780           0 :         sllk = AddOTLToSllks( lk->all[i].lookup, sllk, &sllk_cnt, &sllk_max );
    6781             :     }
    6782             :     /* Each of these gets its own gsub_alternate lookup which gets inserted */
    6783             :     /*  at the head of the lookup list. Each lookup has one subtable */
    6784           0 :     for ( i=0; i<sllk_cnt; ++i ) {
    6785           0 :         if ( sllk[i].cnt==0 )           /* Script used, but provides no alternates */
    6786           0 :     continue;
    6787           0 :         otl = NewAALTLookup(sf,sllk,sllk_cnt,i);
    6788           0 :         if ( lk->cnt>=lk->max )
    6789           0 :             lk->all = realloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
    6790           0 :         for ( k=lk->cnt; k>0; --k )
    6791           0 :             lk->all[k] = lk->all[k-1];
    6792           0 :         memset(&lk->all[0],0,sizeof(struct lkinfo));
    6793           0 :         lk->all[0].lookup = otl;
    6794           0 :         lk->all[0].new = true;
    6795           0 :         ++lk->cnt;
    6796             : 
    6797             :         /* Now add the new subtable */
    6798           0 :         lk->all[0].subtables = calloc(1,sizeof(struct lksubinfo));
    6799           0 :         lk->all[0].subtable_cnt = lk->all[0].subtable_max = 1;
    6800           0 :         lk->all[0].subtables[0].subtable = otl->subtables;
    6801           0 :         lk->all[0].subtables[0].new = true;
    6802             :     }
    6803             : 
    6804           0 :     SllkFree(sllk,sllk_cnt);
    6805           0 : }
    6806             : 
    6807           0 : static void lookupmenu_dispatch(GWindow v, GMenuItem *mi, GEvent *e) {
    6808             :     GEvent dummy;
    6809           0 :     struct gfi_data *gfi = GDrawGetUserData(v);
    6810             :     int i;
    6811             :     char *buts[4];
    6812             : 
    6813           0 :     if ( mi->mid==CID_SaveFeat || mi->mid==CID_SaveLookup ) {
    6814             :         char *filename, *defname;
    6815             :         FILE *out;
    6816           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6817           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6818           0 :         OTLookup *otl = NULL;
    6819             : 
    6820           0 :         if ( mi->mid==CID_SaveLookup ) {
    6821           0 :             for ( i=0; i<lk->cnt && (!lk->all[i].selected || lk->all[i].deleted); ++i );
    6822           0 :             if ( i==lk->cnt )
    6823           0 : return;
    6824           0 :             otl = lk->all[i].lookup;
    6825           0 :             SFFindUnusedLookups(gfi->sf);
    6826           0 :             if ( otl->unused ) {
    6827           0 :                 ff_post_error(_("No data"), _("This lookup contains no data"));
    6828           0 : return;
    6829             :             }
    6830             :         }
    6831           0 :         defname = strconcat(gfi->sf->fontname,".fea");
    6832           0 :         filename = gwwv_save_filename(_("Feature file?"),defname,"*.fea");
    6833           0 :         free(defname);
    6834           0 :         if ( filename==NULL )
    6835           0 : return;
    6836             :         /* Convert to def encoding !!! */
    6837           0 :         out = fopen(filename,"w");
    6838           0 :         if ( out==NULL ) {
    6839           0 :             ff_post_error(_("Cannot open file"),_("Cannot open %s"), filename );
    6840           0 :             free(filename);
    6841           0 : return;
    6842             :         }
    6843           0 :         if ( otl!=NULL )
    6844           0 :             FeatDumpOneLookup( out,gfi->sf,otl );
    6845             :         else
    6846           0 :             FeatDumpFontLookups( out,gfi->sf );
    6847           0 :         if ( ferror(out)) {
    6848           0 :             ff_post_error(_("Output error"),_("An error occurred writing %s"), filename );
    6849           0 :             free(filename);
    6850           0 :             fclose(out);
    6851           0 : return;
    6852             :         }
    6853           0 :         free(filename);
    6854           0 :         fclose(out);
    6855           0 :     } else if ( mi->mid==CID_AddAllAlternates ) {
    6856             :         /* First we want to remove any old aalt-only lookups */
    6857             :         /*  (and remove the 'aalt' tag from any lookups with multiple features) */
    6858             :         /* Then add the new ones */
    6859           0 :         struct lkdata *lk = &gfi->tables[0];             /* GSUB */
    6860           0 :         int has_aalt_only=false, has_aalt_mixed = false;
    6861             :         int i, ret;
    6862             :         FeatureScriptLangList *fl;
    6863             : 
    6864           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6865           0 :             if ( lk->all[i].deleted )
    6866           0 :         continue;
    6867           0 :             for ( fl = lk->all[i].lookup->features; fl!=NULL; fl=fl->next ) {
    6868           0 :                 if ( fl->featuretag==CHR('a','a','l','t') ) {
    6869           0 :                     if ( fl==lk->all[i].lookup->features && fl->next==NULL )
    6870           0 :                         has_aalt_only = true;
    6871             :                     else
    6872           0 :                         has_aalt_mixed = true;
    6873           0 :             break;
    6874             :                 }
    6875             :             }
    6876             :         }
    6877           0 :         if ( has_aalt_only || has_aalt_mixed ) {
    6878           0 :             buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2] = NULL;
    6879           0 :             ret = gwwv_ask(has_aalt_only?_("Lookups will be removed"):_("Feature tags will be removed"),
    6880             :                     (const char **) buts,0,1,
    6881             :                     !has_aalt_mixed ?
    6882             :                     _("Warning: There are already some 'aalt' lookups in\n"
    6883             :                       "the font. If you proceed with this command those\n"
    6884             :                       "lookups will be removed and new lookups will be\n"
    6885             :                       "generated. The old information will be LOST.\n"
    6886             :                       " Is that what you want?") :
    6887             :                     !has_aalt_only ?
    6888             :                     _("Warning: There are already some 'aalt' lookups in\n"
    6889             :                       "the font but there are other feature tags associated\n"
    6890             :                       "with these lookups. If you proceed with this command\n"
    6891             :                       "the 'aalt' tag will be removed from those lookups,\n"
    6892             :                       "and new lookups will be generate which will NOT be\n"
    6893             :                       "associated with the other feature tag(s).\n"
    6894             :                       " Is that what you want?") :
    6895             :                     _("Warning: There are already some 'aalt' lookups in\n"
    6896             :                       "the font, some have no other feature tags associated\n"
    6897             :                       "with them and these will be removed, others have other\n"
    6898             :                       "tags associated and these will remain while the 'aalt'\n"
    6899             :                       "tag will be removed from the lookup -- a new lookup\n"
    6900             :                       "will be generated which is not associated with any\n"
    6901             :                       "other feature tags.\n"
    6902             :                       " Is that what you want?") );
    6903           0 :             if ( ret==1 )
    6904           0 : return;
    6905           0 :             AALTRemoveOld(gfi->sf,lk);
    6906             :         }
    6907           0 :         AALTCreateNew(gfi->sf,lk);
    6908           0 :         GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+0)),NULL,false);
    6909           0 :     } else if ( mi->mid==CID_AddDFLT ) {
    6910             :         struct selection_bits sel;
    6911             :         int toall, ret, i;
    6912             :         char *buts[4];
    6913           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6914           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6915             : 
    6916           0 :         LookupParseSelection(lk,&sel);
    6917           0 :         if ( sel.lookup_cnt==0 ) {
    6918           0 :             buts[0] = _("_Apply to All"); buts[1] = _("_Cancel"); buts[2]=NULL;
    6919             :         } else {
    6920           0 :             buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = _("_Cancel"); buts[3]=NULL;
    6921             :         }
    6922           0 :         ret = gwwv_ask(_("Apply to:"),(const char **) buts,0,sel.lookup_cnt==0?1:2,_("Apply change to which lookups?"));
    6923           0 :         toall = false;
    6924           0 :         if ( ret==0 )
    6925           0 :             toall = true;
    6926           0 :         else if ( (ret==1 && sel.lookup_cnt==0) || (ret==2 && sel.lookup_cnt!=0))
    6927           0 : return;
    6928           0 :         for ( i=0; i<lk->cnt; ++i ) {
    6929           0 :             if ( lk->all[i].deleted )
    6930           0 :         continue;
    6931           0 :             if ( lk->all[i].selected || toall ) {
    6932           0 :                 AddDFLT(lk->all[i].lookup);
    6933             :             }
    6934             :         }
    6935           0 :     } else if ( mi->mid==CID_AddLanguage || mi->mid==CID_RmLanguage ) {
    6936           0 :         int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
    6937           0 :         struct lkdata *lk = &gfi->tables[isgpos];
    6938             : 
    6939           0 :         AddRmLang(gfi->sf,lk,mi->mid==CID_AddLanguage);
    6940             :     } else {
    6941           0 :         memset(&dummy,0,sizeof(dummy));
    6942           0 :         dummy.type = et_controlevent;
    6943           0 :         dummy.u.control.subtype = et_buttonactivate;
    6944           0 :         dummy.u.control.g = GWidgetGetControl(gfi->gw,mi->mid);
    6945           0 :         dummy.w = GGadgetGetWindow(dummy.u.control.g);
    6946           0 :         dummy.u.control.u.button.button = e->u.mouse.button;
    6947           0 :         GGadgetDispatchEvent(dummy.u.control.g,&dummy);
    6948             :     }
    6949             : }
    6950             : 
    6951             : static GMenuItem lookuppopupmenu[] = {
    6952             :     { { (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 },
    6953             :     { { (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 },
    6954             :     { { (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 },
    6955             :     { { (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 },
    6956             :     { { (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 },
    6957             :     { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
    6958             :     { { (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 },
    6959             :     { { (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 },
    6960             :     { { (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 },
    6961             :     { { (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 },
    6962             :     { { (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 },
    6963             :     { { (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 },
    6964             :     { { (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 },
    6965             :     { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
    6966             :     { { (unichar_t *) N_("Add Language to Script..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddLanguage },
    6967             :     { { (unichar_t *) N_("Remove Language from Script..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_RmLanguage },
    6968             :     { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
    6969             :     { { (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 },
    6970             :     { { (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 },
    6971             :     { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, 0, '\0' }, '\0', 0, NULL, NULL, NULL, 0 }, /* line */
    6972             :     { { (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 },
    6973             :     { { (unichar_t *) N_("_Import..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_ImportLookups },
    6974             :     { { (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 },
    6975             :     GMENUITEM_EMPTY
    6976             : };
    6977             : 
    6978           0 : static void LookupMenu(struct gfi_data *gfi,struct lkdata *lk,int isgpos, GEvent *event) {
    6979             :     struct selection_bits sel;
    6980             :     int i,j;
    6981             :     static int initted = false;
    6982             : 
    6983           0 :     if ( !initted ) {
    6984             :         int i;
    6985           0 :         initted = true;
    6986             : 
    6987           0 :         for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i )
    6988           0 :             if ( lookuppopupmenu[i].ti.text!=NULL )
    6989           0 :                 lookuppopupmenu[i].ti.text = (unichar_t *) _( (char *)lookuppopupmenu[i].ti.text);
    6990             :     }
    6991             : 
    6992           0 :     GGadgetEndPopup();
    6993             : 
    6994           0 :     LookupParseSelection(lk,&sel);
    6995           0 :     for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i ) {
    6996           0 :         switch ( lookuppopupmenu[i].mid ) {
    6997             :           case 0:
    6998             :             /* Lines */;
    6999           0 :           break;
    7000             :           case CID_LookupTop:
    7001           0 :             lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt!=1;
    7002           0 :           break;
    7003             :           case CID_LookupUp:
    7004           0 :             lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt==0;
    7005           0 :           break;
    7006             :           case CID_LookupDown:
    7007           0 :             lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt==0;
    7008           0 :           break;
    7009             :           case CID_LookupBottom:
    7010           0 :             lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt!=1;
    7011           0 :           break;
    7012             :           case CID_LookupSort:
    7013           0 :             lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
    7014           0 :           break;
    7015             :           case CID_AddLookup:
    7016           0 :             lookuppopupmenu[i].ti.disabled = sel.lookup_cnt+sel.sub_cnt>1;
    7017           0 :           break;
    7018             :           case CID_AddSubtable:
    7019           0 :             lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt>1) && (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
    7020           0 :           break;
    7021             :           case CID_EditMetadata:
    7022           0 :             lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt!=0) &&
    7023           0 :                         (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
    7024           0 :           break;
    7025             :           case CID_EditSubtable:
    7026           0 :             lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=0 || sel.sub_cnt!=1;
    7027           0 :           break;
    7028             :           case CID_DeleteLookup:
    7029           0 :             lookuppopupmenu[i].ti.disabled = sel.lookup_cnt==0 && sel.sub_cnt==0;
    7030           0 :           break;
    7031             :           case CID_MergeLookup:
    7032           0 :             lookuppopupmenu[i].ti.disabled = !(
    7033           0 :                     (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
    7034           0 :                     (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable)  );
    7035           0 :           break;
    7036             :           case CID_ImportLookups:
    7037           0 :             lookuppopupmenu[i].ti.disabled = !LookupsImportable(gfi->sf,isgpos);
    7038           0 :           break;
    7039             :           case CID_RevertLookups:
    7040           0 :             lookuppopupmenu[i].ti.disabled = false;
    7041           0 :           break;
    7042             :           case CID_SaveLookup:
    7043           0 :             lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=1 || sel.sub_cnt!=0;
    7044           0 :             for ( j=0; j<lk->cnt; ++j ) if ( lk->all[j].selected ) {
    7045           0 :                 int type = lk->all[j].lookup->lookup_type;
    7046           0 :                 if ( type==kern_statemachine || type==morx_indic ||
    7047           0 :                         type==morx_context || type==morx_insert )
    7048           0 :                     lookuppopupmenu[i].ti.disabled = true;
    7049           0 :             break;
    7050             :             }
    7051           0 :           break;
    7052             :           case CID_AddDFLT:
    7053           0 :             lookuppopupmenu[i].ti.disabled = lk->cnt==0;
    7054           0 :           break;
    7055             :           case CID_AddAllAlternates:
    7056           0 :             lookuppopupmenu[i].ti.disabled = lk->cnt==0 || lk==&gfi->tables[1]/*Only applies to GSUB*/;
    7057           0 :           break;
    7058             :           case CID_SaveFeat:
    7059           0 :             lookuppopupmenu[i].ti.disabled = lk->cnt<=0;
    7060           0 :           break;
    7061             :         }
    7062             :     }
    7063           0 :     GMenuCreatePopupMenu(event->w,event, lookuppopupmenu);
    7064           0 : }
    7065             : 
    7066             : 
    7067           0 : static int LookupIndex(struct gfi_data *othergfi, int isgpos, GWindow gw,
    7068             :         GWindow othergw, GEvent *event, int *subindex) {
    7069             :     GPoint pt;
    7070           0 :     struct lkdata *otherlk = &othergfi->tables[isgpos];
    7071             :     int l,i,j, lcnt;
    7072             : 
    7073           0 :     pt.x = event->u.mouse.x; pt.y = event->u.mouse.y;
    7074           0 :     if ( gw!=othergw )
    7075           0 :         GDrawTranslateCoordinates(gw,othergw,&pt);
    7076           0 :     l = (pt.y-LK_MARGIN)/othergfi->fh + otherlk->off_top;
    7077             : 
    7078           0 :     if ( l<0 ) {
    7079           0 :         *subindex = -1;
    7080           0 : return( -1 );
    7081             :     }
    7082             : 
    7083           0 :     lcnt = 0;
    7084           0 :     for ( i=0; i<otherlk->cnt; ++i ) {
    7085           0 :         if ( otherlk->all[i].deleted )
    7086           0 :     continue;
    7087           0 :         if ( l==lcnt ) {
    7088           0 :             *subindex = -1;
    7089           0 : return( i );
    7090             :         }
    7091           0 :         ++lcnt;
    7092           0 :         if ( otherlk->all[i].open ) {
    7093           0 :             for ( j=0; j<otherlk->all[i].subtable_cnt; ++j ) {
    7094           0 :                 if ( otherlk->all[i].subtables[j].deleted )
    7095           0 :             continue;
    7096           0 :                 if ( l==lcnt ) {
    7097           0 :                     *subindex = j;
    7098           0 : return( i );
    7099             :                 }
    7100           0 :                 ++lcnt;
    7101             :             }
    7102             :         }
    7103             :     }
    7104             :     /* drop after last lookup */
    7105           0 :     *subindex = -1;
    7106           0 : return( i );
    7107             : }
    7108             : 
    7109           0 : static int LookupsDropable(struct gfi_data *gfi, struct gfi_data *othergfi,
    7110             :         int isgpos, GWindow gw, GWindow othergw, GEvent *event) {
    7111             :     int lookup, subtable;
    7112           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    7113           0 :     struct lkdata *otherlk = &othergfi->tables[isgpos];
    7114             : 
    7115           0 :     if ( gfi->first_sel_subtable==-1 )
    7116           0 : return( true );                 /* Lookups can be dropped anywhere */
    7117             : 
    7118           0 :     lookup = LookupIndex(othergfi,isgpos,gw,othergw,event,&subtable);
    7119           0 :     if ( lookup<0 || lookup>=lk->cnt )
    7120           0 : return( false );                /* Subtables must be dropped in a lookup */
    7121             : 
    7122           0 :     if ( gfi!=othergfi /* || lookup!=gfi->first_sel_lookup*/ )
    7123           0 : return( false );                /* Can't merge subtables from one lookup to another */
    7124             : 
    7125             :     /* Subtables can only be dropped in a lookup with the same type */
    7126             :     /* At the moment we don't need this test, as we only allow subtables to be dropped within their original lookup */
    7127           0 : return( otherlk->all[lookup].lookup->lookup_type ==
    7128           0 :                 lk->all[gfi->first_sel_lookup].lookup->lookup_type );
    7129             : }
    7130             : 
    7131           0 : static void LookupDragDrop(struct gfi_data *gfi, int isgpos, GEvent *event) {
    7132             :     FontViewBase *fv;
    7133           0 :     struct gfi_data *othergfi=NULL;
    7134           0 :     GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
    7135           0 :     GWindow othergw = NULL;
    7136             :     int i,j;
    7137             : 
    7138           0 :     othergw = GDrawGetPointerWindow(gfi->gw);
    7139             : 
    7140           0 :     for ( fv = (FontViewBase *) fv_list; fv!=NULL; fv=fv->next ) if ( fv->sf->fontinfo!=NULL ) {
    7141             :         int otherisgpos;
    7142             : 
    7143           0 :         othergfi = fv->sf->fontinfo;
    7144           0 :         otherisgpos = GTabSetGetSel(GWidgetGetControl(othergfi->gw,CID_Lookups));
    7145           0 :         if ( otherisgpos!=isgpos )
    7146           0 :     continue;
    7147           0 :         if ( othergw == GDrawableGetWindow(GWidgetGetControl(othergfi->gw,CID_LookupWin+otherisgpos)))
    7148           0 :     break;
    7149             :     }
    7150           0 :     if ( fv==NULL )
    7151           0 :         othergw = NULL;
    7152             : 
    7153           0 :     if ( fv==NULL || !LookupsDropable(gfi,othergfi,isgpos,gw,othergw,event)) {
    7154           0 :         if ( event->type==et_mouseup ) {
    7155           0 :             GDrawSetCursor(gw,ct_mypointer);
    7156           0 :             gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
    7157           0 : return;
    7158             :         } else {
    7159           0 :             if ( gfi->lk_dropablecursor ) {
    7160           0 :                 gfi->lk_dropablecursor = false;
    7161           0 :                 GDrawSetCursor(gw,ct_prohibition);
    7162             :             }
    7163           0 : return;
    7164             :         }
    7165             :     } else {
    7166           0 :         if ( event->type==et_mousemove ) {
    7167           0 :             if ( !gfi->lk_dropablecursor ) {
    7168           0 :                 gfi->lk_dropablecursor = true;
    7169           0 :                 GDrawSetCursor(gw,ct_features);
    7170             :             }
    7171           0 : return;
    7172             :         } else {
    7173           0 :             struct lkdata *otherlk = &othergfi->tables[isgpos];
    7174           0 :             struct lkdata *lk = &gfi->tables[isgpos];
    7175             :             struct lkinfo temp;
    7176             :             struct lksubinfo subtemp;
    7177             :             int lookup, subtable;
    7178             : 
    7179           0 :             lookup = LookupIndex(othergfi,isgpos,gw,othergw,event,&subtable);
    7180             : 
    7181           0 :             if ( gfi==othergfi ) {
    7182             :                 /* dropping in the same window just moves things around */
    7183           0 :                 if ( gfi->first_sel_subtable == -1 ) {
    7184             :                     /* Moving lookups */
    7185           0 :                     if ( lookup<0 ) lookup=0;
    7186           0 :                     else if ( lookup>=lk->cnt ) lookup=lk->cnt;
    7187           0 :                     if ( lookup==gfi->first_sel_lookup )
    7188           0 :   goto done_drop;
    7189           0 :                     for ( i=0; i<lk->cnt; ++i )
    7190           0 :                         lk->all[i].moved = false;
    7191           0 :                     for ( i=gfi->first_sel_lookup; i<lk->cnt; ++i ) {
    7192           0 :                         if ( lk->all[i].deleted || !lk->all[i].selected ||
    7193           0 :                                 lk->all[i].moved || i==lookup )
    7194           0 :                     continue;
    7195           0 :                         temp = lk->all[i];
    7196           0 :                         temp.moved = true;
    7197           0 :                         if ( i<lookup ) {
    7198           0 :                             for ( j=i+1; j<lookup; ++j )
    7199           0 :                                 lk->all[j-1] = lk->all[j];
    7200           0 :                             lk->all[j-1] = temp;
    7201             :                         } else {
    7202           0 :                             for ( j=i; j>lookup; --j )
    7203           0 :                                 lk->all[j] = lk->all[j-1];
    7204           0 :                             lk->all[j] = temp;
    7205             :                         }
    7206           0 :                         --i;
    7207             :                     }
    7208           0 :                 } else if ( lookup==gfi->first_sel_lookup ) {
    7209           0 :                     if ( subtable< 0 ) subtable=0;
    7210           0 :                     if ( subtable==gfi->first_sel_subtable )
    7211           0 :   goto done_drop;
    7212           0 :                     for ( i=0; i<lk->cnt; ++i )
    7213           0 :                         lk->all[lookup].subtables[i].moved = false;
    7214           0 :                     for ( i=gfi->first_sel_subtable; i<lk->all[lookup].subtable_cnt; ++i ) {
    7215           0 :                         if ( lk->all[lookup].subtables[i].deleted || !lk->all[lookup].subtables[i].selected ||
    7216           0 :                                 lk->all[lookup].subtables[i].moved || i==subtable )
    7217           0 :                     continue;
    7218           0 :                         subtemp = lk->all[lookup].subtables[i];
    7219           0 :                         subtemp.moved = true;
    7220           0 :                         if ( i<subtable ) {
    7221           0 :                             for ( j=i+1; j<subtable; ++j )
    7222           0 :                                 lk->all[lookup].subtables[j-1] = lk->all[lookup].subtables[j];
    7223           0 :                             lk->all[lookup].subtables[j-1] = subtemp;
    7224             :                         } else {
    7225           0 :                             for ( j=i; j>subtable; --j )
    7226           0 :                                 lk->all[lookup].subtables[j] = lk->all[lookup].subtables[j-1];
    7227           0 :                             lk->all[lookup].subtables[j] = subtemp;
    7228             :                         }
    7229           0 :                         --i;
    7230             :                     }
    7231             :                 } else {
    7232           0 :                     int old_lk = gfi->first_sel_lookup;
    7233           0 :                     int sel_cnt=0, k;
    7234           0 :                     if ( subtable<0 ) /* dropped into lookup */
    7235           0 :                         subtable = 0;
    7236           0 :                     for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i )
    7237           0 :                         if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
    7238           0 :                             ++sel_cnt;
    7239           0 :                     if ( lk->all[lookup].subtable_cnt+sel_cnt >= lk->all[lookup].subtable_max )
    7240           0 :                         lk->all[lookup].subtables = realloc(lk->all[lookup].subtables,
    7241           0 :                                 (lk->all[lookup].subtable_max += sel_cnt+3)*sizeof(struct lksubinfo));
    7242           0 :                     for ( i= lk->all[lookup].subtable_cnt+sel_cnt-1; i>=subtable; --i )
    7243           0 :                         lk->all[lookup].subtables[i] = lk->all[lookup].subtables[i-sel_cnt];
    7244           0 :                     k=0;
    7245           0 :                     for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i ) {
    7246           0 :                         if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
    7247           0 :                             lk->all[lookup].subtables[subtable+k++] = lk->all[old_lk].subtables[i];
    7248             :                     }
    7249           0 :                     lk->all[lookup].subtable_cnt += k;
    7250           0 :                     k=0;
    7251           0 :                     for ( i=gfi->first_sel_subtable; i<lk->all[old_lk].subtable_cnt; ++i ) {
    7252           0 :                         if ( !lk->all[old_lk].subtables[i].deleted && lk->all[old_lk].subtables[i].selected )
    7253           0 :                             ++k;
    7254           0 :                         else if ( k!=0 )
    7255           0 :                             lk->all[old_lk].subtables[i-k] = lk->all[old_lk].subtables[i];
    7256             :                     }
    7257           0 :                     lk->all[old_lk].subtable_cnt -= k;
    7258             :                 }
    7259             :             } else {
    7260           0 :                 if ( gfi->first_sel_subtable == -1 ) {
    7261             :                     /* Import lookups from one font to another */
    7262             :                     OTLookup **list, *before;
    7263           0 :                     int cnt=0;
    7264           0 :                     for ( i=0; i<lk->cnt; ++i ) {
    7265           0 :                         if ( lk->all[i].deleted )
    7266           0 :                     continue;
    7267           0 :                         if ( lk->all[i].selected )
    7268           0 :                             ++cnt;
    7269             :                     }
    7270           0 :                     list = malloc((cnt+1)*sizeof(OTLookup *));
    7271           0 :                     cnt=0;
    7272           0 :                     for ( i=0; i<lk->cnt; ++i ) {
    7273           0 :                         if ( lk->all[i].deleted )
    7274           0 :                     continue;
    7275           0 :                         if ( lk->all[i].selected )
    7276           0 :                             list[cnt++] = lk->all[i].lookup;
    7277             :                     }
    7278           0 :                     list[cnt] = NULL;
    7279           0 :                     if ( lookup<0 ) lookup=0;
    7280           0 :                     before = lookup>=otherlk->cnt ? NULL : otherlk->all[lookup].lookup;
    7281           0 :                     OTLookupsCopyInto(othergfi->sf,gfi->sf,list,before);
    7282           0 :                     free( list );
    7283             :                 } else
    7284           0 :                     IError("Attempt to merge subtables across fonts not permitted" );
    7285           0 :                 GDrawRequestExpose(othergw,NULL,false);
    7286             :             }
    7287             :   done_drop:
    7288           0 :             GDrawSetCursor(gw,ct_mypointer);
    7289           0 :             GDrawRequestExpose(gw,NULL,false);
    7290           0 :             gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
    7291           0 : return;
    7292             :         }
    7293             :     }
    7294             : }
    7295             : 
    7296           0 : static int LookupDragDropable(struct gfi_data *gfi, struct lkdata *lk) {
    7297             :     int i,j;
    7298           0 :     int first_l= -1, first_s= -1;
    7299             : 
    7300           0 :     for ( i=0; i<lk->cnt; ++i ) {
    7301           0 :         if ( lk->all[i].deleted )
    7302           0 :     continue;
    7303           0 :         if ( lk->all[i].selected ) {
    7304           0 :             if ( first_s!=-1 )
    7305           0 : return( false );                /* Can't have mixed lookups and subtables */
    7306           0 :             if ( first_l==-1 )
    7307           0 :                 first_l = i;
    7308             :         }
    7309           0 :         if ( lk->all[i].open ) {
    7310           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    7311           0 :                 if ( lk->all[i].subtables[j].deleted )
    7312           0 :             continue;
    7313           0 :                 if ( lk->all[i].subtables[j].selected ) {
    7314           0 :                     if ( first_l==i || first_l==-1 )
    7315           0 :                         first_l = i;
    7316             :                     else
    7317           0 : return( false );                /* Mixed lookups and subtables */
    7318           0 :                     if ( first_s==-1 )
    7319           0 :                         first_s = j;
    7320             :                 }
    7321             :             }
    7322             :         }
    7323             :     }
    7324           0 :     gfi->first_sel_lookup   = first_l;
    7325           0 :     gfi->first_sel_subtable = first_s;
    7326           0 : return( true );
    7327             : }
    7328             : 
    7329           0 : static void LookupMouse(struct gfi_data *gfi, int isgpos, GEvent *event) {
    7330           0 :     struct lkdata *lk = &gfi->tables[isgpos];
    7331           0 :     int l = (event->u.mouse.y-LK_MARGIN)/gfi->fh + lk->off_top;
    7332           0 :     int inbox = event->u.mouse.x>=LK_MARGIN &&
    7333           0 :             event->u.mouse.x>=LK_MARGIN-lk->off_left &&
    7334           0 :             event->u.mouse.x<=LK_MARGIN-lk->off_left+gfi->as+1;
    7335           0 :     GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
    7336             :     int i,j,lcnt;
    7337             : 
    7338           0 :     if ( event->type!=et_mousedown && gfi->lk_drag_and_drop ) {
    7339           0 :         LookupDragDrop(gfi,isgpos,event);
    7340           0 : return;
    7341             :     }
    7342             : 
    7343           0 :     if ( l<0 || event->u.mouse.y>=(gfi->lkheight-2*LK_MARGIN) )
    7344           0 : return;
    7345             : 
    7346           0 :     lcnt = 0;
    7347           0 :     for ( i=0; i<lk->cnt; ++i ) {
    7348           0 :         if ( lk->all[i].deleted )
    7349           0 :     continue;
    7350           0 :         if ( l==lcnt ) {
    7351           0 :             if ( event->type==et_mouseup )
    7352           0 : return;
    7353           0 :             else if ( event->type==et_mousemove ) {
    7354           0 :                 LookupPopup(gw,lk->all[i].lookup,NULL,lk);
    7355           0 : return;
    7356             :             } else {
    7357           0 :                 if ( gfi->lk_drag_and_drop ) {
    7358           0 :                     GDrawSetCursor(gw,ct_mypointer);
    7359           0 :                     gfi->lk_drag_and_drop = gfi->lk_dropablecursor = false;
    7360             :                 }
    7361           0 :                 if ( inbox || event->u.mouse.clicks>1 ) {
    7362           0 :                     lk->all[i].open = !lk->all[i].open;
    7363           0 :                     GFI_LookupScrollbars(gfi, isgpos, true);
    7364           0 : return;
    7365             :                 }
    7366           0 :                 if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
    7367             :                     /* If line is selected, and we're going to pop up a menu */
    7368             :                     /*  then don't clear other selected lines */
    7369           0 :                     if ( !lk->all[i].selected ||
    7370           0 :                             (event->u.mouse.button!=3 && !LookupDragDropable(gfi,lk)))
    7371           0 :                         LookupDeselect(lk);
    7372           0 :                     else if ( event->u.mouse.button!=3 ) {
    7373           0 :                         gfi->lk_drag_and_drop = gfi->lk_dropablecursor = true;
    7374           0 :                         GDrawSetCursor(gw,ct_features);
    7375             :                     }
    7376           0 :                     lk->all[i].selected = true;
    7377           0 :                 } else if ( event->u.mouse.state&ksm_control ) {
    7378           0 :                     lk->all[i].selected = !lk->all[i].selected;
    7379           0 :                 } else if ( lk->all[i].selected ) {
    7380           0 :                     lk->all[i].selected = false;
    7381             :                 } else {
    7382           0 :                     for ( j=0; j<lk->cnt; ++j )
    7383           0 :                         if ( !lk->all[j].deleted  && lk->all[j].selected )
    7384           0 :                     break;
    7385           0 :                     if ( j==lk->cnt )
    7386           0 :                         lk->all[i].selected = true;
    7387           0 :                     else if ( j<i ) {
    7388           0 :                         for ( ; j<=i ; ++j )
    7389           0 :                             if ( !lk->all[j].deleted )
    7390           0 :                                 lk->all[j].selected = true;
    7391             :                     } else {
    7392           0 :                         for ( ; j>=i ; --j )
    7393           0 :                             if ( !lk->all[j].deleted )
    7394           0 :                                 lk->all[j].selected = true;
    7395             :                     }
    7396             :                 }
    7397           0 :                 GFI_LookupEnableButtons(gfi,isgpos);
    7398           0 :                 GDrawRequestExpose(gw,NULL,false);
    7399           0 :                 if ( event->u.mouse.button==3 )
    7400           0 :                     LookupMenu(gfi,lk,isgpos,event);
    7401           0 : return;
    7402             :             }
    7403             :         }
    7404           0 :         ++lcnt;
    7405           0 :         if ( lk->all[i].open ) {
    7406           0 :             for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
    7407           0 :                 if ( lk->all[i].subtables[j].deleted )
    7408           0 :             continue;
    7409           0 :                 if ( l==lcnt ) {
    7410           0 :                     if ( event->type==et_mouseup )
    7411           0 : return;
    7412           0 :                     else if ( event->type==et_mousemove ) {
    7413           0 :                         LookupPopup(gw,lk->all[i].lookup,lk->all[i].subtables[j].subtable,lk);
    7414           0 : return;
    7415             :                     } else {
    7416           0 :                         if ( inbox )
    7417           0 : return;         /* Can't open this guy */
    7418           0 :                         if ( event->u.mouse.clicks>1 )
    7419           0 :                             LookupSubtableContents(gfi,isgpos);
    7420             :                         else {
    7421           0 :                             if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
    7422             :                                 /* If line is selected, and we're going to pop up a menu */
    7423             :                                 /*  then don't clear other selected lines */
    7424           0 :                                 if ( !lk->all[i].subtables[j].selected ||
    7425           0 :                                         (event->u.mouse.button!=3 && !LookupDragDropable(gfi,lk)))
    7426           0 :                                     LookupDeselect(lk);
    7427           0 :                                 else if ( event->u.mouse.button!=3 ) {
    7428           0 :                                     gfi->lk_drag_and_drop = gfi->lk_dropablecursor = true;
    7429           0 :                                     GDrawSetCursor(gw,ct_features);
    7430             :                                 }
    7431           0 :                                 lk->all[i].subtables[j].selected = true;
    7432             :                             } else
    7433           0 :                                 lk->all[i].subtables[j].selected = !lk->all[i].subtables[j].selected;
    7434           0 :                             GFI_LookupEnableButtons(gfi,isgpos);
    7435           0 :                             GDrawRequestExpose(gw,NULL,false);
    7436           0 :                             if ( event->u.mouse.button==3 )
    7437           0 :                                 LookupMenu(gfi,lk,isgpos,event);
    7438             :                         }
    7439           0 : return;
    7440             :                     }
    7441             :                 }
    7442           0 :                 ++lcnt;
    7443             :             }
    7444             :         }
    7445             :     }
    7446             : }
    7447             : 
    7448           0 : static int lookups_e_h(GWindow gw, GEvent *event, int isgpos) {
    7449           0 :     struct gfi_data *gfi = GDrawGetUserData(gw);
    7450             : 
    7451           0 :     if (( event->type==et_mouseup || event->type==et_mousedown ) &&
    7452           0 :             (event->u.mouse.button>=4 && event->u.mouse.button<=7) ) {
    7453           0 : return( GGadgetDispatchEvent(GWidgetGetControl(gw,CID_LookupVSB+isgpos),event));
    7454             :     }
    7455             : 
    7456           0 :     switch ( event->type ) {
    7457             :       case et_char:
    7458           0 : return( GFI_Char(gfi,event) );
    7459             :       case et_expose:
    7460           0 :         LookupExpose(gw,gfi,isgpos);
    7461           0 :       break;
    7462             :       case et_mousedown: case et_mousemove: case et_mouseup:
    7463           0 :         LookupMouse(gfi,isgpos,event);
    7464           0 :       break;
    7465             :       case et_resize: {
    7466             :         GRect r;
    7467           0 :         GDrawGetSize(gw,&r);
    7468           0 :         gfi->lkheight = r.height; gfi->lkwidth = r.width;
    7469           0 :         GFI_LookupScrollbars(gfi,false,false);
    7470           0 :         GFI_LookupScrollbars(gfi,true,false);
    7471             :       }
    7472           0 :       break;
    7473             :     }
    7474           0 : return( true );
    7475             : }
    7476             : 
    7477           0 : static int gposlookups_e_h(GWindow gw, GEvent *event) {
    7478           0 : return( lookups_e_h(gw,event,true));
    7479             : }
    7480             : 
    7481           0 : static int gsublookups_e_h(GWindow gw, GEvent *event) {
    7482           0 : return( lookups_e_h(gw,event,false));
    7483             : }
    7484             : 
    7485           0 : void FontInfo(SplineFont *sf,int deflayer,int defaspect,int sync) {
    7486             :     // This opens the Font Info box to the tab specified by defaspect,
    7487             :     // which indexes the array aspects, populated below.
    7488             :     GRect pos;
    7489             :     GWindow gw;
    7490             :     GWindowAttrs wattrs;
    7491             :     GTabInfo aspects[26], vaspects[6], lkaspects[3];
    7492             :     GGadgetCreateData mgcd[10], ngcd[19], psgcd[30], tngcd[8],
    7493             :         pgcd[12], vgcd[21], pangcd[23], comgcd[4], txgcd[23], floggcd[4],
    7494             :         mfgcd[8], mcgcd[8], szgcd[19], mkgcd[7], metgcd[33], vagcd[3], ssgcd[23],
    7495             :         xugcd[8], dgcd[6], ugcd[6], gaspgcd[5], gaspgcd_def[2], lksubgcd[2][4],
    7496             :         lkgcd[2], lkbuttonsgcd[15], cgcd[12], lgcd[20], msgcd[7], ssngcd[8],
    7497             :         woffgcd[8], privategcd_def[4];
    7498             :     GGadgetCreateData mb[2], mb2, nb[2], nb2, nb3, xub[2], psb[2], psb2[3], ppbox[4],
    7499             :             vbox[4], metbox[2], ssbox[2], panbox[2], combox[2], mkbox[3],
    7500             :             txbox[5], ubox[3], dbox[2], flogbox[2],
    7501             :             mcbox[3], mfbox[3], szbox[6], tnboxes[4], gaspboxes[3],
    7502             :             lkbox[7], cbox[6], lbox[8], msbox[3], ssboxes[4], woffbox[2];
    7503             :     GGadgetCreateData *marray[7], *marray2[9], *narray[29], *narray2[7], *narray3[3],
    7504             :         *xuarray[20], *psarray[10], *psarray2[21], *psarray4[10],
    7505             :         *pparray[6], *vradio[5], *varray[41], *metarray[53],
    7506             :         *ssarray[58], *panarray[40], *comarray[3], *flogarray[3],
    7507             :         *mkarray[6], *msarray[6],
    7508             :         *txarray[5], *txarray2[30],
    7509             :         *txarray3[6], *txarray4[6], *uarray[5], *darray[10],
    7510             :         *mcarray[13], *mcarray2[7],
    7511             :         *mfarray[14], *szarray[7], *szarray2[5], *szarray3[7],
    7512             :         *szarray4[4], *tnvarray[4], *tnharray[6], *tnharray2[5], *gaspharray[6],
    7513             :         *gaspvarray[3], *lkarray[2][7], *lkbuttonsarray[17], *lkharray[3],
    7514             :         *charray1[4], *charray2[4], *charray3[4], *cvarray[9], *cvarray2[4],
    7515             :         *larray[16], *larray2[25], *larray3[6], *larray4[5], *uharray[4],
    7516             :         *ssvarray[4], *woffarray[16];
    7517             :     GTextInfo mlabel[10], nlabel[18], pslabel[30], tnlabel[7],
    7518             :         plabel[12], vlabel[21], panlabel[22], comlabel[3], txlabel[23],
    7519             :         mflabel[8], mclabel[8], szlabel[17], mklabel[7], metlabel[32],
    7520             :         sslabel[23], xulabel[8], dlabel[5], ulabel[3], gasplabel[5],
    7521             :         lkbuttonslabel[14], clabel[11], floglabel[3], llabel[20], mslabel[7],
    7522             :         ssnlabel[7], wofflabel[8], privatelabel_def[3];
    7523             :     GTextInfo *namelistnames;
    7524             :     struct gfi_data *d;
    7525             :     char iabuf[20], upbuf[20], uwbuf[20], asbuf[20], dsbuf[20],
    7526             :             vbuf[20], uibuf[12], embuf[20];
    7527             :     char dszbuf[20], dsbbuf[20], dstbuf[21], sibuf[20], swbuf[20], sfntrbuf[20];
    7528             :     char ranges[40], codepages[40];
    7529             :     char woffmajorbuf[20], woffminorbuf[20];
    7530             :     int i,j,k,g, psrow;
    7531             :     int mcs;
    7532             :     char title[130];
    7533             :     FontRequest rq;
    7534             :     int as, ds, ld;
    7535             :     char **nlnames;
    7536             :     char createtime[200], modtime[200];
    7537             :     unichar_t *tmpcreatetime, *tmpmodtime;
    7538             :     time_t t;
    7539             :     const struct tm *tm;
    7540             :     struct matrixinit mi, gaspmi, layersmi, ssmi, sizemi, marks_mi, markc_mi, private_mi;
    7541             :     struct matrix_data *marks_md, *markc_md;
    7542             :     int ltype;
    7543             :     static GBox small_blue_box;
    7544             :     extern GBox _GGadget_button_box;
    7545             :     static GFont *fi_font=NULL;
    7546             :     char *copied_copyright;
    7547             : 
    7548           0 :     FontInfoInit();
    7549             : 
    7550           0 :     if ( sf->fontinfo!=NULL ) {
    7551           0 :         GDrawSetVisible(((struct gfi_data *) (sf->fontinfo))->gw,true);
    7552           0 :         GDrawRaise( ((struct gfi_data *) (sf->fontinfo))->gw );
    7553           0 : return;
    7554             :     }
    7555           0 :     if ( defaspect==-1 )
    7556           0 :         defaspect = last_aspect;
    7557             : 
    7558           0 :     d = calloc(1,sizeof(struct gfi_data));
    7559           0 :     sf->fontinfo = d;
    7560             : 
    7561           0 :     memset(&wattrs,0,sizeof(wattrs));
    7562           0 :     wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg;
    7563           0 :     wattrs.event_masks = ~(1<<et_charup);
    7564           0 :     wattrs.is_dlg = true;
    7565           0 :     if ( sync ) {
    7566           0 :         wattrs.mask |= wam_restrict;
    7567           0 :         wattrs.restrict_input_to_me = 1;
    7568             :     }
    7569           0 :     wattrs.undercursor = 1;
    7570           0 :     wattrs.cursor = ct_pointer;
    7571           0 :     snprintf(title,sizeof(title),_("Font Information for %.90s"),
    7572             :             sf->fontname);
    7573           0 :     wattrs.utf8_window_title = title;
    7574           0 :     pos.x = pos.y = 0;
    7575           0 :     pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268+85));
    7576           0 :     pos.height = GDrawPointsToPixels(NULL,375);
    7577           0 :     gw = GDrawCreateTopWindow(NULL,&pos,e_h,d,&wattrs);
    7578             : 
    7579           0 :     d->sf = sf;
    7580           0 :     d->def_layer = deflayer;
    7581           0 :     d->gw = gw;
    7582           0 :     d->old_sel = -2;
    7583           0 :     d->texdata = sf->texdata;
    7584             : 
    7585           0 :     memset(&nlabel,0,sizeof(nlabel));
    7586           0 :     memset(&ngcd,0,sizeof(ngcd));
    7587             : 
    7588           0 :     nlabel[0].text = (unichar_t *) _("Fo_ntname:");
    7589           0 :     nlabel[0].text_is_1byte = true;
    7590           0 :     nlabel[0].text_in_resource = true;
    7591           0 :     ngcd[0].gd.label = &nlabel[0];
    7592           0 :     ngcd[0].gd.pos.x = 12; ngcd[0].gd.pos.y = 6+6;
    7593           0 :     ngcd[0].gd.flags = gg_visible | gg_enabled;
    7594           0 :     ngcd[0].creator = GLabelCreate;
    7595             : 
    7596           0 :     ngcd[1].gd.pos.x = 115; ngcd[1].gd.pos.y = ngcd[0].gd.pos.y-6; ngcd[1].gd.pos.width = 137;
    7597           0 :     ngcd[1].gd.flags = gg_visible | gg_enabled;
    7598           0 :     nlabel[1].text = (unichar_t *) sf->fontname;
    7599           0 :     nlabel[1].text_is_1byte = true;
    7600           0 :     ngcd[1].gd.label = &nlabel[1];
    7601           0 :     ngcd[1].gd.cid = CID_Fontname;
    7602           0 :     ngcd[1].gd.handle_controlevent = GFI_NameChange;
    7603           0 :     ngcd[1].creator = GTextFieldCreate;
    7604             : 
    7605           0 :     nlabel[2].text = (unichar_t *) _("_Family Name:");
    7606           0 :     nlabel[2].text_is_1byte = true;
    7607           0 :     nlabel[2].text_in_resource = true;
    7608           0 :     ngcd[2].gd.label = &nlabel[2];
    7609           0 :     ngcd[2].gd.pos.x = 12; ngcd[2].gd.pos.y = ngcd[0].gd.pos.y+26;
    7610           0 :     ngcd[2].gd.flags = gg_visible | gg_enabled;
    7611           0 :     ngcd[2].creator = GLabelCreate;
    7612             : 
    7613           0 :     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;
    7614           0 :     ngcd[3].gd.flags = gg_visible | gg_enabled;
    7615           0 :     nlabel[3].text = (unichar_t *) (sf->familyname?sf->familyname:sf->fontname);
    7616           0 :     nlabel[3].text_is_1byte = true;
    7617           0 :     ngcd[3].gd.label = &nlabel[3];
    7618           0 :     ngcd[3].gd.cid = CID_Family;
    7619           0 :     ngcd[3].gd.handle_controlevent = GFI_FamilyChange;
    7620           0 :     ngcd[3].creator = GTextFieldCreate;
    7621           0 :     if ( sf->familyname==NULL || strstr(sf->familyname,"Untitled")==sf->familyname )
    7622           0 :         d->family_untitled = true;
    7623             : 
    7624           0 :     ngcd[4].gd.pos.x = 12; ngcd[4].gd.pos.y = ngcd[3].gd.pos.y+26+6;
    7625           0 :     nlabel[4].text = (unichar_t *) _("Name For Human_s:");
    7626           0 :     nlabel[4].text_is_1byte = true;
    7627           0 :     nlabel[4].text_in_resource = true;
    7628           0 :     ngcd[4].gd.label = &nlabel[4];
    7629           0 :     ngcd[4].gd.flags = gg_visible | gg_enabled;
    7630           0 :     ngcd[4].creator = GLabelCreate;
    7631             : 
    7632           0 :     ngcd[5].gd.pos.x = 115; ngcd[5].gd.pos.y = ngcd[4].gd.pos.y-6; ngcd[5].gd.pos.width = 137;
    7633           0 :     ngcd[5].gd.flags = gg_visible | gg_enabled;
    7634           0 :     nlabel[5].text = (unichar_t *) (sf->fullname?sf->fullname:sf->fontname);
    7635           0 :     nlabel[5].text_is_1byte = true;
    7636           0 :     ngcd[5].gd.label = &nlabel[5];
    7637           0 :     ngcd[5].gd.cid = CID_Human;
    7638           0 :     ngcd[5].gd.handle_controlevent = GFI_HumanChange;
    7639           0 :     ngcd[5].creator = GTextFieldCreate;
    7640           0 :     if ( sf->fullname==NULL || strstr(sf->fullname,"Untitled")==sf->fullname )
    7641           0 :         d->human_untitled = true;
    7642             : 
    7643           0 :     nlabel[6].text = (unichar_t *) _("_Weight");
    7644           0 :     nlabel[6].text_is_1byte = true;
    7645           0 :     nlabel[6].text_in_resource = true;
    7646           0 :     ngcd[6].gd.label = &nlabel[6];
    7647           0 :     ngcd[6].gd.pos.x = ngcd[4].gd.pos.x; ngcd[6].gd.pos.y = ngcd[4].gd.pos.y+26;
    7648           0 :     ngcd[6].gd.flags = gg_visible | gg_enabled;
    7649           0 :     ngcd[6].creator = GLabelCreate;
    7650             : 
    7651           0 :     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;
    7652           0 :     ngcd[7].gd.flags = gg_visible | gg_enabled;
    7653           0 :     nlabel[7].text = (unichar_t *) (sf->weight?sf->weight:"Regular");
    7654           0 :     nlabel[7].text_is_1byte = true;
    7655           0 :     ngcd[7].gd.label = &nlabel[7];
    7656           0 :     ngcd[7].gd.cid = CID_Weight;
    7657           0 :     ngcd[7].creator = GTextFieldCreate;
    7658             : 
    7659           0 :     ngcd[8].gd.pos.x = 12; ngcd[8].gd.pos.y = ngcd[6].gd.pos.y+26;
    7660           0 :     nlabel[8].text = (unichar_t *) _("_Version:");
    7661           0 :     nlabel[8].text_is_1byte = true;
    7662           0 :     nlabel[8].text_in_resource = true;
    7663           0 :     ngcd[8].gd.label = &nlabel[8];
    7664           0 :     ngcd[8].gd.flags = gg_visible | gg_enabled;
    7665           0 :     ngcd[8].creator = GLabelCreate;
    7666             : 
    7667           0 :     ngcd[9].gd.pos.x = 115; ngcd[9].gd.pos.y = ngcd[8].gd.pos.y-6; ngcd[9].gd.pos.width = 137;
    7668           0 :     ngcd[9].gd.flags = gg_visible | gg_enabled;
    7669           0 :     nlabel[9].text = (unichar_t *) (sf->version?sf->version:"");
    7670           0 :     nlabel[9].text_is_1byte = true;
    7671           0 :     if ( sf->subfontcnt!=0 ) {
    7672           0 :         sprintf( vbuf,"%g", sf->cidversion );
    7673           0 :         nlabel[9].text = (unichar_t *) vbuf;
    7674             :     }
    7675           0 :     ngcd[9].gd.label = &nlabel[9];
    7676           0 :     ngcd[9].gd.cid = CID_Version;
    7677           0 :     ngcd[9].creator = GTextFieldCreate;
    7678             : 
    7679           0 :     nlabel[10].text = (unichar_t *) _("sfnt _Revision:");
    7680           0 :     nlabel[10].text_is_1byte = true;
    7681           0 :     nlabel[10].text_in_resource = true;
    7682           0 :     ngcd[10].gd.label = &nlabel[10];
    7683           0 :     ngcd[10].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    7684           0 :     ngcd[10].gd.popup_msg = (unichar_t *) _("If you leave this field blank FontForge will use a default based on\neither the version string above, or one in the 'name' table." );
    7685           0 :     ngcd[10].creator = GLabelCreate;
    7686             : 
    7687           0 :     sfntrbuf[0]='\0';
    7688           0 :     if ( sf->sfntRevision!=sfntRevisionUnset )
    7689           0 :         sprintf( sfntrbuf, "%g", sf->sfntRevision/65536.0 );
    7690           0 :     ngcd[11].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    7691           0 :     nlabel[11].text = (unichar_t *) sfntrbuf;
    7692           0 :     nlabel[11].text_is_1byte = true;
    7693           0 :     ngcd[11].gd.label = &nlabel[11];
    7694           0 :     ngcd[11].gd.cid = CID_Revision;
    7695           0 :     ngcd[11].gd.popup_msg = (unichar_t *) _("If you leave this field blank FontForge will use a default based on\neither the version string above, or one in the 'name' table." );
    7696           0 :     ngcd[11].creator = GTextFieldCreate;
    7697             : 
    7698           0 :     nlabel[12].text = (unichar_t *) _("_Base Filename:");
    7699           0 :     nlabel[12].text_is_1byte = true;
    7700           0 :     nlabel[12].text_in_resource = true;
    7701           0 :     ngcd[12].gd.label = &nlabel[12];
    7702           0 :     ngcd[12].gd.popup_msg = (unichar_t *) _("Use this as the default base for the filename\nwhen generating a font." );
    7703           0 :     ngcd[12].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    7704           0 :     ngcd[12].creator = GLabelCreate;
    7705             : 
    7706             : /* GT: The space in front of "Same" makes things line up better */
    7707           0 :     nlabel[13].text = (unichar_t *) _(" Same as Fontname");
    7708           0 :     nlabel[13].text_is_1byte = true;
    7709           0 :     ngcd[13].gd.label = &nlabel[13];
    7710           0 :     ngcd[13].gd.flags = sf->defbasefilename==NULL ? (gg_visible | gg_enabled | gg_cb_on ) : (gg_visible | gg_enabled);
    7711           0 :     ngcd[13].gd.cid = CID_SameAsFontname;
    7712           0 :     ngcd[13].creator = GRadioCreate;
    7713             : 
    7714           0 :     nlabel[14].text = (unichar_t *) "";
    7715           0 :     nlabel[14].text_is_1byte = true;
    7716           0 :     ngcd[14].gd.label = &nlabel[14];
    7717           0 :     ngcd[14].gd.flags = sf->defbasefilename!=NULL ?
    7718             :                 (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold ) :
    7719             :                 (gg_visible | gg_enabled | gg_rad_continueold);
    7720           0 :     ngcd[14].gd.cid = CID_HasDefBase;
    7721           0 :     ngcd[14].creator = GRadioCreate;
    7722             : 
    7723           0 :     ngcd[15].gd.flags = gg_visible | gg_enabled|gg_text_xim;
    7724           0 :     nlabel[15].text = (unichar_t *) (sf->defbasefilename?sf->defbasefilename:"");
    7725           0 :     nlabel[15].text_is_1byte = true;
    7726           0 :     ngcd[15].gd.label = &nlabel[15];
    7727           0 :     ngcd[15].gd.cid = CID_DefBaseName;
    7728           0 :     ngcd[15].gd.handle_controlevent = GFI_DefBaseChange;
    7729           0 :     ngcd[15].creator = GTextFieldCreate;
    7730             : 
    7731           0 :     ngcd[16].gd.flags = gg_visible | gg_enabled;
    7732           0 :     nlabel[16].text = (unichar_t *) _("Copy_right:");
    7733           0 :     nlabel[16].text_is_1byte = true;
    7734           0 :     nlabel[16].text_in_resource = true;
    7735           0 :     ngcd[16].gd.label = &nlabel[16];
    7736           0 :     ngcd[16].creator = GLabelCreate;
    7737             : 
    7738           0 :     ngcd[17].gd.pos.width = ngcd[5].gd.pos.x+ngcd[5].gd.pos.width-26;
    7739           0 :     ngcd[17].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap | gg_utf8_popup;
    7740           0 :     copied_copyright = NULL;
    7741           0 :     if ( sf->copyright!=NULL ) {
    7742           0 :         if ( !AllAscii(sf->copyright))
    7743           0 :             nlabel[17].text = (unichar_t *) (copied_copyright = StripToASCII(sf->copyright));
    7744             :         else
    7745           0 :             nlabel[17].text = (unichar_t *) sf->copyright;
    7746           0 :         nlabel[17].text_is_1byte = true;
    7747           0 :         ngcd[17].gd.label = &nlabel[17];
    7748             :     }
    7749           0 :     ngcd[17].gd.cid = CID_Notice;
    7750           0 :     ngcd[17].gd.popup_msg = (unichar_t *) _("This must be ASCII, so you may not use the copyright symbol (use (c) instead).");
    7751           0 :     ngcd[17].creator = GTextAreaCreate;
    7752             : 
    7753           0 :     memset(&nb,0,sizeof(nb)); memset(&nb2,0,sizeof(nb2)); memset(&nb3,0,sizeof(nb3));
    7754             : 
    7755           0 :     narray3[0] = &ngcd[14]; narray3[1] = &ngcd[15]; narray3[2] = NULL;
    7756             : 
    7757           0 :     narray2[0] = &ngcd[12]; narray2[1] = &ngcd[13]; narray2[2] = NULL;
    7758           0 :     narray2[3] = GCD_RowSpan; narray2[4] = &nb3; narray2[5] = NULL;
    7759           0 :     narray2[6] = NULL;
    7760             : 
    7761           0 :     narray[0] = &ngcd[0]; narray[1] = &ngcd[1]; narray[2] = NULL;
    7762           0 :     narray[3] = &ngcd[2]; narray[4] = &ngcd[3]; narray[5] = NULL;
    7763           0 :     narray[6] = &ngcd[4]; narray[7] = &ngcd[5]; narray[8] = NULL;
    7764           0 :     narray[9] = &ngcd[6]; narray[10] = &ngcd[7]; narray[11] = NULL;
    7765           0 :     narray[12] = &ngcd[8]; narray[13] = &ngcd[9]; narray[14] = NULL;
    7766           0 :     narray[15] = &ngcd[10]; narray[16] = &ngcd[11]; narray[17] = NULL;
    7767           0 :     narray[18] = &nb2; narray[19] = GCD_ColSpan; narray[20] = NULL;
    7768           0 :     narray[21] = &ngcd[16]; narray[22] = GCD_ColSpan; narray[23] = NULL;
    7769           0 :     narray[24] = &ngcd[17]; narray[25] = GCD_ColSpan; narray[26] = NULL;
    7770           0 :     narray[27] = NULL;
    7771             : 
    7772           0 :     nb3.gd.flags = gg_enabled|gg_visible;
    7773           0 :     nb3.gd.u.boxelements = narray3;
    7774           0 :     nb3.creator = GHBoxCreate;
    7775             : 
    7776           0 :     nb2.gd.flags = gg_enabled|gg_visible;
    7777           0 :     nb2.gd.u.boxelements = narray2;
    7778           0 :     nb2.creator = GHVBoxCreate;
    7779             : 
    7780           0 :     nb[0].gd.flags = gg_enabled|gg_visible;
    7781           0 :     nb[0].gd.u.boxelements = narray;
    7782           0 :     nb[0].creator = GHVBoxCreate;
    7783             : 
    7784             : /******************************************************************************/
    7785           0 :     memset(&xulabel,0,sizeof(xulabel));
    7786           0 :     memset(&xugcd,0,sizeof(xugcd));
    7787             : 
    7788           0 :     xulabel[0].text = (unichar_t *) _("(Adobe now considers XUID/UniqueID unnecessary)");
    7789           0 :     xulabel[0].text_is_1byte = true;
    7790           0 :     xulabel[0].text_in_resource = true;
    7791           0 :     xugcd[0].gd.label = &xulabel[0];
    7792           0 :     xugcd[0].gd.flags = gg_visible | gg_enabled;
    7793           0 :     xugcd[0].creator = GLabelCreate;
    7794             : 
    7795           0 :     xulabel[1].text = (unichar_t *) _("Use XUID");
    7796           0 :     xulabel[1].text_is_1byte = true;
    7797           0 :     xulabel[1].text_in_resource = true;
    7798           0 :     xugcd[1].gd.label = &xulabel[1];
    7799           0 :     xugcd[1].gd.flags = gg_visible | gg_enabled;
    7800           0 :     if ( sf->use_xuid ) xugcd[1].gd.flags = gg_visible | gg_enabled | gg_cb_on;
    7801           0 :     xugcd[1].gd.cid = CID_UseXUID;
    7802           0 :     xugcd[1].gd.handle_controlevent = GFI_UseXUIDChanged;
    7803           0 :     xugcd[1].creator = GCheckBoxCreate;
    7804             : 
    7805           0 :     xugcd[2].gd.pos.x = 12; xugcd[2].gd.pos.y = 10+6;
    7806           0 :     xugcd[2].gd.flags = gg_visible | gg_enabled;
    7807           0 :     xulabel[2].text = (unichar_t *) _("_XUID:");
    7808           0 :     xulabel[2].text_is_1byte = true;
    7809           0 :     xulabel[2].text_in_resource = true;
    7810           0 :     xugcd[2].gd.label = &xulabel[2];
    7811           0 :     xugcd[2].creator = GLabelCreate;
    7812             : 
    7813           0 :     xugcd[3].gd.flags = gg_visible;
    7814           0 :     if ( sf->use_xuid ) xugcd[3].gd.flags = gg_visible | gg_enabled;
    7815           0 :     if ( sf->xuid!=NULL ) {
    7816           0 :         xulabel[3].text = (unichar_t *) sf->xuid;
    7817           0 :         xulabel[3].text_is_1byte = true;
    7818           0 :         xugcd[3].gd.label = &xulabel[3];
    7819             :     }
    7820           0 :     xugcd[3].gd.cid = CID_XUID;
    7821           0 :     xugcd[3].creator = GTextFieldCreate;
    7822             : 
    7823           0 :     xulabel[4].text = (unichar_t *) _("Use UniqueID");
    7824           0 :     xulabel[4].text_is_1byte = true;
    7825           0 :     xulabel[4].text_in_resource = true;
    7826           0 :     xugcd[4].gd.label = &xulabel[4];
    7827           0 :     xugcd[4].gd.flags = gg_visible | gg_enabled;
    7828           0 :     if ( sf->use_uniqueid ) xugcd[4].gd.flags = gg_visible | gg_enabled | gg_cb_on;
    7829           0 :     xugcd[4].gd.cid = CID_UseUniqueID;
    7830           0 :     xugcd[4].gd.handle_controlevent = GFI_UseUniqueIDChanged;
    7831           0 :     xugcd[4].creator = GCheckBoxCreate;
    7832             : 
    7833           0 :     xulabel[5].text = (unichar_t *) _("_UniqueID:");
    7834           0 :     xulabel[5].text_is_1byte = true;
    7835           0 :     xulabel[5].text_in_resource = true;
    7836           0 :     xugcd[5].gd.label = &xulabel[5];
    7837           0 :     xugcd[5].gd.flags = gg_visible | gg_enabled;
    7838           0 :     xugcd[5].creator = GLabelCreate;
    7839             : 
    7840           0 :     xugcd[6].gd.flags = gg_visible;
    7841           0 :     if ( sf->use_uniqueid ) xugcd[6].gd.flags = gg_visible | gg_enabled;
    7842           0 :     xulabel[6].text = (unichar_t *) "";
    7843           0 :     xulabel[6].text_is_1byte = true;
    7844           0 :     if ( sf->uniqueid!=0 ) {
    7845           0 :         sprintf( uibuf, "%d", sf->uniqueid );
    7846           0 :         xulabel[6].text = (unichar_t *) uibuf;
    7847             :     }
    7848           0 :     xugcd[6].gd.label = &xulabel[6];
    7849           0 :     xugcd[6].gd.cid = CID_UniqueID;
    7850           0 :     xugcd[6].creator = GTextFieldCreate;
    7851             : 
    7852           0 :     xuarray[0] = &xugcd[0]; xuarray[1] = GCD_ColSpan; xuarray[2] = NULL;
    7853           0 :     xuarray[3] = &xugcd[1]; xuarray[4] = GCD_ColSpan; xuarray[5] = NULL;
    7854           0 :     xuarray[6] = &xugcd[2]; xuarray[7] = &xugcd[3]; xuarray[8] = NULL;
    7855           0 :     xuarray[9] = &xugcd[4]; xuarray[10] = GCD_ColSpan; xuarray[11] = NULL;
    7856           0 :     xuarray[12] = &xugcd[5]; xuarray[13] = &xugcd[6]; xuarray[14] = NULL;
    7857           0 :     xuarray[15] = GCD_Glue; xuarray[16] = GCD_Glue; xuarray[17] = NULL;
    7858           0 :     xuarray[18] = NULL;
    7859             : 
    7860           0 :     memset(xub,0,sizeof(xub));
    7861           0 :     xub[0].gd.flags = gg_enabled|gg_visible;
    7862           0 :     xub[0].gd.u.boxelements = xuarray;
    7863           0 :     xub[0].creator = GHVBoxCreate;
    7864             : 
    7865             : /******************************************************************************/
    7866           0 :     memset(&pslabel,0,sizeof(pslabel));
    7867           0 :     memset(&psgcd,0,sizeof(psgcd));
    7868             : 
    7869           0 :     psgcd[0].gd.pos.x = 12; psgcd[0].gd.pos.y = 12;
    7870           0 :     psgcd[0].gd.flags = gg_visible | gg_enabled;
    7871           0 :     pslabel[0].text = (unichar_t *) _("_Ascent:");
    7872           0 :     pslabel[0].text_is_1byte = true;
    7873           0 :     pslabel[0].text_in_resource = true;
    7874           0 :     psgcd[0].gd.label = &pslabel[0];
    7875           0 :     psgcd[0].creator = GLabelCreate;
    7876             : 
    7877           0 :     psgcd[1].gd.pos.x = 103; psgcd[1].gd.pos.y = psgcd[0].gd.pos.y-6; psgcd[1].gd.pos.width = 47;
    7878           0 :     psgcd[1].gd.flags = gg_visible | gg_enabled;
    7879           0 :     sprintf( asbuf, "%d", sf->ascent );
    7880           0 :     pslabel[1].text = (unichar_t *) asbuf;
    7881           0 :     pslabel[1].text_is_1byte = true;
    7882           0 :     psgcd[1].gd.label = &pslabel[1];
    7883           0 :     psgcd[1].gd.cid = CID_Ascent;
    7884           0 :     psgcd[1].gd.handle_controlevent = GFI_EmChanged;
    7885           0 :     psgcd[1].creator = GTextFieldCreate;
    7886             : 
    7887           0 :     psgcd[2].gd.pos.x = 155; psgcd[2].gd.pos.y = psgcd[0].gd.pos.y;
    7888           0 :     psgcd[2].gd.flags = gg_visible | gg_enabled;
    7889           0 :     pslabel[2].text = (unichar_t *) _("_Descent:");
    7890           0 :     pslabel[2].text_is_1byte = true;
    7891           0 :     pslabel[2].text_in_resource = true;
    7892           0 :     psgcd[2].gd.label = &pslabel[2];
    7893           0 :     psgcd[2].creator = GLabelCreate;
    7894             : 
    7895           0 :     psgcd[3].gd.pos.x = 200; psgcd[3].gd.pos.y = psgcd[1].gd.pos.y; psgcd[3].gd.pos.width = 47;
    7896           0 :     psgcd[3].gd.flags = gg_visible | gg_enabled;
    7897           0 :     sprintf( dsbuf, "%d", sf->descent );
    7898           0 :     pslabel[3].text = (unichar_t *) dsbuf;
    7899           0 :     pslabel[3].text_is_1byte = true;
    7900           0 :     psgcd[3].gd.label = &pslabel[3];
    7901           0 :     psgcd[3].gd.cid = CID_Descent;
    7902           0 :     psgcd[3].gd.handle_controlevent = GFI_EmChanged;
    7903           0 :     psgcd[3].creator = GTextFieldCreate;
    7904             : 
    7905           0 :     psgcd[4].gd.pos.x = psgcd[0].gd.pos.x+5; psgcd[4].gd.pos.y = psgcd[0].gd.pos.y+24;
    7906           0 :     psgcd[4].gd.flags = gg_visible | gg_enabled;
    7907           0 :     pslabel[4].text = (unichar_t *) _(" _Em Size:");
    7908           0 :     pslabel[4].text_is_1byte = true;
    7909           0 :     pslabel[4].text_in_resource = true;
    7910           0 :     psgcd[4].gd.label = &pslabel[4];
    7911           0 :     psgcd[4].creator = GLabelCreate;
    7912             : 
    7913           0 :     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;
    7914           0 :     psgcd[5].gd.flags = gg_visible | gg_enabled;
    7915           0 :     sprintf( embuf, "%d", sf->descent+sf->ascent );
    7916           0 :     pslabel[5].text = (unichar_t *) embuf;
    7917           0 :     pslabel[5].text_is_1byte = true;
    7918           0 :     psgcd[5].gd.label = &pslabel[5];
    7919           0 :     psgcd[5].gd.cid = CID_Em;
    7920           0 :     psgcd[5].gd.u.list = emsizes;
    7921           0 :     psgcd[5].gd.handle_controlevent = GFI_EmChanged;
    7922           0 :     psgcd[5].creator = GListFieldCreate;
    7923             : 
    7924           0 :     psgcd[6].gd.pos.x = psgcd[2].gd.pos.x; psgcd[6].gd.pos.y = psgcd[4].gd.pos.y-4;
    7925           0 :     psgcd[6].gd.flags = gg_visible | gg_enabled | gg_cb_on;
    7926           0 :     pslabel[6].text = (unichar_t *) _("_Scale Outlines");
    7927           0 :     pslabel[6].text_is_1byte = true;
    7928           0 :     pslabel[6].text_in_resource = true;
    7929           0 :     psgcd[6].gd.label = &pslabel[6];
    7930           0 :     psgcd[6].gd.cid = CID_Scale;
    7931           0 :     psgcd[6].creator = GCheckBoxCreate;
    7932             : 
    7933             : /* I've reversed the label, text field order in the gcd here because */
    7934             : /*  that way the text field will be displayed on top of the label rather */
    7935             : /*  than the reverse, and in Russian that's important translation of */
    7936             : /*  "Italic Angle" is too long. Oops, no it's the next one, might as well leave in here though */
    7937           0 :     psgcd[8].gd.pos.x = 12; psgcd[8].gd.pos.y = psgcd[5].gd.pos.y+26+6;
    7938           0 :     psgcd[8].gd.flags = gg_visible | gg_enabled;
    7939           0 :     pslabel[8].text = (unichar_t *) _("_Italic Angle:");
    7940           0 :     pslabel[8].text_is_1byte = true;
    7941           0 :     pslabel[8].text_in_resource = true;
    7942           0 :     psgcd[8].gd.label = &pslabel[8];
    7943           0 :     psgcd[8].creator = GLabelCreate;
    7944             : 
    7945           0 :     psgcd[7].gd.pos.x = 103; psgcd[7].gd.pos.y = psgcd[8].gd.pos.y-6;
    7946           0 :     psgcd[7].gd.pos.width = 47;
    7947           0 :     psgcd[7].gd.flags = gg_visible | gg_enabled;
    7948           0 :     sprintf( iabuf, "%g", (double) sf->italicangle );
    7949           0 :     pslabel[7].text = (unichar_t *) iabuf;
    7950           0 :     pslabel[7].text_is_1byte = true;
    7951           0 :     psgcd[7].gd.label = &pslabel[7];
    7952           0 :     psgcd[7].gd.cid = CID_ItalicAngle;
    7953           0 :     psgcd[7].creator = GTextFieldCreate;
    7954             : 
    7955           0 :     psgcd[9].gd.pos.y = psgcd[7].gd.pos.y;
    7956           0 :     psgcd[9].gd.pos.width = -1; psgcd[9].gd.pos.height = 0;
    7957           0 :     psgcd[9].gd.pos.x = psgcd[3].gd.pos.x+psgcd[3].gd.pos.width-
    7958           0 :             GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
    7959             :     /*if ( strstrmatch(sf->fontname,"Italic")!=NULL ||strstrmatch(sf->fontname,"Oblique")!=NULL )*/
    7960           0 :         psgcd[9].gd.flags = gg_visible | gg_enabled;
    7961           0 :     pslabel[9].text = (unichar_t *) _("_Guess");
    7962           0 :     pslabel[9].text_is_1byte = true;
    7963           0 :     pslabel[9].text_in_resource = true;
    7964           0 :     psgcd[9].gd.label = &pslabel[9];
    7965           0 :     psgcd[9].gd.handle_controlevent = GFI_GuessItalic;
    7966           0 :     psgcd[9].creator = GButtonCreate;
    7967             : 
    7968             : /* I've reversed the label, text field order in the gcd here because */
    7969             : /*  that way the text field will be displayed on top of the label rather */
    7970             : /*  than the reverse, and in Russian that's important translation of */
    7971             : /*  "Underline position" is too long. */
    7972           0 :     psgcd[11].gd.pos.x = 12; psgcd[11].gd.pos.y = psgcd[7].gd.pos.y+26+6;
    7973           0 :     psgcd[11].gd.flags = gg_visible | gg_enabled;
    7974           0 :     pslabel[11].text = (unichar_t *) _("Underline _Position:");
    7975           0 :     pslabel[11].text_is_1byte = true;
    7976           0 :     pslabel[11].text_in_resource = true;
    7977           0 :     psgcd[11].gd.label = &pslabel[11];
    7978           0 :     psgcd[11].creator = GLabelCreate;
    7979             : 
    7980           0 :     psgcd[10].gd.pos.x = 103; psgcd[10].gd.pos.y = psgcd[11].gd.pos.y-6; psgcd[10].gd.pos.width = 47;
    7981           0 :     psgcd[10].gd.flags = gg_visible | gg_enabled;
    7982           0 :     sprintf( upbuf, "%g", (double) sf->upos );
    7983           0 :     pslabel[10].text = (unichar_t *) upbuf;
    7984           0 :     pslabel[10].text_is_1byte = true;
    7985           0 :     psgcd[10].gd.label = &pslabel[10];
    7986           0 :     psgcd[10].gd.cid = CID_UPos;
    7987           0 :     psgcd[10].creator = GTextFieldCreate;
    7988             : 
    7989           0 :     psgcd[12].gd.pos.x = 155; psgcd[12].gd.pos.y = psgcd[11].gd.pos.y;
    7990           0 :     psgcd[12].gd.flags = gg_visible | gg_enabled;
    7991           0 :     pslabel[12].text = (unichar_t *) S_("Underline|_Height:");
    7992           0 :     pslabel[12].text_is_1byte = true;
    7993           0 :     pslabel[12].text_in_resource = true;
    7994           0 :     psgcd[12].gd.label = &pslabel[12];
    7995           0 :     psgcd[12].creator = GLabelCreate;
    7996             : 
    7997           0 :     psgcd[13].gd.pos.x = 200; psgcd[13].gd.pos.y = psgcd[10].gd.pos.y; psgcd[13].gd.pos.width = 47;
    7998           0 :     psgcd[13].gd.flags = gg_visible | gg_enabled;
    7999           0 :     sprintf( uwbuf, "%g", (double) sf->uwidth );
    8000           0 :     pslabel[13].text = (unichar_t *) uwbuf;
    8001           0 :     pslabel[13].text_is_1byte = true;
    8002           0 :     psgcd[13].gd.label = &pslabel[13];
    8003           0 :     psgcd[13].gd.cid = CID_UWidth;
    8004           0 :     psgcd[13].creator = GTextFieldCreate;
    8005             : 
    8006           0 :     psgcd[14].gd.pos.x = 12; psgcd[14].gd.pos.y = psgcd[13].gd.pos.y+26;
    8007           0 :     pslabel[14].text = (unichar_t *) _("Has _Vertical Metrics");
    8008           0 :     pslabel[14].text_is_1byte = true;
    8009           0 :     pslabel[14].text_in_resource = true;
    8010           0 :     psgcd[14].gd.label = &pslabel[14];
    8011           0 :     psgcd[14].gd.cid = CID_HasVerticalMetrics;
    8012           0 :     psgcd[14].gd.flags = gg_visible | gg_enabled;
    8013           0 :     if ( sf->hasvmetrics )
    8014           0 :         psgcd[14].gd.flags |= gg_cb_on;
    8015           0 :     psgcd[14].gd.handle_controlevent = GFI_VMetricsCheck;
    8016           0 :     psgcd[14].creator = GCheckBoxCreate;
    8017           0 :     k = 15;
    8018             : 
    8019           0 :     psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
    8020           0 :     psgcd[k].gd.flags = gg_visible | gg_enabled;
    8021           0 :     pslabel[k].text = (unichar_t *) _("Interpretation:");
    8022           0 :     pslabel[k].text_is_1byte = true;
    8023           0 :     pslabel[k].text_in_resource = true;
    8024           0 :     psgcd[k].gd.label = &pslabel[k];
    8025           0 :     psgcd[k++].creator = GLabelCreate;
    8026             : 
    8027           0 :     psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
    8028           0 :     psgcd[k].gd.flags = gg_visible | gg_enabled;
    8029           0 :     psgcd[k].gd.u.list = interpretations;
    8030           0 :     psgcd[k].gd.cid = CID_Interpretation;
    8031           0 :     psgcd[k].creator = GListButtonCreate;
    8032           0 :     for ( i=0; interpretations[i].text!=NULL || interpretations[i].line; ++i ) {
    8033           0 :         if ( (void *) (sf->uni_interp)==interpretations[i].userdata &&
    8034           0 :                 interpretations[i].text!=NULL ) {
    8035           0 :             interpretations[i].selected = true;
    8036           0 :             psgcd[k].gd.label = &interpretations[i];
    8037             :         } else
    8038           0 :             interpretations[i].selected = false;
    8039             :     }
    8040           0 :     ++k;
    8041             : 
    8042           0 :     psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
    8043           0 :     psgcd[k].gd.flags = gg_visible | gg_enabled;
    8044           0 :     pslabel[k].text = (unichar_t *) _("Name List:");
    8045           0 :     pslabel[k].text_is_1byte = true;
    8046           0 :     pslabel[k].text_in_resource = true;
    8047           0 :     psgcd[k].gd.label = &pslabel[k];
    8048           0 :     psgcd[k++].creator = GLabelCreate;
    8049             : 
    8050           0 :     psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
    8051           0 :     psgcd[k].gd.flags = gg_visible | gg_enabled;
    8052           0 :     psgcd[k].gd.cid = CID_Namelist;
    8053           0 :     psgcd[k].creator = GListButtonCreate;
    8054           0 :     nlnames = AllNamelistNames();
    8055           0 :     for ( i=0; nlnames[i]!=NULL; ++i);
    8056           0 :     namelistnames = calloc(i+1,sizeof(GTextInfo));
    8057           0 :     for ( i=0; nlnames[i]!=NULL; ++i) {
    8058           0 :         namelistnames[i].text = (unichar_t *) nlnames[i];
    8059           0 :         namelistnames[i].text_is_1byte = true;
    8060           0 :         if ( strcmp(_(sf->for_new_glyphs->title),nlnames[i])==0 ) {
    8061           0 :             namelistnames[i].selected = true;
    8062           0 :             psgcd[k].gd.label = &namelistnames[i];
    8063             :         }
    8064             :     }
    8065           0 :     psgcd[k++].gd.u.list = namelistnames;
    8066           0 :     free(nlnames);
    8067             : 
    8068             : 
    8069           0 :     if ( sf->subfontcnt!=0 ) {
    8070           0 :         for ( i=0; i<=13; ++i )
    8071           0 :             psgcd[i].gd.flags &= ~gg_enabled;
    8072           0 :     } else if ( sf->cidmaster!=NULL ) {
    8073           0 :         for ( i=14; i<=16; ++i )
    8074           0 :             psgcd[i].gd.flags &= ~gg_enabled;
    8075             :     }
    8076             : 
    8077           0 :     psarray[0] = &psb2[0];
    8078           0 :     psarray[1] = &psgcd[14];
    8079           0 :     j=2;
    8080           0 :     psarray[j++] = &psb2[1];
    8081           0 :     psrow = j;
    8082           0 :     psarray[j++] = GCD_Glue;
    8083           0 :     psarray[j++] = NULL;
    8084             : 
    8085           0 :     psarray2[0] = &psgcd[0]; psarray2[1] = &psgcd[1]; psarray2[2] = &psgcd[2]; psarray2[3] = &psgcd[3]; psarray2[4] = NULL;
    8086           0 :     psarray2[5] = &psgcd[4]; psarray2[6] = &psgcd[5]; psarray2[7] = &psgcd[6]; psarray2[8] = GCD_ColSpan; psarray2[9] = NULL;
    8087           0 :     psarray2[10] = &psgcd[8]; psarray2[11] = &psgcd[7]; psarray2[12] = &psgcd[9]; psarray2[13] = GCD_ColSpan; psarray2[14] = NULL;
    8088           0 :     psarray2[15] = &psgcd[11]; psarray2[16] = &psgcd[10]; psarray2[17] = &psgcd[12]; psarray2[18] = &psgcd[13]; psarray2[19] = NULL;
    8089           0 :     psarray2[20] = NULL;
    8090             : 
    8091           0 :     psarray4[0] = &psgcd[k-4]; psarray4[1] = &psgcd[k-3]; psarray4[2] = NULL;
    8092           0 :     psarray4[3] = &psgcd[k-2]; psarray4[4] = &psgcd[k-1]; psarray4[5] = NULL;
    8093           0 :     psarray4[6] = NULL;
    8094             : 
    8095           0 :     memset(psb,0,sizeof(psb));
    8096           0 :     psb[0].gd.flags = gg_enabled|gg_visible;
    8097           0 :     psb[0].gd.u.boxelements = psarray;
    8098           0 :     psb[0].creator = GVBoxCreate;
    8099             : 
    8100           0 :     memset(psb2,0,sizeof(psb2));
    8101           0 :     psb2[0].gd.flags = gg_enabled|gg_visible;
    8102           0 :     psb2[0].gd.u.boxelements = psarray2;
    8103           0 :     psb2[0].creator = GHVBoxCreate;
    8104             : 
    8105           0 :     psb2[1].gd.flags = gg_enabled|gg_visible;
    8106           0 :     psb2[1].gd.u.boxelements = psarray4;
    8107           0 :     psb2[1].creator = GHVBoxCreate;
    8108             : /******************************************************************************/
    8109             : 
    8110           0 :     memset(&llabel,0,sizeof(llabel));
    8111           0 :     memset(&lgcd,0,sizeof(lgcd));
    8112           0 :     memset(&lbox,0,sizeof(lbox));
    8113             : 
    8114           0 :     ltype = -1;
    8115           0 :     for ( j=0; j<sf->layer_cnt; ++j ) {
    8116           0 :         if ( ltype==-1 )
    8117           0 :             ltype = sf->layers[j].order2;
    8118           0 :         else if ( ltype!=sf->layers[j].order2 )
    8119           0 :             ltype = -2;
    8120             :     }
    8121             : 
    8122           0 :     k = j = 0;
    8123             : 
    8124           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
    8125           0 :     llabel[k].text = (unichar_t *) _("Font Type:");
    8126           0 :     llabel[k].text_is_1byte = true;
    8127           0 :     llabel[k].text_in_resource = true;
    8128           0 :     lgcd[k].gd.label = &llabel[k];
    8129           0 :     lgcd[k].gd.flags = (gg_visible | gg_enabled);
    8130           0 :     lgcd[k++].creator = GLabelCreate;
    8131           0 :     larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_ColSpan; larray2[j++] = GCD_Glue; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
    8132             : 
    8133           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+k;
    8134           0 :     llabel[k].text = (unichar_t *) _("_Outline Font");
    8135           0 :     llabel[k].text_is_1byte = true;
    8136           0 :     llabel[k].text_in_resource = true;
    8137           0 :     lgcd[k].gd.label = &llabel[k];
    8138           0 :     lgcd[k].gd.flags = (!sf->strokedfont && !sf->multilayer)?
    8139             :             (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
    8140           0 :     lgcd[k].gd.handle_controlevent = GFI_Type3Change;
    8141           0 :     lgcd[k++].creator = GRadioCreate;
    8142           0 :     larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_Glue; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
    8143             : 
    8144           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+14;
    8145           0 :     llabel[k].text = (unichar_t *) _("_Type3 Multi Layered Font");
    8146           0 :     llabel[k].text_is_1byte = true;
    8147           0 :     llabel[k].text_in_resource = true;
    8148           0 :     lgcd[k].gd.label = &llabel[k];
    8149           0 :     lgcd[k].gd.flags = ltype!=0 ? (gg_visible | gg_utf8_popup | gg_rad_continueold) :
    8150           0 :         sf->multilayer ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on | gg_rad_continueold) :
    8151             :         (gg_visible | gg_enabled | gg_utf8_popup | gg_rad_continueold);
    8152           0 :     lgcd[k].gd.cid = CID_IsMultiLayer;
    8153           0 :     lgcd[k].gd.handle_controlevent = GFI_Type3Change;
    8154           0 :     lgcd[k].creator = GRadioCreate;
    8155           0 :     lgcd[k++].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.");
    8156           0 :     larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1]; larray2[j++] = GCD_ColSpan; larray2[j++] = GCD_Glue; larray2[j++] = NULL;
    8157             : 
    8158           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+14;
    8159           0 :     llabel[k].text = (unichar_t *) _("_Stroked Font");
    8160           0 :     llabel[k].text_is_1byte = true;
    8161           0 :     llabel[k].text_in_resource = true;
    8162           0 :     lgcd[k].gd.label = &llabel[k];
    8163           0 :     lgcd[k].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on) : (gg_visible | gg_enabled | gg_utf8_popup);
    8164           0 :     lgcd[k].gd.cid = CID_IsStrokedFont;
    8165           0 :     lgcd[k].gd.handle_controlevent = GFI_Type3Change;
    8166           0 :     lgcd[k].creator = GRadioCreate;
    8167           0 :     lgcd[k++].gd.popup_msg = (unichar_t *) _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
    8168           0 :     larray2[j++] = GCD_HPad10; larray2[j++] = &lgcd[k-1];
    8169             : 
    8170           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y+20;
    8171           0 :     llabel[k].text = (unichar_t *) _("  Stroke _Width:");
    8172           0 :     llabel[k].text_is_1byte = true;
    8173           0 :     llabel[k].text_in_resource = true;
    8174           0 :     lgcd[k].gd.label = &llabel[k];
    8175           0 :     lgcd[k].gd.flags = gg_visible | gg_enabled;
    8176           0 :     lgcd[k++].creator = GLabelCreate;
    8177           0 :     larray2[j++] = &lgcd[k-1];
    8178             : 
    8179           0 :     sprintf( swbuf,"%g", (double) sf->strokewidth );
    8180           0 :     lgcd[k].gd.pos.x = 115; lgcd[k].gd.pos.y = lgcd[k-1].gd.pos.y-6; lgcd[k].gd.pos.width = 137;
    8181           0 :     lgcd[k].gd.flags = gg_visible | gg_enabled;
    8182           0 :     llabel[k].text = (unichar_t *) swbuf;
    8183           0 :     llabel[k].text_is_1byte = true;
    8184           0 :     lgcd[k].gd.label = &llabel[k];
    8185           0 :     lgcd[k].gd.cid = CID_StrokeWidth;
    8186           0 :     lgcd[k++].creator = GTextFieldCreate;
    8187           0 :     larray2[j++] = &lgcd[k-1]; larray2[j++] = NULL; larray2[j++] = NULL;
    8188             : 
    8189           0 :     lbox[2].gd.flags = gg_enabled|gg_visible;
    8190           0 :     lbox[2].gd.u.boxelements = larray2;
    8191           0 :     lbox[2].creator = GHVBoxCreate;
    8192           0 :     larray[0] = &lbox[2]; larray[1] = NULL;
    8193             : 
    8194           0 :     llabel[k].text = (unichar_t *) _("All layers _cubic");
    8195           0 :     llabel[k].text_is_1byte = true;
    8196           0 :     llabel[k].text_in_resource = true;
    8197           0 :     lgcd[k].gd.label = &llabel[k];
    8198           0 :     lgcd[k].gd.flags = ltype==0 || sf->multilayer ?
    8199             :         (gg_visible | gg_enabled | gg_cb_on | gg_utf8_popup) :
    8200             :         (gg_visible | gg_enabled | gg_utf8_popup);
    8201           0 :     lgcd[k].gd.cid = CID_IsOrder3;
    8202           0 :     lgcd[k].gd.handle_controlevent = GFI_OrderChange;
    8203           0 :     lgcd[k].creator = GRadioCreate;
    8204           0 :     lgcd[k++].gd.popup_msg = (unichar_t *) _(
    8205             :         "Use cubic (that is postscript) splines to hold the outlines of all\n"
    8206             :         "layers of this font. Cubic splines are generally easier to edit\n"
    8207             :         "than quadratic (and you may still generate a truetype font from them).");
    8208             : 
    8209           0 :     llabel[k].text = (unichar_t *) _("All layers _quadratic");
    8210           0 :     llabel[k].text_is_1byte = true;
    8211           0 :     llabel[k].text_in_resource = true;
    8212           0 :     lgcd[k].gd.label = &llabel[k];
    8213           0 :     lgcd[k].gd.flags = sf->multilayer ? (gg_visible | gg_utf8_popup) :
    8214             :             ltype==1 ? (gg_visible | gg_enabled | gg_cb_on | gg_utf8_popup) :
    8215             :                 (gg_visible | gg_enabled | gg_utf8_popup);
    8216           0 :     lgcd[k].gd.cid = CID_IsOrder2;
    8217           0 :     lgcd[k].gd.handle_controlevent = GFI_OrderChange;
    8218           0 :     lgcd[k].creator = GRadioCreate;
    8219           0 :     lgcd[k++].gd.popup_msg = (unichar_t *) _(
    8220             :         "Use quadratic (that is truetype) splines to hold the outlines of all\n"
    8221             :         "layers of this font rather than cubic (postscript) splines.");
    8222             : 
    8223           0 :     llabel[k].text = (unichar_t *) _("_Mixed");
    8224           0 :     llabel[k].text_is_1byte = true;
    8225           0 :     llabel[k].text_in_resource = true;
    8226           0 :     lgcd[k].gd.label = &llabel[k];
    8227           0 :     lgcd[k].gd.flags = sf->multilayer ? (gg_visible | gg_utf8_popup) :
    8228             :             ltype<0 ? (gg_visible | gg_enabled | gg_cb_on | gg_utf8_popup) :
    8229             :                 (gg_visible | gg_enabled | gg_utf8_popup);
    8230           0 :     lgcd[k].gd.handle_controlevent = GFI_OrderChange;
    8231           0 :     lgcd[k].gd.cid = CID_IsMixed;
    8232           0 :     lgcd[k].creator = GRadioCreate;
    8233           0 :     lgcd[k++].gd.popup_msg = (unichar_t *) _(
    8234             :         "The order of each layer of the font can be controlled\n"
    8235             :         "individually. This might be useful if you wished to\n"
    8236             :         "retain both quadratic and cubic versions of a font.");
    8237           0 :     larray3[0] = &lgcd[k-3]; larray3[1] = &lgcd[k-2]; larray3[2] = &lgcd[k-1]; larray3[3] = GCD_Glue; larray3[4] = NULL;
    8238             : 
    8239           0 :     lbox[3].gd.flags = gg_enabled|gg_visible;
    8240           0 :     lbox[3].gd.u.boxelements = larray3;
    8241           0 :     lbox[3].creator = GHBoxCreate;
    8242           0 :     larray[2] = GCD_HPad10; larray[3] = NULL;
    8243           0 :     larray[4] = &lbox[3]; larray[5] = NULL;
    8244             : 
    8245           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
    8246           0 :     llabel[k].text = (unichar_t *) _("Guidelines:");
    8247           0 :     llabel[k].text_is_1byte = true;
    8248           0 :     llabel[k].text_in_resource = true;
    8249           0 :     lgcd[k].gd.label = &llabel[k];
    8250           0 :     lgcd[k].gd.flags = (gg_visible | gg_enabled);
    8251           0 :     lgcd[k++].creator = GLabelCreate;
    8252           0 :     larray4[0] = &lgcd[k-1];
    8253             : 
    8254           0 :     llabel[k].text = (unichar_t *) _("Quadratic");
    8255           0 :     llabel[k].text_is_1byte = true;
    8256           0 :     llabel[k].text_in_resource = true;
    8257           0 :     lgcd[k].gd.label = &llabel[k];
    8258           0 :     lgcd[k].gd.flags = sf->multilayer || ltype>=0 ? (gg_visible | gg_utf8_popup ) :
    8259             :             (gg_visible | gg_enabled | gg_utf8_popup);
    8260           0 :     if ( sf->grid.order2 )
    8261           0 :         lgcd[k].gd.flags |= gg_cb_on;
    8262           0 :     lgcd[k].gd.cid = CID_GuideOrder2;
    8263           0 :     lgcd[k].creator = GCheckBoxCreate;
    8264           0 :     lgcd[k++].gd.popup_msg = (unichar_t *) _(
    8265             :         "Use quadratic splines for the guidelines layer of the font");
    8266           0 :     larray4[1] = &lgcd[k-1]; larray4[2] = GCD_Glue; larray4[3] = NULL;
    8267             : 
    8268           0 :     lbox[4].gd.flags = gg_enabled|gg_visible;
    8269           0 :     lbox[4].gd.u.boxelements = larray4;
    8270           0 :     lbox[4].creator = GHBoxCreate;
    8271           0 :     larray[6] = &lbox[4]; larray[7] = NULL;
    8272             : 
    8273           0 :     lgcd[k].gd.pos.x = 12; lgcd[k].gd.pos.y = 0;
    8274           0 :     llabel[k].text = (unichar_t *) _("\nLayers:");
    8275           0 :     llabel[k].text_is_1byte = true;
    8276           0 :     llabel[k].text_in_resource = true;
    8277           0 :     lgcd[k].gd.label = &llabel[k];
    8278           0 :     lgcd[k].gd.flags = (gg_visible | gg_enabled);
    8279           0 :     lgcd[k++].creator = GLabelCreate;
    8280           0 :     larray[8] = &lgcd[k-1]; larray[9] = NULL;
    8281             : 
    8282           0 :     LayersMatrixInit(&layersmi,d);
    8283             : 
    8284           0 :     lgcd[k].gd.pos.width = 300; lgcd[k].gd.pos.height = 180;
    8285           0 :     lgcd[k].gd.flags = sf->multilayer ? gg_visible : (gg_enabled | gg_visible);
    8286           0 :     lgcd[k].gd.cid = CID_Backgrounds;
    8287           0 :     lgcd[k].gd.u.matrix = &layersmi;
    8288           0 :     lgcd[k].data = d;
    8289           0 :     lgcd[k++].creator = GMatrixEditCreate;
    8290           0 :     larray[10] = &lgcd[k-1]; larray[11] = NULL; larray[12] = NULL;
    8291             : 
    8292           0 :     lbox[0].gd.flags = gg_enabled|gg_visible;
    8293           0 :     lbox[0].gd.u.boxelements = larray;
    8294           0 :     lbox[0].creator = GHVGroupCreate;
    8295             : 
    8296             : /******************************************************************************/
    8297             : 
    8298           0 :     memset(&plabel,0,sizeof(plabel));
    8299           0 :     memset(&pgcd,0,sizeof(pgcd));
    8300             : 
    8301           0 :     PSPrivate_MatrixInit(&private_mi,d);
    8302             : 
    8303           0 :     i=0;
    8304           0 :     pgcd[i].gd.pos.width = 300; pgcd[i].gd.pos.height = 200;
    8305           0 :     pgcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
    8306           0 :     pgcd[i].gd.cid = CID_Private;
    8307           0 :     pgcd[i].gd.u.matrix = &private_mi;
    8308           0 :     pgcd[i].gd.popup_msg = (unichar_t *) _(
    8309             :         "The PostScript 'Private' dictionary gives you control over\n"
    8310             :         "several font-wide versions of hinting.\n"
    8311             :         "The 'Private' dictionary only applies to PostScript fonts.");
    8312           0 :     pgcd[i].data = d;
    8313           0 :     pgcd[i++].creator = GMatrixEditCreate;
    8314           0 :     pparray[0] = &pgcd[0]; pparray[1] = NULL;
    8315             : 
    8316           0 :     memset(ppbox,0,sizeof(ppbox));
    8317           0 :     ppbox[0].gd.flags = gg_enabled|gg_visible;
    8318           0 :     ppbox[0].gd.u.boxelements = pparray;
    8319           0 :     ppbox[0].creator = GVBoxCreate;
    8320             : 
    8321             : 
    8322           0 :     memset(&privatelabel_def,0,sizeof(privatelabel_def));
    8323           0 :     memset(&privategcd_def,0,sizeof(privategcd_def));
    8324           0 :     privategcd_def[0].gd.flags = gg_visible ;
    8325           0 :     privatelabel_def[0].text = (unichar_t *) _("_Guess");
    8326           0 :     privatelabel_def[0].text_is_1byte = true;
    8327           0 :     privatelabel_def[0].text_in_resource = true;
    8328           0 :     privategcd_def[0].gd.label = &privatelabel_def[0];
    8329           0 :     privategcd_def[0].gd.handle_controlevent = PI_Guess;
    8330           0 :     privategcd_def[0].gd.cid = CID_Guess;
    8331           0 :     privategcd_def[0].creator = GButtonCreate;
    8332             : 
    8333           0 :     privategcd_def[1].gd.flags = gg_visible | gg_utf8_popup ;
    8334           0 :     privatelabel_def[1].text = (unichar_t *) _("_Histogram");
    8335           0 :     privatelabel_def[1].text_is_1byte = true;
    8336           0 :     privatelabel_def[1].text_in_resource = true;
    8337           0 :     privategcd_def[1].gd.label = &privatelabel_def[1];
    8338           0 :     privategcd_def[1].gd.handle_controlevent = PI_Hist;
    8339           0 :     privategcd_def[1].gd.cid = CID_Hist;
    8340           0 :     privategcd_def[1].gd.popup_msg = (unichar_t *) _("Histogram Dialog");
    8341           0 :     privategcd_def[1].creator = GButtonCreate;
    8342             : 
    8343             : /******************************************************************************/
    8344           0 :     memset(&vlabel,0,sizeof(vlabel));
    8345           0 :     memset(&vgcd,0,sizeof(vgcd));
    8346             : 
    8347           0 :     vgcd[0].gd.pos.x = 10; vgcd[0].gd.pos.y = 12;
    8348           0 :     vlabel[0].text = (unichar_t *) _("_Weight Class");
    8349           0 :     vlabel[0].text_is_1byte = true;
    8350           0 :     vlabel[0].text_in_resource = true;
    8351           0 :     vgcd[0].gd.label = &vlabel[0];
    8352           0 :     vgcd[0].gd.flags = gg_visible | gg_enabled;
    8353           0 :     vgcd[0].creator = GLabelCreate;
    8354             : 
    8355           0 :     vgcd[1].gd.pos.x = 90; vgcd[1].gd.pos.y = vgcd[0].gd.pos.y-6; vgcd[1].gd.pos.width = 140;
    8356           0 :     vgcd[1].gd.flags = gg_visible | gg_enabled;
    8357           0 :     vgcd[1].gd.cid = CID_WeightClass;
    8358           0 :     vgcd[1].gd.u.list = weightclass;
    8359           0 :     vgcd[1].creator = GListFieldCreate;
    8360             : 
    8361           0 :     vgcd[2].gd.pos.x = 10; vgcd[2].gd.pos.y = vgcd[1].gd.pos.y+26+6;
    8362           0 :     vlabel[2].text = (unichar_t *) _("Width _Class");
    8363           0 :     vlabel[2].text_is_1byte = true;
    8364           0 :     vlabel[2].text_in_resource = true;
    8365           0 :     vgcd[2].gd.label = &vlabel[2];
    8366           0 :     vgcd[2].gd.flags = gg_visible | gg_enabled;
    8367           0 :     vgcd[2].creator = GLabelCreate;
    8368             : 
    8369           0 :     vgcd[3].gd.pos.x = 90; vgcd[3].gd.pos.y = vgcd[2].gd.pos.y-6;
    8370           0 :     vgcd[3].gd.flags = gg_visible | gg_enabled;
    8371           0 :     vgcd[3].gd.cid = CID_WidthClass;
    8372           0 :     vgcd[3].gd.u.list = widthclass;
    8373           0 :     vgcd[3].creator = GListButtonCreate;
    8374             : 
    8375           0 :     vgcd[4].gd.pos.x = 10; vgcd[4].gd.pos.y = vgcd[3].gd.pos.y+26+6;
    8376           0 :     vlabel[4].text = (unichar_t *) _("P_FM Family");
    8377           0 :     vlabel[4].text_is_1byte = true;
    8378           0 :     vlabel[4].text_in_resource = true;
    8379           0 :     vgcd[4].gd.label = &vlabel[4];
    8380           0 :     vgcd[4].gd.flags = gg_visible | gg_enabled;
    8381           0 :     vgcd[4].creator = GLabelCreate;
    8382             : 
    8383           0 :     vgcd[5].gd.pos.x = 90; vgcd[5].gd.pos.y = vgcd[4].gd.pos.y-6; vgcd[5].gd.pos.width = 140;
    8384           0 :     vgcd[5].gd.flags = gg_visible | gg_enabled;
    8385           0 :     vgcd[5].gd.cid = CID_PFMFamily;
    8386           0 :     vgcd[5].gd.u.list = pfmfamily;
    8387           0 :     vgcd[5].creator = GListButtonCreate;
    8388             : 
    8389           0 :     vgcd[6].gd.pos.x = 10; vgcd[6].gd.pos.y = vgcd[5].gd.pos.y+26+6;
    8390           0 :     vlabel[6].text = (unichar_t *) _("_Embeddable");
    8391           0 :     vlabel[6].text_is_1byte = true;
    8392           0 :     vlabel[6].text_in_resource = true;
    8393           0 :     vgcd[6].gd.label = &vlabel[6];
    8394           0 :     vgcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8395           0 :     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.");
    8396           0 :     vgcd[6].creator = GLabelCreate;
    8397             : 
    8398           0 :     vgcd[7].gd.pos.x = 90; vgcd[7].gd.pos.y = vgcd[6].gd.pos.y-6;
    8399           0 :     vgcd[7].gd.pos.width = 140;
    8400           0 :     vgcd[7].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8401           0 :     vgcd[7].gd.cid = CID_FSType;
    8402           0 :     vgcd[7].gd.u.list = fstype;
    8403           0 :     vgcd[7].gd.popup_msg = vgcd[6].gd.popup_msg;
    8404           0 :     vgcd[7].creator = GListButtonCreate;
    8405           0 :     fstype[0].selected = fstype[1].selected =
    8406           0 :             fstype[2].selected = fstype[3].selected = false;
    8407           0 :     if ( sf->pfminfo.fstype == -1 )
    8408           0 :         i = 3;
    8409           0 :     else if ( sf->pfminfo.fstype&0x8 )
    8410           0 :         i = 2;
    8411           0 :     else if ( sf->pfminfo.fstype&0x4 )
    8412           0 :         i = 1;
    8413           0 :     else if ( sf->pfminfo.fstype&0x2 )
    8414           0 :         i = 0;
    8415             :     else
    8416           0 :         i = 3;
    8417           0 :     fstype[i].selected = true;
    8418           0 :     vgcd[7].gd.label = &fstype[i];
    8419             : 
    8420           0 :     vgcd[8].gd.pos.x = 20; vgcd[8].gd.pos.y = vgcd[7].gd.pos.y+26;
    8421           0 :     vlabel[8].text = (unichar_t *) _("No Subsetting");
    8422           0 :     vlabel[8].text_is_1byte = true;
    8423           0 :     vgcd[8].gd.label = &vlabel[8];
    8424           0 :     vgcd[8].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8425           0 :     if ( sf->pfminfo.fstype!=-1 && (sf->pfminfo.fstype&0x100) )
    8426           0 :         vgcd[8].gd.flags |= gg_cb_on;
    8427           0 :     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.");
    8428           0 :     vgcd[8].gd.cid = CID_NoSubsetting;
    8429           0 :     vgcd[8].creator = GCheckBoxCreate;
    8430             : 
    8431           0 :     vgcd[9].gd.pos.x = 110; vgcd[9].gd.pos.y = vgcd[8].gd.pos.y;
    8432           0 :     vlabel[9].text = (unichar_t *) _("Only Embed Bitmaps");
    8433           0 :     vlabel[9].text_is_1byte = true;
    8434           0 :     vgcd[9].gd.label = &vlabel[9];
    8435           0 :     vgcd[9].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8436           0 :     if ( sf->pfminfo.fstype!=-1 && ( sf->pfminfo.fstype&0x200 ))
    8437           0 :         vgcd[9].gd.flags |= gg_cb_on;
    8438           0 :     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).");
    8439           0 :     vgcd[9].gd.cid = CID_OnlyBitmaps;
    8440           0 :     vgcd[9].creator = GCheckBoxCreate;
    8441             : 
    8442           0 :     vgcd[10].gd.pos.x = 10; vgcd[10].gd.pos.y = vgcd[9].gd.pos.y+24;
    8443           0 :     vlabel[10].text = (unichar_t *) _("Vendor ID:");
    8444           0 :     vlabel[10].text_is_1byte = true;
    8445           0 :     vgcd[10].gd.label = &vlabel[10];
    8446           0 :     vgcd[10].gd.flags = gg_visible | gg_enabled;
    8447           0 :     vgcd[10].creator = GLabelCreate;
    8448             : 
    8449           0 :     vgcd[11].gd.pos.x = 90; vgcd[11].gd.pos.y = vgcd[11-1].gd.pos.y-4;
    8450           0 :     vgcd[11].gd.pos.width = 50;
    8451           0 :     vgcd[11].gd.flags = gg_visible | gg_enabled;
    8452             :         /* value set later */
    8453           0 :     vgcd[11].gd.cid = CID_Vendor;
    8454           0 :     vgcd[11].creator = GTextFieldCreate;
    8455             : 
    8456           0 :     vgcd[12].gd.pos.x = 10; vgcd[12].gd.pos.y = vgcd[11].gd.pos.y+24+6;
    8457           0 :     vlabel[12].text = (unichar_t *) _("_IBM Family:");
    8458           0 :     vlabel[12].text_is_1byte = true;
    8459           0 :     vlabel[12].text_in_resource = true;
    8460           0 :     vgcd[12].gd.label = &vlabel[12];
    8461           0 :     vgcd[12].gd.flags = gg_visible | gg_enabled;
    8462           0 :     vgcd[12].creator = GLabelCreate;
    8463             : 
    8464           0 :     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;
    8465           0 :     vgcd[13].gd.flags = gg_visible | gg_enabled;
    8466           0 :     vgcd[13].gd.cid = CID_IBMFamily;
    8467           0 :     vgcd[13].gd.u.list = ibmfamily;
    8468           0 :     vgcd[13].creator = GListButtonCreate;
    8469             : 
    8470           0 :     vgcd[15].gd.pos.x = 10; vgcd[15].gd.pos.y = vgcd[11].gd.pos.y+24+6;
    8471           0 :     vlabel[15].text = (unichar_t *) _("_OS/2 Version");
    8472           0 :     vlabel[15].text_is_1byte = true;
    8473           0 :     vlabel[15].text_in_resource = true;
    8474           0 :     vgcd[15].gd.label = &vlabel[15];
    8475           0 :     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." );
    8476           0 :     vgcd[15].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8477           0 :     vgcd[15].creator = GLabelCreate;
    8478             : 
    8479           0 :     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;
    8480           0 :     vgcd[16].gd.flags = gg_visible | gg_enabled;
    8481           0 :     vgcd[16].gd.cid = CID_OS2Version;
    8482           0 :     vgcd[16].gd.u.list = os2versions;
    8483           0 :     vgcd[16].creator = GListFieldCreate;
    8484             :     
    8485           0 :     vgcd[17].gd.pos.x = 10; vgcd[17].gd.pos.y = vgcd[13].gd.pos.y+26+6;
    8486           0 :     vlabel[17].text = (unichar_t *) _("Style Map:");
    8487           0 :     vlabel[17].text_is_1byte = true;
    8488           0 :     vlabel[17].text_in_resource = true;
    8489           0 :     vgcd[17].gd.label = &vlabel[17];
    8490           0 :     vgcd[17].gd.flags = gg_visible | gg_enabled;
    8491           0 :     vgcd[17].creator = GLabelCreate;
    8492             : 
    8493           0 :     vgcd[18].gd.pos.x = 90; vgcd[18].gd.pos.y = vgcd[17].gd.pos.y-6; vgcd[18].gd.pos.width = vgcd[7].gd.pos.width;
    8494           0 :     vgcd[18].gd.flags = gg_visible | gg_enabled;
    8495           0 :     vgcd[18].gd.cid = CID_StyleMap;
    8496           0 :     vgcd[18].gd.u.list = stylemap;
    8497           0 :     vgcd[18].creator = GListButtonCreate;
    8498           0 :     stylemap[0].selected = stylemap[1].selected =
    8499           0 :             stylemap[2].selected = stylemap[3].selected =
    8500           0 :         stylemap[4].selected = stylemap[5].selected = false;
    8501           0 :     if ( sf->pfminfo.stylemap == 0x00 )
    8502           0 :         i = 1;
    8503           0 :     else if ( sf->pfminfo.stylemap == 0x40 )
    8504           0 :         i = 2;
    8505           0 :     else if ( sf->pfminfo.stylemap == 0x01 )
    8506           0 :         i = 3;
    8507           0 :     else if ( sf->pfminfo.stylemap == 0x20 )
    8508           0 :         i = 4;
    8509           0 :     else if ( sf->pfminfo.stylemap == 0x21 )
    8510           0 :         i = 5;
    8511             :     else
    8512           0 :         i = 0;
    8513           0 :     stylemap[i].selected = true;
    8514           0 :     vgcd[18].gd.label = &stylemap[i];
    8515             : 
    8516           0 :     vgcd[14].gd.pos.x = 10; vgcd[14].gd.pos.y = vgcd[18].gd.pos.y+24+6;
    8517           0 :     vlabel[14].text = (unichar_t *) _("Weight, Width, Slope Only");
    8518           0 :     vlabel[14].text_is_1byte = true;
    8519           0 :     vlabel[14].text_in_resource = true;
    8520           0 :     vgcd[14].gd.label = &vlabel[14];
    8521           0 :     vgcd[14].gd.cid = CID_WeightWidthSlopeOnly;
    8522           0 :     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)." );
    8523           0 :     vgcd[14].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8524           0 :     vgcd[14].creator = GCheckBoxCreate;
    8525             : 
    8526           0 :     vradio[0] = GCD_Glue; vradio[1] = &vgcd[8]; vradio[2] = &vgcd[9]; vradio[3] = GCD_Glue; vradio[4] = NULL;
    8527             : 
    8528           0 :     varray[0] = &vgcd[15]; varray[1] = &vgcd[16]; varray[2] = NULL;
    8529           0 :     varray[3] = &vgcd[0]; varray[4] = &vgcd[1]; varray[5] = NULL;
    8530           0 :     varray[6] = &vgcd[2]; varray[7] = &vgcd[3]; varray[8] = NULL;
    8531           0 :     varray[9] = &vgcd[4]; varray[10] = &vgcd[5]; varray[11] = NULL;
    8532           0 :     varray[12] = &vgcd[6]; varray[13] = &vgcd[7]; varray[14] = NULL;
    8533           0 :     varray[15] = &vbox[2]; varray[16] = GCD_ColSpan; varray[17] = NULL;
    8534           0 :     varray[18] = &vgcd[10]; varray[19] = &vgcd[11]; varray[20] = NULL;
    8535           0 :     varray[21] = &vgcd[12]; varray[22] = &vgcd[13]; varray[23] = NULL;
    8536           0 :     varray[24] = &vgcd[17]; varray[25] = &vgcd[18]; varray[26] = NULL;
    8537           0 :     varray[27] = &vgcd[14]; varray[28] = GCD_ColSpan; varray[29] = NULL;
    8538           0 :     varray[30] = GCD_Glue; varray[31] = GCD_Glue; varray[32] = NULL;
    8539           0 :     varray[33] = GCD_Glue; varray[34] = GCD_Glue; varray[35] = NULL;
    8540           0 :     varray[36] = varray[40] = NULL;
    8541             : 
    8542           0 :     memset(vbox,0,sizeof(vbox));
    8543           0 :     vbox[0].gd.flags = gg_enabled|gg_visible;
    8544           0 :     vbox[0].gd.u.boxelements = varray;
    8545           0 :     vbox[0].creator = GHVBoxCreate;
    8546             : 
    8547           0 :     vbox[2].gd.flags = gg_enabled|gg_visible;
    8548           0 :     vbox[2].gd.u.boxelements = vradio;
    8549           0 :     vbox[2].creator = GHBoxCreate;
    8550             : 
    8551             : /******************************************************************************/
    8552             : 
    8553           0 :     memset(&metgcd,0,sizeof(metgcd));
    8554           0 :     memset(&metlabel,'\0',sizeof(metlabel));
    8555           0 :     memset(&metarray,'\0',sizeof(metarray));
    8556             : 
    8557           0 :     i = j = 0;
    8558             : 
    8559           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = 9;
    8560           0 :     metlabel[i].text = (unichar_t *) _("Win _Ascent Offset:");
    8561           0 :     metlabel[i].text_is_1byte = true;
    8562           0 :     metlabel[i].text_in_resource = true;
    8563           0 :     metgcd[i].gd.label = &metlabel[i];
    8564           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8565           0 :     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.\n\nNote: WinDescent is a POSITIVE number for\nthings below the baseline");
    8566           0 :     metgcd[i].gd.cid = CID_WinAscentLab;
    8567           0 :     metarray[j++] = &metgcd[i];
    8568           0 :     metgcd[i++].creator = GLabelCreate;
    8569             : 
    8570           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8571           0 :     metgcd[i].gd.pos.width = 50;
    8572           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8573             :         /* value set later */
    8574           0 :     metgcd[i].gd.cid = CID_WinAscent;
    8575           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8576           0 :     metarray[j++] = &metgcd[i];
    8577           0 :     metgcd[i++].creator = GTextFieldCreate;
    8578             : 
    8579           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8580           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8581           0 :     metlabel[i].text_is_1byte = true;
    8582           0 :     metgcd[i].gd.label = &metlabel[i];
    8583           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8584             :         /* value set later */
    8585           0 :     metgcd[i].gd.cid = CID_WinAscentIsOff;
    8586           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8587           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8588           0 :     metarray[j++] = &metgcd[i];
    8589           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8590           0 :     metarray[j++] = NULL;
    8591             : 
    8592           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8593           0 :     metlabel[i].text = (unichar_t *) _("Win _Descent Offset:");
    8594           0 :     metlabel[i].text_is_1byte = true;
    8595           0 :     metlabel[i].text_in_resource = true;
    8596           0 :     metgcd[i].gd.label = &metlabel[i];
    8597           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8598           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8599           0 :     metgcd[i].gd.cid = CID_WinDescentLab;
    8600           0 :     metarray[j++] = &metgcd[i];
    8601           0 :     metgcd[i++].creator = GLabelCreate;
    8602             : 
    8603           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8604           0 :     metgcd[i].gd.pos.width = 50;
    8605           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8606             :         /* value set later */
    8607           0 :     metgcd[i].gd.cid = CID_WinDescent;
    8608           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8609           0 :     metarray[j++] = &metgcd[i];
    8610           0 :     metgcd[i++].creator = GTextFieldCreate;
    8611             : 
    8612           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8613           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8614           0 :     metlabel[i].text_is_1byte = true;
    8615           0 :     metgcd[i].gd.label = &metlabel[i];
    8616           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8617             :         /* value set later */
    8618           0 :     metgcd[i].gd.cid = CID_WinDescentIsOff;
    8619           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8620           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8621           0 :     metarray[j++] = &metgcd[i];
    8622           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8623           0 :     metarray[j++] = NULL;
    8624             : 
    8625           0 :     metgcd[i].gd.pos.x = 5; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8626           0 :     metlabel[i].text = (unichar_t *) _("Really use Typo metrics");
    8627           0 :     metlabel[i].text_is_1byte = true;
    8628           0 :     metgcd[i].gd.label = &metlabel[i];
    8629           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8630             :         /* value set later */
    8631           0 :     metgcd[i].gd.cid = CID_UseTypoMetrics;
    8632           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("The specification already says that the typo metrics should be\nused to determine line spacing. But so many\nprograms fail to follow the spec. that MS decided an additional\nbit was needed to remind them to do so.");
    8633           0 :     metarray[j++] = &metgcd[i]; metarray[j++] = GCD_ColSpan; metarray[j++] = GCD_Glue;
    8634           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8635           0 :     metarray[j++] = NULL;
    8636             : 
    8637           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8638           0 :     metlabel[i].text = (unichar_t *) _("_Typo Ascent Offset:");
    8639           0 :     metlabel[i].text_is_1byte = true;
    8640           0 :     metlabel[i].text_in_resource = true;
    8641           0 :     metgcd[i].gd.label = &metlabel[i];
    8642           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8643           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("The typo ascent&descent fields are>supposed<\nto specify the line spacing on windows.\nIn fact usually the win ascent/descent fields do.\n(The descent field is usually negative.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in OS/2.\nIf set then any number you enter will be added to the\nEm-size. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.\n\nNOTE: Typo Descent is a NEGATIVE number for\nthings below the baseline");
    8644           0 :     metgcd[i].gd.cid = CID_TypoAscentLab;
    8645           0 :     metarray[j++] = &metgcd[i];
    8646           0 :     metgcd[i++].creator = GLabelCreate;
    8647             : 
    8648           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8649           0 :     metgcd[i].gd.pos.width = 50;
    8650           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8651             :         /* value set later */
    8652           0 :     metgcd[i].gd.cid = CID_TypoAscent;
    8653           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8654           0 :     metarray[j++] = &metgcd[i];
    8655           0 :     metgcd[i++].creator = GTextFieldCreate;
    8656             : 
    8657           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8658           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8659           0 :     metlabel[i].text_is_1byte = true;
    8660           0 :     metgcd[i].gd.label = &metlabel[i];
    8661           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8662             :         /* value set later */
    8663           0 :     metgcd[i].gd.cid = CID_TypoAscentIsOff;
    8664           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8665           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8666           0 :     metarray[j++] = &metgcd[i];
    8667           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8668           0 :     metarray[j++] = NULL;
    8669             : 
    8670           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8671           0 :     metlabel[i].text = (unichar_t *) _("T_ypo Descent Offset:");
    8672           0 :     metlabel[i].text_is_1byte = true;
    8673           0 :     metlabel[i].text_in_resource = true;
    8674           0 :     metgcd[i].gd.label = &metlabel[i];
    8675           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8676           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8677           0 :     metgcd[i].gd.cid = CID_TypoDescentLab;
    8678           0 :     metarray[j++] = &metgcd[i];
    8679           0 :     metgcd[i++].creator = GLabelCreate;
    8680             : 
    8681           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8682           0 :     metgcd[i].gd.pos.width = 50;
    8683           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8684             :         /* value set later */
    8685           0 :     metgcd[i].gd.cid = CID_TypoDescent;
    8686           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8687           0 :     metarray[j++] = &metgcd[i];
    8688           0 :     metgcd[i++].creator = GTextFieldCreate;
    8689             : 
    8690           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8691           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8692           0 :     metlabel[i].text_is_1byte = true;
    8693           0 :     metgcd[i].gd.label = &metlabel[i];
    8694           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8695             :         /* value set later */
    8696           0 :     metgcd[i].gd.cid = CID_TypoDescentIsOff;
    8697           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8698           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8699           0 :     metarray[j++] = &metgcd[i];
    8700           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8701           0 :     metarray[j++] = NULL;
    8702             : 
    8703           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8704           0 :     metlabel[i].text = (unichar_t *) _("Typo Line _Gap:");
    8705           0 :     metlabel[i].text_is_1byte = true;
    8706           0 :     metlabel[i].text_in_resource = true;
    8707           0 :     metgcd[i].gd.label = &metlabel[i];
    8708           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8709           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the TypoLinegap field in the OS/2 table, used on MS Windows");
    8710           0 :     metarray[j++] = &metgcd[i];
    8711           0 :     metgcd[i++].creator = GLabelCreate;
    8712             : 
    8713           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8714           0 :     metgcd[i].gd.pos.width = 50;
    8715           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8716             :         /* Line gap value set later */
    8717           0 :     metgcd[i].gd.cid = CID_TypoLineGap;
    8718           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8719           0 :     metarray[j++] = &metgcd[i];
    8720           0 :     metgcd[i++].creator = GTextFieldCreate;
    8721           0 :     metarray[j++] = GCD_Glue;
    8722           0 :     metarray[j++] = NULL;
    8723             : 
    8724           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+4;
    8725           0 :     metlabel[i].text = (unichar_t *) _("_HHead Ascent Offset:");
    8726           0 :     metlabel[i].text_is_1byte = true;
    8727           0 :     metlabel[i].text_in_resource = true;
    8728           0 :     metgcd[i].gd.label = &metlabel[i];
    8729           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8730           0 :     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.\n\nNOTE: hhea Descent is a NEGATIVE value for things\nbelow the baseline");
    8731           0 :     metgcd[i].gd.cid = CID_HHeadAscentLab;
    8732           0 :     metarray[j++] = &metgcd[i];
    8733           0 :     metgcd[i++].creator = GLabelCreate;
    8734             : 
    8735           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8736           0 :     metgcd[i].gd.pos.width = 50;
    8737           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8738             :         /* value set later */
    8739           0 :     metgcd[i].gd.cid = CID_HHeadAscent;
    8740           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8741           0 :     metarray[j++] = &metgcd[i];
    8742           0 :     metgcd[i++].creator = GTextFieldCreate;
    8743             : 
    8744           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8745           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8746           0 :     metlabel[i].text_is_1byte = true;
    8747           0 :     metgcd[i].gd.label = &metlabel[i];
    8748           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8749             :         /* value set later */
    8750           0 :     metgcd[i].gd.cid = CID_HHeadAscentIsOff;
    8751           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8752           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8753           0 :     metarray[j++] = &metgcd[i];
    8754           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8755           0 :     metarray[j++] = NULL;
    8756             : 
    8757           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8758           0 :     metlabel[i].text = (unichar_t *) _("HHead De_scent Offset:");
    8759           0 :     metlabel[i].text_in_resource = true;
    8760           0 :     metlabel[i].text_is_1byte = true;
    8761           0 :     metgcd[i].gd.label = &metlabel[i];
    8762           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8763           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8764           0 :     metgcd[i].gd.cid = CID_HHeadDescentLab;
    8765           0 :     metarray[j++] = &metgcd[i];
    8766           0 :     metgcd[i++].creator = GLabelCreate;
    8767             : 
    8768           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8769           0 :     metgcd[i].gd.pos.width = 50;
    8770           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8771             :         /* value set later */
    8772           0 :     metgcd[i].gd.cid = CID_HHeadDescent;
    8773           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8774           0 :     metarray[j++] = &metgcd[i];
    8775           0 :     metgcd[i++].creator = GTextFieldCreate;
    8776             : 
    8777           0 :     metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
    8778           0 :     metlabel[i].text = (unichar_t *) _("Is Offset");
    8779           0 :     metlabel[i].text_is_1byte = true;
    8780           0 :     metgcd[i].gd.label = &metlabel[i];
    8781           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8782             :         /* value set later */
    8783           0 :     metgcd[i].gd.cid = CID_HHeadDescentIsOff;
    8784           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8785           0 :     metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
    8786           0 :     metarray[j++] = &metgcd[i];
    8787           0 :     metgcd[i++].creator = GCheckBoxCreate;
    8788           0 :     metarray[j++] = NULL;
    8789             : 
    8790           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
    8791           0 :     metlabel[i].text = (unichar_t *) _("HHead _Line Gap:");
    8792           0 :     metlabel[i].text_is_1byte = true;
    8793           0 :     metlabel[i].text_in_resource = true;
    8794           0 :     metgcd[i].gd.label = &metlabel[i];
    8795           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8796           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the linegap field in the hhea table, used on the mac");
    8797           0 :     metarray[j++] = &metgcd[i];
    8798           0 :     metgcd[i++].creator = GLabelCreate;
    8799             : 
    8800           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8801           0 :     metgcd[i].gd.pos.width = 50;
    8802           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8803             :         /* Line gap value set later */
    8804           0 :     metgcd[i].gd.cid = CID_LineGap;
    8805           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8806           0 :     metarray[j++] = &metgcd[i];
    8807           0 :     metgcd[i++].creator = GTextFieldCreate;
    8808           0 :     metarray[j++] = GCD_Glue;
    8809           0 :     metarray[j++] = NULL;
    8810             : 
    8811           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+6;
    8812           0 :     metlabel[i].text = (unichar_t *) _("VHead _Column Spacing:");
    8813           0 :     metlabel[i].text_is_1byte = true;
    8814           0 :     metlabel[i].text_in_resource = true;
    8815           0 :     metgcd[i].gd.label = &metlabel[i];
    8816           0 :     metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
    8817           0 :     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.");
    8818           0 :     metgcd[i].gd.cid = CID_VLineGapLab;
    8819           0 :     metarray[j++] = &metgcd[i];
    8820           0 :     metgcd[i++].creator = GLabelCreate;
    8821             : 
    8822           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-6;
    8823           0 :     metgcd[i].gd.pos.width = 50;
    8824           0 :     metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
    8825             :         /* V Line gap value set later */
    8826           0 :     metgcd[i].gd.cid = CID_VLineGap;
    8827           0 :     metgcd[i].gd.popup_msg = metgcd[17].gd.popup_msg;
    8828           0 :     metarray[j++] = &metgcd[i];
    8829           0 :     metgcd[i++].creator = GTextFieldCreate;
    8830           0 :     metarray[j++] = GCD_Glue;
    8831           0 :     metarray[j++] = NULL;
    8832             : 
    8833           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+6;
    8834           0 :     metlabel[i].text = (unichar_t *) _("Ca_pital Height:");
    8835           0 :     metlabel[i].text_is_1byte = true;
    8836           0 :     metlabel[i].text_in_resource = true;
    8837           0 :     metgcd[i].gd.label = &metlabel[i];
    8838           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8839           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("This denotes the height of X.");
    8840           0 :     metgcd[i].gd.cid = CID_CapHeightLab;
    8841           0 :     metarray[j++] = &metgcd[i];
    8842           0 :     metgcd[i++].creator = GLabelCreate;
    8843             : 
    8844           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8845           0 :     metgcd[i].gd.pos.width = 50;
    8846           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8847             :         /* value set later */
    8848           0 :     metgcd[i].gd.cid = CID_CapHeight;
    8849           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8850           0 :     metarray[j++] = &metgcd[i];
    8851           0 :     metgcd[i++].creator = GTextFieldCreate;
    8852           0 :     metarray[j++] = GCD_Glue;
    8853           0 :     metarray[j++] = NULL;
    8854             : 
    8855           0 :     metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+6;
    8856           0 :     metlabel[i].text = (unichar_t *) _("_X Height:");
    8857           0 :     metlabel[i].text_is_1byte = true;
    8858           0 :     metlabel[i].text_in_resource = true;
    8859           0 :     metgcd[i].gd.label = &metlabel[i];
    8860           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8861           0 :     metgcd[i].gd.popup_msg = (unichar_t *) _("This denotes the height of x.");
    8862           0 :     metgcd[i].gd.cid = CID_XHeightLab;
    8863           0 :     metarray[j++] = &metgcd[i];
    8864           0 :     metgcd[i++].creator = GLabelCreate;
    8865             : 
    8866           0 :     metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
    8867           0 :     metgcd[i].gd.pos.width = 50;
    8868           0 :     metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    8869             :         /* value set later */
    8870           0 :     metgcd[i].gd.cid = CID_XHeight;
    8871           0 :     metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
    8872           0 :     metarray[j++] = &metgcd[i];
    8873           0 :     metgcd[i++].creator = GTextFieldCreate;
    8874           0 :     metarray[j++] = GCD_Glue;
    8875           0 :     metarray[j++] = NULL;
    8876             : 
    8877           0 :     metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue;
    8878             : 
    8879           0 :     metarray[j++] = NULL; metarray[j++] = NULL;
    8880             : 
    8881           0 :     memset(metbox,0,sizeof(metbox));
    8882           0 :     metbox[0].gd.flags = gg_enabled|gg_visible;
    8883           0 :     metbox[0].gd.u.boxelements = metarray;
    8884           0 :     metbox[0].creator = GHVBoxCreate;
    8885             : /******************************************************************************/
    8886             : 
    8887           0 :     memset(&ssgcd,0,sizeof(ssgcd));
    8888           0 :     memset(&sslabel,'\0',sizeof(sslabel));
    8889             : 
    8890           0 :     i = j = 0;
    8891             : 
    8892           0 :     ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = 5;
    8893           0 :     sslabel[i].text = (unichar_t *) S_("SubscriptSuperUse|Default");
    8894           0 :     sslabel[i].text_is_1byte = true;
    8895           0 :     ssgcd[i].gd.label = &sslabel[i];
    8896           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8897             :         /* value set later */
    8898           0 :     ssgcd[i].gd.cid = CID_SubSuperDefault;
    8899           0 :     ssgcd[i].gd.handle_controlevent = GFI_SubSuperDefault;
    8900           0 :     ssarray[j++] = &ssgcd[i];
    8901           0 :     ssgcd[i++].creator = GCheckBoxCreate;
    8902           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
    8903           0 :     ssarray[j++] = NULL;
    8904             : 
    8905           0 :     ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+16;
    8906           0 :     sslabel[i].text = (unichar_t *) _("Subscript");
    8907           0 :     sslabel[i].text_is_1byte = true;
    8908           0 :     ssgcd[i].gd.label = &sslabel[i];
    8909           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8910           0 :     ssarray[j++] = &ssgcd[i];
    8911           0 :     ssgcd[i++].creator = GLabelCreate;
    8912             : 
    8913           0 :     ssgcd[i].gd.pos.x = 120; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-4;
    8914             : /* GT: X is a coordinate, the leading spaces help to align it */
    8915           0 :     sslabel[i].text = (unichar_t *) _("  X");
    8916           0 :     sslabel[i].text_is_1byte = true;
    8917           0 :     ssgcd[i].gd.label = &sslabel[i];
    8918           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8919           0 :     ssarray[j++] = &ssgcd[i];
    8920           0 :     ssgcd[i++].creator = GLabelCreate;
    8921             : 
    8922           0 :     ssgcd[i].gd.pos.x = 180; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
    8923             : /* GT: Y is a coordinate, the leading spaces help to align it */
    8924           0 :     sslabel[i].text = (unichar_t *) _("Y");
    8925           0 :     sslabel[i].text_is_1byte = true;
    8926           0 :     ssgcd[i].gd.label = &sslabel[i];
    8927           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8928           0 :     ssarray[j++] = &ssgcd[i];
    8929           0 :     ssgcd[i++].creator = GLabelCreate;
    8930           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    8931             : 
    8932           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+14+4;
    8933           0 :     sslabel[i].text = (unichar_t *) _("Size");
    8934           0 :     sslabel[i].text_is_1byte = true;
    8935           0 :     ssgcd[i].gd.label = &sslabel[i];
    8936           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8937           0 :     ssarray[j++] = &ssgcd[i];
    8938           0 :     ssgcd[i++].creator = GLabelCreate;
    8939             : 
    8940           0 :     ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    8941           0 :     ssgcd[i].gd.pos.width = 50;
    8942           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8943             :         /* set later */
    8944           0 :     ssgcd[i].gd.cid = CID_SubXSize;
    8945           0 :     ssarray[j++] = &ssgcd[i];
    8946           0 :     ssgcd[i++].creator = GTextFieldCreate;
    8947             : 
    8948           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
    8949           0 :     ssgcd[i].gd.pos.width = 50;
    8950           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8951             :         /* set later */
    8952           0 :     ssgcd[i].gd.cid = CID_SubYSize;
    8953           0 :     ssarray[j++] = &ssgcd[i];
    8954           0 :     ssgcd[i++].creator = GTextFieldCreate;
    8955           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    8956             : 
    8957           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
    8958           0 :     sslabel[i].text = (unichar_t *) _("Offset");
    8959           0 :     sslabel[i].text_is_1byte = true;
    8960           0 :     ssgcd[i].gd.label = &sslabel[i];
    8961           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8962           0 :     ssarray[j++] = &ssgcd[i];
    8963           0 :     ssgcd[i++].creator = GLabelCreate;
    8964             : 
    8965           0 :     ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    8966           0 :     ssgcd[i].gd.pos.width = 50;
    8967           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8968             :         /* set later */
    8969           0 :     ssgcd[i].gd.cid = CID_SubXOffset;
    8970           0 :     ssarray[j++] = &ssgcd[i];
    8971           0 :     ssgcd[i++].creator = GTextFieldCreate;
    8972             : 
    8973           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
    8974           0 :     ssgcd[i].gd.pos.width = 50;
    8975           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8976             :         /* set later */
    8977           0 :     ssgcd[i].gd.cid = CID_SubYOffset;
    8978           0 :     ssarray[j++] = &ssgcd[i];
    8979           0 :     ssgcd[i++].creator = GTextFieldCreate;
    8980           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    8981             : 
    8982             : 
    8983           0 :     ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
    8984           0 :     sslabel[i].text = (unichar_t *) _("Superscript");
    8985           0 :     sslabel[i].text_is_1byte = true;
    8986           0 :     ssgcd[i].gd.label = &sslabel[i];
    8987           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8988           0 :     ssarray[j++] = &ssgcd[i];
    8989           0 :     ssgcd[i++].creator = GLabelCreate;
    8990           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
    8991           0 :     ssarray[j++] = NULL;
    8992             : 
    8993           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
    8994           0 :     sslabel[i].text = (unichar_t *) _("Size");
    8995           0 :     sslabel[i].text_is_1byte = true;
    8996           0 :     ssgcd[i].gd.label = &sslabel[i];
    8997           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    8998           0 :     ssarray[j++] = &ssgcd[i];
    8999           0 :     ssgcd[i++].creator = GLabelCreate;
    9000             : 
    9001           0 :     ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    9002           0 :     ssgcd[i].gd.pos.width = 50;
    9003           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9004             :         /* set later */
    9005           0 :     ssgcd[i].gd.cid = CID_SuperXSize;
    9006           0 :     ssarray[j++] = &ssgcd[i];
    9007           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9008             : 
    9009           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
    9010           0 :     ssgcd[i].gd.pos.width = 50;
    9011           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9012             :         /* set later */
    9013           0 :     ssgcd[i].gd.cid = CID_SuperYSize;
    9014           0 :     ssarray[j++] = &ssgcd[i];
    9015           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9016           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    9017             : 
    9018           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
    9019           0 :     sslabel[i].text = (unichar_t *) _("Offset");
    9020           0 :     sslabel[i].text_is_1byte = true;
    9021           0 :     ssgcd[i].gd.label = &sslabel[i];
    9022           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9023           0 :     ssarray[j++] = &ssgcd[i];
    9024           0 :     ssgcd[i++].creator = GLabelCreate;
    9025             : 
    9026           0 :     ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    9027           0 :     ssgcd[i].gd.pos.width = 50;
    9028           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9029             :         /* set later */
    9030           0 :     ssgcd[i].gd.cid = CID_SuperXOffset;
    9031           0 :     ssarray[j++] = &ssgcd[i];
    9032           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9033             : 
    9034           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
    9035           0 :     ssgcd[i].gd.pos.width = 50;
    9036           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9037             :         /* set later */
    9038           0 :     ssgcd[i].gd.cid = CID_SuperYOffset;
    9039           0 :     ssarray[j++] = &ssgcd[i];
    9040           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9041           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    9042             : 
    9043             : 
    9044           0 :     ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
    9045           0 :     sslabel[i].text = (unichar_t *) _("Strikeout");
    9046           0 :     sslabel[i].text_is_1byte = true;
    9047           0 :     ssgcd[i].gd.label = &sslabel[i];
    9048           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9049           0 :     ssarray[j++] = &ssgcd[i];
    9050           0 :     ssgcd[i++].creator = GLabelCreate;
    9051           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
    9052           0 :     ssarray[j++] = NULL;
    9053             : 
    9054           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
    9055           0 :     sslabel[i].text = (unichar_t *) _("Size");
    9056           0 :     sslabel[i].text_is_1byte = true;
    9057           0 :     ssgcd[i].gd.label = &sslabel[i];
    9058           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9059           0 :     ssarray[j++] = &ssgcd[i];
    9060           0 :     ssgcd[i++].creator = GLabelCreate;
    9061           0 :     ssarray[j++] = GCD_Glue;
    9062             : 
    9063           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    9064           0 :     ssgcd[i].gd.pos.width = 50;
    9065           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9066             :         /* set later */
    9067           0 :     ssgcd[i].gd.cid = CID_StrikeoutSize;
    9068           0 :     ssarray[j++] = &ssgcd[i];
    9069           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9070           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    9071             : 
    9072           0 :     ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-2].gd.pos.y+26;
    9073           0 :     sslabel[i].text = (unichar_t *) _("Pos");
    9074           0 :     sslabel[i].text_is_1byte = true;
    9075           0 :     ssgcd[i].gd.label = &sslabel[i];
    9076           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9077           0 :     ssarray[j++] = &ssgcd[i];
    9078           0 :     ssgcd[i++].creator = GLabelCreate;
    9079           0 :     ssarray[j++] = GCD_Glue;
    9080             : 
    9081           0 :     ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
    9082           0 :     ssgcd[i].gd.pos.width = 50;
    9083           0 :     ssgcd[i].gd.flags = gg_visible | gg_enabled;
    9084             :         /* set later */
    9085           0 :     ssgcd[i].gd.cid = CID_StrikeoutPos;
    9086           0 :     ssarray[j++] = &ssgcd[i];
    9087           0 :     ssgcd[i++].creator = GTextFieldCreate;
    9088           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
    9089             : 
    9090           0 :     ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
    9091             : 
    9092           0 :     ssarray[j++] = NULL; ssarray[j++] = NULL;
    9093             : 
    9094           0 :     memset(ssbox,0,sizeof(ssbox));
    9095           0 :     ssbox[0].gd.flags = gg_enabled|gg_visible;
    9096           0 :     ssbox[0].gd.u.boxelements = ssarray;
    9097           0 :     ssbox[0].creator = GHVBoxCreate;
    9098             : /******************************************************************************/
    9099           0 :     memset(&panlabel,0,sizeof(panlabel));
    9100           0 :     memset(&pangcd,0,sizeof(pangcd));
    9101             : 
    9102           0 :     if ( small_blue_box.main_foreground==0 ) {
    9103             :         extern void _GButtonInit(void);
    9104           0 :         _GButtonInit();
    9105           0 :         small_blue_box = _GGadget_button_box;
    9106           0 :         small_blue_box.border_type = bt_box;
    9107           0 :         small_blue_box.border_shape = bs_rect;
    9108           0 :         small_blue_box.border_width = 1;
    9109           0 :         small_blue_box.flags = 0;
    9110           0 :         small_blue_box.padding = 0;
    9111           0 :         small_blue_box.main_foreground = 0x0000ff;
    9112           0 :         small_blue_box.border_darker = small_blue_box.main_foreground;
    9113           0 :         small_blue_box.border_darkest = small_blue_box.border_brighter =
    9114           0 :                 small_blue_box.border_brightest =
    9115           0 :                 small_blue_box.main_background = GDrawGetDefaultBackground(NULL);
    9116             :     }
    9117             : 
    9118           0 :     i = j = 0;
    9119             : 
    9120           0 :     pangcd[i].gd.pos.x = 5; pangcd[i].gd.pos.y = 5;
    9121           0 :     panlabel[i].text = (unichar_t *) S_("PanoseUse|Default");
    9122           0 :     panlabel[i].text_is_1byte = true;
    9123           0 :     pangcd[i].gd.label = &panlabel[i];
    9124           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9125             :         /* value set later */
    9126           0 :     pangcd[i].gd.cid = CID_PanDefault;
    9127             :     /*pangcd[i].gd.popup_msg = pangcd[i-1].gd.popup_msg;*/
    9128           0 :     pangcd[i].gd.handle_controlevent = GFI_PanoseDefault;
    9129           0 :     panarray[j++] = &pangcd[i];
    9130           0 :     pangcd[i++].creator = GCheckBoxCreate;
    9131             : 
    9132           0 :     panlabel[i].text = (unichar_t *) _( "http://panose.com/");
    9133           0 :     panlabel[i].text_is_1byte = true;
    9134           0 :     pangcd[i].gd.label = &panlabel[i];
    9135           0 :     pangcd[i].gd.pos.x = 12; ugcd[1].gd.pos.y = 10;
    9136           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled | gg_dontcopybox;
    9137           0 :     pangcd[i].gd.box = &small_blue_box;
    9138           0 :     pangcd[i].gd.handle_controlevent = GFI_ShowPanoseDocs;
    9139           0 :     pangcd[i++].creator = GButtonCreate;
    9140           0 :     panarray[j++] = &pangcd[i-1]; panarray[j++] = NULL;
    9141             : 
    9142           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+14+4;
    9143           0 :     panlabel[i].text = (unichar_t *) S_("Panose|_Family Kind");
    9144           0 :     panlabel[i].text_is_1byte = true;
    9145           0 :     panlabel[i].text_in_resource = true;
    9146           0 :     pangcd[i].gd.label = &panlabel[i];
    9147           0 :     pangcd[i].gd.cid = CID_PanFamilyLab;
    9148           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9149           0 :     panarray[j++] = &pangcd[i];
    9150           0 :     pangcd[i++].creator = GLabelCreate;
    9151             : 
    9152           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9153           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9154           0 :     pangcd[i].gd.cid = CID_PanFamily;
    9155           0 :     pangcd[i].gd.u.list = panfamily;
    9156           0 :     panarray[j++] = &pangcd[i];
    9157           0 :     pangcd[i].gd.handle_controlevent = GFI_ChangePanoseFamily;
    9158           0 :     pangcd[i++].creator = GListButtonCreate;
    9159           0 :     panarray[j++] = NULL;
    9160             : 
    9161           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9162           0 :     panlabel[i].text = (unichar_t *) _("_Serifs");
    9163           0 :     panlabel[i].text_is_1byte = true;
    9164           0 :     panlabel[i].text_in_resource = true;
    9165           0 :     pangcd[i].gd.label = &panlabel[i];
    9166           0 :     pangcd[i].gd.cid = CID_PanSerifsLab;
    9167           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9168           0 :     panarray[j++] = &pangcd[i];
    9169           0 :     pangcd[i++].creator = GLabelCreate;
    9170             : 
    9171           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9172           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9173           0 :     pangcd[i].gd.cid = CID_PanSerifs;
    9174           0 :     pangcd[i].gd.u.list = panserifs;
    9175           0 :     panarray[j++] = &pangcd[i];
    9176           0 :     pangcd[i++].creator = GListButtonCreate;
    9177           0 :     panarray[j++] = NULL;
    9178             : 
    9179           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9180           0 :     panlabel[i].text = (unichar_t *) S_("Panose|_Weight");
    9181           0 :     panlabel[i].text_is_1byte = true;
    9182           0 :     panlabel[i].text_in_resource = true;
    9183           0 :     pangcd[i].gd.label = &panlabel[i];
    9184           0 :     pangcd[i].gd.cid = CID_PanWeightLab;
    9185           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9186           0 :     panarray[j++] = &pangcd[i];
    9187           0 :     pangcd[i++].creator = GLabelCreate;
    9188             : 
    9189           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9190           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9191           0 :     pangcd[i].gd.cid = CID_PanWeight;
    9192           0 :     pangcd[i].gd.u.list = panweight;
    9193           0 :     panarray[j++] = &pangcd[i];
    9194           0 :     pangcd[i++].creator = GListButtonCreate;
    9195           0 :     panarray[j++] = NULL;
    9196             : 
    9197           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9198           0 :     panlabel[i].text = (unichar_t *) _("_Proportion");
    9199           0 :     panlabel[i].text_is_1byte = true;
    9200           0 :     panlabel[i].text_in_resource = true;
    9201           0 :     pangcd[i].gd.label = &panlabel[i];
    9202           0 :     pangcd[i].gd.cid = CID_PanPropLab;
    9203           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9204           0 :     panarray[j++] = &pangcd[i];
    9205           0 :     pangcd[i++].creator = GLabelCreate;
    9206             : 
    9207           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9208           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9209           0 :     pangcd[i].gd.cid = CID_PanProp;
    9210           0 :     pangcd[i].gd.u.list = panprop;
    9211           0 :     panarray[j++] = &pangcd[i];
    9212           0 :     pangcd[i++].creator = GListButtonCreate;
    9213           0 :     panarray[j++] = NULL;
    9214             : 
    9215           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9216           0 :     panlabel[i].text = (unichar_t *) _("_Contrast");
    9217           0 :     panlabel[i].text_is_1byte = true;
    9218           0 :     panlabel[i].text_in_resource = true;
    9219           0 :     pangcd[i].gd.label = &panlabel[i];
    9220           0 :     pangcd[i].gd.cid = CID_PanContrastLab;
    9221           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9222           0 :     panarray[j++] = &pangcd[i];
    9223           0 :     pangcd[i++].creator = GLabelCreate;
    9224             : 
    9225           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9226           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9227           0 :     pangcd[i].gd.cid = CID_PanContrast;
    9228           0 :     pangcd[i].gd.u.list = pancontrast;
    9229           0 :     panarray[j++] = &pangcd[i];
    9230           0 :     pangcd[i++].creator = GListButtonCreate;
    9231           0 :     panarray[j++] = NULL;
    9232             : 
    9233           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9234           0 :     panlabel[i].text = (unichar_t *) _("Stroke _Variation");
    9235           0 :     panlabel[i].text_is_1byte = true;
    9236           0 :     panlabel[i].text_in_resource = true;
    9237           0 :     pangcd[i].gd.label = &panlabel[i];
    9238           0 :     pangcd[i].gd.cid = CID_PanStrokeVarLab;
    9239           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9240           0 :     panarray[j++] = &pangcd[i];
    9241           0 :     pangcd[i++].creator = GLabelCreate;
    9242             : 
    9243           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9244           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9245           0 :     pangcd[i].gd.cid = CID_PanStrokeVar;
    9246           0 :     pangcd[i].gd.u.list = panstrokevar;
    9247           0 :     panarray[j++] = &pangcd[i];
    9248           0 :     pangcd[i++].creator = GListButtonCreate;
    9249           0 :     panarray[j++] = NULL;
    9250             : 
    9251           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9252           0 :     panlabel[i].text = (unichar_t *) _("_Arm Style");
    9253           0 :     panlabel[i].text_is_1byte = true;
    9254           0 :     panlabel[i].text_in_resource = true;
    9255           0 :     pangcd[i].gd.label = &panlabel[i];
    9256           0 :     pangcd[i].gd.cid = CID_PanArmStyleLab;
    9257           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9258           0 :     panarray[j++] = &pangcd[i];
    9259           0 :     pangcd[i++].creator = GLabelCreate;
    9260             : 
    9261           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9262           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9263           0 :     pangcd[i].gd.cid = CID_PanArmStyle;
    9264           0 :     pangcd[i].gd.u.list = panarmstyle;
    9265           0 :     panarray[j++] = &pangcd[i];
    9266           0 :     pangcd[i++].creator = GListButtonCreate;
    9267           0 :     panarray[j++] = NULL;
    9268             : 
    9269           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9270           0 :     panlabel[i].text = (unichar_t *) _("_Letterform");
    9271           0 :     panlabel[i].text_is_1byte = true;
    9272           0 :     panlabel[i].text_in_resource = true;
    9273           0 :     pangcd[i].gd.label = &panlabel[i];
    9274           0 :     pangcd[i].gd.cid = CID_PanLetterformLab;
    9275           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9276           0 :     panarray[j++] = &pangcd[i];
    9277           0 :     pangcd[i++].creator = GLabelCreate;
    9278             : 
    9279           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9280           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9281           0 :     pangcd[i].gd.cid = CID_PanLetterform;
    9282           0 :     pangcd[i].gd.u.list = panletterform;
    9283           0 :     panarray[j++] = &pangcd[i];
    9284           0 :     pangcd[i++].creator = GListButtonCreate;
    9285           0 :     panarray[j++] = NULL;
    9286             : 
    9287           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9288           0 :     panlabel[i].text = (unichar_t *) _("_Midline");
    9289           0 :     panlabel[i].text_is_1byte = true;
    9290           0 :     panlabel[i].text_in_resource = true;
    9291           0 :     pangcd[i].gd.label = &panlabel[i];
    9292           0 :     pangcd[i].gd.cid = CID_PanMidLineLab;
    9293           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9294           0 :     panarray[j++] = &pangcd[i];
    9295           0 :     pangcd[i++].creator = GLabelCreate;
    9296             : 
    9297           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9298           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9299           0 :     pangcd[i].gd.cid = CID_PanMidLine;
    9300           0 :     pangcd[i].gd.u.list = panmidline;
    9301           0 :     panarray[j++] = &pangcd[i];
    9302           0 :     pangcd[i++].creator = GListButtonCreate;
    9303           0 :     panarray[j++] = NULL;
    9304             : 
    9305           0 :     pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
    9306           0 :     panlabel[i].text = (unichar_t *) _("_X-Height");
    9307           0 :     panlabel[i].text_is_1byte = true;
    9308           0 :     panlabel[i].text_in_resource = true;
    9309           0 :     pangcd[i].gd.label = &panlabel[i];
    9310           0 :     pangcd[i].gd.cid = CID_PanXHeightLab;
    9311           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9312           0 :     panarray[j++] = &pangcd[i];
    9313           0 :     pangcd[i++].creator = GLabelCreate;
    9314             : 
    9315           0 :     pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
    9316           0 :     pangcd[i].gd.flags = gg_visible | gg_enabled;
    9317           0 :     pangcd[i].gd.cid = CID_PanXHeight;
    9318           0 :     pangcd[i].gd.u.list = panxheight;
    9319           0 :     panarray[j++] = &pangcd[i];
    9320           0 :     pangcd[i++].creator = GListButtonCreate;
    9321           0 :     panarray[j++] = NULL;
    9322             : 
    9323           0 :     panarray[j++] = GCD_Glue; panarray[j++] = GCD_Glue;
    9324             : 
    9325           0 :     panarray[j++] = NULL; panarray[j++] = NULL;
    9326             : 
    9327           0 :     memset(panbox,0,sizeof(panbox));
    9328           0 :     panbox[0].gd.flags = gg_enabled|gg_visible;
    9329           0 :     panbox[0].gd.u.boxelements = panarray;
    9330           0 :     panbox[0].creator = GHVBoxCreate;
    9331             : /******************************************************************************/
    9332           0 :     memset(cgcd,0,sizeof(cgcd));
    9333           0 :     memset(clabel,0,sizeof(clabel));
    9334           0 :     memset(cbox,0,sizeof(cbox));
    9335             : 
    9336           0 :     i = j = 0;
    9337           0 :     clabel[i].text = (unichar_t *) _("Unicode Ranges:");
    9338           0 :     clabel[i].text_is_1byte = true;
    9339           0 :     cgcd[i].gd.label = &clabel[i];
    9340           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled;
    9341           0 :     cgcd[i++].creator = GLabelCreate;
    9342           0 :     charray1[0] = &cgcd[i-1];
    9343             : 
    9344           0 :     clabel[i].text = (unichar_t *) _("Default");
    9345           0 :     clabel[i].text_is_1byte = true;
    9346           0 :     cgcd[i].gd.label = &clabel[i];
    9347           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled;
    9348           0 :     if ( !sf->pfminfo.hasunicoderanges ) {
    9349           0 :         cgcd[i].gd.flags = gg_visible | gg_enabled | gg_cb_on;
    9350           0 :         OS2FigureUnicodeRanges(sf,sf->pfminfo.unicoderanges);
    9351             :     }
    9352           0 :     cgcd[i].gd.cid = CID_URangesDefault;
    9353           0 :     cgcd[i].gd.handle_controlevent = OS2_URangesDefault;
    9354           0 :     cgcd[i++].creator = GCheckBoxCreate;
    9355           0 :     charray1[1] = &cgcd[i-1]; charray1[2] = GCD_Glue; charray1[3] = NULL;
    9356             : 
    9357           0 :     cbox[2].gd.flags = gg_enabled|gg_visible;
    9358           0 :     cbox[2].gd.u.boxelements = charray1;
    9359           0 :     cbox[2].creator = GHBoxCreate;
    9360           0 :     cvarray[j++] = &cbox[2];
    9361             : 
    9362           0 :     sprintf( ranges, "%08x.%08x.%08x.%08x",
    9363             :             sf->pfminfo.unicoderanges[3], sf->pfminfo.unicoderanges[2],
    9364             :             sf->pfminfo.unicoderanges[1], sf->pfminfo.unicoderanges[0]);
    9365           0 :     clabel[i].text = (unichar_t *) ranges;
    9366           0 :     clabel[i].text_is_1byte = true;
    9367           0 :     cgcd[i].gd.label = &clabel[i];
    9368           0 :     cgcd[i].gd.pos.width = 270;
    9369           0 :     cgcd[i].gd.flags = /* gg_visible |*/ gg_enabled;
    9370           0 :     if ( !sf->pfminfo.hasunicoderanges )
    9371           0 :         cgcd[i].gd.flags = /* gg_visible*/ 0;
    9372           0 :     cgcd[i].gd.cid = CID_UnicodeRanges;
    9373           0 :     cgcd[i].gd.handle_controlevent = OS2_UnicodeChange;
    9374           0 :     cgcd[i++].creator = GTextFieldCreate;
    9375           0 :     cvarray[j++] = &cgcd[i-1];
    9376             : 
    9377           0 :     cgcd[i].gd.pos.width = 220; cgcd[i].gd.pos.height = 6*12+10;
    9378           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
    9379           0 :     if ( !sf->pfminfo.hasunicoderanges )
    9380           0 :         cgcd[i].gd.flags = gg_visible | gg_list_multiplesel;
    9381           0 :     cgcd[i].gd.cid = CID_UnicodeList;
    9382           0 :     cgcd[i].gd.u.list = unicoderangenames;
    9383           0 :     cgcd[i].gd.handle_controlevent = OS2_UnicodeChange;
    9384           0 :     cgcd[i++].creator = GListCreate;
    9385           0 :     cvarray[j++] = &cgcd[i-1];
    9386             : 
    9387           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled ;
    9388           0 :     cgcd[i++].creator = GLineCreate;
    9389           0 :     cvarray[j++] = &cgcd[i-1];
    9390             : 
    9391           0 :     clabel[i].text = (unichar_t *) _("MS Code Pages:");
    9392           0 :     clabel[i].text_is_1byte = true;
    9393           0 :     cgcd[i].gd.label = &clabel[i];
    9394           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled;
    9395           0 :     cgcd[i++].creator = GLabelCreate;
    9396           0 :     charray2[0] = &cgcd[i-1];
    9397             : 
    9398           0 :     clabel[i].text = (unichar_t *) _("Default");
    9399           0 :     clabel[i].text_is_1byte = true;
    9400           0 :     cgcd[i].gd.label = &clabel[i];
    9401           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled;
    9402           0 :     if ( !sf->pfminfo.hascodepages ) {
    9403           0 :         cgcd[i].gd.flags = gg_visible | gg_enabled | gg_cb_on;
    9404           0 :         OS2FigureCodePages(sf,sf->pfminfo.codepages);
    9405             :     }
    9406           0 :     cgcd[i].gd.cid = CID_CPageDefault;
    9407           0 :     cgcd[i].gd.handle_controlevent = OS2_CPageDefault;
    9408           0 :     cgcd[i++].creator = GCheckBoxCreate;
    9409           0 :     charray2[1] = &cgcd[i-1]; charray2[2] = GCD_Glue; charray2[3] = NULL;
    9410             : 
    9411           0 :     cbox[3].gd.flags = gg_enabled|gg_visible;
    9412           0 :     cbox[3].gd.u.boxelements = charray2;
    9413           0 :     cbox[3].creator = GHBoxCreate;
    9414           0 :     cvarray[j++] = &cbox[3];
    9415             : 
    9416           0 :     sprintf( codepages, "%08x.%08x",
    9417             :             sf->pfminfo.codepages[1], sf->pfminfo.codepages[0]);
    9418           0 :     clabel[i].text = (unichar_t *) codepages;
    9419           0 :     clabel[i].text_is_1byte = true;
    9420           0 :     cgcd[i].gd.label = &clabel[i];
    9421           0 :     cgcd[i].gd.pos.width = 140;
    9422           0 :     cgcd[i].gd.flags = /*gg_visible |*/ gg_enabled;
    9423           0 :     if ( !sf->pfminfo.hascodepages )
    9424           0 :         cgcd[i].gd.flags = /*gg_visible*/ 0;
    9425           0 :     cgcd[i].gd.cid = CID_CodePageRanges;
    9426           0 :     cgcd[i].gd.handle_controlevent = OS2_CodePageChange;
    9427           0 :     cgcd[i++].creator = GTextFieldCreate;
    9428           0 :     cvarray2[0] = &cgcd[i-1]; cvarray2[1] = GCD_Glue; cvarray2[2] = NULL;
    9429             : 
    9430           0 :     cbox[4].gd.flags = gg_enabled|gg_visible;
    9431           0 :     cbox[4].gd.u.boxelements = cvarray2;
    9432           0 :     cbox[4].creator = GVBoxCreate;
    9433           0 :     charray3[0] = &cbox[4];
    9434             : 
    9435           0 :     cgcd[i].gd.pos.width = 200; cgcd[i].gd.pos.height = 6*12+10;
    9436           0 :     cgcd[i].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
    9437           0 :     if ( !sf->pfminfo.hascodepages )
    9438           0 :         cgcd[i].gd.flags = gg_visible | gg_list_multiplesel;
    9439           0 :     cgcd[i].gd.cid = CID_CodePageList;
    9440           0 :     cgcd[i].gd.u.list = codepagenames;
    9441           0 :     cgcd[i].gd.handle_controlevent = OS2_CodePageChange;
    9442           0 :     cgcd[i++].creator = GListCreate;
    9443           0 :     charray3[1] = &cgcd[i-1]; charray3[2] = NULL;
    9444             : 
    9445           0 :     cbox[5].gd.flags = gg_enabled|gg_visible;
    9446           0 :     cbox[5].gd.u.boxelements = charray3;
    9447           0 :     cbox[5].creator = GHBoxCreate;
    9448           0 :     cvarray[j++] = &cbox[5]; cvarray[j++] = GCD_Glue; cvarray[j++] = NULL;
    9449             : 
    9450           0 :     cbox[0].gd.flags = gg_enabled|gg_visible;
    9451           0 :     cbox[0].gd.u.boxelements = cvarray;
    9452           0 :     cbox[0].creator = GVBoxCreate;
    9453             : 
    9454             : /******************************************************************************/
    9455             : 
    9456           0 :     memset(&vagcd,0,sizeof(vagcd));
    9457           0 :     memset(&vaspects,'\0',sizeof(vaspects));
    9458             : 
    9459           0 :     i = 0;
    9460           0 :     vaspects[i].text = (unichar_t *) _("Misc.");
    9461           0 :     vaspects[i].text_is_1byte = true;
    9462           0 :     vaspects[i++].gcd = vbox;
    9463             : 
    9464           0 :     vaspects[i].text = (unichar_t *) _("Metrics");
    9465           0 :     vaspects[i].text_is_1byte = true;
    9466           0 :     vaspects[i++].gcd = metbox;
    9467             : 
    9468           0 :     vaspects[i].text = (unichar_t *) _("Sub/Super");
    9469           0 :     vaspects[i].text_is_1byte = true;
    9470           0 :     vaspects[i++].gcd = ssbox;
    9471             : 
    9472           0 :     vaspects[i].text = (unichar_t *) _("Panose");
    9473           0 :     vaspects[i].text_is_1byte = true;
    9474           0 :     vaspects[i++].gcd = panbox;
    9475             : 
    9476           0 :     vaspects[i].text = (unichar_t *) _("Charsets");
    9477           0 :     vaspects[i].text_is_1byte = true;
    9478           0 :     vaspects[i++].gcd = cbox;
    9479             : 
    9480           0 :     vagcd[0].gd.pos.x = 4; vagcd[0].gd.pos.y = 6;
    9481           0 :     vagcd[0].gd.pos.width = 252;
    9482           0 :     vagcd[0].gd.pos.height = 300;
    9483           0 :     vagcd[0].gd.u.tabs = vaspects;
    9484           0 :     vagcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_scroll;
    9485             :     /*vagcd[0].gd.handle_controlevent = GFI_TTFAspectChange;*/
    9486           0 :     vagcd[0].gd.cid = CID_TTFTabs;
    9487           0 :     vagcd[0].creator = GTabSetCreate;
    9488             : 
    9489             : /******************************************************************************/
    9490           0 :     memset(&gaspboxes,0,sizeof(gaspboxes));
    9491           0 :     memset(&gaspgcd,0,sizeof(gaspgcd));
    9492           0 :     memset(&gasplabel,0,sizeof(gasplabel));
    9493           0 :     memset(&gaspgcd_def,0,sizeof(gaspgcd_def));
    9494             : 
    9495           0 :     GaspMatrixInit(&gaspmi,d);
    9496             : 
    9497           0 :     i = j = 0;
    9498             : 
    9499           0 :     gasplabel[i].text = (unichar_t *) S_("Gasp|_Version");
    9500           0 :     gasplabel[i].text_is_1byte = true;
    9501           0 :     gasplabel[i].text_in_resource = true;
    9502           0 :     gaspgcd[i].gd.label = &gasplabel[i];
    9503           0 :     gaspgcd[i].gd.flags = gg_visible | gg_enabled;
    9504           0 :     gaspharray[j++] = &gaspgcd[i];
    9505           0 :     gaspgcd[i++].creator = GLabelCreate;
    9506             : 
    9507           0 :     for ( g=0; gaspversions[g].text!=NULL; ++g )
    9508           0 :         gaspversions[g].selected = false;
    9509           0 :     g = ( sf->gasp_version>=0 && sf->gasp_version<g ) ? sf->gasp_version : 0;
    9510             : 
    9511           0 :     gaspversions[g].selected = true;
    9512           0 :     gaspgcd[i].gd.flags = gg_visible | gg_enabled;
    9513           0 :     gaspgcd[i].gd.cid = CID_GaspVersion;
    9514           0 :     gaspgcd[i].gd.label = &gaspversions[g];
    9515           0 :     gaspgcd[i].gd.u.list = gaspversions;
    9516           0 :     gaspharray[j++] = &gaspgcd[i];
    9517           0 :     gaspgcd[i].gd.handle_controlevent = GFI_GaspVersion;
    9518           0 :     gaspgcd[i++].creator = GListButtonCreate;
    9519           0 :     gaspharray[j++] = GCD_HPad10;
    9520             : 
    9521           0 :     gasplabel[i].text = (unichar_t *) _("Optimized For ClearType");
    9522           0 :     gasplabel[i].text_is_1byte = true;
    9523           0 :     gasplabel[i].text_in_resource = true;
    9524           0 :     gaspgcd[i].gd.label = &gasplabel[i];
    9525           0 :     gaspgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9526           0 :     gaspgcd[i].gd.cid = CID_HeadClearType;
    9527           0 :     if ( sf->head_optimized_for_cleartype )
    9528           0 :         gaspgcd[i].gd.flags |= gg_cb_on;
    9529           0 :     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");
    9530           0 :     gaspharray[j++] = &gaspgcd[i];
    9531           0 :     gaspgcd[i++].creator = GCheckBoxCreate;
    9532           0 :     gaspharray[j++] = NULL;
    9533             : 
    9534           0 :     gaspboxes[2].gd.flags = gg_enabled|gg_visible;
    9535           0 :     gaspboxes[2].gd.u.boxelements = gaspharray;
    9536           0 :     gaspboxes[2].creator = GHBoxCreate;
    9537             : 
    9538           0 :     gaspvarray[0] = &gaspboxes[2];
    9539             : 
    9540           0 :     gaspgcd[i].gd.pos.width = 300; gaspgcd[i].gd.pos.height = 200;
    9541           0 :     gaspgcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
    9542           0 :     gaspgcd[i].gd.cid = CID_Gasp;
    9543           0 :     gaspgcd[i].gd.u.matrix = &gaspmi;
    9544           0 :     gaspgcd[i].gd.popup_msg = (unichar_t *) _(
    9545             :         "The 'gasp' table gives you control over when grid-fitting and\n"
    9546             :         "anti-aliased rasterizing are done.\n"
    9547             :         "The table consists of an (ordered) list of pixel sizes each with\n"
    9548             :         "a set of flags. Those flags apply to all pixel sizes bigger than\n"
    9549             :         "the previous table entry but less than or equal to the current.\n"
    9550             :         "The list must be terminated with a pixel size of 65535.\n"
    9551             :         "Version 1 of the table contains two additional flags that\n"
    9552             :         "apply to MS's ClearType rasterizer.\n\n"
    9553             :         "The 'gasp' table only applies to truetype fonts.");
    9554           0 :     gaspgcd[i].data = d;
    9555           0 :     gaspgcd[i].creator = GMatrixEditCreate;
    9556           0 :     gaspvarray[1] = &gaspgcd[i];
    9557           0 :     gaspvarray[2] = NULL;
    9558             : 
    9559           0 :     gaspboxes[0].gd.flags = gg_enabled|gg_visible;
    9560           0 :     gaspboxes[0].gd.u.boxelements = gaspvarray;
    9561           0 :     gaspboxes[0].creator = GVBoxCreate;
    9562             : 
    9563           0 :     gaspgcd_def[0].gd.flags = gg_visible | gg_enabled;
    9564           0 :     gasplabel[4].text = (unichar_t *) S_("Gasp|_Default");
    9565           0 :     gasplabel[4].text_is_1byte = true;
    9566           0 :     gasplabel[4].text_in_resource = true;
    9567           0 :     gaspgcd_def[0].gd.label = &gasplabel[4];
    9568           0 :     gaspgcd_def[0].gd.handle_controlevent = Gasp_Default;
    9569           0 :     gaspgcd_def[0].creator = GButtonCreate;
    9570             : /******************************************************************************/
    9571           0 :     memset(&tnlabel,0,sizeof(tnlabel));
    9572           0 :     memset(&tngcd,0,sizeof(tngcd));
    9573           0 :     memset(&tnboxes,0,sizeof(tnboxes));
    9574             : 
    9575           0 :     TNMatrixInit(&mi,d);
    9576             : 
    9577           0 :     tngcd[0].gd.pos.x = 5; tngcd[0].gd.pos.y = 6;
    9578           0 :     tngcd[0].gd.flags = gg_visible | gg_enabled;
    9579           0 :     tnlabel[0].text = (unichar_t *) _("Sort By:");
    9580           0 :     tnlabel[0].text_is_1byte = true;
    9581           0 :     tngcd[0].gd.label = &tnlabel[0];
    9582           0 :     tngcd[0].creator = GLabelCreate;
    9583           0 :     tnharray[0] = &tngcd[0];
    9584             : 
    9585           0 :     tngcd[1].gd.pos.x = 50; tngcd[1].gd.pos.y = tngcd[0].gd.pos.y-4;
    9586           0 :     tngcd[1].gd.flags = gg_enabled | gg_visible;
    9587           0 :     tngcd[1].gd.cid = CID_TNLangSort;
    9588           0 :     tnlabel[1].text = (unichar_t *) _("_Language");
    9589           0 :     tnlabel[1].text_is_1byte = true;
    9590           0 :     tnlabel[1].text_in_resource = true;
    9591           0 :     tngcd[1].gd.label = &tnlabel[1];
    9592           0 :     tngcd[1].creator = GRadioCreate;
    9593           0 :     tngcd[1].gd.handle_controlevent = GFI_SortBy;
    9594           0 :     tnharray[1] = &tngcd[1];
    9595             : 
    9596           0 :     tngcd[2].gd.pos.x = 120; tngcd[2].gd.pos.y = tngcd[1].gd.pos.y;
    9597           0 :     tngcd[2].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
    9598           0 :     tngcd[2].gd.cid = CID_TNStringSort;
    9599           0 :     tnlabel[2].text = (unichar_t *) _("_String Type");
    9600           0 :     tnlabel[2].text_is_1byte = true;
    9601           0 :     tnlabel[2].text_in_resource = true;
    9602           0 :     tngcd[2].gd.label = &tnlabel[2];
    9603           0 :     tngcd[2].creator = GRadioCreate;
    9604           0 :     tngcd[2].gd.handle_controlevent = GFI_SortBy;
    9605           0 :     tnharray[2] = &tngcd[2];
    9606             : 
    9607           0 :     tngcd[3].gd.pos.x = 195; tngcd[3].gd.pos.y = tngcd[1].gd.pos.y;
    9608           0 :     tngcd[3].gd.flags = gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold;
    9609           0 :     tnlabel[3].text = (unichar_t *) S_("SortingScheme|Default");
    9610           0 :     tnlabel[3].text_is_1byte = true;
    9611           0 :     tngcd[3].gd.label = &tnlabel[3];
    9612           0 :     tngcd[3].creator = GRadioCreate;
    9613           0 :     tngcd[3].gd.handle_controlevent = GFI_SortBy;
    9614           0 :     tnharray[3] = &tngcd[3]; tnharray[4] = GCD_Glue; tnharray[5] = NULL;
    9615             : 
    9616           0 :     tngcd[4].gd.pos.x = 10; tngcd[4].gd.pos.y = tngcd[1].gd.pos.y+14;
    9617           0 :     tngcd[4].gd.pos.width = 300; tngcd[4].gd.pos.height = 200;
    9618           0 :     tngcd[4].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
    9619           0 :     tngcd[4].gd.cid = CID_TNames;
    9620           0 :     tngcd[4].gd.u.matrix = &mi;
    9621           0 :     tngcd[4].gd.popup_msg = (unichar_t *) _(
    9622             :         "To create a new name, left click on the <New> button, and select a locale.\n"
    9623             :         "To change the locale, left click on it.\n"
    9624             :         "To change the string type, left click on it.\n"
    9625             :         "To change the text, left click in it and then type.\n"
    9626             :         "To delete a name, right click on the name & select Delete from the menu.\n"
    9627             :         "To associate or disassociate a truetype name to its postscript equivalent\n"
    9628             :         "right click and select the appropriate menu item." );
    9629           0 :     tngcd[4].data = d;
    9630           0 :     tngcd[4].creator = GMatrixEditCreate;
    9631             : 
    9632           0 :     tngcd[5].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9633             : /* GT: when translating this please leave the "SIL Open Font License" in */
    9634             : /* GT: English (possibly translating it in parentheses). I believe there */
    9635             : /* GT: are legal reasons for this. */
    9636             : /* GT: So "Añadir SIL Open Font License (licencia de fuentes libres)" */
    9637           0 :     tnlabel[5].text = (unichar_t *) S_("Add OFL");
    9638           0 :     tnlabel[5].image_precedes = false;
    9639           0 :     tnlabel[5].image = &OFL_logo;
    9640           0 :     tnlabel[5].text_is_1byte = true;
    9641           0 :     tnlabel[5].text_in_resource = true;
    9642           0 :     tngcd[5].gd.label = &tnlabel[5];
    9643           0 :     tngcd[5].gd.handle_controlevent = GFI_AddOFL;
    9644           0 :     tngcd[5].gd.popup_msg = (unichar_t *) _(
    9645             :         "Click here to add the OFL metadata to your own font in the License and License URL fields. \n"
    9646             :         "Then click on the License field to fill in the placeholders in sync with OFL.txt. \n");
    9647           0 :     tngcd[5].creator = GButtonCreate;
    9648             : 
    9649           0 :     tngcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9650           0 :     tnlabel[6].text = (unichar_t *) S_("scripts.sil.org/OFL");
    9651           0 :     tnlabel[6].text_is_1byte = true;
    9652           0 :     tnlabel[6].text_in_resource = true;
    9653           0 :     tngcd[6].gd.label = &tnlabel[6];
    9654           0 :     tngcd[6].gd.handle_controlevent = GFI_HelpOFL;
    9655           0 :     tngcd[6].gd.popup_msg = (unichar_t *) _(
    9656             :         "Click here for more information about the OFL (SIL Open Font License) \n"
    9657             :         "including the corresponding FAQ. \n");
    9658           0 :     tngcd[6].creator = GButtonCreate;
    9659           0 :     tnharray2[0] = &tngcd[5]; tnharray2[1] = &tngcd[6]; tnharray2[2] = GCD_Glue; tnharray2[3] = NULL;
    9660           0 :     tnvarray[0] = &tnboxes[2]; tnvarray[1] = &tngcd[4]; tnvarray[2] = &tnboxes[3]; tnvarray[3] = NULL;
    9661             : 
    9662           0 :     tnboxes[0].gd.flags = gg_enabled|gg_visible;
    9663           0 :     tnboxes[0].gd.u.boxelements = tnvarray;
    9664           0 :     tnboxes[0].creator = GVBoxCreate;
    9665             : 
    9666           0 :     tnboxes[2].gd.flags = gg_enabled|gg_visible;
    9667           0 :     tnboxes[2].gd.u.boxelements = tnharray;
    9668           0 :     tnboxes[2].creator = GHBoxCreate;
    9669             : 
    9670           0 :     tnboxes[3].gd.flags = gg_enabled|gg_visible;
    9671           0 :     tnboxes[3].gd.u.boxelements = tnharray2;
    9672           0 :     tnboxes[3].creator = GHBoxCreate;
    9673             : /******************************************************************************/
    9674           0 :     memset(&ssnlabel,0,sizeof(ssnlabel));
    9675           0 :     memset(&ssngcd,0,sizeof(ssngcd));
    9676           0 :     memset(&ssboxes,0,sizeof(ssboxes));
    9677             : 
    9678           0 :     SSMatrixInit(&ssmi,d);
    9679             : 
    9680           0 :     ssngcd[0].gd.flags = gg_visible | gg_enabled;
    9681           0 :     ssnlabel[0].text = (unichar_t *) _("The OpenType Style Set features ('ss01'-'ss20') may\n"
    9682             :                                       "be assigned human readable names here.");
    9683           0 :     ssnlabel[0].text_is_1byte = true;
    9684           0 :     ssngcd[0].gd.label = &ssnlabel[0];
    9685           0 :     ssngcd[0].creator = GLabelCreate;
    9686           0 :     ssvarray[0] = &ssngcd[0];
    9687             : 
    9688           0 :     ssngcd[1].gd.pos.width = 300; ssngcd[1].gd.pos.height = 200;
    9689           0 :     ssngcd[1].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
    9690           0 :     ssngcd[1].gd.cid = CID_SSNames;
    9691           0 :     ssngcd[1].gd.u.matrix = &ssmi;
    9692           0 :     ssngcd[1].gd.popup_msg = (unichar_t *) _(
    9693             :         "To create a new name, left click on the <New> button, and select a locale (language).\n"
    9694             :         "To change the locale, left click on it.\n"
    9695             :         "To change the feature, left click on it.\n"
    9696             :         "To change the text, left click in it and then type.\n"
    9697             :         );
    9698           0 :     ssngcd[1].data = d;
    9699           0 :     ssngcd[1].creator = GMatrixEditCreate;
    9700           0 :     ssvarray[1] = &ssngcd[1]; ssvarray[2] = NULL;
    9701             : 
    9702           0 :     ssboxes[0].gd.flags = gg_enabled|gg_visible;
    9703           0 :     ssboxes[0].gd.u.boxelements = ssvarray;
    9704           0 :     ssboxes[0].creator = GVBoxCreate;
    9705             : /******************************************************************************/
    9706           0 :     memset(&comlabel,0,sizeof(comlabel));
    9707           0 :     memset(&comgcd,0,sizeof(comgcd));
    9708             : 
    9709           0 :     comgcd[0].gd.flags = gg_visible | gg_enabled;
    9710           0 :     comlabel[0].text = (unichar_t *) _("The font comment can contain whatever you feel it should");
    9711           0 :     comlabel[0].text_is_1byte = true;
    9712           0 :     comgcd[0].gd.label = &comlabel[0];
    9713           0 :     comgcd[0].creator = GLabelCreate;
    9714             : 
    9715           0 :     comgcd[1].gd.pos.x = 10; comgcd[1].gd.pos.y = 10;
    9716           0 :     comgcd[1].gd.pos.width = ngcd[11].gd.pos.width; comgcd[1].gd.pos.height = 230;
    9717           0 :     comgcd[1].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap | gg_text_xim;
    9718           0 :     comgcd[1].gd.cid = CID_Comment;
    9719           0 :     comlabel[1].text = (unichar_t *) sf->comments;
    9720           0 :     comlabel[1].text_is_1byte = true;
    9721           0 :     if ( comlabel[1].text==NULL ) comlabel[1].text = (unichar_t *) "";
    9722           0 :     comgcd[1].gd.label = &comlabel[1];
    9723           0 :     comgcd[1].creator = GTextAreaCreate;
    9724             : 
    9725           0 :     comarray[0] = &comgcd[0]; comarray[1] = &comgcd[1]; comarray[2] = NULL;
    9726           0 :     memset(combox,0,sizeof(combox));
    9727           0 :     combox[0].gd.flags = gg_enabled|gg_visible;
    9728           0 :     combox[0].gd.u.boxelements = comarray;
    9729           0 :     combox[0].creator = GVBoxCreate;
    9730             : 
    9731             : /******************************************************************************/
    9732           0 :     memset(&floglabel,0,sizeof(floglabel));
    9733           0 :     memset(&floggcd,0,sizeof(floggcd));
    9734             : 
    9735           0 :     floggcd[0].gd.flags = gg_visible | gg_enabled;
    9736           0 :     floglabel[0].text = (unichar_t *) _("The FONTLOG contains some description of the \n font project, a detailed changelog, and a list of contributors");
    9737           0 :     floglabel[0].text_is_1byte = true;
    9738           0 :     floggcd[0].gd.label = &floglabel[0];
    9739           0 :     floggcd[0].creator = GLabelCreate;
    9740             : 
    9741           0 :     floggcd[1].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap | gg_text_xim;
    9742           0 :     floggcd[1].gd.cid = CID_FontLog;
    9743           0 :     floglabel[1].text = (unichar_t *) sf->fontlog;
    9744           0 :     floglabel[1].text_is_1byte = true;
    9745           0 :     if ( floglabel[1].text==NULL ) floglabel[1].text = (unichar_t *) "";
    9746           0 :     floggcd[1].gd.label = &floglabel[1];
    9747           0 :     floggcd[1].creator = GTextAreaCreate;
    9748             : 
    9749           0 :     flogarray[0] = &floggcd[0]; flogarray[1] = &floggcd[1]; flogarray[2] = NULL;
    9750           0 :     memset(flogbox,0,sizeof(flogbox));
    9751           0 :     flogbox[0].gd.flags = gg_enabled|gg_visible;
    9752           0 :     flogbox[0].gd.u.boxelements = flogarray;
    9753           0 :     flogbox[0].creator = GVBoxCreate;
    9754             : 
    9755             : /******************************************************************************/
    9756           0 :     memset(&mklabel,0,sizeof(mklabel));
    9757           0 :     memset(&mkgcd,0,sizeof(mkgcd));
    9758             : 
    9759           0 :     mklabel[0].text = (unichar_t *) _(
    9760             :         "These are not Anchor Classes. For them see the \"Lookups\" pane.\n"
    9761             :         "(Mark Classes can control when lookups are active, they do NOT\n"
    9762             :         " position glyphs.)");
    9763           0 :     mklabel[0].text_is_1byte = true;
    9764           0 :     mkgcd[0].gd.label = &mklabel[0];
    9765           0 :     mkgcd[0].gd.flags = gg_visible | gg_enabled;
    9766           0 :     mkgcd[0].creator = GLabelCreate;
    9767             : 
    9768           0 :     memset(&markc_mi,0,sizeof(markc_mi));
    9769           0 :     markc_mi.col_cnt = 2;
    9770           0 :     markc_mi.col_init = markc_ci;
    9771             : 
    9772             :     /* Class 0 is unused */
    9773           0 :     markc_md = calloc(sf->mark_class_cnt+1,2*sizeof(struct matrix_data));
    9774           0 :     for ( i=1; i<sf->mark_class_cnt; ++i ) {
    9775           0 :         markc_md[2*(i-1)+0].u.md_str = copy(sf->mark_class_names[i]);
    9776           0 :         markc_md[2*(i-1)+1].u.md_str = SFNameList2NameUni(sf,sf->mark_classes[i]);
    9777             :     }
    9778           0 :     markc_mi.matrix_data = markc_md;
    9779           0 :     markc_mi.initial_row_cnt = sf->mark_class_cnt>0?sf->mark_class_cnt-1:0;
    9780           0 :     markc_mi.finishedit = GFI_Mark_FinishEdit;
    9781             : 
    9782           0 :     mkgcd[1].gd.pos.x = 10; mkgcd[1].gd.pos.y = 10;
    9783           0 :     mkgcd[1].gd.pos.width = ngcd[15].gd.pos.width; mkgcd[1].gd.pos.height = 200;
    9784           0 :     mkgcd[1].gd.flags = gg_visible | gg_enabled;
    9785           0 :     mkgcd[1].gd.cid = CID_MarkClasses;
    9786           0 :     mkgcd[1].gd.u.matrix = &markc_mi;
    9787           0 :     mkgcd[1].creator = GMatrixEditCreate;
    9788             : 
    9789           0 :     mkgcd[2].gd.pos.x = 10; mkgcd[2].gd.pos.y = mkgcd[1].gd.pos.y+mkgcd[1].gd.pos.height+4;
    9790           0 :     mkgcd[2].gd.pos.width = -1;
    9791           0 :     mkgcd[2].gd.flags = gg_visible | gg_enabled;
    9792             : 
    9793           0 :     mkarray[0] = &mkgcd[0]; mkarray[1] = &mkgcd[1];
    9794           0 :       mkarray[2] = NULL;
    9795           0 :     memset(mkbox,0,sizeof(mkbox));
    9796           0 :     mkbox[0].gd.flags = gg_enabled|gg_visible;
    9797           0 :     mkbox[0].gd.u.boxelements = mkarray;
    9798           0 :     mkbox[0].creator = GVBoxCreate;
    9799             : /******************************************************************************/
    9800           0 :     memset(&mslabel,0,sizeof(mslabel));
    9801           0 :     memset(&msgcd,0,sizeof(msgcd));
    9802             : 
    9803           0 :     mslabel[0].text = (unichar_t *) _(
    9804             :         "These are not Anchor Classes. For them see the \"Lookups\" pane.\n"
    9805             :         "(Mark Sets, like Mark Classes can control when lookups are active,\n"
    9806             :         " they do NOT position glyphs.)");
    9807           0 :     mslabel[0].text_is_1byte = true;
    9808           0 :     msgcd[0].gd.label = &mslabel[0];
    9809           0 :     msgcd[0].gd.flags = gg_visible | gg_enabled;
    9810           0 :     msgcd[0].creator = GLabelCreate;
    9811             : 
    9812           0 :     memset(&marks_mi,0,sizeof(marks_mi));
    9813           0 :     marks_mi.col_cnt = 2;
    9814           0 :     marks_mi.col_init = marks_ci;
    9815             : 
    9816             :     /* Set 0 is used */
    9817           0 :     marks_md = calloc(sf->mark_set_cnt+1,2*sizeof(struct matrix_data));
    9818           0 :     for ( i=0; i<sf->mark_set_cnt; ++i ) {
    9819           0 :         marks_md[2*i+0].u.md_str = copy(sf->mark_set_names[i]);
    9820           0 :         marks_md[2*i+1].u.md_str = SFNameList2NameUni(sf,sf->mark_sets[i]);
    9821             :     }
    9822           0 :     marks_mi.matrix_data = marks_md;
    9823           0 :     marks_mi.initial_row_cnt = sf->mark_set_cnt;
    9824           0 :     marks_mi.finishedit = GFI_Mark_FinishEdit;
    9825             : 
    9826           0 :     msgcd[1].gd.pos.x = 10; msgcd[1].gd.pos.y = 10;
    9827           0 :     msgcd[1].gd.pos.width = ngcd[15].gd.pos.width; msgcd[1].gd.pos.height = 200;
    9828           0 :     msgcd[1].gd.flags = gg_visible | gg_enabled;
    9829           0 :     msgcd[1].gd.cid = CID_MarkSets;
    9830           0 :     msgcd[1].gd.u.matrix = &marks_mi;
    9831           0 :     msgcd[1].creator = GMatrixEditCreate;
    9832             : 
    9833           0 :     msarray[0] = &msgcd[0]; msarray[1] = &msgcd[1];
    9834           0 :       msarray[2] = NULL;
    9835           0 :     memset(msbox,0,sizeof(msbox));
    9836           0 :     msbox[0].gd.flags = gg_enabled|gg_visible;
    9837           0 :     msbox[0].gd.u.boxelements = msarray;
    9838           0 :     msbox[0].creator = GVBoxCreate;
    9839             : /******************************************************************************/
    9840           0 :     memset(&wofflabel,0,sizeof(wofflabel));
    9841           0 :     memset(&woffgcd,0,sizeof(woffgcd));
    9842             : 
    9843           0 :     wofflabel[0].text = (unichar_t *) _("Version, Major:");
    9844           0 :     wofflabel[0].text_is_1byte = true;
    9845           0 :     woffgcd[0].gd.label = &wofflabel[0];
    9846           0 :     woffgcd[0].gd.flags = gg_visible | gg_enabled;
    9847           0 :     woffgcd[0].creator = GLabelCreate;
    9848             : 
    9849           0 :     woffmajorbuf[0]='\0';
    9850           0 :     woffminorbuf[0]='\0';
    9851           0 :     if ( sf->woffMajor!=woffUnset ) {
    9852           0 :         sprintf( woffmajorbuf, "%d", sf->woffMajor );
    9853           0 :         sprintf( woffminorbuf, "%d", sf->woffMinor );
    9854             :     }
    9855           0 :     woffgcd[1].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9856           0 :     wofflabel[1].text = (unichar_t *) woffmajorbuf;
    9857           0 :     wofflabel[1].text_is_1byte = true;
    9858           0 :     woffgcd[1].gd.label = &wofflabel[1];
    9859           0 :     woffgcd[1].gd.cid = CID_WoffMajor;
    9860           0 :     woffgcd[1].gd.popup_msg = (unichar_t *) _("If you leave this field blank FontForge will use a default based on\neither the version string, or one in the 'name' table." );
    9861           0 :     woffgcd[1].creator = GTextFieldCreate;
    9862             : 
    9863           0 :     wofflabel[2].text = (unichar_t *) _("Minor:");
    9864           0 :     wofflabel[2].text_is_1byte = true;
    9865           0 :     woffgcd[2].gd.label = &wofflabel[2];
    9866           0 :     woffgcd[2].gd.flags = gg_visible | gg_enabled;
    9867           0 :     woffgcd[2].creator = GLabelCreate;
    9868             : 
    9869           0 :     woffgcd[3].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9870           0 :     wofflabel[3].text = (unichar_t *) woffminorbuf;
    9871           0 :     wofflabel[3].text_is_1byte = true;
    9872           0 :     woffgcd[3].gd.label = &wofflabel[3];
    9873           0 :     woffgcd[3].gd.cid = CID_WoffMinor;
    9874           0 :     woffgcd[3].gd.popup_msg = (unichar_t *) _("If you leave this field blank FontForge will use a default based on\neither the version string, or one in the 'name' table." );
    9875           0 :     woffgcd[3].creator = GTextFieldCreate;
    9876             : 
    9877           0 :     woffarray[0] = &woffgcd[0];
    9878           0 :     woffarray[1] = &woffgcd[1];
    9879           0 :     woffarray[2] = &woffgcd[2];
    9880           0 :     woffarray[3] = &woffgcd[3];
    9881           0 :     woffarray[4] = NULL;
    9882             : 
    9883           0 :     wofflabel[4].text = (unichar_t *) _("Metadata (xml):");
    9884           0 :     wofflabel[4].text_is_1byte = true;
    9885           0 :     woffgcd[4].gd.label = &wofflabel[4];
    9886           0 :     woffgcd[4].gd.flags = gg_visible | gg_enabled;
    9887           0 :     woffgcd[4].creator = GLabelCreate;
    9888             : 
    9889           0 :     woffarray[5] = &woffgcd[4];
    9890           0 :     woffarray[6] = GCD_ColSpan;
    9891           0 :     woffarray[7] = GCD_ColSpan;
    9892           0 :     woffarray[8] = GCD_ColSpan;
    9893           0 :     woffarray[9] = NULL;
    9894             : 
    9895           0 :     woffgcd[5].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
    9896           0 :     if ( sf->woffMetadata!=NULL ) {
    9897           0 :         wofflabel[5].text = (unichar_t *) sf->woffMetadata;
    9898           0 :         wofflabel[5].text_is_1byte = true;
    9899           0 :         woffgcd[5].gd.label = &wofflabel[5];
    9900             :     }
    9901           0 :     woffgcd[5].gd.cid = CID_WoffMetadata;
    9902           0 :     woffgcd[5].creator = GTextAreaCreate;
    9903             : 
    9904           0 :     woffarray[10] = &woffgcd[5];
    9905           0 :     woffarray[11] = GCD_ColSpan;
    9906           0 :     woffarray[12] = GCD_ColSpan;
    9907           0 :     woffarray[13] = GCD_ColSpan;
    9908           0 :     woffarray[14] = NULL;
    9909           0 :     woffarray[15] = NULL;
    9910             : 
    9911           0 :     memset(woffbox,0,sizeof(woffbox));
    9912           0 :     woffbox[0].gd.flags = gg_enabled|gg_visible;
    9913           0 :     woffbox[0].gd.u.boxelements = woffarray;
    9914           0 :     woffbox[0].creator = GHVBoxCreate;
    9915             : /******************************************************************************/
    9916           0 :     memset(&txlabel,0,sizeof(txlabel));
    9917           0 :     memset(&txgcd,0,sizeof(txgcd));
    9918             : 
    9919           0 :     k=0;
    9920           0 :     txlabel[k].text = (unichar_t *) U_("ΤεΧ General");
    9921           0 :     txlabel[k].text_is_1byte = true;
    9922           0 :     txgcd[k].gd.label = &txlabel[k];
    9923           0 :     txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = 10;
    9924           0 :     txgcd[k].gd.flags = gg_visible | gg_enabled;
    9925           0 :     txgcd[k].gd.cid = CID_TeXText;
    9926           0 :     txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
    9927           0 :     txgcd[k++].creator = GRadioCreate;
    9928             : 
    9929           0 :     txlabel[k].text = (unichar_t *) U_("ΤεΧ Math Symbol");
    9930           0 :     txlabel[k].text_is_1byte = true;
    9931           0 :     txgcd[k].gd.label = &txlabel[k];
    9932           0 :     txgcd[k].gd.pos.x = 80; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
    9933           0 :     txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
    9934           0 :     txgcd[k].gd.cid = CID_TeXMathSym;
    9935           0 :     txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
    9936           0 :     txgcd[k++].creator = GRadioCreate;
    9937             : 
    9938           0 :     txlabel[k].text = (unichar_t *) U_("ΤεΧ Math Extension");
    9939           0 :     txlabel[k].text_is_1byte = true;
    9940           0 :     txgcd[k].gd.label = &txlabel[k];
    9941           0 :     txgcd[k].gd.pos.x = 155; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
    9942           0 :     txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
    9943           0 :     txgcd[k].gd.cid = CID_TeXMathExt;
    9944           0 :     txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
    9945           0 :     txgcd[k++].creator = GRadioCreate;
    9946             : 
    9947           0 :     for ( i=j=0; texparams[i]!=0; ++i ) {
    9948           0 :         txlabel[k].text = (unichar_t *) texparams[i];
    9949           0 :         txlabel[k].text_is_1byte = true;
    9950           0 :         txgcd[k].gd.label = &txlabel[k];
    9951           0 :         txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = txgcd[k-2].gd.pos.y+26;
    9952           0 :         txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
    9953           0 :         txgcd[k].gd.popup_msg = (unichar_t *) texpopups[i];
    9954           0 :         txarray2[j++] = &txgcd[k];
    9955           0 :         txgcd[k++].creator = GLabelCreate;
    9956             : 
    9957           0 :         txgcd[k].gd.pos.x = 70; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y-4;
    9958           0 :         txgcd[k].gd.flags = gg_visible | gg_enabled;
    9959           0 :         txgcd[k].gd.cid = CID_TeX + i;
    9960           0 :         txarray2[j++] = &txgcd[k];
    9961           0 :         txgcd[k++].creator = GTextFieldCreate;
    9962           0 :         txarray2[j++] = GCD_Glue;
    9963           0 :         txarray2[j++] = NULL;
    9964             :     }
    9965           0 :     txgcd[k-2].gd.cid = CID_TeXExtraSpLabel;
    9966           0 :     txarray2[j++] = NULL;
    9967             : 
    9968             : /* GT: More Parameters */
    9969           0 :     txlabel[k].text = (unichar_t *) _("More Params");
    9970           0 :     txlabel[k].text_is_1byte = true;
    9971           0 :     txgcd[k].gd.label = &txlabel[k];
    9972           0 :     txgcd[k].gd.pos.x = 20; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+26;
    9973           0 :     txgcd[k].gd.flags = gg_visible | gg_enabled;
    9974           0 :     txgcd[k].gd.handle_controlevent = GFI_MoreParams;
    9975           0 :     txgcd[k].gd.cid = CID_MoreParams;
    9976           0 :     txgcd[k++].creator = GButtonCreate;
    9977             : 
    9978           0 :     txarray[0] = &txbox[2]; txarray[1] = &txbox[3]; txarray[2] = &txbox[4]; txarray[3] = GCD_Glue; txarray[4] = NULL;
    9979           0 :     txarray3[0] = &txgcd[0]; txarray3[1] = GCD_Glue; txarray3[2] = &txgcd[1];
    9980           0 :      txarray3[3] = GCD_Glue; txarray3[4] = &txgcd[2]; txarray3[5] = NULL;
    9981           0 :     txarray4[0] = GCD_Glue; txarray4[1] = &txgcd[k-1];
    9982           0 :      txarray4[2] = txarray4[3] = txarray4[4] = GCD_Glue; txarray4[5] = NULL;
    9983           0 :     memset(txbox,0,sizeof(txbox));
    9984           0 :     txbox[0].gd.flags = gg_enabled|gg_visible;
    9985           0 :     txbox[0].gd.u.boxelements = txarray;
    9986           0 :     txbox[0].creator = GVBoxCreate;
    9987             : 
    9988           0 :     txbox[2].gd.flags = gg_enabled|gg_visible;
    9989           0 :     txbox[2].gd.u.boxelements = txarray3;
    9990           0 :     txbox[2].creator = GHBoxCreate;
    9991             : 
    9992           0 :     txbox[3].gd.flags = gg_enabled|gg_visible;
    9993           0 :     txbox[3].gd.u.boxelements = txarray2;
    9994           0 :     txbox[3].gd.cid = CID_TeXBox;
    9995           0 :     txbox[3].creator = GHVBoxCreate;
    9996             : 
    9997           0 :     txbox[4].gd.flags = gg_enabled|gg_visible;
    9998           0 :     txbox[4].gd.u.boxelements = txarray4;
    9999           0 :     txbox[4].creator = GHBoxCreate;
   10000             : /******************************************************************************/
   10001           0 :     memset(&szlabel,0,sizeof(szlabel));
   10002           0 :     memset(&szgcd,0,sizeof(szgcd));
   10003           0 :     SizeMatrixInit(&sizemi,d);
   10004             : 
   10005           0 :     k=0;
   10006             : 
   10007           0 :     szlabel[k].text = (unichar_t *) _("De_sign Size:");
   10008           0 :     szlabel[k].text_is_1byte = true;
   10009           0 :     szlabel[k].text_in_resource = true;
   10010           0 :     szgcd[k].gd.label = &szlabel[k];
   10011           0 :     szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = 9;
   10012           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10013           0 :     szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
   10014           0 :     szgcd[k++].creator = GLabelCreate;
   10015             : 
   10016           0 :     sprintf(dszbuf, "%.1f", sf->design_size/10.0);
   10017           0 :     szlabel[k].text = (unichar_t *) dszbuf;
   10018           0 :     szlabel[k].text_is_1byte = true;
   10019           0 :     szgcd[k].gd.label = &szlabel[k];
   10020           0 :     szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
   10021           0 :     szgcd[k].gd.pos.width = 60;
   10022           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled;
   10023           0 :     szgcd[k].gd.cid = CID_DesignSize;
   10024           0 :     szgcd[k++].creator = GTextFieldCreate;
   10025             : 
   10026           0 :     szlabel[k].text = (unichar_t *) S_("Size|Points");
   10027           0 :     szlabel[k].text_is_1byte = true;
   10028           0 :     szgcd[k].gd.label = &szlabel[k];
   10029           0 :     szgcd[k].gd.pos.x = 134; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
   10030           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10031           0 :     szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
   10032           0 :     szgcd[k++].creator = GLabelCreate;
   10033             : 
   10034           0 :     szlabel[k].text = (unichar_t *) _("Design Range");
   10035           0 :     szlabel[k].text_is_1byte = true;
   10036           0 :     szgcd[k].gd.label = &szlabel[k];
   10037           0 :     szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+24;
   10038           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10039           0 :     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.");
   10040           0 :     szgcd[k++].creator = GLabelCreate;
   10041             : 
   10042           0 :     szgcd[k].gd.pos.x = 8; szgcd[k].gd.pos.y = GDrawPointsToPixels(NULL,szgcd[k-1].gd.pos.y+6);
   10043           0 :     szgcd[k].gd.pos.width = pos.width-32; szgcd[k].gd.pos.height = GDrawPointsToPixels(NULL,36);
   10044           0 :     szgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
   10045           0 :     szgcd[k++].creator = GGroupCreate;
   10046             : 
   10047           0 :     szlabel[k].text = (unichar_t *) _("_Bottom:");
   10048           0 :     szlabel[k].text_is_1byte = true;
   10049           0 :     szlabel[k].text_in_resource = true;
   10050           0 :     szgcd[k].gd.label = &szlabel[k];
   10051           0 :     szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+18;
   10052           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10053           0 :     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.");
   10054           0 :     szgcd[k++].creator = GLabelCreate;
   10055             : 
   10056           0 :     sprintf(dsbbuf, "%.1f", sf->design_range_bottom/10.0);
   10057           0 :     szlabel[k].text = (unichar_t *) dsbbuf;
   10058           0 :     szlabel[k].text_is_1byte = true;
   10059           0 :     szgcd[k].gd.label = &szlabel[k];
   10060           0 :     szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
   10061           0 :     szgcd[k].gd.pos.width = 60;
   10062           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled;
   10063           0 :     szgcd[k].gd.cid = CID_DesignBottom;
   10064           0 :     szgcd[k++].creator = GTextFieldCreate;
   10065             : 
   10066           0 :     szlabel[k].text = (unichar_t *) _("_Top:");
   10067           0 :     szlabel[k].text_is_1byte = true;
   10068           0 :     szlabel[k].text_in_resource = true;
   10069           0 :     szgcd[k].gd.label = &szlabel[k];
   10070           0 :     szgcd[k].gd.pos.x = 140; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
   10071           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10072           0 :     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.");
   10073           0 :     szgcd[k++].creator = GLabelCreate;
   10074             : 
   10075           0 :     sprintf(dstbuf, "%.1f", sf->design_range_top/10.0);
   10076           0 :     szlabel[k].text = (unichar_t *) dstbuf;
   10077           0 :     szlabel[k].text_is_1byte = true;
   10078           0 :     szgcd[k].gd.label = &szlabel[k];
   10079           0 :     szgcd[k].gd.pos.x = 180; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
   10080           0 :     szgcd[k].gd.pos.width = 60;
   10081           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled;
   10082           0 :     szgcd[k].gd.cid = CID_DesignTop;
   10083           0 :     szgcd[k++].creator = GTextFieldCreate;
   10084             : 
   10085           0 :     szlabel[k].text = (unichar_t *) _("Style _ID:");
   10086           0 :     szlabel[k].text_is_1byte = true;
   10087           0 :     szlabel[k].text_in_resource = true;
   10088           0 :     szgcd[k].gd.label = &szlabel[k];
   10089           0 :     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;
   10090           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10091           0 :     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");
   10092           0 :     szgcd[k++].creator = GLabelCreate;
   10093             : 
   10094           0 :     sprintf(sibuf, "%d", sf->fontstyle_id);
   10095           0 :     szlabel[k].text = (unichar_t *) sibuf;
   10096           0 :     szlabel[k].text_is_1byte = true;
   10097           0 :     szgcd[k].gd.label = &szlabel[k];
   10098           0 :     szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
   10099           0 :     szgcd[k].gd.pos.width = 60;
   10100           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled;
   10101           0 :     szgcd[k].gd.cid = CID_StyleID;
   10102           0 :     szgcd[k++].creator = GTextFieldCreate;
   10103             : 
   10104           0 :     szlabel[k].text = (unichar_t *) _("Style Name:");
   10105           0 :     szlabel[k].text_is_1byte = true;
   10106           0 :     szgcd[k].gd.label = &szlabel[k];
   10107           0 :     szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+22;
   10108           0 :     szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10109           0 :     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.");
   10110           0 :     szgcd[k++].creator = GLabelCreate;
   10111             : 
   10112           0 :     szgcd[k].gd.pos.width = 300; szgcd[k].gd.pos.height = 200;
   10113           0 :     szgcd[k].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
   10114           0 :     szgcd[k].gd.cid = CID_StyleName;
   10115           0 :     szgcd[k].gd.u.matrix = &sizemi;
   10116           0 :     szgcd[k].gd.popup_msg = (unichar_t *) _(
   10117             :         "To create a new name, left click on the <New> button, and select a locale (language).\n"
   10118             :         "To change the locale, left click on it.\n"
   10119             :         "To change the text, left click in it and then type.\n"
   10120             :         );
   10121           0 :     szgcd[k].data = d;
   10122           0 :     szgcd[k].creator = GMatrixEditCreate;
   10123             : 
   10124           0 :     szarray[0] = &szbox[2];
   10125           0 :     szarray[1] = &szbox[3];
   10126           0 :     szarray[2] = &szbox[4];
   10127           0 :     szarray[3] = &szgcd[11];
   10128           0 :     szarray[4] = &szgcd[12];
   10129           0 :     szarray[5] = NULL;
   10130             : 
   10131           0 :     szarray2[0] = &szgcd[0]; szarray2[1] = &szgcd[1]; szarray2[2] = &szgcd[2]; szarray2[3] = GCD_Glue; szarray2[4] = NULL;
   10132           0 :     szarray3[0] = &szgcd[5]; szarray3[1] = &szgcd[6]; szarray3[2] = &szgcd[7]; szarray3[3] = &szgcd[8]; szarray3[4] = GCD_Glue; szarray3[5] = NULL;
   10133           0 :      szarray3[6] = NULL;
   10134           0 :     szarray4[0] = &szgcd[9]; szarray4[1] = &szgcd[10]; szarray4[2] = GCD_Glue; szarray4[3] = NULL;
   10135             : 
   10136           0 :     memset(szbox,0,sizeof(szbox));
   10137           0 :     szbox[0].gd.flags = gg_enabled|gg_visible;
   10138           0 :     szbox[0].gd.u.boxelements = szarray;
   10139           0 :     szbox[0].creator = GVBoxCreate;
   10140             : 
   10141           0 :     szbox[2].gd.flags = gg_enabled|gg_visible;
   10142           0 :     szbox[2].gd.u.boxelements = szarray2;
   10143           0 :     szbox[2].creator = GHBoxCreate;
   10144             : 
   10145           0 :     szbox[3].gd.flags = gg_enabled|gg_visible;
   10146           0 :     szbox[3].gd.label = (GTextInfo *) &szgcd[3];
   10147           0 :     szbox[3].gd.u.boxelements = szarray3;
   10148           0 :     szbox[3].creator = GHVGroupCreate;
   10149             : 
   10150           0 :     szbox[4].gd.flags = gg_enabled|gg_visible;
   10151           0 :     szbox[4].gd.u.boxelements = szarray4;
   10152           0 :     szbox[4].creator = GHBoxCreate;
   10153             : 
   10154             : /******************************************************************************/
   10155           0 :     memset(&mcgcd,0,sizeof(mcgcd));
   10156           0 :     memset(&mclabel,'\0',sizeof(mclabel));
   10157             : 
   10158           0 :     k=0;
   10159           0 :     mclabel[k].text = (unichar_t *) _("Mac Style Set:");
   10160           0 :     mclabel[k].text_is_1byte = true;
   10161           0 :     mcgcd[k].gd.label = &mclabel[k];
   10162           0 :     mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 7;
   10163           0 :     mcgcd[k].gd.flags = gg_visible | gg_enabled;
   10164           0 :     mcgcd[k++].creator = GLabelCreate;
   10165             : 
   10166           0 :     mclabel[k].text = (unichar_t *) _("Automatic");
   10167           0 :     mclabel[k].text_is_1byte = true;
   10168           0 :     mcgcd[k].gd.label = &mclabel[k];
   10169           0 :     mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 20;
   10170           0 :     mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
   10171           0 :     mcgcd[k].gd.cid = CID_MacAutomatic;
   10172           0 :     mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
   10173           0 :     mcgcd[k++].creator = GRadioCreate;
   10174             : 
   10175           0 :     mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = 20;
   10176           0 :     mcgcd[k].gd.flags = (sf->macstyle!=-1) ? (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_rad_continueold);
   10177           0 :     mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
   10178           0 :     mcgcd[k++].creator = GRadioCreate;
   10179             : 
   10180           0 :     mcgcd[k].gd.pos.x = 110; mcgcd[k].gd.pos.y = 20;
   10181           0 :     mcgcd[k].gd.pos.width = 120; mcgcd[k].gd.pos.height = 7*12+10;
   10182           0 :     mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_list_multiplesel) : (gg_visible | gg_enabled | gg_list_multiplesel);
   10183           0 :     mcgcd[k].gd.cid = CID_MacStyles;
   10184           0 :     mcgcd[k].gd.u.list = macstyles;
   10185           0 :     mcgcd[k++].creator = GListCreate;
   10186             : 
   10187           0 :     mclabel[k].text = (unichar_t *) _("FOND Name:");
   10188           0 :     mclabel[k].text_is_1byte = true;
   10189           0 :     mcgcd[k].gd.label = &mclabel[k];
   10190           0 :     mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y + mcgcd[k-1].gd.pos.height+8;
   10191           0 :     mcgcd[k].gd.flags = gg_visible | gg_enabled;
   10192           0 :     mcgcd[k++].creator = GLabelCreate;
   10193             : 
   10194           0 :     mclabel[k].text = (unichar_t *) sf->fondname;
   10195           0 :     mclabel[k].text_is_1byte = true;
   10196           0 :     mcgcd[k].gd.label = sf->fondname==NULL ? NULL : &mclabel[k];
   10197           0 :     mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y - 4;
   10198           0 :     mcgcd[k].gd.flags = gg_visible | gg_enabled;
   10199           0 :     mcgcd[k].gd.cid = CID_MacFOND;
   10200           0 :     mcgcd[k++].creator = GTextFieldCreate;
   10201             : 
   10202             : 
   10203           0 :     mcs = MacStyleCode(sf,NULL);
   10204           0 :     for ( i=0; macstyles[i].text!=NULL; ++i )
   10205           0 :         macstyles[i].selected = (mcs&(int) (intpt) macstyles[i].userdata)? 1 : 0;
   10206             : 
   10207           0 :     mcarray[0] = &mcgcd[0]; mcarray[1] = GCD_Glue; mcarray[2] = NULL;
   10208           0 :     mcarray[3] = &mcbox[2]; mcarray[4] = &mcgcd[3]; mcarray[5] = NULL;
   10209           0 :     mcarray[6] = &mcgcd[4]; mcarray[7] = &mcgcd[5]; mcarray[8] = NULL;
   10210           0 :     mcarray[9] = GCD_Glue; mcarray[10] = GCD_Glue; mcarray[11] = NULL;
   10211           0 :     mcarray[12] = NULL;
   10212           0 :     mcarray2[0] = &mcgcd[1]; mcarray2[1] = &mcgcd[2]; mcarray2[2] = NULL;
   10213           0 :     mcarray2[3] = GCD_Glue; mcarray2[4] = GCD_Glue; mcarray2[5] = NULL;
   10214           0 :     mcarray2[6] = NULL;
   10215             : 
   10216           0 :     memset(mcbox,0,sizeof(mcbox));
   10217           0 :     mcbox[0].gd.flags = gg_enabled|gg_visible;
   10218           0 :     mcbox[0].gd.u.boxelements = mcarray;
   10219           0 :     mcbox[0].creator = GHVBoxCreate;
   10220             : 
   10221           0 :     mcbox[2].gd.flags = gg_enabled|gg_visible;
   10222           0 :     mcbox[2].gd.u.boxelements = mcarray2;
   10223           0 :     mcbox[2].creator = GHVBoxCreate;
   10224             : 
   10225             : /******************************************************************************/
   10226           0 :     memset(&lksubgcd,0,sizeof(lksubgcd));
   10227           0 :     memset(&lkgcd,0,sizeof(lkgcd));
   10228           0 :     memset(&lkaspects,'\0',sizeof(lkaspects));
   10229           0 :     memset(&lkbox,'\0',sizeof(lkbox));
   10230           0 :     memset(&lkbuttonsgcd,'\0',sizeof(lkbuttonsgcd));
   10231           0 :     memset(&lkbuttonslabel,'\0',sizeof(lkbuttonslabel));
   10232             : 
   10233           0 :     LookupSetup(&d->tables[0],sf->gsub_lookups);
   10234           0 :     LookupSetup(&d->tables[1],sf->gpos_lookups);
   10235             : 
   10236           0 :     i=0;
   10237           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10238           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10239           0 :     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.");
   10240           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Top");
   10241           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10242           0 :     lkbuttonslabel[i].text_in_resource = true;
   10243           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10244           0 :     lkbuttonsgcd[i].gd.cid = CID_LookupTop;
   10245           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
   10246           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10247             : 
   10248           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10249           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10250           0 :     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.");
   10251           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Up");
   10252           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10253           0 :     lkbuttonslabel[i].text_in_resource = true;
   10254           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10255           0 :     lkbuttonsgcd[i].gd.cid = CID_LookupUp;
   10256           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
   10257           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10258             : 
   10259           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10260           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10261           0 :     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.");
   10262           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Down");
   10263           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10264           0 :     lkbuttonslabel[i].text_in_resource = true;
   10265           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10266           0 :     lkbuttonsgcd[i].gd.cid = CID_LookupDown;
   10267           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
   10268           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10269             : 
   10270           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10271           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10272           0 :     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");
   10273           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Bottom");
   10274           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10275           0 :     lkbuttonslabel[i].text_in_resource = true;
   10276           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10277           0 :     lkbuttonsgcd[i].gd.cid = CID_LookupBottom;
   10278           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
   10279           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10280             : 
   10281           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10282           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10283           0 :     lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Sorts the lookups in a default ordering based on feature tags");
   10284           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Sort");
   10285           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10286           0 :     lkbuttonslabel[i].text_in_resource = true;
   10287           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10288           0 :     lkbuttonsgcd[i].gd.cid = CID_LookupSort;
   10289           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupSort;
   10290           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10291             : 
   10292           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10293           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled ;
   10294           0 :     lkbuttonsgcd[i++].creator = GLineCreate;
   10295             : 
   10296           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10297           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup ;
   10298           0 :     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.");
   10299           0 :     lkbuttonslabel[i].text = (unichar_t *) _("Add _Lookup");
   10300           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10301           0 :     lkbuttonslabel[i].text_in_resource = true;
   10302           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10303           0 :     lkbuttonsgcd[i].gd.cid = CID_AddLookup;
   10304           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddLookup;
   10305           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10306             : 
   10307           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10308           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10309           0 :     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.");
   10310           0 :     lkbuttonslabel[i].text = (unichar_t *) _("Add Sub_table");
   10311           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10312           0 :     lkbuttonslabel[i].text_in_resource = true;
   10313           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10314           0 :     lkbuttonsgcd[i].gd.cid = CID_AddSubtable;
   10315           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddSubtable;
   10316           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10317             : 
   10318           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10319           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10320           0 :     lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits a lookup or lookup subtable.");
   10321           0 :     lkbuttonslabel[i].text = (unichar_t *) _("Edit _Metadata");
   10322           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10323           0 :     lkbuttonslabel[i].text_in_resource = true;
   10324           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10325           0 :     lkbuttonsgcd[i].gd.cid = CID_EditMetadata;
   10326           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditMetadata;
   10327           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10328             : 
   10329           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10330           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10331           0 :     lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits the transformations in a lookup subtable.");
   10332           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Edit Data");
   10333           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10334           0 :     lkbuttonslabel[i].text_in_resource = true;
   10335           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10336           0 :     lkbuttonsgcd[i].gd.cid = CID_EditSubtable;
   10337           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditSubtableContents;
   10338           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10339             : 
   10340           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10341           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10342           0 :     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.");
   10343           0 :     lkbuttonslabel[i].text = (unichar_t *) _("De_lete");
   10344           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10345           0 :     lkbuttonslabel[i].text_in_resource = true;
   10346           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10347           0 :     lkbuttonsgcd[i].gd.cid = CID_DeleteLookup;
   10348           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupDeleteLookup;
   10349           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10350             : 
   10351           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10352           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10353           0 :     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");
   10354           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Merge");
   10355           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10356           0 :     lkbuttonslabel[i].text_in_resource = true;
   10357           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10358           0 :     lkbuttonsgcd[i].gd.cid = CID_MergeLookup;
   10359           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupMergeLookup;
   10360           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10361             : 
   10362           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10363           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10364           0 :     lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Reverts the lookup list to its original condition.\nBut any changes to subtable data will remain.");
   10365           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Revert");
   10366           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10367           0 :     lkbuttonslabel[i].text_in_resource = true;
   10368           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10369           0 :     lkbuttonsgcd[i].gd.cid = CID_RevertLookups;
   10370           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupRevertLookup;
   10371           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10372             : 
   10373           0 :     lkbuttonsarray[i] = &lkbuttonsgcd[i];
   10374           0 :     lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
   10375           0 :     lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Imports a lookup (and all its subtables) from another font.");
   10376           0 :     lkbuttonslabel[i].text = (unichar_t *) _("_Import");
   10377           0 :     lkbuttonslabel[i].text_is_1byte = true;
   10378           0 :     lkbuttonslabel[i].text_in_resource = true;
   10379           0 :     lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
   10380           0 :     lkbuttonsgcd[i].gd.cid = CID_ImportLookups;
   10381           0 :     lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupImportLookup;
   10382           0 :     lkbuttonsgcd[i++].creator = GButtonCreate;
   10383           0 :     lkbuttonsarray[i] = GCD_Glue;
   10384           0 :     lkbuttonsarray[i+1] = NULL;
   10385             : 
   10386           0 :     for ( i=0; i<2; ++i ) {
   10387           0 :         lkaspects[i].text = (unichar_t *) (i?"GPOS":"GSUB");
   10388           0 :         lkaspects[i].text_is_1byte = true;
   10389           0 :         lkaspects[i].gcd = &lkbox[2*i];
   10390             : 
   10391           0 :         lksubgcd[i][0].gd.pos.x = 10; lksubgcd[i][0].gd.pos.y = 10;
   10392           0 :         lksubgcd[i][0].gd.pos.width = ngcd[15].gd.pos.width;
   10393           0 :         lksubgcd[i][0].gd.pos.height = 150;
   10394           0 :         lksubgcd[i][0].gd.flags = gg_visible | gg_enabled;
   10395           0 :         lksubgcd[i][0].gd.u.drawable_e_h = i ? gposlookups_e_h : gsublookups_e_h;
   10396           0 :         lksubgcd[i][0].gd.cid = CID_LookupWin+i;
   10397           0 :         lksubgcd[i][0].creator = GDrawableCreate;
   10398             : 
   10399           0 :         lksubgcd[i][1].gd.pos.x = 10; lksubgcd[i][1].gd.pos.y = 10;
   10400           0 :         lksubgcd[i][1].gd.pos.height = 150;
   10401           0 :         lksubgcd[i][1].gd.flags = gg_visible | gg_enabled | gg_sb_vert;
   10402           0 :         lksubgcd[i][1].gd.cid = CID_LookupVSB+i;
   10403           0 :         lksubgcd[i][1].gd.handle_controlevent = LookupsVScroll;
   10404           0 :         lksubgcd[i][1].creator = GScrollBarCreate;
   10405             : 
   10406           0 :         lksubgcd[i][2].gd.pos.x = 10; lksubgcd[i][2].gd.pos.y = 10;
   10407           0 :         lksubgcd[i][2].gd.pos.width = 150;
   10408           0 :         lksubgcd[i][2].gd.flags = gg_visible | gg_enabled;
   10409           0 :         lksubgcd[i][2].gd.cid = CID_LookupHSB+i;
   10410           0 :         lksubgcd[i][2].gd.handle_controlevent = LookupsHScroll;
   10411           0 :         lksubgcd[i][2].creator = GScrollBarCreate;
   10412             : 
   10413           0 :         lksubgcd[i][3].gd.pos.x = 10; lksubgcd[i][3].gd.pos.y = 10;
   10414           0 :         lksubgcd[i][3].gd.pos.width = lksubgcd[i][3].gd.pos.height = _GScrollBar_Width;
   10415           0 :         lksubgcd[i][3].gd.flags = gg_visible | gg_enabled | gg_tabset_nowindow;
   10416           0 :         lksubgcd[i][3].creator = GDrawableCreate;
   10417             : 
   10418           0 :         lkarray[i][0] = &lksubgcd[i][0]; lkarray[i][1] = &lksubgcd[i][1]; lkarray[i][2] = NULL;
   10419           0 :         lkarray[i][3] = &lksubgcd[i][2]; lkarray[i][4] = &lksubgcd[i][3]; lkarray[i][5] = NULL;
   10420           0 :         lkarray[i][6] = NULL;
   10421             : 
   10422           0 :         lkbox[2*i].gd.flags = gg_enabled|gg_visible;
   10423           0 :         lkbox[2*i].gd.u.boxelements = lkarray[i];
   10424           0 :         lkbox[2*i].creator = GHVBoxCreate;
   10425             :     }
   10426             : 
   10427           0 :     lkaspects[0].selected = true;
   10428             : 
   10429           0 :     lkgcd[0].gd.pos.x = 4; lkgcd[0].gd.pos.y = 10;
   10430           0 :     lkgcd[0].gd.pos.width = 250;
   10431           0 :     lkgcd[0].gd.pos.height = 260;
   10432           0 :     lkgcd[0].gd.u.tabs = lkaspects;
   10433           0 :     lkgcd[0].gd.flags = gg_visible | gg_enabled;
   10434           0 :     lkgcd[0].gd.cid = CID_Lookups;
   10435           0 :     lkgcd[0].gd.handle_controlevent = GFI_LookupAspectChange;
   10436           0 :     lkgcd[0].creator = GTabSetCreate;
   10437             : 
   10438           0 :     lkharray[0] = &lkgcd[0]; lkharray[1] = &lkbox[4]; lkharray[2] = NULL;
   10439             : 
   10440           0 :     lkbox[4].gd.flags = gg_enabled|gg_visible;
   10441           0 :     lkbox[4].gd.u.boxelements = lkbuttonsarray;
   10442           0 :     lkbox[4].creator = GVBoxCreate;
   10443             : 
   10444           0 :     lkbox[5].gd.flags = gg_enabled|gg_visible;
   10445           0 :     lkbox[5].gd.u.boxelements = lkharray;
   10446           0 :     lkbox[5].creator = GHBoxCreate;
   10447             : 
   10448             : 
   10449             : /******************************************************************************/
   10450           0 :     memset(&mfgcd,0,sizeof(mfgcd));
   10451           0 :     memset(&mflabel,'\0',sizeof(mflabel));
   10452           0 :     memset(mfbox,0,sizeof(mfbox));
   10453             : 
   10454           0 :     GCDFillMacFeat(mfgcd,mflabel,250,sf->features, false, mfbox, mfarray);
   10455             : /******************************************************************************/
   10456             : 
   10457           0 :     memset(&dlabel,0,sizeof(dlabel));
   10458           0 :     memset(&dgcd,0,sizeof(dgcd));
   10459             : 
   10460           0 :     dlabel[0].text = (unichar_t *) _("Creation Date:");
   10461           0 :     dlabel[0].text_is_1byte = true;
   10462           0 :     dlabel[0].text_in_resource = true;
   10463           0 :     dgcd[0].gd.label = &dlabel[0];
   10464           0 :     dgcd[0].gd.pos.x = 12; dgcd[0].gd.pos.y = 6+6;
   10465           0 :     dgcd[0].gd.flags = gg_visible | gg_enabled;
   10466           0 :     dgcd[0].creator = GLabelCreate;
   10467             : 
   10468           0 :     t = sf->creationtime;
   10469           0 :     tm = localtime(&t);
   10470           0 :     if(!tm) strcpy(createtime, "error");
   10471           0 :     else    strftime(createtime,sizeof(createtime),"%c",tm);
   10472           0 :     tmpcreatetime = def2u_copy(createtime);
   10473           0 :     dgcd[1].gd.pos.x = 115; dgcd[1].gd.pos.y = dgcd[0].gd.pos.y;
   10474           0 :     dgcd[1].gd.flags = gg_visible | gg_enabled;
   10475           0 :     dlabel[1].text = tmpcreatetime;
   10476           0 :     dgcd[1].gd.label = &dlabel[1];
   10477           0 :     dgcd[1].creator = GLabelCreate;
   10478             : 
   10479           0 :     dlabel[2].text = (unichar_t *) _("Modification Date:");
   10480           0 :     dlabel[2].text_is_1byte = true;
   10481           0 :     dlabel[2].text_in_resource = true;
   10482           0 :     dgcd[2].gd.label = &dlabel[2];
   10483           0 :     dgcd[2].gd.pos.x = 12; dgcd[2].gd.pos.y = dgcd[0].gd.pos.y+14;
   10484           0 :     dgcd[2].gd.flags = gg_visible | gg_enabled;
   10485           0 :     dgcd[2].creator = GLabelCreate;
   10486             : 
   10487           0 :     t = sf->modificationtime;
   10488           0 :     tm = localtime(&t);
   10489           0 :     if(!tm) strcpy(modtime, "error");
   10490           0 :     else    strftime(modtime,sizeof(modtime),"%c",tm);
   10491           0 :     tmpmodtime = def2u_copy(modtime);
   10492           0 :     dgcd[3].gd.pos.x = 115; dgcd[3].gd.pos.y = dgcd[2].gd.pos.y;
   10493           0 :     dgcd[3].gd.flags = gg_visible | gg_enabled;
   10494           0 :     dlabel[3].text = tmpmodtime;
   10495           0 :     dgcd[3].gd.label = &dlabel[3];
   10496           0 :     dgcd[3].creator = GLabelCreate;
   10497             : 
   10498           0 :     darray[0] = &dgcd[0]; darray[1] = &dgcd[1]; darray[2] = NULL;
   10499           0 :     darray[3] = &dgcd[2]; darray[4] = &dgcd[3]; darray[5] = NULL;
   10500           0 :     darray[6] = GCD_Glue; darray[7] = GCD_Glue; darray[8] = NULL;
   10501           0 :     darray[9] = NULL;
   10502             : 
   10503           0 :     memset(dbox,0,sizeof(dbox));
   10504           0 :     dbox[0].gd.flags = gg_enabled|gg_visible;
   10505           0 :     dbox[0].gd.u.boxelements = darray;
   10506           0 :     dbox[0].creator = GHVBoxCreate;
   10507             : /******************************************************************************/
   10508             : 
   10509           0 :     memset(&ulabel,0,sizeof(ulabel));
   10510           0 :     memset(&ugcd,0,sizeof(ugcd));
   10511           0 :     memset(ubox,0,sizeof(ubox));
   10512             : 
   10513           0 :     ulabel[0].text = (unichar_t *) _(
   10514             :             "This pane is informative only and shows the characters\n"
   10515             :             "actually in the font. If you wish to set the OS/2 Unicode\n"
   10516             :             "Range field, change the pane to");
   10517           0 :     ulabel[0].text_is_1byte = true;
   10518           0 :     ugcd[0].gd.label = &ulabel[0];
   10519           0 :     ugcd[0].gd.pos.x = 12; ugcd[0].gd.pos.y = 10;
   10520           0 :     ugcd[0].gd.flags = gg_visible | gg_enabled;
   10521           0 :     ugcd[0].creator = GLabelCreate;
   10522             : 
   10523           0 :     ulabel[1].text = (unichar_t *) _( "OS/2 -> Charsets");
   10524           0 :     ulabel[1].text_is_1byte = true;
   10525           0 :     ugcd[1].gd.label = &ulabel[1];
   10526           0 :     ugcd[1].gd.pos.x = 12; ugcd[1].gd.pos.y = 10;
   10527           0 :     ugcd[1].gd.flags = gg_visible | gg_enabled | gg_dontcopybox;
   10528           0 :     ugcd[1].gd.box = &small_blue_box;
   10529           0 :     ugcd[1].gd.handle_controlevent = GFI_URangeAspectChange;
   10530           0 :     ugcd[1].creator = GButtonCreate;
   10531           0 :     uharray[0] = GCD_Glue; uharray[1] = &ugcd[1]; uharray[2] = GCD_Glue; uharray[3] = NULL;
   10532             : 
   10533           0 :     ubox[2].gd.flags = gg_enabled|gg_visible;
   10534           0 :     ubox[2].gd.u.boxelements = uharray;
   10535           0 :     ubox[2].creator = GHBoxCreate;
   10536             : 
   10537           0 :     ulabel[2].text = (unichar_t *) _("Include Empty Blocks");
   10538           0 :     ulabel[2].text_is_1byte = true;
   10539           0 :     ulabel[2].text_in_resource = true;
   10540           0 :     ugcd[2].gd.label = &ulabel[2];
   10541           0 :     ugcd[2].gd.pos.x = 12; ugcd[2].gd.pos.y = 10;
   10542           0 :     ugcd[2].gd.flags = gg_visible | gg_enabled;
   10543           0 :     ugcd[2].gd.handle_controlevent = GFI_UnicodeEmptiesChange;
   10544           0 :     ugcd[2].gd.cid = CID_UnicodeEmpties;
   10545           0 :     ugcd[2].creator = GCheckBoxCreate;
   10546             : 
   10547           0 :     ugcd[3].gd.pos.x = 12; ugcd[3].gd.pos.y = 30;
   10548           0 :     ugcd[3].gd.pos.width = ngcd[15].gd.pos.width;
   10549           0 :     ugcd[3].gd.pos.height = 200;
   10550           0 :     ugcd[3].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
   10551           0 :     ugcd[3].gd.cid = CID_Unicode;
   10552           0 :     ugcd[3].gd.handle_controlevent = GFI_UnicodeRangeChange;
   10553           0 :     ugcd[3].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.");
   10554           0 :     ugcd[3].creator = GListCreate;
   10555             : 
   10556           0 :     uarray[0] = &ugcd[0]; uarray[1] = &ubox[2]; uarray[2] = &ugcd[2]; uarray[3] = &ugcd[3]; uarray[4] = NULL;
   10557             : 
   10558           0 :     ubox[0].gd.flags = gg_enabled|gg_visible;
   10559           0 :     ubox[0].gd.u.boxelements = uarray;
   10560           0 :     ubox[0].creator = GVBoxCreate;
   10561             : 
   10562             : /******************************************************************************/
   10563             : 
   10564             :     // This is where the indices for the different tabs get set as referenced by defaspect.
   10565             :     // If you change something here, it's probably a good idea to grep for calls to FontInfo
   10566             :     // in order to confirm/adjust the defaspect arguments.
   10567             : 
   10568           0 :     memset(&mlabel,0,sizeof(mlabel));
   10569           0 :     memset(&mgcd,0,sizeof(mgcd));
   10570           0 :     memset(&aspects,'\0',sizeof(aspects));
   10571             : 
   10572           0 :     i = 0;
   10573             : 
   10574           0 :     aspects[i].text = (unichar_t *) _("PS Names");
   10575           0 :     d->old_aspect = 0;
   10576           0 :     aspects[i].text_is_1byte = true;
   10577           0 :     aspects[i++].gcd = nb;
   10578             : 
   10579           0 :     aspects[i].text = (unichar_t *) _("General");
   10580           0 :     aspects[i].text_is_1byte = true;
   10581           0 :     aspects[i++].gcd = psb;
   10582             : 
   10583           0 :     aspects[i].text = (unichar_t *) _("Layers");
   10584           0 :     aspects[i].text_is_1byte = true;
   10585           0 :     aspects[i++].gcd = lbox;
   10586             : 
   10587           0 :     aspects[i].text = (unichar_t *) _("PS UID");
   10588           0 :     aspects[i].text_is_1byte = true;
   10589           0 :     aspects[i++].gcd = xub;
   10590             : 
   10591           0 :     d->private_aspect = i;
   10592           0 :     aspects[i].text = (unichar_t *) _("PS Private");
   10593           0 :     aspects[i].text_is_1byte = true;
   10594           0 :     aspects[i++].gcd = ppbox;
   10595             : 
   10596           0 :     d->ttfv_aspect = i;
   10597           0 :     aspects[i].text = (unichar_t *) _("OS/2");
   10598           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10599           0 :     aspects[i].text_is_1byte = true;
   10600           0 :     aspects[i++].gcd = vagcd;
   10601             : 
   10602           0 :     d->tn_aspect = i;
   10603           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10604           0 :     aspects[i].text = (unichar_t *) _("TTF Names");
   10605           0 :     aspects[i].text_is_1byte = true;
   10606           0 :     aspects[i++].gcd = tnboxes;
   10607             : 
   10608           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10609           0 :     aspects[i].text = (unichar_t *) _("StyleSet Names");
   10610           0 :     aspects[i].text_is_1byte = true;
   10611           0 :     aspects[i++].gcd = ssboxes;
   10612             : 
   10613           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10614           0 :     aspects[i].text = (unichar_t *) _("Grid Fitting");
   10615           0 :     aspects[i].text_is_1byte = true;
   10616           0 :     aspects[i++].gcd = gaspboxes;
   10617             : 
   10618           0 :     d->tx_aspect = i;
   10619             : /* xgettext won't use non-ASCII messages */
   10620           0 :     aspects[i].text = (unichar_t *) U_("ΤεΧ");     /* Tau epsilon Chi, in greek */
   10621           0 :     aspects[i].text_is_1byte = true;
   10622           0 :     aspects[i++].gcd = txbox;
   10623             : 
   10624           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10625           0 :     aspects[i].text = (unichar_t *) _("Size");
   10626           0 :     aspects[i].text_is_1byte = true;
   10627           0 :     aspects[i++].gcd = szbox;
   10628             : 
   10629           0 :     aspects[i].text = (unichar_t *) _("Comment");
   10630           0 :     aspects[i].text_is_1byte = true;
   10631           0 :     aspects[i++].gcd = combox;
   10632             : 
   10633           0 :     aspects[i].text = (unichar_t *) _("FONTLOG");
   10634           0 :     aspects[i].text_is_1byte = true;
   10635           0 :     aspects[i++].gcd = flogbox;
   10636             : 
   10637           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10638           0 :     aspects[i].text = (unichar_t *) _("Mark Classes");
   10639           0 :     aspects[i].text_is_1byte = true;
   10640           0 :     aspects[i++].gcd = mkbox;
   10641             : 
   10642           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10643           0 :     aspects[i].text = (unichar_t *) _("Mark Sets");
   10644           0 :     aspects[i].text_is_1byte = true;
   10645           0 :     aspects[i++].gcd = msbox;
   10646             : 
   10647             : /* GT: OpenType GPOS/GSUB lookups */
   10648           0 :     if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
   10649           0 :     aspects[i].text = (unichar_t *) S_("OpenType|Lookups");
   10650           0 :     aspects[i].text_is_1byte = true;
   10651           0 :     aspects[i++].gcd = &lkbox[5];
   10652             : /* On my system the "lookups line appears indented. That seems to be because */
   10653             : /*  the letter "L" has more of a left-side bearing than it should. It is not */
   10654             : /*  a bug in the nesting level. Remember this next time it bugs me */
   10655             : 
   10656           0 :     aspects[i].text = (unichar_t *) _("WOFF");
   10657           0 :     aspects[i].text_is_1byte = true;
   10658           0 :     aspects[i++].gcd = woffbox;
   10659             : 
   10660           0 :     aspects[i].text = (unichar_t *) _("Mac");
   10661           0 :     aspects[i].text_is_1byte = true;
   10662           0 :     aspects[i++].gcd = mcbox;
   10663             : 
   10664           0 :     aspects[i].text = (unichar_t *) _("Mac Features");
   10665           0 :     aspects[i].text_is_1byte = true;
   10666           0 :     aspects[i++].gcd = mfbox;
   10667             : 
   10668           0 :     aspects[i].text = (unichar_t *) _("Dates");
   10669           0 :     aspects[i].text_is_1byte = true;
   10670           0 :     aspects[i++].gcd = dbox;
   10671             : 
   10672           0 :     d->unicode_aspect = i;
   10673           0 :     aspects[i].text = (unichar_t *) _("Unicode Ranges");
   10674           0 :     aspects[i].text_is_1byte = true;
   10675           0 :     aspects[i++].gcd = ubox;
   10676             : 
   10677           0 :     aspects[defaspect].selected = true;
   10678             : 
   10679           0 :     mgcd[0].gd.pos.x = 4; mgcd[0].gd.pos.y = 6;
   10680           0 :     mgcd[0].gd.u.tabs = aspects;
   10681           0 :     mgcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_vert;
   10682             :     // We adjusted the following two values so as to make the GPOS and GSUB scrollbars visible.
   10683           0 :     mgcd[0].gd.pos.width = 500; // 260+85;
   10684           0 :     mgcd[0].gd.pos.height = 380; // 325;
   10685           0 :     mgcd[0].gd.handle_controlevent = GFI_AspectChange;
   10686           0 :     mgcd[0].gd.cid = CID_Tabs;
   10687           0 :     mgcd[0].creator = GTabSetCreate;
   10688             : 
   10689           0 :     mgcd[1].gd.pos.x = 30-3; mgcd[1].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
   10690           0 :     mgcd[1].gd.pos.width = -1; mgcd[1].gd.pos.height = 0;
   10691           0 :     mgcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
   10692           0 :     mlabel[1].text = (unichar_t *) _("_OK");
   10693           0 :     mlabel[1].text_is_1byte = true;
   10694           0 :     mlabel[1].text_in_resource = true;
   10695           0 :     mgcd[1].gd.label = &mlabel[1];
   10696           0 :     mgcd[1].gd.handle_controlevent = GFI_OK;
   10697           0 :     mgcd[1].gd.cid = CID_OK;
   10698           0 :     mgcd[1].creator = GButtonCreate;
   10699             : 
   10700           0 :     mgcd[2].gd.pos.x = -30; mgcd[2].gd.pos.y = mgcd[1].gd.pos.y+3;
   10701           0 :     mgcd[2].gd.pos.width = -1; mgcd[2].gd.pos.height = 0;
   10702           0 :     mgcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
   10703           0 :     mlabel[2].text = (unichar_t *) _("_Cancel");
   10704           0 :     mlabel[2].text_is_1byte = true;
   10705           0 :     mlabel[2].text_in_resource = true;
   10706           0 :     mgcd[2].gd.label = &mlabel[2];
   10707           0 :     mgcd[2].gd.handle_controlevent = GFI_Cancel;
   10708           0 :     mgcd[2].gd.cid = CID_Cancel;
   10709           0 :     mgcd[2].creator = GButtonCreate;
   10710             : 
   10711           0 :     mgcd[3].gd.pos.x = 2; mgcd[3].gd.pos.y = 2;
   10712           0 :     mgcd[3].gd.pos.width = pos.width-4; mgcd[3].gd.pos.height = pos.height-4;
   10713           0 :     mgcd[3].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
   10714           0 :     mgcd[3].gd.cid = CID_MainGroup;
   10715           0 :     mgcd[3].creator = GGroupCreate;
   10716             : 
   10717           0 :     marray2[0] = marray2[2] = marray2[3] = marray2[4] = marray2[6] = GCD_Glue; marray2[7] = NULL;
   10718           0 :     marray2[1] = &mgcd[1]; marray2[5] = &mgcd[2];
   10719             : 
   10720           0 :     marray[0] = &mgcd[0]; marray[1] = NULL;
   10721           0 :     marray[2] = &mb2; marray[3] = NULL;
   10722           0 :     marray[4] = GCD_Glue; marray[5] = NULL;
   10723           0 :     marray[6] = NULL;
   10724             : 
   10725           0 :     memset(mb,0,sizeof(mb));
   10726           0 :     mb[0].gd.pos.x = mb[0].gd.pos.y = 2;
   10727           0 :     mb[0].gd.flags = gg_enabled|gg_visible;
   10728           0 :     mb[0].gd.u.boxelements = marray;
   10729           0 :     mb[0].gd.cid = CID_TopBox;
   10730           0 :     mb[0].creator = GHVGroupCreate;
   10731             : 
   10732           0 :     memset(&mb2,0,sizeof(mb2));
   10733           0 :     mb2.gd.flags = gg_enabled|gg_visible;
   10734           0 :     mb2.gd.u.boxelements = marray2;
   10735           0 :     mb2.creator = GHBoxCreate;
   10736             : 
   10737           0 :     GGadgetsCreate(gw,mb);
   10738           0 :     GMatrixEditSetNewText(tngcd[4].ret,S_("TrueTypeName|New"));
   10739           0 :     GGadgetSelectOneListItem(gaspgcd[0].ret,sf->gasp_version);
   10740           0 :     GMatrixEditSetNewText(gaspgcd[3].ret,S_("gaspTableEntry|New"));
   10741           0 :     GMatrixEditAddButtons(gaspgcd[3].ret,gaspgcd_def);
   10742           0 :     if ( sf->gasp_version==0 ) {
   10743           0 :         GMatrixEditShowColumn(gaspgcd[3].ret,3,false);
   10744           0 :         GMatrixEditShowColumn(gaspgcd[3].ret,4,false);
   10745             :     }
   10746           0 :     GHVBoxSetExpandableCol(gaspboxes[2].ret,2);
   10747           0 :     GHVBoxSetExpandableRow(gaspboxes[0].ret,1);
   10748             : 
   10749           0 :     GMatrixEditAddButtons(pgcd[0].ret,privategcd_def);
   10750           0 :     GMatrixEditSetUpDownVisible(pgcd[0].ret, true);
   10751           0 :     GMatrixEditSetOtherButtonEnable(pgcd[0].ret, PSPrivate_EnableButtons);
   10752           0 :     GMatrixEditSetNewText(pgcd[0].ret,S_("PSPrivateDictKey|New"));
   10753             : 
   10754           0 :     GHVBoxSetExpandableCol(lbox[2].ret,3);
   10755           0 :     GHVBoxSetExpandableCol(lbox[3].ret,gb_expandglue);
   10756           0 :     GHVBoxSetExpandableCol(lbox[4].ret,gb_expandglue);
   10757           0 :     GHVBoxSetExpandableRow(lbox[0].ret,5);
   10758           0 :     GMatrixEditEnableColumn(GWidgetGetControl(gw,CID_Backgrounds),1,ltype<0);
   10759           0 :     GMatrixEditShowColumn(GWidgetGetControl(gw,CID_Backgrounds),3,false);
   10760             :         /* This column contains internal state information which the user */
   10761             :         /* should not see, ever */
   10762             : 
   10763           0 :     GHVBoxSetExpandableRow(combox[0].ret,1);
   10764           0 :     GHVBoxSetExpandableRow(flogbox[0].ret,1);
   10765             : 
   10766           0 :     GHVBoxSetExpandableRow(mb[0].ret,0);
   10767           0 :     GHVBoxSetExpandableCol(mb2.ret,gb_expandgluesame);
   10768             : 
   10769           0 :     GHVBoxSetExpandableCol(nb[0].ret,1);
   10770           0 :     GHVBoxSetExpandableRow(nb[0].ret,8);
   10771           0 :     GHVBoxSetExpandableCol(nb2.ret,1);
   10772           0 :     GHVBoxSetExpandableCol(nb3.ret,1);
   10773             : 
   10774           0 :     GHVBoxSetExpandableCol(xub[0].ret,1);
   10775           0 :     GHVBoxSetExpandableRow(xub[0].ret,5);
   10776             : 
   10777           0 :     GHVBoxSetExpandableRow(psb[0].ret,psrow);
   10778           0 :     GHVBoxSetExpandableCol(psb2[0].ret,3);
   10779           0 :     GHVBoxSetExpandableCol(psb2[1].ret,1);
   10780             : 
   10781           0 :     GHVBoxSetExpandableRow(vbox[0].ret,gb_expandglue);
   10782           0 :     GHVBoxSetExpandableCol(vbox[0].ret,1);
   10783           0 :     GHVBoxSetExpandableCol(vbox[2].ret,gb_expandglue);
   10784             : 
   10785           0 :     GHVBoxSetExpandableRow(metbox[0].ret,10);
   10786           0 :     GHVBoxSetExpandableCol(metbox[0].ret,1);
   10787             : 
   10788           0 :     GHVBoxSetExpandableRow(ssbox[0].ret,gb_expandglue);
   10789           0 :     GHVBoxSetExpandableCol(ssbox[0].ret,gb_expandglue);
   10790             : 
   10791           0 :     GHVBoxSetExpandableRow(panbox[0].ret,gb_expandglue);
   10792           0 :     GHVBoxSetExpandableCol(panbox[0].ret,1);
   10793             : 
   10794           0 :     GHVBoxSetExpandableRow(cbox[0].ret,2);
   10795           0 :     GHVBoxSetExpandableCol(cbox[2].ret,gb_expandglue);
   10796           0 :     GHVBoxSetExpandableCol(cbox[3].ret,gb_expandglue);
   10797           0 :     GHVBoxSetExpandableRow(cbox[4].ret,gb_expandglue);
   10798             : 
   10799           0 :     GHVBoxSetExpandableRow(woffbox[0].ret,2);
   10800             : 
   10801           0 :     GHVBoxSetExpandableRow(mkbox[0].ret,1);
   10802           0 :     GMatrixEditSetBeforeDelete(mkgcd[1].ret, GFI_Mark_DeleteClass);
   10803           0 :     GMatrixEditSetColumnCompletion(mkgcd[1].ret,1,GFI_GlyphListCompletion);
   10804             : 
   10805           0 :     GHVBoxSetExpandableRow(msbox[0].ret,1);
   10806           0 :     GMatrixEditSetBeforeDelete(msgcd[1].ret, GFI_Mark_DeleteClass);
   10807           0 :     GMatrixEditSetColumnCompletion(msgcd[1].ret,1,GFI_GlyphListCompletion);
   10808             : 
   10809           0 :     GHVBoxSetExpandableRow(txbox[0].ret,gb_expandglue);
   10810           0 :     GHVBoxSetExpandableCol(txbox[2].ret,gb_expandglue);
   10811           0 :     GHVBoxSetExpandableCol(txbox[3].ret,gb_expandglue);
   10812           0 :     GHVBoxSetExpandableCol(txbox[4].ret,gb_expandglue);
   10813             : 
   10814           0 :     GHVBoxSetExpandableRow(szbox[0].ret,4);
   10815           0 :     GHVBoxSetPadding(szbox[2].ret,6,2);
   10816           0 :     GHVBoxSetExpandableCol(szbox[2].ret,gb_expandglue);
   10817           0 :     GHVBoxSetPadding(szbox[3].ret,6,2);
   10818           0 :     GHVBoxSetExpandableCol(szbox[3].ret,gb_expandglue);
   10819           0 :     GHVBoxSetPadding(szbox[4].ret,6,2);
   10820           0 :     GHVBoxSetExpandableCol(szbox[4].ret,gb_expandglue);
   10821             : 
   10822           0 :     GHVBoxSetExpandableRow(tnboxes[0].ret,1);
   10823           0 :     GHVBoxSetExpandableCol(tnboxes[2].ret,gb_expandglue);
   10824           0 :     GHVBoxSetExpandableCol(tnboxes[3].ret,gb_expandglue);
   10825             : 
   10826           0 :     GHVBoxSetExpandableRow(ssboxes[0].ret,1);
   10827             : 
   10828           0 :     GHVBoxSetExpandableRow(mcbox[0].ret,gb_expandglue);
   10829           0 :     GHVBoxSetExpandableCol(mcbox[0].ret,1);
   10830           0 :     GHVBoxSetExpandableRow(mcbox[2].ret,gb_expandglue);
   10831             : 
   10832           0 :     GHVBoxSetExpandableRow(mfbox[0].ret,0);
   10833           0 :     GHVBoxSetExpandableRow(mfbox[2].ret,gb_expandglue);
   10834             : 
   10835           0 :     GHVBoxSetExpandableRow(dbox[0].ret,gb_expandglue);
   10836           0 :     GHVBoxSetExpandableCol(dbox[0].ret,1);
   10837             : 
   10838           0 :     GHVBoxSetExpandableRow(ubox[0].ret,3);
   10839           0 :     GHVBoxSetExpandableCol(ubox[2].ret,gb_expandglue);
   10840             : 
   10841           0 :     GHVBoxSetExpandableCol(lkbox[0].ret,0);
   10842           0 :     GHVBoxSetExpandableRow(lkbox[0].ret,0);
   10843           0 :     GHVBoxSetPadding(lkbox[0].ret,0,0);
   10844           0 :     GHVBoxSetExpandableCol(lkbox[2].ret,0);
   10845           0 :     GHVBoxSetExpandableRow(lkbox[2].ret,0);
   10846           0 :     GHVBoxSetPadding(lkbox[2].ret,0,0);
   10847           0 :     GHVBoxSetExpandableRow(lkbox[4].ret,gb_expandglue);
   10848           0 :     GHVBoxSetExpandableCol(lkbox[5].ret,0);
   10849             : 
   10850           0 :     GFI_LookupEnableButtons(d,true);
   10851           0 :     GFI_LookupEnableButtons(d,false);
   10852             : 
   10853           0 :     OS2_UnicodeChange(GWidgetGetControl(gw,CID_UnicodeRanges),NULL);
   10854           0 :     OS2_CodePageChange(GWidgetGetControl(gw,CID_CodePageRanges),NULL);
   10855             : 
   10856           0 :     if ( fi_font==NULL ) {
   10857           0 :         memset(&rq,0,sizeof(rq));
   10858           0 :         rq.utf8_family_name = SANS_UI_FAMILIES;
   10859           0 :         rq.point_size = 12;
   10860           0 :         rq.weight = 400;
   10861           0 :         fi_font = GDrawInstanciateFont(gw,&rq);
   10862           0 :         fi_font = GResourceFindFont("FontInfo.Font",fi_font);
   10863             :     }
   10864           0 :     d->font = fi_font;
   10865           0 :     GDrawWindowFontMetrics(gw,d->font,&as,&ds,&ld);
   10866           0 :     d->as = as; d->fh = as+ds;
   10867             : 
   10868           0 :     GTextInfoListFree(namelistnames);
   10869             : 
   10870           0 :     for ( i=0; i<mi.initial_row_cnt; ++i )
   10871           0 :         free( mi.matrix_data[3*i+2].u.md_str );
   10872           0 :     free( mi.matrix_data );
   10873             : 
   10874           0 :     free(tmpcreatetime);
   10875           0 :     free(tmpmodtime);
   10876             : 
   10877           0 :     free(copied_copyright);
   10878             : 
   10879           0 :     GWidgetIndicateFocusGadget(ngcd[1].ret);
   10880           0 :     PSPrivate_EnableButtons(GWidgetGetControl(d->gw,CID_Private),-1,-1);
   10881           0 :     GFI_AspectChange(mgcd[0].ret,NULL);
   10882             : 
   10883           0 :     GHVBoxFitWindow(mb[0].ret);
   10884             : 
   10885           0 :     GWidgetHidePalettes();
   10886           0 :     GDrawSetVisible(gw,true);
   10887             : 
   10888           0 :     if ( sync ) {
   10889           0 :         while ( !d->done )
   10890           0 :             GDrawProcessOneEvent(NULL);
   10891             :     }
   10892             : }
   10893             : 
   10894           0 : void FontMenuFontInfo(void *_fv) {
   10895           0 :     if ( _fv && collabclient_inSessionFV( _fv) ) {
   10896           0 :         gwwv_post_error(_("Feature Not Available"), _("The Font Information Dialog is not available in collaboration mode yet."));
   10897           0 :         return;
   10898             :     }
   10899           0 :     FontInfo( ((FontViewBase *) _fv)->sf,((FontViewBase *) _fv)->active_layer,-1,false);
   10900             : }
   10901             : 
   10902           0 : void FontInfoDestroy(SplineFont *sf) {
   10903           0 :     if ( sf->fontinfo )
   10904           0 :         GFI_CancelClose( (struct gfi_data *) (sf->fontinfo) );
   10905           0 : }
   10906             : 
   10907           6 : void FontInfoInit(void) {
   10908             :     static int done = false;
   10909             :     int i, j, k;
   10910             :     static GTextInfo *needswork[] = {
   10911             :         macstyles, widthclass, weightclass, fstype, pfmfamily, ibmfamily,
   10912             :         panfamily, panserifs, panweight, panprop, pancontrast, panstrokevar,
   10913             :         panarmstyle, panletterform, panmidline, panxheight,
   10914             :         pantool, panspacing, panasprat, pancontrast2, pantopology, panform,
   10915             :         panfinials, panxascent,
   10916             :         panclass, panaspect, panserifvar, pantreatment, panlining,
   10917             :         pantopology2, pancharrange, pancontrast3,
   10918             :         pankind, panasprat2,
   10919             :         mslanguages,
   10920             :         ttfnameids, interpretations, gridfit, antialias, os2versions,
   10921             :         codepagenames, unicoderangenames, symsmooth, gfsymsmooth, splineorder,
   10922             :         NULL
   10923             :     };
   10924             :     struct titlelist *tl;
   10925             :     static char **needswork2[] = { texparams, texpopups,
   10926             :         mathparams, mathpopups, extparams, extpopups,
   10927             :     NULL };
   10928             :     static struct {
   10929             :         int size;
   10930             :         struct col_init *ci;
   10931             :     } needswork3[] = {{ sizeof(ci)/sizeof(ci[0]), ci},
   10932             :                         { sizeof(gaspci)/sizeof(gaspci[0]), gaspci },
   10933             :                         { sizeof(layersci)/sizeof(layersci[0]), layersci },
   10934             :                         { sizeof(ssci)/sizeof(ssci[0]), ssci },
   10935             :                         { sizeof(sizeci)/sizeof(sizeci[0]), sizeci },
   10936             :                         { sizeof(marks_ci)/sizeof(marks_ci[0]), marks_ci },
   10937             :                         { sizeof(markc_ci)/sizeof(markc_ci[0]), markc_ci },
   10938             :                         { 0, NULL }};
   10939             : 
   10940           6 :     if ( done )
   10941          11 : return;
   10942           1 :     done = true;
   10943          46 :     for ( j=0; needswork[j]!=NULL; ++j ) {
   10944        1053 :         for ( i=0; needswork[j][i].text!=NULL; ++i )
   10945        1008 :             needswork[j][i].text = (unichar_t *) S_((char *) needswork[j][i].text);
   10946             :     }
   10947           7 :     for ( j=0; needswork2[j]!=NULL; ++j ) {
   10948          62 :         for ( i=0; needswork2[j][i]!=NULL; ++i )
   10949          56 :             needswork2[j][i] = S_(needswork2[j][i]);
   10950             :     }
   10951             : 
   10952           8 :     for ( j=0; needswork3[j].ci!=NULL; ++j ) {
   10953          28 :         for ( i=0; i<needswork3[j].size; ++i ) {
   10954          21 :             needswork3[j].ci[i].title = S_(needswork3[j].ci[i].title);
   10955          21 :             if ( needswork3[j].ci[i].enum_vals!=NULL ) {
   10956         733 :                 for ( k=0; needswork3[j].ci[i].enum_vals[k].text!=NULL; ++k )
   10957         722 :                     needswork3[j].ci[i].enum_vals[k].text = (unichar_t *) S_((char *) needswork3[j].ci[i].enum_vals[k].text);
   10958             :             }
   10959             :         }
   10960             :     }
   10961             : 
   10962          64 :     for ( tl=&panoses[0][0]; tl->name!=NULL; ++tl )
   10963          63 :         tl->name = S_(tl->name);
   10964             : 
   10965           1 :     LookupUIInit();
   10966           1 :     LookupInit();
   10967             : }

Generated by: LCOV version 1.10