1 /* otfview.c -- View glyphs of OpenType fonts.
3 Copyright (C) 2003, 2004
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H15PRO167
7 This file is part of libotf.
9 Libotf is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 Libotf is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library, in a file named COPYING; if not,
21 write to the Free Software Foundation, Inc., 59 Temple Place, Suite
22 330, Boston, MA 02111-1307, USA. */
31 #include <X11/Intrinsic.h>
32 #include <X11/StringDefs.h>
33 #include <X11/Shell.h>
34 #include <X11/Xaw/Command.h>
35 #include <X11/Xaw/Toggle.h>
36 #include <X11/Xaw/Box.h>
37 #include <X11/Xaw/Form.h>
38 #include <X11/Xaw/Viewport.h>
41 #include FT_FREETYPE_H
45 #define DEFAULT_PIXEL_SIZE 30
46 #define DEFAULT_FONT_NAME "6x13"
48 #define FONT_HEIGHT (font->ascent + font->descent)
49 #define FONT_DESCENT (font->descent)
50 #define FONT_WIDTH (font->max_bounds.width)
54 +--- frame (form) -------------------------+
55 | +--- command_area (box) ---------------+ |
56 | | quit charmap ... | |
57 | +--------------------------------------+ |
58 | +---- navi_area (box) -----------------+ |
59 | | FIRST PREV prev label next NEXT LAST | |
60 | +--------------------------------------+ |
61 | +--- glyph_area (form) ----------------+ |
62 | | glyph[0] ... glyph[15] | |
64 | | glyph[112] ... glyph[127]| |
65 | +--------------------------------------+ |
66 | +--- render_area (form) ---------------+ |
68 | | +--- raw (box) --------------------+ | |
69 | | | raw_label raw_image | | |
70 | | +--- seq (box) --------------------+ | |
71 | | | seq_label seq_image | | |
72 | | +--- gsub (box) -------------------+ | |
73 | | | gsub_label gsub_image | | |
74 | | +--- gpos (box) -------------------+ | |
75 | | | gpos_label gpos_image | | |
76 | | +----------------------------------+ | |
77 | +--------------------------------------+ |
78 +------------------------------------------+ */
80 Widget command_area, quit, *charmap;
81 Widget navi_area, FIRST, PREV, prev, label, next, NEXT, LAST;
82 Widget glyph_area, glyph[128];
83 Widget render_area, clear, raw, seq, gsub, gpos;
84 Widget raw_label, raw_image, seq_label, seq_image;
85 Widget gsub_label, gsub_image, gpos_label, gpos_image;
90 GC gc, gc_set, gc_or, gc_inv;
94 unsigned width, height;
99 BitmapRec bitmap[0x10000];
101 int render_width, render_height;
102 Pixmap raw_pixmap, seq_pixmap, gsub_pixmap, gpos_pixmap;
115 unsigned glyph_width, glyph_height;
116 int glyph_x, glyph_y;
128 create_pixmap (int pixel_size, int index)
130 int err = FT_Load_Glyph (face, index, FT_LOAD_RENDER | FT_LOAD_MONOCHROME);
133 int height = glyph_height + 1 + FONT_HEIGHT;
138 bitmap[index].pixmap = (Pixmap) 0;
141 ximage.height = face->glyph->bitmap.rows;
142 ximage.width = face->glyph->bitmap.width;
144 ximage.bits_per_pixel = 1;
146 ximage.format = XYPixmap;
147 ximage.data = (char *) face->glyph->bitmap.buffer;
148 ximage.byte_order = MSBFirst;
149 ximage.bitmap_unit = 8;
150 ximage.bitmap_bit_order = MSBFirst;
151 ximage.bitmap_pad = 8;
152 ximage.bytes_per_line = face->glyph->bitmap.pitch;
153 XInitImage (&ximage);
154 pixmap = XCreatePixmap (display, DefaultRootWindow (display),
155 glyph_width, height, 1);
156 XFillRectangle (display, pixmap, gc, 0, 0, glyph_width, height);
157 XPutImage (display, pixmap, gc, &ximage, 0, 0,
158 glyph_x + face->glyph->bitmap_left,
159 glyph_y - face->glyph->bitmap_top,
160 ximage.width, ximage.height);
161 sprintf (index_buf, "%04X", index);
162 XDrawLine (display, pixmap, gc_inv,
163 0, glyph_height + 1, glyph_width, glyph_height + 1);
164 XDrawString (display, pixmap, gc_inv,
165 (glyph_width - XTextWidth (font, index_buf, 4)) / 2,
166 height - FONT_DESCENT, index_buf, 4);
167 bitmap[index].pixmap = pixmap;
168 bitmap[index].width = ximage.width;
169 bitmap[index].height = ximage.height;
170 bitmap[index].x = face->glyph->bitmap_left;
171 bitmap[index].y = - face->glyph->bitmap_top;
172 bitmap[index].advance = face->glyph->metrics.horiAdvance >> 6;
182 for (i = 0; i < 128; i++)
184 int index = glyph_index + i;
186 if (charmap_index >= 0)
187 index = FT_Get_Char_Index (face, (FT_ULong) index);
188 if (bitmap[index].pixmap)
189 XtSetArg (arg[0], XtNbitmap, bitmap[index].pixmap);
191 XtSetArg (arg[0], XtNbitmap, none_pixmap);
192 XtSetValues (glyph[i], arg, 1);
195 sprintf (buf, " %04X-%04X ", glyph_index, glyph_index + 0x7F);
196 XtSetArg (arg[0], XtNlabel, buf);
197 XtSetValues (label, arg, 1);
201 update_render_area ()
207 XFillRectangle (display, raw_pixmap, gc, 0, 0, render_width, render_height);
208 XFillRectangle (display, seq_pixmap, gc, 0, 0, render_width, render_height);
209 for (i = 0, x = glyph_x; i < glyph_rec.n_glyphs; i++)
211 BitmapRec *bmp = bitmap + glyph_rec.glyphs[i];
214 XCopyArea (display, bmp->pixmap, raw_pixmap, gc,
215 0, 0, glyph_width, glyph_height,
216 (glyph_width + 1) * i + 1, 1);
217 XDrawRectangle (display, raw_pixmap, gc_set,
218 (glyph_width + 1) * i, 0,
219 glyph_width + 1, glyph_height + 1);
220 XDrawLine (display, raw_pixmap, gc_set,
221 (glyph_width + 1) * i + 1 + glyph_x, 1,
222 (glyph_width + 1) * i + 1 + glyph_x, glyph_height + 1);
223 XDrawLine (display, raw_pixmap, gc_set,
224 (glyph_width + 1) * i + 1 + glyph_x + bmp->advance, 1,
225 (glyph_width + 1) * i + 1 + glyph_x + bmp->advance,
228 sprintf (buf, "%04X", glyph_rec.codes[i]);
229 XDrawString (display, raw_pixmap, gc_inv,
230 (glyph_width + 1) * i + 1
231 + (glyph_width - XTextWidth (font, buf, 4)) / 2,
232 glyph_height + 2 + FONT_HEIGHT, buf, 4);
233 XCopyArea (display, bmp->pixmap, seq_pixmap, gc_or,
234 glyph_x + bmp->x, glyph_y + bmp->y, bmp->width, bmp->height,
235 x + bmp->x, glyph_y + bmp->y);
238 XtSetArg (arg[0], XtNbitmap, raw_pixmap);
239 XtSetValues (raw_image, arg, 1);
240 XtSetArg (arg[0], XtNbitmap, seq_pixmap);
241 XtSetValues (seq_image, arg, 1);
244 XFillRectangle (display, gsub_pixmap, gc, 0, 0, render_width, render_height);
245 XFillRectangle (display, gpos_pixmap, gc, 0, 0, render_width, render_height);
246 XtSetArg (arg[0], XtNbitmap, gsub_pixmap);
247 XtSetValues (gsub_image, arg, 1);
248 XtSetArg (arg[0], XtNbitmap, gpos_pixmap);
249 XtSetValues (gpos_image, arg, 1);
253 QuitProc (Widget w, XtPointer client_data, XtPointer call_data)
255 XtAppSetExitFlag (XtWidgetToApplicationContext (w));
259 GlyphProc (Widget w, XtPointer client_data, XtPointer call_data)
261 int old_glyph_index = glyph_index;
263 if ((int) client_data == -3 && glyph_index > 0)
265 else if ((int) client_data == -2 && glyph_index > 0)
266 glyph_index = (glyph_index - 1) & 0xF000;
267 else if ((int) client_data == -1 && glyph_index > 0)
269 else if ((int) client_data == 1 && glyph_index < 0xFF80)
271 else if ((int) client_data == 2 && glyph_index < 0xF000)
272 glyph_index = (glyph_index + 0x1000) & 0xF000;
273 else if ((int) client_data == 3 && glyph_index < 0xF000)
274 glyph_index = 0xFF80;
275 if (glyph_index != old_glyph_index)
276 update_glyph_area ();
280 CharmapProc (Widget w, XtPointer client_data, XtPointer call_data)
282 if (charmap_index == (int) client_data)
284 charmap_index = (int) client_data;
285 if (charmap_index >= 0)
286 FT_Set_Charmap (face, face->charmaps[charmap_index]);
287 update_glyph_area ();
291 RenderProc (Widget w, XtPointer client_data, XtPointer call_data)
293 if ((int) client_data < 0)
295 glyph_rec.n_glyphs = 0;
296 update_render_area ();
298 else if (glyph_rec.n_glyphs < 64)
300 int index = glyph_index + (int) client_data;
302 if (charmap_index >= 0)
303 index = FT_Get_Char_Index (face, (FT_ULong) index);
304 if (bitmap[index].pixmap)
306 glyph_rec.codes[glyph_rec.n_glyphs] = glyph_index + (int) client_data;
307 glyph_rec.glyphs[glyph_rec.n_glyphs++] = index;
308 update_render_area ();
316 String quit_action = "<KeyPress>q: set() notify() unset()";
317 String FIRST_action = "~Shift<KeyPress>f: set() notify() unset()";
318 String PREV_action = "Shift<KeyPress>p: set() notify() unset()";
319 String prev_action = "~Shift<KeyPress>p: set() notify() unset()";
320 String next_action = "~Shift<KeyPress>n: set() notify() unset()";
321 String NEXT_action = "Shift<KeyPress>n: set() notify() unset()";
322 String LAST_action = "~Shift<KeyPress>l: set() notify() unset()";
325 int glyph_widget_height;
327 frame = XtCreateManagedWidget ("frame", formWidgetClass, shell, NULL, 0);
328 XtSetArg (arg[0], XtNleft, XawChainLeft);
329 XtSetArg (arg[1], XtNright, XawChainLeft);
330 XtSetArg (arg[2], XtNtop, XawChainTop);
331 XtSetArg (arg[3], XtNbottom, XawChainTop);
332 XtSetArg (arg[4], XtNborderWidth, 0);
333 XtSetArg (arg[5], XtNorientation, XtorientHorizontal);
334 command_area = XtCreateManagedWidget ("command-area", boxWidgetClass,
336 XtSetArg (arg[6], XtNfromVert, command_area);
337 navi_area = XtCreateManagedWidget ("navi-area", boxWidgetClass,
339 XtSetArg (arg[4], XtNborderWidth, 1);
340 XtSetArg (arg[5], XtNfromVert, navi_area);
341 XtSetArg (arg[6], XtNdefaultDistance, 0);
342 glyph_area = XtCreateManagedWidget ("glyph-area", formWidgetClass,
344 XtSetArg (arg[4], XtNborderWidth, 0);
345 XtSetArg (arg[5], XtNfromVert, glyph_area);
346 render_area = XtCreateManagedWidget ("render-area", formWidgetClass,
349 XtSetArg (arg[0], XtNaccelerators, XtParseAcceleratorTable (quit_action));
350 quit = XtCreateManagedWidget ("quit", commandWidgetClass,
351 command_area, arg, 1);
352 XtAddCallback (quit, XtNcallback, QuitProc, NULL);
354 charmap = alloca (sizeof (Widget) * (face->num_charmaps + 1));
355 XtSetArg (arg[0], XtNstate, True);
356 charmap[0] = XtCreateManagedWidget (charmap_rec[0].name, toggleWidgetClass,
357 command_area, arg, 1);
358 XtAddCallback (charmap[0], XtNcallback, CharmapProc, (XtPointer) -1);
359 XtSetArg (arg[0], XtNradioGroup, charmap[0]);
360 for (i = 0; i < face->num_charmaps; i++)
362 charmap[i + 1] = XtCreateManagedWidget (charmap_rec[i + 1].name,
364 command_area, arg, 1);
365 XtAddCallback (charmap[i + 1], XtNcallback, CharmapProc, (XtPointer) i);
368 XtSetArg (arg[0], XtNlabel, " |< (f)");
369 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (FIRST_action));
370 FIRST = XtCreateManagedWidget ("FIRST", commandWidgetClass,
372 XtAddCallback (FIRST, XtNcallback, GlyphProc, (XtPointer) -3);
373 XtSetArg (arg[0], XtNlabel, "<< (P)");
374 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (PREV_action));
375 PREV = XtCreateManagedWidget ("PREV", commandWidgetClass,
377 XtAddCallback (PREV, XtNcallback, GlyphProc, (XtPointer) -2);
378 XtSetArg (arg[0], XtNlabel, "< (p)");
379 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (prev_action));
380 prev = XtCreateManagedWidget ("prev", commandWidgetClass,
382 XtAddCallback (prev, XtNcallback, GlyphProc, (XtPointer) -1);
383 XtSetArg (arg[0], XtNlabel, " 0000 ");
384 label = XtCreateManagedWidget ("label", labelWidgetClass,
386 XtSetArg (arg[0], XtNlabel, "> (n)");
387 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (next_action));
388 next = XtCreateManagedWidget ("next", commandWidgetClass,
390 XtAddCallback (next, XtNcallback, GlyphProc, (XtPointer) 1);
391 XtSetArg (arg[0], XtNlabel, ">> (N)");
392 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (NEXT_action));
393 NEXT = XtCreateManagedWidget ("NEXT", commandWidgetClass,
395 XtAddCallback (NEXT, XtNcallback, GlyphProc, (XtPointer) 2);
396 XtSetArg (arg[0], XtNlabel, ">| (l)");
397 XtSetArg (arg[1], XtNaccelerators, XtParseAcceleratorTable (LAST_action));
398 LAST = XtCreateManagedWidget ("LAST", commandWidgetClass,
400 XtAddCallback (LAST, XtNcallback, GlyphProc, (XtPointer) 3);
402 glyph_widget_height = glyph_height + 1 + FONT_HEIGHT;
403 XtSetArg (arg[0], XtNleft, XawChainLeft);
404 XtSetArg (arg[1], XtNright, XawChainLeft);
405 XtSetArg (arg[2], XtNtop, XawChainTop);
406 XtSetArg (arg[3], XtNbottom, XawChainTop);
407 for (i = 0; i < 8; i++)
408 for (j = 0; j < 16; j++)
413 XtSetArg (arg[num_args], XtNwidth, glyph_width), num_args++;
414 XtSetArg (arg[num_args], XtNheight, glyph_widget_height), num_args++;
416 XtSetArg (arg[num_args], XtNfromHoriz, glyph[k - 1]), num_args++;
418 XtSetArg (arg[num_args], XtNfromVert, glyph[k - 16]), num_args++;
419 XtSetArg (arg[num_args], XtNinternalWidth, 0), num_args++;
420 glyph[k] = XtCreateManagedWidget ("glyph", commandWidgetClass,
421 glyph_area, arg, num_args);
422 XtAddCallback (glyph[k], XtNcallback, RenderProc, (XtPointer) k);
425 XtSetArg (arg[0], XtNleft, XawChainLeft);
426 XtSetArg (arg[1], XtNright, XawChainLeft);
427 XtSetArg (arg[2], XtNtop, XawChainTop);
428 XtSetArg (arg[3], XtNbottom, XawChainTop);
429 clear = XtCreateManagedWidget ("clear", commandWidgetClass,
430 render_area, arg, 4);
431 XtAddCallback (clear, XtNcallback, RenderProc, (XtPointer) -1);
432 XtSetArg (arg[4], XtNorientation, XtorientHorizontal);
433 XtSetArg (arg[5], XtNborderWidth, 0);
434 XtSetArg (arg[6], XtNfromVert, clear);
435 raw = XtCreateManagedWidget ("raw", boxWidgetClass,
436 render_area, arg, 7);
437 XtSetArg (arg[0], XtNborderWidth, 0);
438 XtSetArg (arg[1], XtNlabel, "raw: ");
439 raw_label = XtCreateManagedWidget ("raw-label", labelWidgetClass,
441 XtSetArg (arg[1], XtNbitmap, raw_pixmap);
442 raw_image = XtCreateManagedWidget ("raw-image", labelWidgetClass,
444 XtSetArg (arg[6], XtNfromVert, raw);
445 seq = XtCreateManagedWidget ("seq", boxWidgetClass,
446 render_area, arg, 7);
447 XtSetArg (arg[0], XtNborderWidth, 0);
448 XtSetArg (arg[1], XtNlabel, "seq: ");
449 seq_label = XtCreateManagedWidget ("seq-label", labelWidgetClass,
451 XtSetArg (arg[1], XtNbitmap, seq_pixmap);
452 seq_image = XtCreateManagedWidget ("seq-image", labelWidgetClass,
456 XtSetArg (arg[6], XtNfromVert, seq);
457 gsub = XtCreateManagedWidget ("gsub", boxWidgetClass,
458 render_area, arg, 7);
459 XtSetArg (arg[0], XtNborderWidth, 0);
460 XtSetArg (arg[1], XtNlabel, "gsub: ");
461 gsub_label = XtCreateManagedWidget ("gsub-label", labelWidgetClass,
463 gsub_image = XtCreateManagedWidget ("gsub-image", labelWidgetClass,
465 XtSetArg (arg[6], XtNfromVert, gsub);
466 gpos = XtCreateManagedWidget ("gpos", boxWidgetClass,
467 render_area, arg, 7);
468 XtSetArg (arg[0], XtNborderWidth, 0);
469 XtSetArg (arg[1], XtNlabel, "gpos: ");
470 gpos_label = XtCreateManagedWidget ("gpos-label", labelWidgetClass,
472 gpos_image = XtCreateManagedWidget ("gpos-image", labelWidgetClass,
476 XtInstallAllAccelerators (shell, shell);
480 /* Format MSG by FMT and print the result to the stderr, and exit. */
482 #define FATAL_ERROR(fmt, arg) \
484 fprintf (stderr, fmt, arg); \
489 main (int argc, char **argv)
493 OTF_GlyphString gstring;
498 int pixel_size = DEFAULT_PIXEL_SIZE;
502 char *str = getenv ("PIXEL_SIZE");
504 if (str && (i = atoi (str)) > 0)
508 gstring.size = gstring.used = 256;
509 g = calloc (256, sizeof (OTF_Glyph));
512 shell = XtOpenApplication (&context, "OTFView", NULL, 0, &argc, argv, NULL,
513 shellWidgetClass, NULL, 0);
514 display = XtDisplay (shell);
515 display_width = DisplayWidth (display,
516 XScreenNumberOfScreen (XtScreen (shell)));
517 font = XLoadQueryFont (display, DEFAULT_FONT_NAME);
519 font = XLoadQueryFont (display, "fixed");
522 FATAL_ERROR ("%s\n", "Usage: otfview [ X-OPTION ... ] OTF-FILE");
524 if (strstr (argv[1], ".ttf")
525 || strstr (argv[1], ".TTF")
526 || strstr (argv[1], ".otf")
527 || strstr (argv[1], ".OTF"))
529 otf = OTF_open (argv[1]);
531 || OTF_get_table (otf, "head") < 0
532 || OTF_get_table (otf, "cmap") < 0
533 || (OTF_get_table (otf, "gsub") < 0
534 && OTF_get_table (otf, "gpos") < 0))
538 if ((err = FT_Init_FreeType (&library)))
539 FATAL_ERROR ("%s\n", "FT_Init_FreeType: error");
540 err = FT_New_Face (library, argv[1], 0, &face);
541 if (err == FT_Err_Unknown_File_Format)
542 FATAL_ERROR ("%s\n", "FT_New_Face: unknown file format");
544 FATAL_ERROR ("%s\n", "FT_New_Face: unknown error");
545 if ((err = FT_Set_Pixel_Sizes (face, 0, pixel_size)))
546 FATAL_ERROR ("%s\n", "FT_Set_Pixel_Sizes: error");
552 sprintf (title, "%s family:%s style:%s",
553 basename (argv[1]), face->family_name, face->style_name);
554 XtSetArg (arg[0], XtNtitle, title);
555 XtSetValues (shell, arg, 1);
558 glyph_width = ((face->bbox.xMax - face->bbox.xMin)
559 * pixel_size / face->units_per_EM);
560 if (glyph_width * 16 > display_width * 0.8)
562 pixel_size = (pixel_size * display_width * 0.8 / 16 / glyph_width);
563 FT_Set_Pixel_Sizes (face, 0, pixel_size);
564 glyph_width = ((face->bbox.xMax - face->bbox.xMin)
565 * pixel_size / face->units_per_EM);
567 if (glyph_width < FONT_WIDTH * 4)
568 glyph_width = FONT_WIDTH * 4;
570 glyph_height = ((face->bbox.yMax - face->bbox.yMin)
571 * pixel_size / face->units_per_EM);
573 glyph_x = - (face->bbox.xMin * pixel_size / face->units_per_EM);
574 glyph_y = face->ascender * pixel_size / face->units_per_EM;
576 for (i = 0; i < 0x10000; i++)
577 if (FT_Load_Glyph (face, i, FT_LOAD_RENDER | FT_LOAD_MONOCHROME) == 0)
579 if (glyph_x < - face->glyph->bitmap_left)
580 glyph_x = - face->glyph->bitmap_left;
581 if (glyph_y < face->glyph->bitmap_top)
582 glyph_y = face->glyph->bitmap_top;
584 < glyph_x + face->glyph->bitmap_left + face->glyph->bitmap.width)
586 = glyph_x + face->glyph->bitmap_left + face->glyph->bitmap.width;
588 < glyph_y - face->glyph->bitmap_top + face->glyph->bitmap.rows)
590 = glyph_y - face->glyph->bitmap_top + face->glyph->bitmap.rows;
593 none_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
594 glyph_width, glyph_height + 1 + FONT_HEIGHT, 1);
597 unsigned long valuemask = GCFunction | GCLineWidth;
600 gc = XCreateGC (display, none_pixmap, (unsigned long) 0, NULL);
601 values.function = GXset;
602 values.line_width = 1;
603 gc_set = XCreateGC (display, none_pixmap, valuemask, &values);
604 values.function = GXor;
605 gc_or = XCreateGC (display, none_pixmap, valuemask, &values);
606 values.function = GXcopyInverted;
607 gc_inv = XCreateGC (display, none_pixmap, valuemask, &values);
610 XFillRectangle (display, none_pixmap, gc, 0, 0,
611 glyph_width, glyph_height + 1 + FONT_HEIGHT);
612 XDrawString (display, none_pixmap, gc_inv,
613 (glyph_width - XTextWidth (font, "none", 4)) / 2,
614 glyph_height / 2, "none", 4);
616 render_width = (glyph_width + 1) * 15 + 1;
617 render_height = glyph_height + FONT_HEIGHT + 2;
619 charmap_rec[0].platform_id = -1;
620 charmap_rec[0].encoding_id = -1;
621 strcpy (charmap_rec[0].name, "no charmap");
623 for (i = 0; i < face->num_charmaps; i++)
625 charmap_rec[i + 1].platform_id = face->charmaps[i]->platform_id;
626 charmap_rec[i + 1].encoding_id = face->charmaps[i]->encoding_id;
627 sprintf (charmap_rec[i + 1].name, "%d-%d",
628 charmap_rec[i + 1].platform_id, charmap_rec[i + 1].encoding_id);
629 if (face->charmaps[i]->platform_id == 0
630 || (face->charmaps[i]->platform_id == 3
631 && face->charmaps[i]->encoding_id == 1))
632 strcat (charmap_rec[i + 1].name, " (unicode)");
633 else if (face->charmaps[i]->platform_id == 1
634 && face->charmaps[i]->encoding_id == 0)
635 strcat (charmap_rec[i + 1].name, " (apple-roman)");
638 raw_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
639 render_width, render_height, 1);
640 seq_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
641 render_width, render_height, 1);
642 gsub_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
643 render_width, render_height, 1);
644 gpos_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
645 render_width, render_height, 1);
647 for (i = 0; i < 0x10000; i++)
648 create_pixmap (pixel_size, i);
652 update_glyph_area ();
653 update_render_area ();
655 XtRealizeWidget (shell);
656 XtAppMainLoop (context);