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:
295dd98
)
several bugfixes. Freetype fonts are now properly sized.
author
kramm
<kramm>
Sat, 14 Aug 2004 07:44:14 +0000
(07:44 +0000)
committer
kramm
<kramm>
Sat, 14 Aug 2004 07:44:14 +0000
(07:44 +0000)
lib/modules/swffont.c
patch
|
blob
|
history
diff --git
a/lib/modules/swffont.c
b/lib/modules/swffont.c
index
4d14534
..
fb837cc
100644
(file)
--- a/
lib/modules/swffont.c
+++ b/
lib/modules/swffont.c
@@
-21,10
+21,9
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-static int loadfont_scale = 1;
+static int loadfont_scale = 64;
static int skip_unused = 1;
static int skip_unused = 1;
-// TODO: should be named "setLoadFontParameters"
void swf_SetLoadFontParameters(int _scale, int _skip_unused)
{
loadfont_scale = _scale;
void swf_SetLoadFontParameters(int _scale, int _skip_unused)
{
loadfont_scale = _scale;
@@
-35,6
+34,7
@@
void swf_SetLoadFontParameters(int _scale, int _skip_unused)
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
+#include <freetype/ftsizes.h>
#include <freetype/ftsnames.h>
#include <freetype/ttnameid.h>
#include <freetype/ftoutln.h>
#include <freetype/ftsnames.h>
#include <freetype/ttnameid.h>
#include <freetype/ftoutln.h>
@@
-105,6
+105,7
@@
SWFFONT* swf_LoadTrueTypeFont(char*filename)
SWFFONT* font;
int t;
int*glyph2glyph;
SWFFONT* font;
int t;
int*glyph2glyph;
+ FT_Size size;
if(ftlibrary == 0) {
if(FT_Init_FreeType(&ftlibrary)) {
if(ftlibrary == 0) {
if(FT_Init_FreeType(&ftlibrary)) {
@@
-113,6
+114,8
@@
SWFFONT* swf_LoadTrueTypeFont(char*filename)
}
}
error = FT_New_Face(ftlibrary, filename, 0, &face);
}
}
error = FT_New_Face(ftlibrary, filename, 0, &face);
+ FT_Set_Pixel_Sizes (face, 16, 16);
+
if(error) {
fprintf(stderr, "Couldn't load file %s- not a TTF file?\n", filename);
return 0;
if(error) {
fprintf(stderr, "Couldn't load file %s- not a TTF file?\n", filename);
return 0;
@@
-216,14
+219,14
@@
SWFFONT* swf_LoadTrueTypeFont(char*filename)
if(!font->glyph2ascii[t] && !hasname && skip_unused) {
continue;
}
if(!font->glyph2ascii[t] && !hasname && skip_unused) {
continue;
}
- error = FT_Load_Glyph(face, t, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
+ error = FT_Load_Glyph(face, t, FT_LOAD_NO_BITMAP);
if(error) {
if(error) {
- fprintf(stderr, "Couldn't load glyph %d\n", t);
+ fprintf(stderr, "Couldn't load glyph %d, error:%d\n", t, error);
continue;
}
error = FT_Get_Glyph(face->glyph, &glyph);
if(error) {
continue;
}
error = FT_Get_Glyph(face->glyph, &glyph);
if(error) {
- fprintf(stderr, "Couldn't get glyph %d\n", t);
+ fprintf(stderr, "Couldn't get glyph %d, error:%d\n", t, error);
continue;
}
continue;
}
@@
-427,7
+430,6
@@
SWFFONT* swf_LoadT1Font(char*filename)
swf_Shape01DrawerInit(&draw, 0);
swf_Shape01DrawerInit(&draw, 0);
- printf("Char %d (%08x)", c, outline);
while(outline) {
pos.x += (outline->dest.x/(float)0xffff);
pos.y += (outline->dest.y/(float)0xffff);
while(outline) {
pos.x += (outline->dest.x/(float)0xffff);
pos.y += (outline->dest.y/(float)0xffff);
@@
-520,9
+522,6
@@
SWFFONT* swf_LoadFont(char*filename)
return swf_ReadFont(filename);
}
return swf_ReadFont(filename);
}
-
- return swf_LoadT1Font(filename);
-
#if defined(HAVE_FREETYPE)
return swf_LoadTrueTypeFont(filename);
#elif defined(HAVE_T1LIB)
#if defined(HAVE_FREETYPE)
return swf_LoadTrueTypeFont(filename);
#elif defined(HAVE_T1LIB)