From: handa Date: Mon, 29 Dec 2008 14:54:19 +0000 (+0000) Subject: (OTF_get_variation_glyphs): New function. X-Git-Tag: REL-0-9-9~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c1c9eeb8185b48a866f5e3841ef55c254fa96bfc;p=m17n%2Flibotf.git (OTF_get_variation_glyphs): New function. --- diff --git a/src/otfdrive.c b/src/otfdrive.c index 90be525..0f7633e 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -1509,6 +1509,35 @@ OTF_get_unicode (OTF *otf, OTF_GlyphID code) } int +OTF_get_variation_glyphs (OTF *otf, int c, OTF_GlyphID code[256]) +{ + int i, n; + OTF_cmap *cmap; + OTF_EncodingSubtable14 *sub14; + + memset (code, 0, sizeof (OTF_GlyphID) * 256); + if (! otf->cmap + && OTF_get_table (otf, "cmap") < 0) + return 0; + cmap = otf->cmap; + for (i = 0; i < cmap->numTables; i++) + if (cmap->EncodingRecord[i].subtable.format == 14) + break; + if (i == cmap->numTables) + return 0; + sub14 = cmap->EncodingRecord[i].subtable.f.f14; + for (i = 0, n = 0; i < 256; i++) + { + int uvs = (i < 16 ? 0xFE00 + i : 0xE0100 + (i - 16)); + + if ((code[i] = get_uvs_glyph (cmap, sub14, c, uvs))) + n++; + } + return n; +} + + +int OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring) { OTF_GDEF *gdef;