git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fc71326
)
only create a unicode2glyph table if explicitly requested
author
Matthias Kramm
<kramm@quiss.org>
Thu, 6 May 2010 01:39:51 +0000
(18:39 -0700)
committer
Matthias Kramm
<kramm@quiss.org>
Thu, 6 May 2010 01:39:51 +0000
(18:39 -0700)
lib/gfxfont.c
patch
|
blob
|
history
lib/gfxfont.h
patch
|
blob
|
history
diff --git
a/lib/gfxfont.c
b/lib/gfxfont.c
index
e6f96cb
..
a310bfa
100644
(file)
--- a/
lib/gfxfont.c
+++ b/
lib/gfxfont.c
@@
-557,7
+557,22
@@
void gfxfont_fix_unicode(gfxfont_t*font)
max = u;
}
free(used);
max = u;
}
free(used);
-
+ if(font->unicode2glyph) {
+ free(font->unicode2glyph);
+ }
+ font->unicode2glyph = 0;
+ font->max_unicode = 0;
+}
+
+void gfxfont_add_unicode2glyph(gfxfont_t*font)
+{
+ int t;
+ int max = 0;
+ for(t=0;t<font->num_glyphs;t++) {
+ int u = font->glyphs[t].unicode;
+ if(u > max)
+ max = u;
+ }
if(!font->unicode2glyph) {
/* (re)generate unicode2glyph-to-glyph mapping table by reverse mapping
the glyph unicode2glyph's indexes into the mapping table. For collisions,
if(!font->unicode2glyph) {
/* (re)generate unicode2glyph-to-glyph mapping table by reverse mapping
the glyph unicode2glyph's indexes into the mapping table. For collisions,
diff --git
a/lib/gfxfont.h
b/lib/gfxfont.h
index
0c18a56
..
a3e1acc
100644
(file)
--- a/
lib/gfxfont.h
+++ b/
lib/gfxfont.h
@@
-37,6
+37,7
@@
void gfxfont_save(gfxfont_t*font, const char*filename);
void gfxfont_save_eot(gfxfont_t*font, const char*filename);
void gfxfont_fix_unicode(gfxfont_t*font);
void gfxfont_free(gfxfont_t*font);
void gfxfont_save_eot(gfxfont_t*font, const char*filename);
void gfxfont_fix_unicode(gfxfont_t*font);
void gfxfont_free(gfxfont_t*font);
+void gfxfont_add_unicode2glyph(gfxfont_t*font);
#ifdef __cplusplus
}
#ifdef __cplusplus
}