summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2006-10-12 04:57:59 +0000
committerRich Felker <dalias@aerifal.cx>2006-10-12 04:57:59 +0000
commit58ece9167987dbc3b88656c470244543cb3d5c32 (patch)
treea179d554c596ef7e885800564b61e7117c49e979
parentc50a3902f6a5557c0173f6c588540d3207914aec (diff)
store max possible glyphs bound
-rw-r--r--ucf.c1
-rw-r--r--ucf.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/ucf.c b/ucf.c
index 94caa40..8c4a487 100644
--- a/ucf.c
+++ b/ucf.c
@@ -29,6 +29,7 @@ int ucf_init(struct ucf *f, const unsigned char *map, size_t len)
f->ranges = map + U32(map+20) + 4;
f->gmap = map + U32(map+24);
f->glyphs = map + U32(map+28);
+ f->nglyphs = (len - (f->glyphs - map)) / f->S;
f->ctab = f->ranges + 8*(f->nranges = U32(f->ranges - 4));
return 0;
}
diff --git a/ucf.h b/ucf.h
index da238cd..1429cd3 100644
--- a/ucf.h
+++ b/ucf.h
@@ -6,7 +6,7 @@ struct ucf
{
int w, h, s, S;
const unsigned char *ranges, *ctab, *gmap, *glyphs;
- unsigned nranges;
+ unsigned nranges, nglyphs;
};
int ucf_init(struct ucf *, const unsigned char *, size_t);