123a0898aSmrg/*
223a0898aSmrgCopyright (c) 1998-2001 by Juliusz Chroboczek
323a0898aSmrg
423a0898aSmrgPermission is hereby granted, free of charge, to any person obtaining a copy
523a0898aSmrgof this software and associated documentation files (the "Software"), to deal
623a0898aSmrgin the Software without restriction, including without limitation the rights
723a0898aSmrgto use, copy, modify, merge, publish, distribute, sublicense, and/or sell
823a0898aSmrgcopies of the Software, and to permit persons to whom the Software is
923a0898aSmrgfurnished to do so, subject to the following conditions:
1023a0898aSmrg
1123a0898aSmrgThe above copyright notice and this permission notice shall be included in
1223a0898aSmrgall copies or substantial portions of the Software.
1323a0898aSmrg
1423a0898aSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1523a0898aSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1623a0898aSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1723a0898aSmrgAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1823a0898aSmrgLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1923a0898aSmrgOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2023a0898aSmrgTHE SOFTWARE.
2123a0898aSmrg*/
2223a0898aSmrg
2323a0898aSmrg/* Binary compatibility code. */
2423a0898aSmrg
2523a0898aSmrg/* This file includes code to make modules compiled for earlier
2623a0898aSmrg   versions of the fontenc interfaces link with this one.  It does
2723a0898aSmrg   *not* provide source compatibility, as many of the data structures
2823a0898aSmrg   now have different names. */
2923a0898aSmrg
3023a0898aSmrg#ifdef HAVE_CONFIG_H
3123a0898aSmrg#include <config.h>
3223a0898aSmrg#endif
3323a0898aSmrg#include <X11/fonts/fontenc.h>
3423a0898aSmrg#include <X11/fonts/fontencc.h>
3523a0898aSmrg
3623a0898aSmrgextern void ErrorF(const char *f, ...);
3723a0898aSmrg
3823a0898aSmrgchar *
3923a0898aSmrgfont_encoding_from_xlfd(const char * name, int length)
4023a0898aSmrg{
4123a0898aSmrg    return FontEncFromXLFD(name, length);
4223a0898aSmrg}
4323a0898aSmrg
4423a0898aSmrgFontEncPtr
4523a0898aSmrgfont_encoding_find(const char *encoding_name, const char *filename)
4623a0898aSmrg{
4723a0898aSmrg    return FontEncFind(encoding_name, filename);
4823a0898aSmrg}
4923a0898aSmrg
5023a0898aSmrgunsigned
5141c30155Smrgfont_encoding_recode(unsigned code,
5223a0898aSmrg                     FontEncPtr encoding, FontMapPtr mapping)
5323a0898aSmrg{
5423a0898aSmrg    if(encoding != mapping->encoding) {
5523a0898aSmrg        ErrorF("Inconsistent mapping/encoding\n");
5623a0898aSmrg        return 0;
5723a0898aSmrg    }
5823a0898aSmrg    return FontEncRecode(code, mapping);
5923a0898aSmrg}
6023a0898aSmrg
6123a0898aSmrgchar *
6223a0898aSmrgfont_encoding_name(unsigned code,
6323a0898aSmrg                     FontEncPtr encoding, FontMapPtr mapping)
6423a0898aSmrg{
6523a0898aSmrg    if(encoding != mapping->encoding) {
6623a0898aSmrg        ErrorF("Inconsistent mapping/encoding\n");
6723a0898aSmrg        return 0;
6823a0898aSmrg    }
6923a0898aSmrg    return FontEncName(code, mapping);
7023a0898aSmrg}
7123a0898aSmrg
7223a0898aSmrgchar **
7323a0898aSmrgidentifyEncodingFile(const char *filename)
7423a0898aSmrg{
7523a0898aSmrg    return FontEncIdentify(filename);
7623a0898aSmrg}
77