else if (glyph_rec.n_glyphs < 64)
{
int index = glyph_index + (int) client_data;
- if (charmap_index >= 0)
- index = FT_Get_Char_Index (face, (FT_ULong) index);
- glyph_rec.glyphs[glyph_rec.n_glyphs++] = index;
- update_render_area ();
+
+ if (bitmap[index].pixmap)
+ {
+ if (charmap_index >= 0)
+ index = FT_Get_Char_Index (face, (FT_ULong) index);
+ glyph_rec.glyphs[glyph_rec.n_glyphs++] = index;
+ update_render_area ();
+ }
}
}
int err;
int i;
int pixel_size = DEFAULT_PIXEL_SIZE;
+ int display_width;
{
char *str = getenv ("PIXEL_SIZE");
shell = XtOpenApplication (&context, "OTFView", NULL, 0, &argc, argv, NULL,
shellWidgetClass, NULL, 0);
display = XtDisplay (shell);
+ display_width = DisplayWidth (display,
+ XScreenNumberOfScreen (XtScreen (shell)));
if (argc != 2)
FATAL_ERROR ("%s\n", "Usage: otfview [ X-OPTION ... ] OTF-FILE");
else if (err)
FATAL_ERROR ("%s\n", "FT_New_Face: unknown error");
if ((err = FT_Set_Pixel_Sizes (face, 0, pixel_size)))
- FATAL_ERROR ("%s\n", "FT_Set_Char_Size: error");
+ FATAL_ERROR ("%s\n", "FT_Set_Pixel_Sizes: error");
{
char title[256];
XtSetValues (shell, arg, 1);
}
-
glyph_width = ((face->bbox.xMax - face->bbox.xMin)
* pixel_size / face->units_per_EM);
+ if (glyph_width * 16 > display_width * 0.8)
+ {
+ pixel_size = (pixel_size * display_width * 0.8 / 16 / glyph_width);
+ FT_Set_Pixel_Sizes (face, 0, pixel_size);
+ glyph_width = ((face->bbox.xMax - face->bbox.xMin)
+ * pixel_size / face->units_per_EM);
+ }
glyph_height = ((face->bbox.yMax - face->bbox.yMin)
* pixel_size / face->units_per_EM);
+
glyph_x = - (face->bbox.xMin * pixel_size / face->units_per_EM);
glyph_y = face->bbox.yMax * pixel_size / face->units_per_EM;
+ render_width = (glyph_width + 1) * 15 + 1;
+ render_height = glyph_height + 2;
+
charmap_rec[0].platform_id = -1;
charmap_rec[0].encoding_id = -1;
strcpy (charmap_rec[0].name, "no charmap");
strcat (charmap_rec[i + 1].name, " (apple-roman)");
}
- render_width = (glyph_width + 1) * 15 + 1;
- render_height = glyph_height + 2;
raw_pixmap = XCreatePixmap (display, DefaultRootWindow (display),
render_width, render_height, 1);
seq_pixmap = XCreatePixmap (display, DefaultRootWindow (display),