Debian Codegraph @

texk/xdvik/encodings.h

raw
1 /*
2 * Copyright (c) 2003-2004 the xdvik development team
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23 #ifndef ENCODINGS_H_
24 #define ENCODINGS_H_
25
26 #include "xdvi.h"
27
28 struct adobe2unicode {
29 const char *adobe_name;
30 uint32_t unicode;
31 };
32
33 struct unicode2adobe {
34 uint32_t unicode;
35 const char *adobe_name;
36 };
37
38 extern uint32_t get_accented_glyph(uint32_t accent, uint32_t base_glyph);
39 extern const char *unicode2adobe_name(uint32_t unicode);
40 extern uint32_t adobe2unicode_name(const char *adobe_name);
41 extern uint32_t guess_encoding(wide_ubyte ch, const char *fontname, char *retbuf);
42 extern const char *expand_ligature(uint32_t unicode);
43 extern const char *search_normalize_chars(uint32_t unicode);
44
45 extern Boolean utf8_lowercase(char *utf8);
46 extern int utf8_to_ucs4(const char *utf8, uint32_t *ucs4, size_t len);
47 extern void ucs4_to_utf8(uint32_t ucs4, char *utf8, size_t *len, Boolean do_lowercase);
48 extern unsigned char utf8_to_iso_8859_1(const char *utf8, size_t *len);
49 extern char *str_utf8_to_iso_8859_1(const char *utf8);
50 extern void iso_8859_1_to_utf8(unsigned char iso_8859_1, char *utf8, size_t *len);
51 extern int str_iso_8859_1_to_utf8(const char *latin1, char *utf8, size_t len);
52 extern Boolean is_hyphenchar(uint32_t unicode);
53 extern Boolean is_ideograph(uint32_t unicode);
54
55 #endif /* ENCODINGS_H_ */
56