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 (from parent 1:
24eea9a
)
fixed fontUsage functions.
author
kramm
<kramm>
Fri, 28 May 2004 08:50:53 +0000
(08:50 +0000)
committer
kramm
<kramm>
Fri, 28 May 2004 08:50:53 +0000
(08:50 +0000)
lib/modules/swftext.c
patch
|
blob
|
history
diff --git
a/lib/modules/swftext.c
b/lib/modules/swftext.c
index
6b13c64
..
3d6a49b
100644
(file)
--- a/
lib/modules/swftext.c
+++ b/
lib/modules/swftext.c
@@
-478,7
+478,7
@@
int swf_FontReduce(SWFFONT * f,FONTUSAGE * use)
j = 0;
for (i=0;i<f->numchars;i++)
if (f->glyph[i].shape)
j = 0;
for (i=0;i<f->numchars;i++)
if (f->glyph[i].shape)
- { if (f->glyph2ascii[i]<f->numchars&&
+ { if (f->glyph2ascii[i]<f->maxascii&&
use->code[f->glyph2ascii[i]])
{ f->ascii2glyph[f->glyph2ascii[i]] = j;
f->glyph2ascii[j] = f->glyph2ascii[i];
use->code[f->glyph2ascii[i]])
{ f->ascii2glyph[f->glyph2ascii[i]] = j;
f->glyph2ascii[j] = f->glyph2ascii[i];
@@
-501,8
+501,8
@@
int swf_FontReduce(SWFFONT * f,FONTUSAGE * use)
int swf_FontInitUsage(SWFFONT* f, FONTUSAGE * use)
{ if (!use) return -1;
int swf_FontInitUsage(SWFFONT* f, FONTUSAGE * use)
{ if (!use) return -1;
- use->code = malloc(sizeof(use->code[0])*f->numchars);
- memset(use->code,0,sizeof(use->code[0])*f->numchars);
+ use->code = malloc(sizeof(use->code[0])*f->maxascii);
+ memset(use->code,0,sizeof(use->code[0])*f->maxascii);
return 0;
}
return 0;
}
@@
-511,7
+511,7
@@
void swf_FontClearUsage(SWFFONT* f, FONTUSAGE * use)
free(use->code);
}
free(use->code);
}
-int swf_FontUse(FONTUSAGE * use,U8 * s)
+int swf_FontUse(SWFFONT*f, FONTUSAGE * use,U8 * s)
{ if ((!use)||(!s)) return -1;
while (s[0])
{ use->code[s[0]] = 1;
{ if ((!use)||(!s)) return -1;
while (s[0])
{ use->code[s[0]] = 1;