printf("%c",code);
}
if (jobs&FEDTJ_MODIFY)
- f->glyph[glyph].advance = adv;
+ f->glyph[glyph].advance = adv*20; //?
} else {
if (jobs&FEDTJ_PRINT) {
printf("?");
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];
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;
}
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;
glyph = font->ascii2glyph[s[0]];
if(glyph>=0) {
g = swf_CountUBits(glyph,g);
- a = swf_CountBits((((U32)font->glyph[glyph].advance)*scale)/100,a);
+ a = swf_CountBits(((((U32)font->glyph[glyph].advance)*scale)/20)/100,a);
}
s++;
}
g = font->ascii2glyph[s[i]];
if(g>=0) {
swf_SetBits(t,g,gbits);
- swf_SetBits(t,(((U32)font->glyph[g].advance)*scale)/100,abits);
+ swf_SetBits(t,((((U32)font->glyph[g].advance)*scale)/20)/100,abits);
l++;
if(l==0x7f)
break;
if(*s < font->maxascii)
g = font->ascii2glyph[*s];
if(g>=0)
- res += font->glyph[g].advance;
+ res += font->glyph[g].advance/20;
s++;
}
if (scale) res = (res*scale)/100;
{
int g = font->ascii2glyph[s];
if(g>=0) {
- if(font->glyph[g].advance*textscale/64 > xmax) {
- xmax = font->glyph[g].advance*textscale/64;
+ if((font->glyph[g].advance*textscale/20)/64 > xmax) {
+ xmax = (font->glyph[g].advance*textscale/20)/64;
}
c++;
}
}
swf_SetU8(t,1);
swf_SetBits(t, g, gbits);
- swf_SetBits(t, font->glyph[g].advance, abits);
- lastx = x*xmax+font->glyph[g].advance;
+ swf_SetBits(t, font->glyph[g].advance/20, abits);
+ lastx = x*xmax+(font->glyph[g].advance/20);
swf_ResetWriteBits(t);
}
}
rn.ymin = (rn.ymin * scale)/100;
rn.ymax = (rn.ymax * scale)/100;
swf_ExpandRect2(&r, &rn);
- pos += (font->glyph[g].advance*scale*20)/100;
+ pos += (font->glyph[g].advance*scale)/100;
}
}
c++;
bbox = swf_GetShapeBoundingBox(shape2);
swf_Shape2Free(shape2);
f->layout->bounds[t] = bbox;
- /* FIXME */
- //width = (bbox.xmax - bbox.xmin)/20;
- width = (bbox.xmax)/20;
+
+ width = (bbox.xmax);
/* The following is a heuristic- it may be that extractfont_DefineText
has already found out some widths for individual characters (from the way
l = l->next;
}
swf_Shape2Free(shape2);
- advance += font->glyph[g].advance;
+ advance += font->glyph[g].advance/20.0;
}
}