2 /* Copyright (C) 2002, 2003, 2006, 2009
3 Free Software Foundation, Inc.
4 Written by Werner Lemberg <wl@gnu.org>
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 // Convert a groff glyph name to a string containing an underscore-separated
22 // list of Unicode code points. For example,
26 // `fl' -> `0066_006C'
28 // Return NULL if there is no equivalent.
29 const char *glyph_name_to_unicode(const char *);
31 // Convert a string containing an underscore-separated list of Unicode code
32 // points to a groff glyph name. For example,
35 // `0066_006C' -> `fl'
37 // Return NULL if there is no equivalent.
38 const char *unicode_to_glyph_name(const char *);
40 // Convert a string containing a precomposed Unicode character to a string
41 // containing an underscore-separated list of Unicode code points,
42 // representing its canonical decomposition. Also perform compatibility
43 // equivalent replacement. For example,
45 // `1F3A' -> `0399_0313_0300'
48 // Return NULL if there is no equivalent.
49 const char *decompose_unicode(const char *);
51 // Test whether the given string denotes a Unicode character. It must
52 // be of the form `uNNNN', obeying the following rules.
54 // - `NNNN' must consist of at least 4 hexadecimal digits in upper case.
55 // - If there are more than 4 hexadecimal digits, the leading one must not
57 // - `NNNN' must denote a valid Unicode code point (U+0000..U+10FFFF,
58 // excluding surrogate code points.
60 // Return a pointer to `NNNN' (skipping the leading `u' character) in case
61 // of success, NULL otherwise.
62 const char *check_unicode_name(const char *);