static int loadfont_scale = 64;
static int skip_unused = 1;
+static int full_unicode = 0;
-void swf_SetLoadFontParameters(int _scale, int _skip_unused)
+void swf_SetLoadFontParameters(int _scale, int _skip_unused, int _full_unicode)
{
- loadfont_scale = _scale;
+ if(_scale) loadfont_scale = _scale;
skip_unused = _skip_unused;
}
int t;
int*glyph2glyph;
FT_Size size;
+ int max_unicode = 0;
if(ftlibrary == 0) {
if(FT_Init_FreeType(&ftlibrary)) {
}
charcode = FT_Get_Next_Char(face, charcode, &gindex);
}
+
+ if(full_unicode)
+ font->maxascii = 65535;
font->ascii2glyph = malloc(font->maxascii*sizeof(int));
g = -1;
font->ascii2glyph[t] = g;
if(g>=0) {
+ max_unicode = t;
if(!font->glyph2ascii[g]) {
font->glyph2ascii[g] = t;
}
}
}
+ font->maxascii = max_unicode;
font->numchars = 0;
SHAPE * shape;
} SWFGLYPH;
-typedef struct _FONTUSAGE
-{ int* chars;
- char is_reduced;
-} FONTUSAGE, * LPFONTUSAGE;
-
#define FONT_STYLE_BOLD 1
#define FONT_STYLE_ITALIC 2
#define FONT_ENCODING_UNICODE 1
SWFGLYPH * glyph;
U8 language;
char ** glyphnames;
-
- FONTUSAGE * use;
-
} SWFFONT, * LPSWFFONT;
+// does not support wide characters !
+typedef struct _FONTUSAGE
+{ U8* code;
+} FONTUSAGE, * LPFONTUSAGE;
#define ET_HASTEXT 32768
#define ET_WORDWRAP 16384
int swf_FontIsBold(SWFFONT * f);
int swf_FontSetID(SWFFONT * f,U16 id);
-int swf_FontReduce(SWFFONT * f);
+int swf_FontReduce(SWFFONT * f,FONTUSAGE * use);
-int swf_FontInitUsage(SWFFONT * f);
-int swf_FontUseGlyph(SWFFONT * f, int glyph);
-int swf_FontUse(SWFFONT* f,U8 * s);
+int swf_FontInitUsage(SWFFONT * f,FONTUSAGE * use);
+int swf_FontUse(SWFFONT* f,FONTUSAGE * use,U8 * s);
int swf_FontSetDefine(TAG * t,SWFFONT * f);
int swf_FontSetDefine2(TAG * t,SWFFONT * f);