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:
5eb77fb
)
made advance value fixing less picky
author
kramm
<kramm>
Sun, 21 Oct 2007 19:55:32 +0000
(19:55 +0000)
committer
kramm
<kramm>
Sun, 21 Oct 2007 19:55:32 +0000
(19:55 +0000)
lib/devices/swf.c
patch
|
blob
|
history
diff --git
a/lib/devices/swf.c
b/lib/devices/swf.c
index
b23f262
..
cf9b655
100644
(file)
--- a/
lib/devices/swf.c
+++ b/
lib/devices/swf.c
@@
-694,7
+694,7
@@
static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, int charid, float x, floa
}
if(charid<0 || charid>=swffont->numchars) {
}
if(charid<0 || charid>=swffont->numchars) {
- msg("<warning> No character %d in font %s ", charid, FIXNULL((char*)swffont->name));
+ msg("<warning> No character %d in font %s (%d chars)", charid, FIXNULL((char*)swffont->name), swffont->numchars);
return 0;
}
/*if(swffont->glyph[charid].shape->bitlen <= 16) {
return 0;
}
/*if(swffont->glyph[charid].shape->bitlen <= 16) {
@@
-2438,9
+2438,10
@@
static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id)
swffont->glyph[t].shape = swf_ShapeDrawerToShape(&draw);
swffont->layout->bounds[t] = swf_ShapeDrawerGetBBox(&draw);
swffont->glyph[t].shape = swf_ShapeDrawerToShape(&draw);
swffont->layout->bounds[t] = swf_ShapeDrawerGetBBox(&draw);
- if(swffont->layout->bounds[t].xmax && swffont->layout->bounds[t].xmax*2 < advance) {
- printf("fix bad advance value: bbox=%d, advance=%d (%f)\n", swffont->layout->bounds[t].xmax, advance, font->glyphs[t].advance);
- advance = swffont->layout->bounds[t].xmax;
+ int xmax = swffont->layout->bounds[t].xmax / 20;
+ if(xmax>0 && xmax*2 < advance) {
+ printf("fix bad advance value: bbox=%d, advance=%d (%f)\n", xmax, advance, font->glyphs[t].advance);
+ advance = xmax;
}
if(advance<32768) {
}
if(advance<32768) {