|
||||
File indexing completed on 2025-01-18 09:57:27
0001 /* FriBidi 0002 * fribidi.h - Unicode bidirectional and Arabic joining/shaping algorithms 0003 * 0004 * Author: 0005 * Behdad Esfahbod, 2004 0006 * 0007 * Copyright (C) 2004 Sharif FarsiWeb, Inc 0008 * 0009 * This library is free software; you can redistribute it and/or 0010 * modify it under the terms of the GNU Lesser General Public 0011 * License as published by the Free Software Foundation; either 0012 * version 2.1 of the License, or (at your option) any later version. 0013 * 0014 * This library is distributed in the hope that it will be useful, 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0017 * Lesser General Public License for more details. 0018 * 0019 * You should have received a copy of the GNU Lesser General Public License 0020 * along with this library, in a file named COPYING; if not, write to the 0021 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0022 * Boston, MA 02110-1301, USA 0023 * 0024 * For licensing issues, contact <fribidi.license@gmail.com>. 0025 */ 0026 #ifndef _FRIBIDI_H 0027 #define _FRIBIDI_H 0028 0029 #include "fribidi-common.h" 0030 0031 #include "fribidi-unicode.h" 0032 #include "fribidi-types.h" 0033 #include "fribidi-flags.h" 0034 #include "fribidi-bidi-types.h" 0035 #include "fribidi-bidi.h" 0036 #include "fribidi-joining-types.h" 0037 #include "fribidi-joining.h" 0038 #include "fribidi-mirroring.h" 0039 #include "fribidi-brackets.h" 0040 #include "fribidi-arabic.h" 0041 #include "fribidi-shape.h" 0042 #include "fribidi-char-sets.h" 0043 0044 #include "fribidi-begindecls.h" 0045 0046 /* fribidi_remove_bidi_marks - remove bidi marks out of an string 0047 * 0048 * This function removes the bidi and boundary-neutral marks out of an string 0049 * and the accompanying lists. It implements rule X9 of the Unicode 0050 * Bidirectional Algorithm available at 0051 * http://www.unicode.org/reports/tr9/#X9, with the exception that it removes 0052 * U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too. 0053 * 0054 * If any of the input lists are NULL, the list is skipped. If str is the 0055 * visual string, then positions_to_this is positions_L_to_V and 0056 * position_from_this_list is positions_V_to_L; if str is the logical 0057 * string, the other way. Moreover, the position maps should be filled with 0058 * valid entries. 0059 * 0060 * A position map pointing to a removed character is filled with \(mi1. By the 0061 * way, you should not use embedding_levels if str is visual string. 0062 * 0063 * For best results this function should be run on a whole paragraph, not 0064 * lines; but feel free to do otherwise if you know what you are doing. 0065 * 0066 * Returns: New length of the string, or \(mi1 if an error occurred (memory 0067 * allocation failure most probably). 0068 */ 0069 FRIBIDI_ENTRY FriBidiStrIndex 0070 fribidi_remove_bidi_marks ( 0071 FriBidiChar *str, /* input string to clean */ 0072 const FriBidiStrIndex len, /* input string length */ 0073 FriBidiStrIndex *positions_to_this, /* list mapping positions to the 0074 order used in str */ 0075 FriBidiStrIndex *position_from_this_list, /* list mapping positions from the 0076 order used in str */ 0077 FriBidiLevel *embedding_levels /* list of embedding levels */ 0078 ); 0079 0080 0081 /* fribidi_log2vis - get visual string 0082 * 0083 * This function converts the logical input string to the visual output 0084 * strings as specified by the Unicode Bidirectional Algorithm. As a side 0085 * effect it also generates mapping lists between the two strings, and the 0086 * list of embedding levels as defined by the algorithm. 0087 * 0088 * If NULL is passed as any of the the lists, the list is ignored and not 0089 * filled. 0090 * 0091 * Note that this function handles one-line paragraphs. For multi- 0092 * paragraph texts it is necessary to first split the text into 0093 * separate paragraphs and then carry over the resolved pbase_dir 0094 * between the subsequent invocations. 0095 * 0096 * Returns: Maximum level found plus one, or zero if any error occurred 0097 * (memory allocation failure most probably). 0098 */ 0099 FRIBIDI_ENTRY FriBidiLevel fribidi_log2vis ( 0100 const FriBidiChar *str, /* input logical string */ 0101 const FriBidiStrIndex len, /* input string length */ 0102 FriBidiParType *pbase_dir, /* requested and resolved paragraph 0103 * base direction */ 0104 FriBidiChar *visual_str, /* output visual string */ 0105 FriBidiStrIndex *positions_L_to_V, /* output mapping from logical to 0106 * visual string positions */ 0107 FriBidiStrIndex *positions_V_to_L, /* output mapping from visual string 0108 * back to the logical string 0109 * positions */ 0110 FriBidiLevel *embedding_levels /* output list of embedding levels */ 0111 ); 0112 0113 /* End of functions */ 0114 0115 #ifdef FRIBIDI_NO_DEPRECATED 0116 #else 0117 # include "fribidi-deprecated.h" 0118 #endif /* !FRIBIDI_NO_DEPRECATED */ 0119 0120 0121 /* An string containing the version information of the library. */ 0122 FRIBIDI_ENTRY FRIBIDI_EXTERN const char *fribidi_version_info; 0123 0124 #include "fribidi-enddecls.h" 0125 0126 #endif /* !_FRIBIDI_H */ 0127 /* Editor directions: 0128 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent 0129 */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |