git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes to ttf file format, merged in Mike Lewis name table patch
[swftools.git]
/
lib
/
gfxfont.c
diff --git
a/lib/gfxfont.c
b/lib/gfxfont.c
index
d7a8803
..
c0cbac2
100644
(file)
--- a/
lib/gfxfont.c
+++ b/
lib/gfxfont.c
@@
-690,16
+690,22
@@
ttf_t* gfxfont_to_ttf(gfxfont_t*font)
int g = font->unicode2glyph[u];
if(invalid_unicode(u))
continue;
int g = font->unicode2glyph[u];
if(invalid_unicode(u))
continue;
- if(g>=0 && !ttf->unicode[u]) {
+ if(g>=0 && g<font->num_glyphs && !ttf->unicode[u]) {
ttf->unicode[u] = g+offset;
}
}
}
ttf->unicode[u] = g+offset;
}
}
}
+
ttf->ascent = font->ascent;
ttf->descent = font->descent;
ttf->ascent = font->ascent;
ttf->descent = font->descent;
- ttf->lineGap = font->ascent + font->descent;
+ ttf->lineGap = font->ascent - font->descent;
- ttf->name = strdup(font->id);
+ ttf->full_name = strdup(font->id);
+ ttf->family_name = strdup(font->id);
+ ttf->subfamily_name = strdup(font->id);
+ ttf->postscript_name = strdup(font->id);
+ ttf->version_string = strdup("Version 1.0");
+ ttf->font_uid = strdup(font->id);
ttf_create_truetype_tables(ttf);
return ttf;
ttf_create_truetype_tables(ttf);
return ttf;
@@
-712,3
+718,10
@@
void gfxfont_save(gfxfont_t*font, const char*filename)
ttf_destroy(ttf);
}
ttf_destroy(ttf);
}
+void gfxfont_save_eot(gfxfont_t*font, const char*filename)
+{
+ ttf_t*ttf = gfxfont_to_ttf(font);
+ ttf_save_eot(ttf, filename);
+ ttf_destroy(ttf);
+}
+