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:
a61b92b
)
handle fonts with zero bboxes in layout more gracefully
author
Matthias Kramm
<kramm@quiss.org>
Sun, 29 Nov 2009 19:58:01 +0000
(11:58 -0800)
committer
Matthias Kramm
<kramm@quiss.org>
Sun, 29 Nov 2009 19:58:01 +0000
(11:58 -0800)
lib/modules/swftext.c
patch
|
blob
|
history
diff --git
a/lib/modules/swftext.c
b/lib/modules/swftext.c
index
41207bf
..
bc0ff4f
100644
(file)
--- a/
lib/modules/swftext.c
+++ b/
lib/modules/swftext.c
@@
-349,6
+349,13
@@
int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag)
for (t = 0; t < glyphcount; t++) {
swf_ResetReadBits(tag);
swf_GetRect(tag, &font->layout->bounds[t]);
+ SRECT b = font->layout->bounds[t];
+ if((b.xmin|b.xmax|b.ymin|b.ymax) == 0) {
+ // recalculate bounding box
+ SHAPE2 *shape2 = swf_ShapeToShape2(font->glyph[t].shape);
+ font->layout->bounds[t] = swf_GetShapeBoundingBox(shape2);
+ swf_Shape2Free(shape2);
+ }
}
kerningcount = swf_GetU16(tag);