Changeset 929 for libcaca/trunk/tools/makefont.c
- Timestamp:
- May 5, 2006, 4:03:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/tools/makefont.c
r914 r929 27 27 # include <netinet/in.h> 28 28 #endif 29 30 #include "cucul.h" 31 #include "cucul_internals.h" 29 32 30 33 #include <pango/pango.h> … … 200 203 { 201 204 unsigned int ch = i; 202 char buf[10] , *parser;205 char buf[10]; 203 206 int x, y, bytes; 204 207 205 if(ch < 0x80) 206 { 207 bytes = 1; 208 buf[0] = ch; 209 buf[1] = '\0'; 210 } 211 else 212 { 213 static const unsigned char mark[7] = 214 { 215 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC 216 }; 217 218 /* FIXME: use libcucul instead of this shit */ 219 bytes = (ch < 0x800) ? 2 : (ch < 0x10000) ? 3 : 4; 220 buf[bytes] = '\0'; 221 parser = buf + bytes; 222 223 switch(bytes) 224 { 225 case 4: *--parser = (ch | 0x80) & 0xbf; ch >>= 6; 226 case 3: *--parser = (ch | 0x80) & 0xbf; ch >>= 6; 227 case 2: *--parser = (ch | 0x80) & 0xbf; ch >>= 6; 228 } 229 *--parser = ch | mark[bytes]; 230 } 208 bytes = _cucul_utf32_to_utf8(buf, ch); 209 buf[bytes] = '\0'; 231 210 232 211 /* Print glyph value in comment */
Note: See TracChangeset
for help on using the changeset viewer.