From c1c9eeb8185b48a866f5e3841ef55c254fa96bfc Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 29 Dec 2008 14:54:19 +0000 Subject: [PATCH] (OTF_get_variation_glyphs): New function. --- src/otfdrive.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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; -- 1.7.10.4