~ubuntu-branches/ubuntu/raring/libcaca/raring

« back to all changes in this revision

Viewing changes to tools/makefont.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2010-02-08 01:40:59 UTC
  • mfrom: (1.1.8 upstream) (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100208014059-9q4av8pze8p7uw3i
Tags: 0.99.beta17-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  makefont       create libcaca font data
3
 
 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
 
3
 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
4
4
 *                All Rights Reserved
5
5
 *
6
 
 *  $Id$
7
 
 *
8
6
 *  This program is free software. It comes without any warranty, to
9
7
 *  the extent permitted by applicable law. You can redistribute it
10
8
 *  and/or modify it under the terms of the Do What The Fuck You Want
30
28
#include <pango/pango.h>
31
29
#include <pango/pangoft2.h>
32
30
 
 
31
#include "caca_stubs.h"
33
32
#include "caca.h"
34
33
 
35
34
/* Split our big strings into chunks of 480 characters, because it is
49
48
    0x0370, 0x0400, /* Greek and Coptic: Λ α β */
50
49
    0x0400, 0x0500, /* Cyrillic: И Я */
51
50
    0x0530, 0x0590, /* Armenian: Ո */
 
51
    0x1401, 0x1677, /* Unified Canadian Aboriginal Syllabics: ᒐ ᗡ */
52
52
    0x1d00, 0x1d80, /* Phonetic Extensions: ᴉ ᵷ */
53
53
    0x2000, 0x2070, /* General Punctuation: ‘’ “” */
54
54
    0x2100, 0x2150, /* Letterlike Symbols: Ⅎ */
55
 
    0x2200, 0x2300, /* Mathematical Operators: √ ∞ ∙ */
 
55
    0x2200, 0x2300, /* Mathematical Operators: ∀ √ ∞ ∙ */
56
56
    0x2300, 0x2400, /* Miscellaneous Technical: ⌐ ⌂ ⌠ ⌡ */
57
57
    0x2500, 0x2580, /* Box Drawing: ═ ║ ╗ ╔ ╩ */
58
58
    0x2580, 0x25a0, /* Block Elements: ▛ ▞ ░ ▒ ▓ */
62
62
    0x3040, 0x30a0, /* Hiragana: で す */
63
63
    0x30a0, 0x3100, /* Katakana: ロ ル */
64
64
    0xff00, 0xfff0, /* Halfwidth and Fullwidth Forms: A, B, C, a, b, c */
 
65
    0x10400, 0x10450, /* Deseret: 𐐒 𐐋 */
65
66
    0, 0
66
67
};
67
68
 
185
186
    printf(" */\n");
186
187
    printf("\n");
187
188
 
188
 
    printf("static unsigned int const %s_size = %i;\n",
189
 
           prefix, 4 + control_size + data_size);
190
 
    printf("static char %s_data[%i] =\n", prefix, 4 + control_size + data_size);
 
189
    printf("static size_t const %s_size = %i;\n",
 
190
           prefix, 4 + control_size + data_size);
 
191
    printf("static uint8_t %s_data[%i] =\n",
 
192
           prefix, 4 + control_size + data_size);
191
193
    printf("{\n");
192
194
 
193
195
    printf("/* file: */\n");
431
433
 
432
434
static int printf_u32(char const *fmt, uint32_t i)
433
435
{
434
 
    uint32_t ni = htonl(i);
 
436
    uint32_t ni = hton32(i);
435
437
    return printf_hex(fmt, (uint8_t *)&ni, 4);
436
438
}
437
439
 
438
440
static int printf_u16(char const *fmt, uint16_t i)
439
441
{
440
 
    uint16_t ni = htons(i);
 
442
    uint16_t ni = hton16(i);
441
443
    return printf_hex(fmt, (uint8_t *)&ni, 2);
442
444
}
443
445