fontencc.c revision 23a0898a
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/* $XFree86: xc/lib/font/fontfile/fontencc.c,v 1.1 2001/08/13 21:46:47 dawes Exp $ */ 2323a0898aSmrg 2423a0898aSmrg/* Binary compatibility code. */ 2523a0898aSmrg 2623a0898aSmrg/* This file includes code to make modules compiled for earlier 2723a0898aSmrg versions of the fontenc interfaces link with this one. It does 2823a0898aSmrg *not* provide source compatibility, as many of the data structures 2923a0898aSmrg now have different names. */ 3023a0898aSmrg 3123a0898aSmrg#ifdef HAVE_CONFIG_H 3223a0898aSmrg#include <config.h> 3323a0898aSmrg#endif 3423a0898aSmrg#include <X11/fonts/fontenc.h> 3523a0898aSmrg#include <X11/fonts/fontencc.h> 3623a0898aSmrg 3723a0898aSmrgextern void ErrorF(const char *f, ...); 3823a0898aSmrg 3923a0898aSmrgchar * 4023a0898aSmrgfont_encoding_from_xlfd(const char * name, int length) 4123a0898aSmrg{ 4223a0898aSmrg return FontEncFromXLFD(name, length); 4323a0898aSmrg} 4423a0898aSmrg 4523a0898aSmrgFontEncPtr 4623a0898aSmrgfont_encoding_find(const char *encoding_name, const char *filename) 4723a0898aSmrg{ 4823a0898aSmrg return FontEncFind(encoding_name, filename); 4923a0898aSmrg} 5023a0898aSmrg 5123a0898aSmrgunsigned 5223a0898aSmrgfont_encoding_recode(unsigned code, 5323a0898aSmrg FontEncPtr encoding, FontMapPtr mapping) 5423a0898aSmrg{ 5523a0898aSmrg if(encoding != mapping->encoding) { 5623a0898aSmrg ErrorF("Inconsistent mapping/encoding\n"); 5723a0898aSmrg return 0; 5823a0898aSmrg } 5923a0898aSmrg return FontEncRecode(code, mapping); 6023a0898aSmrg} 6123a0898aSmrg 6223a0898aSmrgchar * 6323a0898aSmrgfont_encoding_name(unsigned code, 6423a0898aSmrg FontEncPtr encoding, FontMapPtr mapping) 6523a0898aSmrg{ 6623a0898aSmrg if(encoding != mapping->encoding) { 6723a0898aSmrg ErrorF("Inconsistent mapping/encoding\n"); 6823a0898aSmrg return 0; 6923a0898aSmrg } 7023a0898aSmrg return FontEncName(code, mapping); 7123a0898aSmrg} 7223a0898aSmrg 7323a0898aSmrgchar ** 7423a0898aSmrgidentifyEncodingFile(const char *filename) 7523a0898aSmrg{ 7623a0898aSmrg return FontEncIdentify(filename); 7723a0898aSmrg} 78