static void dochar_plotter(char const data[YSIZE], unsigned flags);
static void domosaic(unsigned code, bool sep);
static void domosaic4(unsigned code, bool sep);
-static void doalias(char const *alias_of);
static void dopanose(void);
static void docmap(int pid, int eid, int format);
static void glyph_complement(void);
static struct glyph const *glyphs_by_name[NGLYPHS];
static void dolookups(struct glyph const *);
+static void doglyph(struct glyph const *);
static bool
getpix(char const data[YSIZE - 1], int x, int y, unsigned flags)
TTXF(StdHW, "%4g", (double)YPIX);
TTXF(StdVW, "%4g", (double)(XPIX * (100 + weight->weight) / 100));
TTXI(defaultWidthX, XSIZE * XPIX);
- printf(" </Private>\n");
/* if (plottermode) { */
/* printf("StrokedFont: 1\n"); */
/* printf("StrokeWidth: 50\n"); */
/* printf("OtfFeatName: 'ss16' 1033 \"6-cell separated graphics\"\n"); */
/* printf("Lookup: 257 0 0 \"palt: proportional metrics\" {\"palt\"} " */
/* "['palt' ('DFLT' <'dflt'> 'latn' <'dflt'>)]\n"); */
- printf(" <CharStrings>\n");
extraglyphs = 0;
for (i = 0; i < nglyphs; i++)
glyphs_by_name[i] = glyphs + i;
qsort(glyphs_by_name, nglyphs, sizeof(glyphs_by_name[0]),
&compare_glyphs_by_name);
+ printf(" </Private>\n");
+ printf(" <CharStrings>\n");
for (i = 0; i < nglyphs; i++) {
printf(" <CharString name='%s'>\n", glyphs[i].name);
- /* dolookups(&glyphs[i]); */
- if (glyphs[i].flags & IS_ALIAS)
- doalias(glyphs[i].alias_of);
- else if (glyphs[i].flags & MOS6)
- domosaic(glyphs[i].data[0],
- (glyphs[i].flags & SEP) != 0);
- else if (glyphs[i].flags & MOS4)
- domosaic4(glyphs[i].data[0],
- (glyphs[i].flags & SEP) != 0);
- else {
- if (plottermode)
- dochar_plotter(glyphs[i].data, glyphs[i].flags);
- else
- dochar(glyphs[i].data, glyphs[i].flags);
- }
+ doglyph(&glyphs[i]);
printf(" </CharString>\n");
}
printf(" </CharStrings>\n");
printf(" </cmap_format_%d>\n", format);
}
+/* Emit a charstring for a glyph. */
+static void
+doglyph(struct glyph const *g)
+{
+
+ while (g->flags & IS_ALIAS)
+ g = get_glyph_by_name(g->alias_of);
+ if (g->flags & MOS6)
+ domosaic(g->data[0], (g->flags & SEP) != 0);
+ else if (g->flags & MOS4)
+ domosaic4(g->data[0], (g->flags & SEP) != 0);
+ else if (plottermode)
+ dochar_plotter(g->data, g->flags);
+ else
+ dochar(g->data, g->flags);
+}
+
static void
dopalt(struct glyph const *g)
{
emit_path();
}
-static void
-doalias(char const *alias_of)
-{
- struct glyph const *g;
-
- /* g = get_glyph_by_name(alias_of); */
- /* printf("Refer: %td %d N 1 0 0 1 0 0 1\n", g - glyphs, g->unicode); */
- /* XXX */
- printf("endchar\n");
-}
-
static int
byunicode(const void *va, const void *vb)
{