git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new function swf_RemoveJPEGTables()
[swftools.git]
/
lib
/
modules
/
swftext.c
diff --git
a/lib/modules/swftext.c
b/lib/modules/swftext.c
index
06d3eea
..
8690989
100644
(file)
--- a/
lib/modules/swftext.c
+++ b/
lib/modules/swftext.c
@@
-101,7
+101,7
@@
int swf_FontIsBold(SWFFONT * f)
static const int WRITEFONTID = 0x4e46; // font id for WriteFont and ReadFont
static const int WRITEFONTID = 0x4e46; // font id for WriteFont and ReadFont
-int swf_FontEnumerate(SWF * swf, void (*FontCallback) (U16, U8 *))
+int swf_FontEnumerate(SWF * swf, void (*FontCallback) (void*, U16, U8 *), void*self)
{
int n;
TAG *t;
{
int n;
TAG *t;
@@
-129,7
+129,7
@@
int swf_FontEnumerate(SWF * swf, void (*FontCallback) (U16, U8 *))
s[l] = 0;
}
s[l] = 0;
}
- (FontCallback) (id, s);
+ (FontCallback) (self, id, s);
swf_RestoreTagPos(t);
}
swf_RestoreTagPos(t);
}
@@
-381,7
+381,7
@@
int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag)
static int
swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs,
void (*callback) (void *self,
static int
swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs,
void (*callback) (void *self,
- int *chars, int *ypos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self)
+ int *chars, int *xpos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self)
{
U16 cid;
SRECT r;
{
U16 cid;
SRECT r;
@@
-1015,16
+1015,22
@@
int swf_TextSetInfoRecord(TAG * t, SWFFONT * font, U16 size, RGBA * color, int d
swf_SetRGB(t, color);
}
if (dx) {
swf_SetRGB(t, color);
}
if (dx) {
- dx &= ~SET_TO_ZERO;
- if(dx>32767 || dx<-32768)
- fprintf(stderr, "Warning: Horizontal char position overflow: %d\n", dx);
- swf_SetS16(t, dx);
+ if(dx != SET_TO_ZERO) {
+ if(dx>32767 || dx<-32768)
+ fprintf(stderr, "Warning: Horizontal char position overflow: %d\n", dx);
+ swf_SetS16(t, dx);
+ } else {
+ swf_SetS16(t, 0);
+ }
}
if (dy) {
}
if (dy) {
- dy &= ~SET_TO_ZERO;
- if(dy>32767 || dy<-32768)
- fprintf(stderr, "Warning: Vertical char position overflow: %d\n", dy);
- swf_SetS16(t, dy);
+ if(dy != SET_TO_ZERO) {
+ if(dy>32767 || dy<-32768)
+ fprintf(stderr, "Warning: Vertical char position overflow: %d\n", dy);
+ swf_SetS16(t, dy);
+ } else {
+ swf_SetS16(t, 0);
+ }
}
if (font)
swf_SetU16(t, size);
}
if (font)
swf_SetU16(t, size);