6 static void make_tests(void);
7 static void print(const char *s);
9 //static const char *font = "Times-Roman";
10 static const char *font = "Times Bold Italic";
11 //static const char *font = "Courier";
12 //static const char *font = "Courier Bold Oblique";
17 #define charset_legend "Macintosh charset"
24 #define charset_legend "IsoLatin1 charset"
31 print(AE); /* very wide char */
32 print(AE AE AE AE AE AE AE AE AE AE AE AE AE AE AE);
33 print(charset_legend);
36 print("Hello, world");
37 print("AVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAV");
38 print("AAAAAAAAAAAAAAAAAAVVVVVVVVVVVVVVVVVV");
39 print("fiffififfififfififfififfififfififfi");
42 print("fifififififififififififififififififififififififififi");
43 print(AE "bleskiver med gl"oe"gg. " NBSP NBSP NBSP NBSP NBSP NBSP NBSP
44 AE" Fywerhus: 'A "ae" u "aa" "ae" "oe" i "ae" fywer'.");
45 print("Ingef"ae"rp"ae"rer med karamelsauce. R"oe"dgr"oe"d med fl"oe"de.");
46 print("(Optional.) Ligature sequence where successor and ligature are both names. The current character may join ...");
49 static void vline(double x, double y1, double y2)
51 fprintf(fp, "<line x1=\"%.2f\" y1=\"%.2f\" x2=\"%.2f\" y2=\"%.2f\""
52 " stroke-width=\"1\" stroke=\"#000\"/>\n",
56 static void print(const char *s)
60 double width = afm_get_text_width(0, font, size, 4, s);
61 unsigned char *up = (unsigned char*)s;
62 fprintf(stderr, "Width = %f for '%s'\n", width, s);
65 fprintf(fp, "<text x=\"%.2f\" y=\"%.2f\" font-size=\"%.2f\">", x, y, size);
67 unsigned char ch = afm_host2unicode(*up);
71 fprintf(fp, "&#%d;", ch);
74 fputs("</text>\n", fp);
75 vline(x + width, y, y + 5);
82 "<?xml version=\"1.0\" standalone=\"no\"?>\n"
83 "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\"\n"
84 " \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n"
85 "<svg width=\"650\" height=\"400\" preserveAspectRatio=\"xMidYMid\"\n"
86 " font-family=\"%s\">\n", font);
92 fputs("</svg>\n", fp);
97 fp = fopen("test.svg", "w");
99 fprintf(stderr, "Can't create output.\n");