From: handa Date: Tue, 13 Jan 2004 02:49:28 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: REL-0-9-1~82 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c99dcb981a794c449fcbde870792c3f2e1016769;p=m17n%2Flibotf.git *** empty log message *** --- diff --git a/example/otftobdf.c b/example/otftobdf.c index af9a7fc..acbdf2c 100644 --- a/example/otftobdf.c +++ b/example/otftobdf.c @@ -93,7 +93,7 @@ main (int argc, char **argv) int err; int i; int pixel_size = DEFAULT_PIXEL_SIZE; - FT_UInt unicode_table[0x80]; + FT_UInt unicode_table[0x10000]; int nchars; if (argc != 2) @@ -106,9 +106,6 @@ main (int argc, char **argv) FATAL_ERROR ("%s\n", "FT_New_Face: unknown file format"); 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_Pixel_Sizes: error"); - { char *str = getenv ("PIXEL_SIZE"); @@ -116,18 +113,28 @@ main (int argc, char **argv) pixel_size = i; } + if ((err = FT_Set_Pixel_Sizes (face, 0, pixel_size))) + FATAL_ERROR ("%s\n", "FT_Set_Pixel_Sizes: error"); + for (i = nchars = 0; i < 0x10000; i++) if (! FT_Load_Glyph (face, i, FT_LOAD_RENDER | FT_LOAD_MONOCHROME) && face->glyph->bitmap.rows * face->glyph->bitmap.width) nchars++; - for (i = 0x0D00; i < 0x0D80; i++) - if ((unicode_table[i - 0x0D00] = FT_Get_Char_Index (face, (FT_ULong) i))) - nchars++; + for (i = 0; i < 0x10000; i++) + if ((unicode_table[i] = FT_Get_Char_Index (face, (FT_ULong) i))) + { + if (! FT_Load_Glyph (face, unicode_table[i], + FT_LOAD_RENDER | FT_LOAD_MONOCHROME) + && face->glyph->bitmap.rows * face->glyph->bitmap.width) + nchars++; + else + unicode_table[i] = 0; + } dump_header (face, "SuperSoft", nchars, pixel_size); - for (i = 0; i < 0x80; i++) + for (i = 0; i < 0x10000; i++) if (unicode_table[i]) - dump_image (pixel_size, unicode_table[i], 0x0D00 + i, 1); + dump_image (pixel_size, unicode_table[i], i, 1); for (i = 0; i < 0x10000; i++) dump_image (pixel_size, i, 0xE000 + i, 0); dump_tailer ();