fontencc.c revision 23a0898a
1/*
2Copyright (c) 1998-2001 by Juliusz Chroboczek
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22/* $XFree86: xc/lib/font/fontfile/fontencc.c,v 1.1 2001/08/13 21:46:47 dawes Exp $ */
23
24/* Binary compatibility code. */
25
26/* This file includes code to make modules compiled for earlier
27   versions of the fontenc interfaces link with this one.  It does
28   *not* provide source compatibility, as many of the data structures
29   now have different names. */
30
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34#include <X11/fonts/fontenc.h>
35#include <X11/fonts/fontencc.h>
36
37extern void ErrorF(const char *f, ...);
38
39char *
40font_encoding_from_xlfd(const char * name, int length)
41{
42    return FontEncFromXLFD(name, length);
43}
44
45FontEncPtr
46font_encoding_find(const char *encoding_name, const char *filename)
47{
48    return FontEncFind(encoding_name, filename);
49}
50
51unsigned
52font_encoding_recode(unsigned code,
53                     FontEncPtr encoding, FontMapPtr mapping)
54{
55    if(encoding != mapping->encoding) {
56        ErrorF("Inconsistent mapping/encoding\n");
57        return 0;
58    }
59    return FontEncRecode(code, mapping);
60}
61
62char *
63font_encoding_name(unsigned code,
64                     FontEncPtr encoding, FontMapPtr mapping)
65{
66    if(encoding != mapping->encoding) {
67        ErrorF("Inconsistent mapping/encoding\n");
68        return 0;
69    }
70    return FontEncName(code, mapping);
71}
72
73char **
74identifyEncodingFile(const char *filename)
75{
76    return FontEncIdentify(filename);
77}
78