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