ref: bbc9cf576436e4e7ee57e5062ad9d789b2ef56bf
parent: cc916744b83db65cc98e88729b1d5ceec0a38ae0
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Aug 8 06:22:17 EDT 2014
font: inline glyph groups with only one glyph
--- a/font.c
+++ b/font.c
@@ -147,12 +147,14 @@
/* finding the first glyph; -1 if FG_GRP */
while (i < rule->len && rule->pats[i].flg & (GF_REP | GF_CON))
i++; /* skipping replacement and context glyphs */
- g1 = i < rule->len && rule->pats[i].flg == GF_PAT ? rule->pats[i].g : -1;
+ if (i < rule->len && rule->pats[i].flg == GF_PAT)
+ g1 = rule->pats[i].g;
i++;
/* finding the second glyph; -1 if FG_GRP */
while (i < rule->len && rule->pats[i].flg & GF_REP)
i++; /* skipping replacement glyphs */
- g2 = i < rule->len && rule->pats[i].flg == GF_PAT ? rule->pats[i].g : -1;
+ if (i < rule->len && rule->pats[i].flg == GF_PAT)
+ g2 = rule->pats[i].g;
return GHASH(g1, g2);
}
@@ -376,8 +378,11 @@
static int font_readgpat(struct font *fn, struct gpat *p, char *s)
{
if (s[0] == '@') {
- p->flg |= GF_GRP;
p->g = atoi(s + 1);
+ if (fn->ggrp_len[p->g] == 1)
+ p->g = fn->ggrp[p->g][0];
+ else
+ p->flg |= GF_GRP;
} else {
p->g = font_idx(fn, font_glyph(fn, s));
}