bladeenc -> lame
[swftools.git] / lib / example / makefonts.cc
index 82ecc06..370a81a 100644 (file)
@@ -82,7 +82,9 @@ SWFFONT * t1font2swffont(int i)
 
     wfont->maxascii = encodingsize;
     wfont->numchars = num;
-    wfont->flags = /*layout*/0x80 + /*bold*/0?1:0 + /*italic*/(angle>0.05)?2:0;
+    
+    wfont->style = (/*bold*/0?FONT_STYLE_BOLD:0) + (angle>0.05?FONT_STYLE_ITALIC:0);
+
     wfont->glyph = (SWFGLYPH*)malloc(num*sizeof(SWFGLYPH));
     memset(wfont->glyph, 0, num*sizeof(SWFGLYPH));
     wfont->glyph2ascii = (U16*)malloc(num*sizeof(U16));
@@ -114,7 +116,7 @@ SWFFONT * t1font2swffont(int i)
                wfont->glyph2ascii[num] = s;
                swf_ShapeNew(&wfont->glyph[num].shape);
                SHAPE*shape = wfont->glyph[num].shape;
-               wfont->glyph[num].advance = width/8;
+               wfont->glyph[num].advance = width/2;
                
                TAG*tag = swf_InsertTag(0,ST_DEFINESHAPE);
 
@@ -135,7 +137,7 @@ SWFFONT * t1font2swffont(int i)
                drawpath(tag, outline, &m, log);
                
                /*uncomment this to mark the glyph sizes:
-               */   plotxy p1,p2;
+               plotxy p1,p2;
                p1.x=0;
                p1.y=0;
                p2.x=width/8;
@@ -147,7 +149,7 @@ SWFFONT * t1font2swffont(int i)
                lineto(tag, p2);
                lineto(tag, p1);
                p1.x -= 2;
-               lineto(tag, p1);//*/
+               lineto(tag, p1);// */
 
                swf_ShapeSetEnd(tag);
 
@@ -168,10 +170,27 @@ int main(int argc, char ** argv)
   //T1LIB_CONFIG.
   putenv( "T1LIB_CONFIG=/tmp/t1lib.config.tmp");
   FILE*fi = fopen("/tmp/t1lib.config.tmp", "wb");
-  fprintf(fi, "FONTDATABASE=%s/FontDataBase\n", DATADIR);
-  fprintf(fi, "ENCODING=%s:.\n", DATADIR);
-  fprintf(fi, "AFM=%s:.\n", DATADIR);
-  fprintf(fi, "TYPE1=%s:.\n", DATADIR);
+  fprintf(fi, "FONTDATABASE=/tmp/FontDataBase\n", DATADIR);
+  fprintf(fi, "ENCODING=%s/fonts:.\n", DATADIR);
+  fprintf(fi, "AFM=%s/fonts:.\n", DATADIR);
+  fprintf(fi, "TYPE1=%s/fonts:.\n", DATADIR);
+  fclose(fi);
+  fi = fopen("/tmp/FontDataBase", "wb");
+  fprintf(fi, "14\n");             
+  fprintf(fi, "n021003l.afm\n"); //fixme
+  fprintf(fi, "n021023l.afm\n");
+  fprintf(fi, "n021004l.afm\n");
+  fprintf(fi, "n021024l.afm\n");
+  fprintf(fi, "n019003l.afm\n");
+  fprintf(fi, "n019023l.afm\n");
+  fprintf(fi, "n019004l.afm\n");
+  fprintf(fi, "n019024l.afm\n");
+  fprintf(fi, "n022003l.afm\n");
+  fprintf(fi, "n022023l.afm\n");
+  fprintf(fi, "n022004l.afm\n");
+  fprintf(fi, "n022024l.afm\n");
+  fprintf(fi, "s050000l.afm\n");
+  fprintf(fi, "d050000l.afm\n");
   fclose(fi);
   /* initialize t1lib */
   T1_SetBitmapPad( 16);