| 1 |
/* |
| 2 |
Copyright (c) 1998-2001 by Juliusz Chroboczek |
| 3 |
|
| 4 |
Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 |
of this software and associated documentation files (the "Software"), to deal |
| 6 |
in the Software without restriction, including without limitation the rights |
| 7 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 |
copies of the Software, and to permit persons to whom the Software is |
| 9 |
furnished to do so, subject to the following conditions: |
| 10 |
|
| 11 |
The above copyright notice and this permission notice shall be included in |
| 12 |
all copies or substantial portions of the Software. |
| 13 |
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 20 |
THE 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 |
|
| 37 |
char * |
| 38 |
font_encoding_from_xlfd(const char * name, int length) |
| 39 |
{ |
| 40 |
return FontEncFromXLFD(name, length); |
| 41 |
} |
| 42 |
|
| 43 |
FontEncPtr |
| 44 |
font_encoding_find(const char *encoding_name, const char *filename) |
| 45 |
{ |
| 46 |
return FontEncFind(encoding_name, filename); |
| 47 |
} |
| 48 |
|
| 49 |
unsigned |
| 50 |
font_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 |
|
| 60 |
char * |
| 61 |
font_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 |
|
| 71 |
char ** |
| 72 |
identifyEncodingFile(const char *filename) |
| 73 |
{ |
| 74 |
return FontEncIdentify(filename); |
| 75 |
} |