source: libcaca/trunk/cucul/export.c @ 805

Last change on this file since 805 was 805, checked in by Sam Hocevar, 14 years ago
  • Cosmetic code changes and minor optimisations.
  • Property svn:keywords set to Id
File size: 20.4 KB
RevLine 
[804]1/*
2 *  libcucul      Canvas for ultrafast compositing of Unicode letters
3 *  Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
4 *                2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
5 *                All Rights Reserved
6 *
7 *  $Id: export.c 805 2006-04-18 08:33:06Z sam $
8 *
9 *  This library is free software; you can redistribute it and/or
10 *  modify it under the terms of the Do What The Fuck You Want To
11 *  Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 *  This file contains various export functions
17 */
18
19#include "config.h"
20
21#if !defined(__KERNEL__)
22#   include <stdlib.h>
23#   include <stdio.h>
24#   include <string.h>
25#endif
26
27#include "cucul.h"
28#include "cucul_internals.h"
29
30static void export_ansi(cucul_t *, cucul_buffer_t *);
31static void export_html(cucul_t *, cucul_buffer_t *);
32static void export_html3(cucul_t *, cucul_buffer_t *);
33static void export_irc(cucul_t *, cucul_buffer_t *);
34static void export_ps(cucul_t *, cucul_buffer_t *);
35static void export_svg(cucul_t *, cucul_buffer_t *);
36static void export_tga(cucul_t *, cucul_buffer_t *);
37
38/** \brief Export a canvas into a foreign format.
39 *
40 *  This function exports a libcucul canvas into various foreign formats such
41 *  as ANSI art, HTML, IRC colours, etc. One should use cucul_get_buffer_data()
42 *  and cucul_get_buffer_size() to access the buffer contents. The allocated
43 *  data is valid until cucul_free_buffer() is called.
44 *
45 *  Valid values for \e format are:
46 *
47 *  \li \e "ansi": export ANSI art (CP437 charset with ANSI colour codes).
48 *
49 *  \li \e "html": export an HTML page with CSS information.
50 *
51 *  \li \e "html3": export an HTML table that should be compatible with
52 *      most navigators, including textmode ones.
53 *
54 *  \li \e "irc": export UTF-8 text with mIRC colour codes.
55 *
56 *  \li \e "ps": export a PostScript document.
57 *
58 *  \li \e "svg": export an SVG vector image.
59 *
60 *  \li \e "tga": export a TGA image.
61 *
62 *  \param qq A libcucul canvas
63 *  \param format A string describing the requested output format.
64 */
65cucul_buffer_t * cucul_create_export(cucul_t *qq, char const *format)
66{
67    cucul_buffer_t *ex;
68
69    ex = malloc(sizeof(cucul_buffer_t));
70    ex->size = 0;
71    ex->data = NULL;
72
73    if(!strcasecmp("ansi", format))
74        export_ansi(qq, ex);
75    else if(!strcasecmp("html", format))
76        export_html(qq, ex);
77    else if(!strcasecmp("html3", format))
78        export_html3(qq, ex);
79    else if(!strcasecmp("irc", format))
80        export_irc(qq, ex);
81    else if(!strcasecmp("ps", format))
82        export_ps(qq, ex);
83    else if(!strcasecmp("svg", format))
84        export_svg(qq, ex);
85    else if(!strcasecmp("tga", format))
86        export_tga(qq, ex);
87
88    if(ex->size == 0)
89    {
90        free(ex);
91        return NULL;
92    }
93
94    return ex;
95}
96
97/** \brief Get available export formats
98 *
99 *  Return a list of available export formats. The list is a NULL-terminated
100 *  array of strings, interleaving a string containing the internal value for
101 *  the export format, to be used with \e cucul_create_export(), and a string
102 *  containing the natural language description for that export format.
103 *
104 *  \return An array of strings.
105 */
106char const * const * cucul_get_export_list(void)
107{
108    static char const * const list[] =
109    {
110        "ansi", "ANSI",
111        "html", "HTML",
112        "html3", "backwards-compatible HTML",
113        "irc", "IRC with mIRC colours",
114        "ps", "PostScript document",
115        "svg", "SVG vector image",
116        "tga", "TGA image",
117        NULL, NULL
118    };
119
120    return list;
121}
122
123/*
124 * XXX: the following functions are local.
125 */
126
127/* Generate ANSI representation of current canvas. */
128static void export_ansi(cucul_t *qq, cucul_buffer_t *ex)
129{
[805]130    static uint8_t const palette[] =
[804]131    {
132        0,  4,  2,  6, 1,  5,  3,  7,
133        8, 12, 10, 14, 9, 13, 11, 15
134    };
135
136    char *cur;
137    unsigned int x, y;
138
139    /* 23 bytes assumed for max length per pixel ('\e[5;1;3x;4y;9x;10ym' plus
140     * 4 max bytes for a UTF-8 character).
141     * Add height*9 to that (zeroes color at the end and jump to next line) */
142    ex->size = (qq->height * 9) + (qq->width * qq->height * 23);
143    ex->data = malloc(ex->size);
144
145    cur = ex->data;
146
147    for(y = 0; y < qq->height; y++)
148    {
149        uint32_t *lineattr = qq->attr + y * qq->width;
150        uint32_t *linechar = qq->chars + y * qq->width;
151
152        uint8_t prevfg = -1;
153        uint8_t prevbg = -1;
154
155        for(x = 0; x < qq->width; x++)
156        {
157            uint8_t fg = palette[_cucul_argb32_to_ansi4fg(lineattr[x])];
158            uint8_t bg = palette[_cucul_argb32_to_ansi4bg(lineattr[x])];
159            uint32_t c = linechar[x];
160
161            if(fg != prevfg || bg != prevbg)
162            {
163                cur += sprintf(cur, "\033[0;");
164
165                if(fg < 8)
166                    if(bg < 8)
167                        cur += sprintf(cur, "3%d;4%dm", fg, bg);
168                    else
169                        cur += sprintf(cur, "5;3%d;4%d;10%dm",
170                                            fg, bg - 8, bg - 8);
171                else
172                    if(bg < 8)
173                        cur += sprintf(cur, "1;3%d;4%d;9%dm",
174                                            fg - 8, bg, fg - 8);
175                    else
176                        cur += sprintf(cur, "5;1;3%d;4%d;9%d;10%dm",
177                                            fg - 8, bg - 8, fg - 8, bg - 8);
178            }
179
180            *cur++ = c & 0x7f;
181
182            prevfg = fg;
183            prevbg = bg;
184        }
185
186        cur += sprintf(cur, "\033[0m\r\n");
187    }
188
189    /* Crop to really used size */
190    ex->size = (uintptr_t)(cur - ex->data);
191    ex->data = realloc(ex->data, ex->size);
192}
193
194/* Generate HTML representation of current canvas. */
195static void export_html(cucul_t *qq, cucul_buffer_t *ex)
196{
[805]197    static uint16_t const palette[] =
[804]198    {
199        0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888,
200        0x444, 0x44f, 0x4f4, 0x4ff, 0xf44, 0xf4f, 0xff4, 0xfff,
201    };
202    char *cur;
203    unsigned int x, y, len;
204
205    /* The CSS palette: roughly 13000 bytes
206     * A line: 7 chars for "<br />\n"
207     * A glyph: 18 chars for "<span class='bxx'>"
208     *          up to 9 chars for "&#xxxxxx;", far less for pure ASCII
209     *          7 chars for "</span>" */
210    ex->size = 13000 + qq->height * (7 + qq->width * (18 + 9 + 7));
211    ex->data = malloc(ex->size);
212
213    cur = ex->data;
214
215    /* HTML header */
216    cur += sprintf(cur, "<html>\n<head>\n<title>Generated by libcaca %s</title>\n", VERSION);
217
218    /* CSS */
219    cur += sprintf(cur, "<style>\n");
220    cur += sprintf(cur, ".caca { font-family: monospace, fixed; font-weight: bold; }");
221    for(x = 0; x < 0x100; x++)
222    {
223        cur += sprintf(cur, ".b%02x { color:#%03x; background-color:#%03x; }\n",
224                       x, palette[x & 0xf ], palette[x >> 4]);
225    }
226    cur += sprintf(cur, "</style>\n</head>\n<body>\n");
227
228    cur += sprintf(cur, "<div cellpadding='0' cellspacing='0' style='%s'>\n",
229                        "font-family: monospace, fixed; font-weight: bold;");
230
231    for(y = 0; y < qq->height; y++)
232    {
233        uint32_t *lineattr = qq->attr + y * qq->width;
234        uint32_t *linechar = qq->chars + y * qq->width;
235
236        for(x = 0; x < qq->width; x += len)
237        {
238            cur += sprintf(cur, "<span class='b%02x'>",
239                           _cucul_argb32_to_ansi8(lineattr[x]));
240
241            for(len = 0;
242                x + len < qq->width && lineattr[x + len] == lineattr[x];
243                len++)
244            {
245                if(linechar[x + len] <= 0x00000020)
246                    cur += sprintf(cur, "&nbsp;");
247                else if(linechar[x + len] < 0x00000080)
248                    cur += sprintf(cur, "%c", linechar[x + len]);
249                else
250                    cur += sprintf(cur, "&#%i;", linechar[x + len]);
251            }
252            cur += sprintf(cur, "</span>");
253        }
254        /* New line */
255        cur += sprintf(cur, "<br />\n");
256    }
257
258    cur += sprintf(cur, "</div></body></html>\n");
259
260    /* Crop to really used size */
261    ex->size = strlen(ex->data) + 1;
262    ex->data = realloc(ex->data, ex->size);
263}
264
265/* Export an HTML3 document. This function is way bigger than export_html(),
266 * but permits viewing in old browsers (or limited ones such as links). It
267 * will not work under gecko (mozilla rendering engine) unless you set a
268 * correct header. */
269static void export_html3(cucul_t *qq, cucul_buffer_t *ex)
270{
[805]271    static uint32_t const palette[] =
[804]272    {
273        0x000000, 0x000088, 0x008800, 0x008888,
274        0x880000, 0x880088, 0x888800, 0x888888,
275        0x444444, 0x4444ff, 0x44ff44, 0x44ffff,
276        0xff4444, 0xff44ff, 0xffff44, 0xffffff,
277    };
278
279    char *cur;
280    unsigned int x, y, len;
281
282    /* The CSS palette: roughly 13000 bytes
283     * A line: 10 chars for "<tr></tr>\n"
284     * A glyph: 40 chars for "<td bgcolor=#xxxxxx><font color=#xxxxxx>"
285     *          up to 9 chars for "&#xxxxxx;", far less for pure ASCII
286     *          12 chars for "</font></td>" */
287    ex->size = 13000 + qq->height * (10 + qq->width * (40 + 9 + 12));
288    ex->data = malloc(ex->size);
289
290    cur = ex->data;
291
292    /* Table */
293    cur += sprintf(cur, "<table cols='%d' cellpadding='0' cellspacing='0'>\n",
294                        qq->height);
295
296    for(y = 0; y < qq->height; y++)
297    {
298        uint32_t *lineattr = qq->attr + y * qq->width;
299        uint32_t *linechar = qq->chars + y * qq->width;
300
301        cur += sprintf(cur, "<tr>");
302
303        for(x = 0; x < qq->width; x += len)
304        {
305            unsigned int i;
306
307            /* Use colspan option to factorize cells with same attributes
308             * (see below) */
309            len = 1;
310            while(x + len < qq->width && lineattr[x + len] == lineattr[x])
311                len++;
312
313            cur += sprintf(cur, "<td bgcolor=#%06x",
314                           palette[_cucul_argb32_to_ansi4bg(lineattr[x])]);
315
316            if(len > 1)
317                cur += sprintf(cur, " colspan=%d", len);
318
319            cur += sprintf(cur, "><font color=#%06x>",
320                           palette[_cucul_argb32_to_ansi4fg(lineattr[x])]);
321
322            for(i = 0; i < len; i++)
323            {
324                if(linechar[x + i] <= 0x00000020)
325                    cur += sprintf(cur, "&nbsp;");
326                else if(linechar[x + i] < 0x00000080)
327                    cur += sprintf(cur, "%c", linechar[x + i]);
328                else
329                    cur += sprintf(cur, "&#%i;", linechar[x + i]);
330            }
331
332            cur += sprintf(cur, "</font></td>");
333        }
334        cur += sprintf(cur, "</tr>\n");
335    }
336
337    /* Footer */
338    cur += sprintf(cur, "</table>\n");
339
340    /* Crop to really used size */
341    ex->size = (uintptr_t)(cur - ex->data);
342    ex->data = realloc(ex->data, ex->size);
343}
344
345/* Export a text file with IRC colours */
346static void export_irc(cucul_t *qq, cucul_buffer_t *ex)
347{
[805]348    static uint8_t const palette[] =
[804]349    {
350        1, 2, 3, 10, 5, 6, 7, 15, /* Dark */
351        14, 12, 9, 11, 4, 13, 8, 0, /* Light */
352    };
353
354    char *cur;
355    unsigned int x, y;
356
357    /* 11 bytes assumed for max length per pixel. Worst case scenario:
358     * ^Cxx,yy   6 bytes
359     * ^B^B      2 bytes
360     * c         1 byte
361     * \r\n      2 bytes
362     * In real life, the average bytes per pixel value will be around 5.
363     */
364
365    ex->size = 2 + (qq->width * qq->height * 11);
366    ex->data = malloc(ex->size);
367
368    cur = ex->data;
369
370    for(y = 0; y < qq->height; y++)
371    {
372        uint32_t *lineattr = qq->attr + y * qq->width;
373        uint32_t *linechar = qq->chars + y * qq->width;
374
375        uint8_t prevfg = -1;
376        uint8_t prevbg = -1;
377
378        for(x = 0; x < qq->width; x++)
379        {
380            uint8_t fg = palette[_cucul_argb32_to_ansi4fg(lineattr[x])];
381            uint8_t bg = palette[_cucul_argb32_to_ansi4bg(lineattr[x])];
382            uint32_t c = linechar[x];
383
384            if(bg == prevbg)
385            {
386                if(fg == prevfg)
387                    ; /* Same fg/bg, do nothing */
388                else if(c == (uint32_t)' ')
389                    fg = prevfg; /* Hackety hack */
390                else
391                {
392                    cur += sprintf(cur, "\x03%d", fg);
393                    if(c >= (uint32_t)'0' && c <= (uint32_t)'9')
394                        cur += sprintf(cur, "\x02\x02");
395                }
396            }
397            else
398            {
399                if(fg == prevfg)
400                    cur += sprintf(cur, "\x03,%d", bg);
401                else
402                    cur += sprintf(cur, "\x03%d,%d", fg, bg);
403
404                if(c >= (uint32_t)'0' && c <= (uint32_t)'9')
405                    cur += sprintf(cur, "\x02\x02");
406            }
407            *cur++ = c & 0x7f;
408            prevfg = fg;
409            prevbg = bg;
410        }
411        *cur++ = '\r';
412        *cur++ = '\n';
413    }
414
415    /* Crop to really used size */
416    ex->size = (uintptr_t)(cur - ex->data);
417    ex->data = realloc(ex->data, ex->size);
418}
419
420/* Export a PostScript document. */
421static void export_ps(cucul_t *qq, cucul_buffer_t *ex)
422{
423    static char const *ps_header =
424        "%!\n"
425        "%% libcaca PDF export\n"
426        "%%LanguageLevel: 2\n"
427        "%%Pages: 1\n"
428        "%%DocumentData: Clean7Bit\n"
429        "/csquare {\n"
430        "  newpath\n"
431        "  0 0 moveto\n"
432        "  0 1 rlineto\n"
433        "  1 0 rlineto\n"
434        "  0 -1 rlineto\n"
435        "  closepath\n"
436        "  setrgbcolor\n"
437        "  fill\n"
438        "} def\n"
439        "/S {\n"
440        "  Show\n"
441        "} bind def\n"
442        "/Courier-Bold findfont\n"
443        "8 scalefont\n"
444        "setfont\n"
445        "gsave\n"
446        "6 10 scale\n";
447
448    char *cur;
449    unsigned int x, y;
450
451    /* 200 is arbitrary but should be ok */
452    ex->size = strlen(ps_header) + (qq->width * qq->height * 200);
453    ex->data = malloc(ex->size);
454
455    cur = ex->data;
456
457    /* Header */
458    cur += sprintf(cur, "%s", ps_header);
459
460    /* Background, drawn using csquare macro defined in header */
461    for(y = qq->height; y--; )
462    {
463        uint32_t *lineattr = qq->attr + y * qq->width;
464
465        for(x = 0; x < qq->width; x++)
466        {
467            uint8_t argb[8];
468            _cucul_argb32_to_argb4(*lineattr++, argb);
469            cur += sprintf(cur, "1 0 translate\n %f %f %f csquare\n",
470                           (float)argb[1] * (1.0 / 0xf),
471                           (float)argb[2] * (1.0 / 0xf),
472                           (float)argb[3] * (1.0 / 0xf));
473        }
474
475        /* Return to beginning of the line, and jump to the next one */
476        cur += sprintf(cur, "-%d 1 translate\n", qq->width);
477    }
478
479    cur += sprintf(cur, "grestore\n"); /* Restore transformation matrix */
480
481    for(y = qq->height; y--; )
482    {
483        uint32_t *lineattr = qq->attr + (qq->height - y - 1) * qq->width;
484        uint32_t *linechar = qq->chars + (qq->height - y - 1) * qq->width;
485
486        for(x = 0; x < qq->width; x++)
487        {
488            uint8_t argb[8];
489            uint32_t c = *linechar++;
490
491            _cucul_argb32_to_argb4(*lineattr++, argb);
492
493            cur += sprintf(cur, "newpath\n");
494            cur += sprintf(cur, "%d %d moveto\n", (x + 1) * 6, y * 10 + 2);
495            cur += sprintf(cur, "%f %f %f setrgbcolor\n",
496                           (float)argb[5] * (1.0 / 0xf),
497                           (float)argb[6] * (1.0 / 0xf),
498                           (float)argb[7] * (1.0 / 0xf));
499
500            if(c < 0x00000020)
501                cur += sprintf(cur, "(?) show\n");
502            else if(c >= 0x00000080)
503                cur += sprintf(cur, "(?) show\n");
504            else switch((uint8_t)(c & 0x7f))
505            {
506                case '\\':
507                case '(':
508                case ')':
509                    cur += sprintf(cur, "(\\%c) show\n", c);
510                    break;
511                default:
512                    cur += sprintf(cur, "(%c) show\n", c);
513                    break;
514            }
515        }
516    }
517
518    cur += sprintf(cur, "showpage\n");
519
520    /* Crop to really used size */
521    ex->size = (uintptr_t)(cur - ex->data);
522    ex->data = realloc(ex->data, ex->size);
523}
524
525/* Export an SVG vector image */
526static void export_svg(cucul_t *qq, cucul_buffer_t *ex)
527{
528    static char const svg_header[] =
529        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
530        "<svg width=\"%d\" height=\"%d\" viewBox=\"0 0 %d %d\""
531        " xmlns=\"http://www.w3.org/2000/svg\""
532        " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
533        " xml:space=\"preserve\" version=\"1.1\"  baseProfile=\"full\">\n";
534
535    char *cur;
536    unsigned int x, y;
537
538    /* 200 is arbitrary but should be ok */
539    ex->size = strlen(svg_header) + (qq->width * qq->height * 200);
540    ex->data = malloc(ex->size);
541
542    cur = ex->data;
543
544    /* Header */
545    cur += sprintf(cur, svg_header, qq->width * 6, qq->height * 10,
546                                    qq->width * 6, qq->height * 10);
547
548    cur += sprintf(cur, " <g id=\"mainlayer\" font-size=\"12\">\n");
549
550    /* Background */
551    for(y = 0; y < qq->height; y++)
552    {
553        uint32_t *lineattr = qq->attr + y * qq->width;
554
555        for(x = 0; x < qq->width; x++)
556        {
557            cur += sprintf(cur, "<rect style=\"fill:#%.03x\" x=\"%d\" y=\"%d\""
558                                " width=\"6\" height=\"10\"/>\n",
559                                _cucul_argb32_to_rgb12bg(*lineattr++),
560                                x * 6, y * 10);
561        }
562    }
563
564    /* Text */
565    for(y = 0; y < qq->height; y++)
566    {
567        uint32_t *lineattr = qq->attr + y * qq->width;
568        uint32_t *linechar = qq->chars + y * qq->width;
569
570        for(x = 0; x < qq->width; x++)
571        {
572            uint32_t c = *linechar++;
573
574            cur += sprintf(cur, "<text style=\"fill:#%.03x\" "
575                                "x=\"%d\" y=\"%d\">",
576                                _cucul_argb32_to_rgb12fg(*lineattr++),
577                                x * 6, (y * 10) + 10);
578            if(c < 0x00000020)
579                cur += sprintf(cur, "?");
580            else if(c > 0x0000007f)
581            {
582                static const uint8_t mark[7] =
583                {
584                    0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC
585                };
586
587                char buf[10], *parser;
588                int bytes = (c < 0x800) ? 2 : (c < 0x10000) ? 3 : 4;
589
590                buf[bytes] = '\0';
591                parser = buf + bytes;
592
593                switch(bytes)
594                {
595                    case 4: *--parser = (c | 0x80) & 0xbf; c >>= 6;
596                    case 3: *--parser = (c | 0x80) & 0xbf; c >>= 6;
597                    case 2: *--parser = (c | 0x80) & 0xbf; c >>= 6;
598                }
599                *--parser = c | mark[bytes];
600
601                cur += sprintf(cur, "%s", buf);
602            }
603            else switch((uint8_t)c)
604            {
605                case '>': cur += sprintf(cur, "&gt;"); break;
606                case '<': cur += sprintf(cur, "&lt;"); break;
607                case '&': cur += sprintf(cur, "&amp;"); break;
608                default: cur += sprintf(cur, "%c", c); break;
609            }
610            cur += sprintf(cur, "</text>\n");
611        }
612    }
613
614    cur += sprintf(cur, " </g>\n");
615    cur += sprintf(cur, "</svg>\n");
616
617    /* Crop to really used size */
618    ex->size = (uintptr_t)(cur - ex->data);
619    ex->data = realloc(ex->data, ex->size);
620}
621
622/* Export a TGA image */
623static void export_tga(cucul_t *qq, cucul_buffer_t *ex)
624{
[805]625    char const * const * fontlist;
[804]626    char * cur;
627    cucul_font_t *f;
628    unsigned int i, w, h;
629
[805]630    fontlist = cucul_get_font_list();
631    if(!fontlist[0])
[804]632        return;
633
[805]634    f = cucul_load_font(fontlist[0], 0);
[804]635
636    w = cucul_get_width(qq) * cucul_get_font_width(f);
637    h = cucul_get_height(qq) * cucul_get_font_height(f);
638
639    ex->size = w * h * 4 + 18; /* 32 bpp + 18 bytes for the header */
640    ex->data = malloc(ex->size);
641
642    cur = ex->data;
643
644    /* ID Length */
645    cur += sprintf(cur, "%c", 0);
646    /* Color Map Type: no colormap */
647    cur += sprintf(cur, "%c", 0);
648    /* Image Type: uncompressed truecolor */
649    cur += sprintf(cur, "%c", 2);
650    /* Color Map Specification: no color map */
651    memset(cur, 0, 5); cur += 5;
652
653    /* Image Specification */
654    cur += sprintf(cur, "%c%c", 0, 0); /* X Origin */
655    cur += sprintf(cur, "%c%c", 0, 0); /* Y Origin */
656    cur += sprintf(cur, "%c%c", w & 0xff, w >> 8); /* Width */
657    cur += sprintf(cur, "%c%c", h & 0xff, h >> 8); /* Height */
658    cur += sprintf(cur, "%c", 32); /* Pixel Depth */
659    cur += sprintf(cur, "%c", 40); /* Image Descriptor */
660
661    /* Image ID: no ID */
662    /* Color Map Data: no colormap */
663
664    /* Image Data */
665    cucul_render_canvas(qq, f, cur, w, h, 4 * w);
666
667    /* Swap bytes. What a waste of time. */
668    for(i = 0; i < w * h * 4; i += 4)
669    {
670        char w;
671        w = cur[i]; cur[i] = cur[i + 3]; cur[i + 3] = w;
672        w = cur[i + 1]; cur[i + 1] = cur[i + 2]; cur[i + 2] = w;
673    }
674
675    cucul_free_font(f);
676}
677
Note: See TracBrowser for help on using the repository browser.