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
23/* Binary compatibility code. */
24
25/* This file includes code to make modules compiled for earlier
26   versions of the fontenc interfaces link with this one.  It does
27   *not* provide source compatibility, as many of the data structures
28   now have different names. */
29
30#ifdef HAVE_CONFIG_H
31#include <config.h>
32#endif
33#include "libxfontint.h"
34#include <X11/fonts/fontenc.h>
35#include <X11/fonts/fontencc.h>
36
37char *
38font_encoding_from_xlfd(const char * name, int length)
39{
40    return FontEncFromXLFD(name, length);
41}
42
43FontEncPtr
44font_encoding_find(const char *encoding_name, const char *filename)
45{
46    return FontEncFind(encoding_name, filename);
47}
48
49unsigned
50font_encoding_recode(unsigned code,
51                     FontEncPtr encoding, FontMapPtr mapping)
52{
53    if(encoding != mapping->encoding) {
54        ErrorF("Inconsistent mapping/encoding\n");
55        return 0;
56    }
57    return FontEncRecode(code, mapping);
58}
59
60char *
61font_encoding_name(unsigned code,
62                     FontEncPtr encoding, FontMapPtr mapping)
63{
64    if(encoding != mapping->encoding) {
65        ErrorF("Inconsistent mapping/encoding\n");
66        return 0;
67    }
68    return FontEncName(code, mapping);
69}
70
71char **
72identifyEncodingFile(const char *filename)
73{
74    return FontEncIdentify(filename);
75}
76