Back to index

tetex-bin  3.0
encodings.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2004 the xdvik development team
00003  * 
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to
00006  * deal in the Software without restriction, including without limitation the
00007  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00008  * sell copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  * 
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  * 
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017  * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
00018  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  * OTHER DEALINGS IN THE SOFTWARE.
00021  */
00022 
00023 #ifndef ENCODINGS_H_
00024 #define ENCODINGS_H_
00025 
00026 #include "xdvi-config.h"
00027 #include "xdvi.h"
00028 
00029 struct adobe2unicode {
00030     const char *adobe_name;
00031     uint32_t unicode;
00032 };
00033 
00034 struct unicode2adobe {
00035     uint32_t unicode;
00036     const char *adobe_name;
00037 };
00038 
00039 extern uint32_t get_accented_glyph(uint32_t accent, uint32_t base_glyph);
00040 extern const char *unicode2adobe_name(uint32_t unicode);
00041 extern uint32_t adobe2unicode_name(const char *adobe_name);
00042 extern uint32_t guess_encoding(wide_ubyte ch, const char *fontname, char *retbuf);
00043 extern const char *expand_ligature(uint32_t unicode);
00044 extern const char *search_normalize_chars(uint32_t unicode);
00045 
00046 extern Boolean utf8_lowercase(char *utf8);
00047 extern int utf8_to_ucs4(const char *utf8, uint32_t *ucs4, size_t len);
00048 extern void ucs4_to_utf8(uint32_t ucs4, char *utf8, size_t *len, Boolean do_lowercase);
00049 extern unsigned char utf8_to_iso_8859_1(const char *utf8, size_t *len);
00050 extern char *str_utf8_to_iso_8859_1(const char *utf8);
00051 extern void iso_8859_1_to_utf8(unsigned char iso_8859_1, char *utf8, size_t *len);
00052 extern int str_iso_8859_1_to_utf8(const char *latin1, char *utf8, size_t len);
00053 extern Boolean is_hyphenchar(uint32_t unicode);
00054 extern Boolean is_ideograph(uint32_t unicode);
00055 extern void close_iconv(void);
00056 
00057 #endif /* ENCODINGS_H_ */
00058