- if (!strcmp(command, "font"))
- {
- if(dict_lookup(&fonts, name))
- syntaxerror("font %s defined twice", name);
-
- SWFFONT* font;
- fontfile = lu(&args, "filename");
- font = swf_LoadFont(fontfile);
- if(font == 0) {
- warning("Couldn't open font file \"%s\"", fontfile);
- font = (SWFFONT*)malloc(sizeof(SWFFONT));
- memset(font, 0, sizeof(SWFFONT));
- }
- else
- {
- swf_FontPrepareForEditText(font);
- glyphs_to_include = (U8*)lu(&args, "glyphs");
- if (!strcmp(glyphs_to_include, "all"))
- {
- swf_FontUseAll(font);
- font->use->glyphs_specified = 1;
- }
- else
- {
- if (strcmp (glyphs_to_include, ""))
- {
- swf_FontUseUTF8(font, glyphs_to_include);
- font->use->glyphs_specified = 1;
- }
- else
- swf_FontInitUsage(font);
- }
- }
- dict_put(&fonts, name, font);
- }
- else