diff options
author | Matthias Kramm <kramm@quiss.org> | 2009-11-18 21:12:26 -0800 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2009-11-18 21:12:26 -0800 |
commit | 18c92a7b9532ccc8ad219fa4a2f83cdc651ec3e1 (patch) | |
tree | 288ad6fa75b572a1cb5c4908988ccd52b15a1fc2 | |
parent | e633c982297e1728e8373f80d25533776a9b92b0 (diff) |
added occurence counting to glyph pair tracker
-rw-r--r-- | lib/modules/swfalignzones.c | 2 | ||||
-rw-r--r-- | lib/modules/swftext.c | 6 | ||||
-rw-r--r-- | lib/rfxswf.h | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/modules/swfalignzones.c b/lib/modules/swfalignzones.c index f05cad81..21780d35 100644 --- a/lib/modules/swfalignzones.c +++ b/lib/modules/swfalignzones.c @@ -238,7 +238,7 @@ void swf_FontCreateAlignZones(SWFFONT * f) printf("[font %d] pairing %c with ", f->id, f->glyph2ascii[t]); for(s=0;s<f->use->num_neighbors;s++) { if(f->use->neighbors[s].char2 == t) { - printf("%c ", f->glyph2ascii[f->use->neighbors[s].char1]); + printf("%c (%d) ", f->glyph2ascii[f->use->neighbors[s].char1], f->use->neighbors[s].num); draw_char(f, f->use->neighbors[s].char1, row, column, bounds); drawn++; } diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 2ce669a8..c473211b 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -967,17 +967,19 @@ void swf_FontUsePair(SWFFONT * f, int char1, int char2) } } - if(!swf_FontUseGetPair(f, char1, char2)) { + int nr = swf_FontUseGetPair(f, char1, char2); + if(!nr) { if(u->num_neighbors == u->neighbors_size) { u->neighbors_size += 4096; u->neighbors = rfx_realloc(u->neighbors, sizeof(SWFGLYPHPAIR)*u->neighbors_size); } u->neighbors[u->num_neighbors].char1 = char1; u->neighbors[u->num_neighbors].char2 = char2; + u->neighbors[u->num_neighbors].num = 1; hashadd(u, char1, char2, u->num_neighbors); u->num_neighbors++; } else { - // increase? + u->neighbors[nr-1].num++; } } diff --git a/lib/rfxswf.h b/lib/rfxswf.h index 4ca38a28..7f8eb1cb 100644 --- a/lib/rfxswf.h +++ b/lib/rfxswf.h @@ -534,6 +534,7 @@ typedef struct _SWFGLYPHPAIR { U16 char1; U16 char2; + int num; } SWFGLYPHPAIR; typedef struct _FONTUSAGE |