git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only store max. 256 characters into a font SWF file to prevent
[swftools.git]
/
lib
/
modules
/
swftext.c
diff --git
a/lib/modules/swftext.c
b/lib/modules/swftext.c
index
3d6a49b
..
1e8e7e6
100644
(file)
--- a/
lib/modules/swftext.c
+++ b/
lib/modules/swftext.c
@@
-927,7
+927,7
@@
void swf_WriteFont(SWFFONT*font, char* filename)
{
int c;
t = swf_InsertTag(t,ST_GLYPHNAMES);
{
int c;
t = swf_InsertTag(t,ST_GLYPHNAMES);
- swf_SetU16(t, font->id);
+ swf_SetU16(t, WRITEFONTID);
swf_SetU16(t, font->numchars);
for(c=0;c<font->numchars;c++) {
swf_SetString(t, font->glyphnames[c]);
swf_SetU16(t, font->numchars);
for(c=0;c<font->numchars;c++) {
swf_SetString(t, font->glyphnames[c]);
@@
-943,9
+943,14
@@
void swf_WriteFont(SWFFONT*font, char* filename)
int ypos = 1;
U8 gbits,abits;
int x,y,c;
int ypos = 1;
U8 gbits,abits;
int x,y,c;
+ int range = font->maxascii;
c=0;
c=0;
- for(s=0;s<font->maxascii;s++)
+ if(useDefineFont2 && range > 256) {
+ range = 256;
+ }
+
+ for(s=0;s<range;s++)
{
int g = font->ascii2glyph[s];
if(g>=0) {
{
int g = font->ascii2glyph[s];
if(g>=0) {
@@
-989,11
+994,11
@@
void swf_WriteFont(SWFFONT*font, char* filename)
rgb.g = 0x00;
rgb.b = 0x00;
ypos = 1;
rgb.g = 0x00;
rgb.b = 0x00;
ypos = 1;
- for(y=0;y<((font->maxascii+15)/16);y++)
+ for(y=0;y<((range+15)/16);y++)
{
int c=0,lastx=-1;
for(x=0;x<16;x++) {
{
int c=0,lastx=-1;
for(x=0;x<16;x++) {
- int g = (y*16+x<font->maxascii)?font->ascii2glyph[y*16+x]:-1;
+ int g = (y*16+x<range)?font->ascii2glyph[y*16+x]:-1;
if(g>=0 && font->glyph[g].shape) {
c++;
if(lastx<0)
if(g>=0 && font->glyph[g].shape) {
c++;
if(lastx<0)
@@
-1004,7
+1009,7
@@
void swf_WriteFont(SWFFONT*font, char* filename)
swf_TextSetInfoRecord(t,font,textscale,&rgb,lastx+1,textscale*ypos*2);
for(x=0;x<16;x++)
{
swf_TextSetInfoRecord(t,font,textscale,&rgb,lastx+1,textscale*ypos*2);
for(x=0;x<16;x++)
{
- int g = (y*16+x<font->maxascii)?font->ascii2glyph[y*16+x]:-1;
+ int g = (y*16+x<range)?font->ascii2glyph[y*16+x]:-1;
if(g>=0 && font->glyph[g].shape) {
if(lastx != x*xmax) {
swf_TextSetInfoRecord(t,0,0,0,x*xmax+1,0);
if(g>=0 && font->glyph[g].shape) {
if(lastx != x*xmax) {
swf_TextSetInfoRecord(t,0,0,0,x*xmax+1,0);