first commit
Some checks failed
/ buid (push) Has been cancelled

This commit is contained in:
2026-04-16 14:48:09 +07:00
commit 4b968a3347
5625 changed files with 1685474 additions and 0 deletions

View File

@ -0,0 +1,81 @@
/* fribidi-arabic.h - do Arabic shaping to presentation forms
*
* Copyright (C) 2005 Behdad Esfahbod
*
* This file is part of GNU FriBidi.
*
* GNU FriBidi is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* GNU FriBidi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with GNU FriBidi; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For licensing issues, contact <fribidi.license@gmail.com> or write to
* Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
*
* Author(s):
* Behdad Esfahbod, 2005
*/
#ifndef _FRIBIDI_ARABIC_H
#define _FRIBIDI_ARABIC_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-flags.h"
#include "fribidi-bidi-types.h"
#include "fribidi-joining.h"
#include "fribidi-begindecls.h"
/* fribidi_shape_arabic - do Arabic shaping
*
* The actual shaping that is done depends on the flags set. Only flags
* starting with FRIBIDI_FLAG_SHAPE_ARAB_ affect this function.
* Currently these are:
*
* * FRIBIDI_FLAG_SHAPE_MIRRORING: Do mirroring.
* * FRIBIDI_FLAG_SHAPE_ARAB_PRES: Shape Arabic characters to their
* presentation form glyphs.
* * FRIBIDI_FLAG_SHAPE_ARAB_LIGA: Form mandatory Arabic ligatures.
* * FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE: Perform additional Arabic shaping
* suitable for text rendered on
* grid terminals with no mark
* rendering capabilities.
*
* Of the above, FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE is only used in special
* cases, but the rest are recommended in any environment that doesn't have
* other means for doing Arabic shaping. The set of extra flags that enable
* this level of Arabic support has a shortcut named FRIBIDI_FLAGS_ARABIC.
*/
FRIBIDI_ENTRY void
fribidi_shape_arabic (
FriBidiFlags flags, /* shaping flags */
const FriBidiLevel *embedding_levels,
const FriBidiStrIndex len, /* input string length */
FriBidiArabicProp *ar_props, /* input/output Arabic properties as
* computed by fribidi_join_arabic */
FriBidiChar *str /* string to shape */
);
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_ARABIC_H */
/* Editor directions:
* Local Variables:
* mode: c
* c-basic-offset: 2
* indent-tabs-mode: t
* tab-width: 8
* End:
* vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
*/

View File

@ -0,0 +1,3 @@
#ifdef FRIBIDI_BEGIN_DECLS
FRIBIDI_BEGIN_DECLS
#endif /* FRIBIDI_BEGIN_DECLS */

View File

@ -0,0 +1,96 @@
#ifndef __FRIBIDI_DOC
/* FriBidi
* fribidi-bidi-types-list.h - list of bidi types
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
/* *INDENT-OFF* */
#endif /* !__FRIBIDI_DOC */
#ifndef _FRIBIDI_ADD_TYPE
# define _FRIBIDI_ADD_TYPE(x,y)
#endif
#ifndef _FRIBIDI_ADD_ALIAS
# define _FRIBIDI_ADD_ALIAS(x1,x2)
#endif
#if !defined(_FRIBIDI_PAR_TYPES) || defined(_FRIBIDI_ALL_TYPES)
_FRIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right letter */
_FRIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left letter */
_FRIBIDI_ADD_TYPE (AL, 'A') /* Arabic Letter */
_FRIBIDI_ADD_TYPE (EN, '1') /* European Numeral */
_FRIBIDI_ADD_TYPE (AN, '9') /* Arabic Numeral */
_FRIBIDI_ADD_TYPE (ES, 'w') /* European number Separator */
_FRIBIDI_ADD_TYPE (ET, 'w') /* European number Terminator */
_FRIBIDI_ADD_TYPE (CS, 'w') /* Common Separator */
_FRIBIDI_ADD_TYPE (NSM, '`') /* Non Spacing Mark */
_FRIBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */
_FRIBIDI_ADD_TYPE (BS, 'B') /* Block Separator */
_FRIBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */
_FRIBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */
_FRIBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */
_FRIBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */
_FRIBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */
_FRIBIDI_ADD_TYPE (LRO, '+') /* Left-to-Right Override */
_FRIBIDI_ADD_TYPE (RLO, '+') /* Right-to-Left Override */
_FRIBIDI_ADD_TYPE (PDF, '-') /* Pop Directional Flag */
_FRIBIDI_ADD_TYPE (LRI, '+') /* Left-to-Right Isolate */
_FRIBIDI_ADD_TYPE (RLI, '+') /* Right-to-Left Isolate */
_FRIBIDI_ADD_TYPE (FSI, '+') /* First-Strong Isolate */
_FRIBIDI_ADD_TYPE (PDI, '-') /* Pop Directional Isolate */
#if defined(_FRIBIDI_ADD_ALIAS)
_FRIBIDI_ADD_ALIAS (L, LTR)
_FRIBIDI_ADD_ALIAS (R, RTL)
_FRIBIDI_ADD_ALIAS (B, BS)
_FRIBIDI_ADD_ALIAS (S, SS)
#endif /* _FRIBIDI_ADD_ALIAS */
#if defined(_FRIBIDI_SENTINEL_TYPE) || defined(_FRIBIDI_ALL_TYPES)
_FRIBIDI_ADD_TYPE (SENTINEL, '$') /* SENTINEL */
#endif /* _FRIBIDI_SENTINEL_TYPES || _FRIBIDI_ALL_TYPES*/
#endif /* !_FRIBIDI_PAR_TYPES || _FRIBIDI_ALL_TYPES */
#if defined(_FRIBIDI_PAR_TYPES) || defined(_FRIBIDI_ALL_TYPES)
# if !defined(_FRIBIDI_ALL_TYPES)
_FRIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right paragraph */
_FRIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left paragraph */
_FRIBIDI_ADD_TYPE (ON, 'n') /* directiOn-Neutral paragraph */
# endif /* !_FRIBIDI_ALL_TYPES */
_FRIBIDI_ADD_TYPE (WLTR, 'l') /* Weak Left To Right paragraph */
_FRIBIDI_ADD_TYPE (WRTL, 'r') /* Weak Right To Left paragraph */
#endif /* _FRIBIDI_PAR_TYPES || _FRIBIDI_ALL_TYPES*/
#if defined(_FRIBIDI_ENUM_TYPES)
typedef enum {
# define _FRIBIDI_ADD_TYPE _FRIBIDI_ENUM_ADD_TYPE
# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ADD_TYPE
_FRIBIDI_TYPES_MAX
} _FRIBIDI_ENUM_TYPES
#endif /* _FRIBIDI_ENUM_TYPES */
#ifndef __FRIBIDI_DOC
/* *INDENT-ON* */
#endif /* !__FRIBIDI_DOC */

View File

@ -0,0 +1,405 @@
/* FriBidi
* fribidi-bidi-types.h - character bidi types
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_BIDI_TYPES_H
#define _FRIBIDI_BIDI_TYPES_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-begindecls.h"
typedef signed char FriBidiLevel;
/*
* Define bit masks that bidi types are based on, each mask has
* only one bit set.
*/
/* RTL mask better be the least significant bit. */
#define FRIBIDI_MASK_RTL 0x00000001L /* Is right to left */
#define FRIBIDI_MASK_ARABIC 0x00000002L /* Is arabic */
/* Each char can be only one of the three following. */
#define FRIBIDI_MASK_STRONG 0x00000010L /* Is strong */
#define FRIBIDI_MASK_WEAK 0x00000020L /* Is weak */
#define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
#define FRIBIDI_MASK_SENTINEL 0x00000080L /* Is sentinel */
/* Sentinels are not valid chars, just identify the start/end of strings. */
/* Each char can be only one of the six following. */
#define FRIBIDI_MASK_LETTER 0x00000100L /* Is letter: L, R, AL */
#define FRIBIDI_MASK_NUMBER 0x00000200L /* Is number: EN, AN */
#define FRIBIDI_MASK_NUMSEPTER 0x00000400L /* Is separator or terminator: ES, ET, CS */
#define FRIBIDI_MASK_SPACE 0x00000800L /* Is space: BN, BS, SS, WS */
#define FRIBIDI_MASK_EXPLICIT 0x00001000L /* Is explicit mark: LRE, RLE, LRO, RLO, PDF */
#define FRIBIDI_MASK_ISOLATE 0x00008000L /* Is isolate mark: LRI, RLI, FSI, PDI */
/* Can be set only if FRIBIDI_MASK_SPACE is also set. */
#define FRIBIDI_MASK_SEPARATOR 0x00002000L /* Is text separator: BS, SS */
/* Can be set only if FRIBIDI_MASK_EXPLICIT is also set. */
#define FRIBIDI_MASK_OVERRIDE 0x00004000L /* Is explicit override: LRO, RLO */
#define FRIBIDI_MASK_FIRST 0x02000000L /* Whether direction is determined by first strong */
/* The following exist to make types pairwise different, some of them can
* be removed but are here because of efficiency (make queries faster). */
#define FRIBIDI_MASK_ES 0x00010000L
#define FRIBIDI_MASK_ET 0x00020000L
#define FRIBIDI_MASK_CS 0x00040000L
#define FRIBIDI_MASK_NSM 0x00080000L
#define FRIBIDI_MASK_BN 0x00100000L
#define FRIBIDI_MASK_BS 0x00200000L
#define FRIBIDI_MASK_SS 0x00400000L
#define FRIBIDI_MASK_WS 0x00800000L
/* We reserve a single bit for user's private use: we will never use it. */
#define FRIBIDI_MASK_PRIVATE 0x01000000L
/*
* Define values for FriBidiCharType
*/
/* Strong types */
/* Left-To-Right letter */
#define FRIBIDI_TYPE_LTR_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER )
/* Right-To-Left letter */
#define FRIBIDI_TYPE_RTL_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
| FRIBIDI_MASK_RTL)
/* Arabic Letter */
#define FRIBIDI_TYPE_AL_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
| FRIBIDI_MASK_RTL | FRIBIDI_MASK_ARABIC )
/* Left-to-Right Embedding */
#define FRIBIDI_TYPE_LRE_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT)
/* Right-to-Left Embedding */
#define FRIBIDI_TYPE_RLE_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
| FRIBIDI_MASK_RTL )
/* Left-to-Right Override */
#define FRIBIDI_TYPE_LRO_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
| FRIBIDI_MASK_OVERRIDE )
/* Right-to-Left Override */
#define FRIBIDI_TYPE_RLO_VAL ( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
| FRIBIDI_MASK_RTL | FRIBIDI_MASK_OVERRIDE )
/* Weak types */
/* Pop Directional Flag*/
#define FRIBIDI_TYPE_PDF_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_EXPLICIT )
/* European Numeral */
#define FRIBIDI_TYPE_EN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER )
/* Arabic Numeral */
#define FRIBIDI_TYPE_AN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER \
| FRIBIDI_MASK_ARABIC )
/* European number Separator */
#define FRIBIDI_TYPE_ES_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
| FRIBIDI_MASK_ES )
/* European number Terminator */
#define FRIBIDI_TYPE_ET_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
| FRIBIDI_MASK_ET )
/* Common Separator */
#define FRIBIDI_TYPE_CS_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
| FRIBIDI_MASK_CS )
/* Non Spacing Mark */
#define FRIBIDI_TYPE_NSM_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NSM )
/* Boundary Neutral */
#define FRIBIDI_TYPE_BN_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_SPACE \
| FRIBIDI_MASK_BN )
/* Neutral types */
/* Block Separator */
#define FRIBIDI_TYPE_BS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
| FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_BS )
/* Segment Separator */
#define FRIBIDI_TYPE_SS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
| FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_SS )
/* WhiteSpace */
#define FRIBIDI_TYPE_WS_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
| FRIBIDI_MASK_WS )
/* Other Neutral */
#define FRIBIDI_TYPE_ON_VAL ( FRIBIDI_MASK_NEUTRAL )
/* The following are used in specifying paragraph direction only. */
/* Weak Left-To-Right */
#define FRIBIDI_TYPE_WLTR_VAL ( FRIBIDI_MASK_WEAK )
/* Weak Right-To-Left */
#define FRIBIDI_TYPE_WRTL_VAL ( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_RTL )
/* start or end of text (run list) SENTINEL. Only used internally */
#define FRIBIDI_TYPE_SENTINEL ( FRIBIDI_MASK_SENTINEL )
/* Private types for applications. More private types can be obtained by
* summing up from this one. */
#define FRIBIDI_TYPE_PRIVATE ( FRIBIDI_MASK_PRIVATE )
/* New types in Unicode 6.3 */
/* Left-to-Right Isolate */
#define FRIBIDI_TYPE_LRI_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_ISOLATE )
/* Right-to-Left Isolate */
#define FRIBIDI_TYPE_RLI_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_ISOLATE | FRIBIDI_MASK_RTL )
/* First strong isolate */
#define FRIBIDI_TYPE_FSI_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_ISOLATE | FRIBIDI_MASK_FIRST )
/* Pop Directional Isolate*/
#define FRIBIDI_TYPE_PDI_VAL ( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_WEAK | FRIBIDI_MASK_ISOLATE )
/* Define Enums only if sizeof(int) == 4 (UTF-32), and not compiling C++.
* The problem with C++ is that then casts between int32 and enum will fail!
*/
#if defined(__FRIBIDI_DOC) || (FRIBIDI_SIZEOF_INT+0 == 4 && !defined(__cplusplus))
typedef enum
{
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) \
FRIBIDI_TYPE_##TYPE = FRIBIDI_TYPE_##TYPE##_VAL,
# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ADD_TYPE
_FRIBIDI_TYPE_SENTINEL = FRIBIDI_TYPE_SENTINEL /* Don't use this */
} FriBidiCharType;
typedef enum
{
# define _FRIBIDI_PAR_TYPES
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) \
FRIBIDI_PAR_##TYPE = FRIBIDI_TYPE_##TYPE##_VAL,
# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ADD_TYPE
# undef _FRIBIDI_PAR_TYPES
_FRIBIDI_PAR_SENTINEL = FRIBIDI_TYPE_SENTINEL /* Don't use this */
} FriBidiParType;
#else
typedef uint32_t FriBidiCharType;
# define FRIBIDI_TYPE_LTR FRIBIDI_TYPE_LTR_VAL
# define FRIBIDI_TYPE_RTL FRIBIDI_TYPE_RTL_VAL
# define FRIBIDI_TYPE_AL FRIBIDI_TYPE_AL_VAL
# define FRIBIDI_TYPE_EN FRIBIDI_TYPE_EN_VAL
# define FRIBIDI_TYPE_AN FRIBIDI_TYPE_AN_VAL
# define FRIBIDI_TYPE_ES FRIBIDI_TYPE_ES_VAL
# define FRIBIDI_TYPE_ET FRIBIDI_TYPE_ET_VAL
# define FRIBIDI_TYPE_CS FRIBIDI_TYPE_CS_VAL
# define FRIBIDI_TYPE_NSM FRIBIDI_TYPE_NSM_VAL
# define FRIBIDI_TYPE_BN FRIBIDI_TYPE_BN_VAL
# define FRIBIDI_TYPE_BS FRIBIDI_TYPE_BS_VAL
# define FRIBIDI_TYPE_SS FRIBIDI_TYPE_SS_VAL
# define FRIBIDI_TYPE_WS FRIBIDI_TYPE_WS_VAL
# define FRIBIDI_TYPE_ON FRIBIDI_TYPE_ON_VAL
# define FRIBIDI_TYPE_LRE FRIBIDI_TYPE_LRE_VAL
# define FRIBIDI_TYPE_RLE FRIBIDI_TYPE_RLE_VAL
# define FRIBIDI_TYPE_LRO FRIBIDI_TYPE_LRO_VAL
# define FRIBIDI_TYPE_RLO FRIBIDI_TYPE_RLO_VAL
# define FRIBIDI_TYPE_PDF FRIBIDI_TYPE_PDF_VAL
# define FRIBIDI_TYPE_LRI FRIBIDI_TYPE_LRI_VAL
# define FRIBIDI_TYPE_RLI FRIBIDI_TYPE_RLI_VAL
# define FRIBIDI_TYPE_FSI FRIBIDI_TYPE_FSI_VAL
# define FRIBIDI_TYPE_PDI FRIBIDI_TYPE_PDI_VAL
typedef uint32_t FriBidiParType;
# define FRIBIDI_PAR_LTR FRIBIDI_TYPE_LTR_VAL
# define FRIBIDI_PAR_RTL FRIBIDI_TYPE_RTL_VAL
# define FRIBIDI_PAR_ON FRIBIDI_TYPE_ON_VAL
# define FRIBIDI_PAR_WLTR FRIBIDI_TYPE_WLTR_VAL
# define FRIBIDI_PAR_WRTL FRIBIDI_TYPE_WRTL_VAL
#endif
/* Please don't use these two type names, use FRIBIDI_PAR_* form instead. */
#define FRIBIDI_TYPE_WLTR FRIBIDI_PAR_WLTR
#define FRIBIDI_TYPE_WRTL FRIBIDI_PAR_WRTL
/*
* Defining macros for needed queries, It is fully dependent on the
* implementation of FriBidiCharType.
*/
/* Is right-to-left level? */
#define FRIBIDI_LEVEL_IS_RTL(lev) ((lev) & 1)
/* Return the bidi type corresponding to the direction of the level number,
FRIBIDI_TYPE_LTR for evens and FRIBIDI_TYPE_RTL for odds. */
#define FRIBIDI_LEVEL_TO_DIR(lev) \
(FRIBIDI_LEVEL_IS_RTL (lev) ? FRIBIDI_TYPE_RTL : FRIBIDI_TYPE_LTR)
/* Return the minimum level of the direction, 0 for FRIBIDI_TYPE_LTR and
1 for FRIBIDI_TYPE_RTL and FRIBIDI_TYPE_AL. */
#define FRIBIDI_DIR_TO_LEVEL(dir) \
((FriBidiLevel) (FRIBIDI_IS_RTL (dir) ? 1 : 0))
/* Is right to left: RTL, AL, RLE, RLO? */
#define FRIBIDI_IS_RTL(p) ((p) & FRIBIDI_MASK_RTL)
/* Is arabic: AL, AN? */
#define FRIBIDI_IS_ARABIC(p) ((p) & FRIBIDI_MASK_ARABIC)
/* Is strong? */
#define FRIBIDI_IS_STRONG(p) ((p) & FRIBIDI_MASK_STRONG)
/* Is weak? */
#define FRIBIDI_IS_WEAK(p) ((p) & FRIBIDI_MASK_WEAK)
/* Is neutral? */
#define FRIBIDI_IS_NEUTRAL(p) ((p) & FRIBIDI_MASK_NEUTRAL)
/* Is sentinel? */
#define FRIBIDI_IS_SENTINEL(p) ((p) & FRIBIDI_MASK_SENTINEL)
/* Is letter: L, R, AL? */
#define FRIBIDI_IS_LETTER(p) ((p) & FRIBIDI_MASK_LETTER)
/* Is number: EN, AN? */
#define FRIBIDI_IS_NUMBER(p) ((p) & FRIBIDI_MASK_NUMBER)
/* Is number separator or terminator: ES, ET, CS? */
#define FRIBIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR(p) \
((p) & FRIBIDI_MASK_NUMSEPTER)
/* Is space: BN, BS, SS, WS? */
#define FRIBIDI_IS_SPACE(p) ((p) & FRIBIDI_MASK_SPACE)
/* Is explicit mark: LRE, RLE, LRO, RLO, PDF? */
#define FRIBIDI_IS_EXPLICIT(p) ((p) & FRIBIDI_MASK_EXPLICIT)
/* Is isolator */
#define FRIBIDI_IS_ISOLATE(p) ((p) & FRIBIDI_MASK_ISOLATE)
/* Is text separator: BS, SS? */
#define FRIBIDI_IS_SEPARATOR(p) ((p) & FRIBIDI_MASK_SEPARATOR)
/* Is explicit override: LRO, RLO? */
#define FRIBIDI_IS_OVERRIDE(p) ((p) & FRIBIDI_MASK_OVERRIDE)
/* Some more: */
/* Is left to right letter: LTR? */
#define FRIBIDI_IS_LTR_LETTER(p) \
((p) & (FRIBIDI_MASK_LETTER | FRIBIDI_MASK_RTL) == FRIBIDI_MASK_LETTER)
/* Is right to left letter: RTL, AL? */
#define FRIBIDI_IS_RTL_LETTER(p) \
((p) & (FRIBIDI_MASK_LETTER | FRIBIDI_MASK_RTL) \
== (FRIBIDI_MASK_LETTER | FRIBIDI_MASK_RTL))
/* Is ES or CS: ES, CS? */
#define FRIBIDI_IS_ES_OR_CS(p) \
((p) & (FRIBIDI_MASK_ES | FRIBIDI_MASK_CS))
/* Is explicit or BN: LRE, RLE, LRO, RLO, PDF, BN? */
#define FRIBIDI_IS_EXPLICIT_OR_BN(p) \
((p) & (FRIBIDI_MASK_EXPLICIT | FRIBIDI_MASK_BN))
/* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
#define FRIBIDI_IS_EXPLICIT_OR_BN_OR_NSM(p) \
((p) & (FRIBIDI_MASK_EXPLICIT | FRIBIDI_MASK_BN | FRIBIDI_MASK_NSM))
/* Is explicit or BN or NSM: LRE, RLE, LRO, RLO, PDF, BN, NSM? */
#define FRIBIDI_IS_EXPLICIT_OR_ISOLATE_OR_BN_OR_NSM(p) \
((p) & (FRIBIDI_MASK_EXPLICIT | FRIBIDI_MASK_ISOLATE | FRIBIDI_MASK_BN | FRIBIDI_MASK_NSM))
/* Is explicit or BN or WS: LRE, RLE, LRO, RLO, PDF, BN, WS? */
#define FRIBIDI_IS_EXPLICIT_OR_BN_OR_WS(p) \
((p) & (FRIBIDI_MASK_EXPLICIT | FRIBIDI_MASK_BN | FRIBIDI_MASK_WS))
/* Is explicit or separator or BN or WS: LRE, RLE, LRO, RLO, PDF, BS, SS, BN, WS? */
#define FRIBIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(p) \
((p) & (FRIBIDI_MASK_EXPLICIT | FRIBIDI_MASK_SEPARATOR \
| FRIBIDI_MASK_BN | FRIBIDI_MASK_WS))
/* Is private-use type for application? */
#define FRIBIDI_IS_PRIVATE(p) ((p) & FRIBIDI_MASK_PRIVATE)
/* Define some conversions. */
/* Change numbers to RTL: EN,AN -> RTL. */
#define FRIBIDI_CHANGE_NUMBER_TO_RTL(p) \
(FRIBIDI_IS_NUMBER(p) ? FRIBIDI_TYPE_RTL : (p))
/* Override status of an explicit mark:
* LRO,LRE->LTR, RLO,RLE->RTL, otherwise->ON. */
#define FRIBIDI_EXPLICIT_TO_OVERRIDE_DIR(p) \
(FRIBIDI_IS_OVERRIDE(p) ? FRIBIDI_LEVEL_TO_DIR(FRIBIDI_DIR_TO_LEVEL(p)) \
: FRIBIDI_TYPE_ON)
/* Weaken type for paragraph fallback purposes:
* LTR->WLTR, RTL->WRTL. */
#define FRIBIDI_WEAK_PARAGRAPH(p) (FRIBIDI_PAR_WLTR | ((p) & FRIBIDI_MASK_RTL))
/* Functions finally */
/* fribidi_get_bidi_type - get character bidi type
*
* This function returns the bidi type of a character as defined in Table 3.7
* Bidirectional Character Types of the Unicode Bidirectional Algorithm
* available at
* http://www.unicode.org/reports/tr9/#Bidirectional_Character_Types, using
* data provided in file UnicodeData.txt of the Unicode Character Database
* available at http://www.unicode.org/Public/UNIDATA/UnicodeData.txt.
*
* There are a few macros defined in fribidi-bidi-types.h for querying a bidi
* type.
*/
FRIBIDI_ENTRY FriBidiCharType
fribidi_get_bidi_type (
FriBidiChar ch /* input character */
) FRIBIDI_GNUC_CONST;
/* fribidi_get_bidi_types - get bidi types for an string of characters
*
* This function finds the bidi types of an string of characters. See
* fribidi_get_bidi_type() for more information about the bidi types returned
* by this function.
*/
FRIBIDI_ENTRY void fribidi_get_bidi_types (
const FriBidiChar *str, /* input string */
const FriBidiStrIndex len, /* input string length */
FriBidiCharType *btypes /* output bidi types */
);
/* fribidi_get_bidi_type_name - get bidi type name
*
* This function returns the bidi type name of a character type. The
* returned string is a static string and should not be freed.
*
* The type names are the same as ones defined in Table 3.7 Bidirectional
* Character Types of the Unicode Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/#Bidirectional_Character_Types, with a
* few modifications: L->LTR, R->RTL, B->BS, S->SS.
*/
FRIBIDI_ENTRY const char *fribidi_get_bidi_type_name (
FriBidiCharType t /* input bidi type */
) FRIBIDI_GNUC_CONST;
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_BIDI_TYPES_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,142 @@
/* FriBidi
* fribidi-bidi.h - bidirectional algorithm
*
* Authors:
* Behdad Esfahbod, 2001, 2002, 2004
* Dov Grobgeld, 1999, 2000
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001,2002 Behdad Esfahbod
* Copyright (C) 1999,2000 Dov Grobgeld
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_BIDI_H
#define _FRIBIDI_BIDI_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-flags.h"
#include "fribidi-bidi-types.h"
#include "fribidi-begindecls.h"
/* fribidi_get_par_direction - get base paragraph direction
*
* This function finds the base direction of a single paragraph,
* as defined by rule P2 of the Unicode Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/#P2.
*
* You typically do not need this function as
* fribidi_get_par_embedding_levels() knows how to compute base direction
* itself, but you may need this to implement a more sophisticated paragraph
* direction handling. Note that you can pass more than a paragraph to this
* function and the direction of the first non-neutral paragraph is returned,
* which is a very good heuristic to set direction of the neutral paragraphs
* at the beginning of text. For other neutral paragraphs, you better use the
* direction of the previous paragraph.
*
* Returns: Base pargraph direction. No weak paragraph direction is returned,
* only LTR, RTL, or ON.
*/
FRIBIDI_ENTRY FriBidiParType fribidi_get_par_direction (
const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
fribidi_get_bidi_types() */
const FriBidiStrIndex len /* input string length */
);
/* fribidi_get_par_embedding_levels_ex - get bidi embedding levels of a paragraph
*
* This function finds the bidi embedding levels of a single paragraph,
* as defined by the Unicode Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/. This function implements rules P2 to
* I1 inclusive, and parts 1 to 3 of L1, except for rule X9 which is
* implemented in fribidi_remove_bidi_marks(). Part 4 of L1 is implemented
* in fribidi_reorder_line().
*
* There are a few macros defined in fribidi-bidi-types.h to work with this
* embedding levels.
*
* Returns: Maximum level found plus one, or zero if any error occurred
* (memory allocation failure most probably).
*/
FRIBIDI_ENTRY FriBidiLevel
fribidi_get_par_embedding_levels_ex (
const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
fribidi_get_bidi_types() */
const FriBidiBracketType *bracket_types, /* input list of bracket types as returned by
fribidi_get_bracket_types() */
const FriBidiStrIndex len, /* input string length of the paragraph */
FriBidiParType *pbase_dir, /* requested and resolved paragraph
* base direction */
FriBidiLevel *embedding_levels /* output list of embedding levels */
) FRIBIDI_GNUC_WARN_UNUSED;
/* fribidi_reorder_line - reorder a line of logical string to visual
*
* This function reorders the characters in a line of text from logical to
* final visual order. This function implements part 4 of rule L1, and rules
* L2 and L3 of the Unicode Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels.
*
* As a side effect it also sets position maps if not NULL.
*
* You should provide the resolved paragraph direction and embedding levels as
* set by fribidi_get_par_embedding_levels(). Also note that the embedding
* levels may change a bit. To be exact, the embedding level of any sequence
* of white space at the end of line is reset to the paragraph embedding level
* (That is part 4 of rule L1).
*
* Note that the bidi types and embedding levels are not reordered. You can
* reorder these (or any other) arrays using the map later. The user is
* responsible to initialize map to something sensible, like an identity
* mapping, or pass NULL if no map is needed.
*
* There is an optional part to this function, which is whether non-spacing
* marks for right-to-left parts of the text should be reordered to come after
* their base characters in the visual string or not. Most rendering engines
* expect this behavior, but console-based systems for example do not like it.
* This is controlled by the FRIBIDI_FLAG_REORDER_NSM flag. The flag is on
* in FRIBIDI_FLAGS_DEFAULT.
*
* Returns: Maximum level found in this line plus one, or zero if any error
* occurred (memory allocation failure most probably).
*/
FRIBIDI_ENTRY FriBidiLevel fribidi_reorder_line (
FriBidiFlags flags, /* reorder flags */
const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
fribidi_get_bidi_types() */
const FriBidiStrIndex len, /* input length of the line */
const FriBidiStrIndex off, /* input offset of the beginning of the line
in the paragraph */
const FriBidiParType base_dir, /* resolved paragraph base direction */
FriBidiLevel *embedding_levels, /* input list of embedding levels,
as returned by
fribidi_get_par_embedding_levels */
FriBidiChar *visual_str, /* visual string to reorder */
FriBidiStrIndex *map /* a map of string indices which is reordered
* to reflect where each glyph ends up. */
) FRIBIDI_GNUC_WARN_UNUSED;
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_BIDI_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,89 @@
/* fribidi-brackets.h - get bracket character property
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001, 2002, 2004 Behdad Esfahbod
* Copyright (C) 1999, 2000, 2017 Dov Grobgeld
*
* This file is part of GNU FriBidi.
*
* GNU FriBidi is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* GNU FriBidi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with GNU FriBidi; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For licensing issues, contact <fribidi.license@gmail.com> or write to
* Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
*
* Author(s):
* Behdad Esfahbod, 2001, 2002, 2004
* Dov Grobgeld, 1999, 2000, 2017
*/
#ifndef _FRIBIDI_BRACKETS_H
#define _FRIBIDI_BRACKETS_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-bidi-types.h"
#include "fribidi-begindecls.h"
/* fribidi_get_bracket - get bracketed character
*
* This function finds the bracketed equivalent of a character as defined in
* the file BidiBrackets.txt of the Unicode Character Database available at
* http://www.unicode.org/Public/UNIDATA/BidiBrackets.txt.
*
* If the input character is a declared as a brackets character in the
* Unicode standard and has a bracketed equivalent. The matching bracketed
* character is put in the output, otherwise the input character itself is
* put.
*
* Returns: The bracket type of the character. Use the
* FRIBIDI_IS_BRACKET(FriBidiBracketType) to test if it is a valid
* property.
*/
FRIBIDI_ENTRY FriBidiBracketType fribidi_get_bracket (
FriBidiChar ch /* input character */
);
/* fribidi_get_bracket_types - get bracketed characters
*
* This function finds the bracketed characters of an string of characters.
* See fribidi_get_bracket() for more information about the bracketed
* characters returned by this function.
*/
FRIBIDI_ENTRY void
fribidi_get_bracket_types (
const FriBidiChar *str, /* input string */
const FriBidiStrIndex len, /* input string length */
const FriBidiCharType *types, /* input bidi types */
FriBidiBracketType *btypes /* output bracketed characters */
);
#define FRIBIDI_BRACKET_OPEN_MASK 0x80000000
#define FRIBIDI_BRACKET_ID_MASK 0x7fffffff
#define FRIBIDI_IS_BRACKET_OPEN(bt) ((bt & FRIBIDI_BRACKET_OPEN_MASK)>0)
#define FRIBIDI_BRACKET_ID(bt) ((bt & FRIBIDI_BRACKET_ID_MASK))
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_BRACKETS_H */
/* Editor directions:
* Local Variables:
* mode: c
* c-basic-offset: 2
* indent-tabs-mode: t
* tab-width: 8
* End:
* vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
*/

View File

@ -0,0 +1,54 @@
#ifndef __FRIBIDI_DOC
/* FriBidi
* fribidi-char-sets-list.h - list of supported character sets
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
/* *INDENT-OFF* */
/* The order of types in this list should not be important at compile time,
* but apparently it should not be changed after compilation! */
#endif /* !__FRIBIDI_DOC */
#ifdef _FRIBIDI_ADD_CHAR_SET
# define _FRIBIDI_ADD_CHAR_SET_OTHERS _FRIBIDI_ADD_CHAR_SET
# define _FRIBIDI_ADD_CHAR_SET_ONE2ONE _FRIBIDI_ADD_CHAR_SET
#endif /* _FRIBIDI_ADD_CHAR_SET */
#ifdef _FRIBIDI_ADD_CHAR_SET_OTHERS
_FRIBIDI_ADD_CHAR_SET_OTHERS (UTF8, utf8) /* UTF-8 (Unicode) */
_FRIBIDI_ADD_CHAR_SET_OTHERS (CAP_RTL, cap_rtl) /* CapRTL (Test) */
#endif /* _FRIBIDI_ADD_CHAR_SET_OTHERS */
#ifdef _FRIBIDI_ADD_CHAR_SET_ONE2ONE
_FRIBIDI_ADD_CHAR_SET_ONE2ONE (ISO8859_6, iso8859_6) /* ISO8859-6 (Arabic) */
_FRIBIDI_ADD_CHAR_SET_ONE2ONE (ISO8859_8, iso8859_8) /* ISO8859-8 (Hebrew) */
_FRIBIDI_ADD_CHAR_SET_ONE2ONE (CP1255, cp1255) /* CP1255 (MS Hebrew/Yiddish) */
_FRIBIDI_ADD_CHAR_SET_ONE2ONE (CP1256, cp1256) /* CP1256 (MS Arabic) */
#endif /* _FRIBIDI_ADD_CHAR_SET_ONE2ONE */
#ifdef _FRIBIDI_ADD_CHAR_SET
# undef _FRIBIDI_ADD_CHAR_SET_OTHERS
# undef _FRIBIDI_ADD_CHAR_SET_ONE2ONE
#endif /* _FRIBIDI_ADD_CHAR_SET */
#ifndef __FRIBIDI_DOC
/* *INDENT-ON* */
#endif /* !__FRIBIDI_DOC */

View File

@ -0,0 +1,106 @@
/* FriBidi
* fribidi-char-sets.h - character set conversion routines
*
* Authors:
* Behdad Esfahbod, 2001, 2002, 2004
* Dov Grobgeld, 1999, 2000
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001,2002 Behdad Esfahbod
* Copyright (C) 1999,2000 Dov Grobgeld
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_CHAR_SETS_H
#define _FRIBIDI_CHAR_SETS_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-begindecls.h"
typedef enum
{
_FRIBIDI_CHAR_SET_NOT_FOUND,
# define _FRIBIDI_ADD_CHAR_SET(CHAR_SET, char_set) FRIBIDI_CHAR_SET_##CHAR_SET,
# include "fribidi-char-sets-list.h"
# undef _FRIBIDI_ADD_CHAR_SET
_FRIBIDI_CHAR_SETS_NUM_PLUS_ONE
}
FriBidiCharSet;
#define FRIBIDI_CHAR_SET_NOT_FOUND _FRIBIDI_CHAR_SET_NOT_FOUND
#define FRIBIDI_CHAR_SETS_NUM (_FRIBIDI_CHAR_SETS_NUM_PLUS_ONE - 1)
/* fribidi_charset_to_unicode - convert string to Unicode
*
* This function converts an string from a character set, to a Unicode string.
*
* Returns: The length of the new string.
*/
FRIBIDI_ENTRY FriBidiStrIndex fribidi_charset_to_unicode (
FriBidiCharSet char_set, /* character set to convert from */
const char *s, /* input string encoded in char_set */
FriBidiStrIndex len, /* input string length */
FriBidiChar *us /* output Unicode string */
);
/* fribidi_unicode_to_charset - convert string from Unicode
*
* This function converts a Unicode string to an string in another character
* set. It also null-terminates the output string.
*
* Returns: The length of the new string.
*/
FRIBIDI_ENTRY FriBidiStrIndex fribidi_unicode_to_charset (
FriBidiCharSet char_set, /* character set to convert to */
const FriBidiChar *us, /* input Unicode string */
FriBidiStrIndex len, /* input string length */
char *s /* output string encoded in char_set */
);
/* fribidi_parse_charset - parse character set name
*
* Returns: The character set named s, or FRIBIDI_CHAR_SET_NOT_FOUND if the
* character set is not available.
*/
FRIBIDI_ENTRY FriBidiCharSet fribidi_parse_charset (
const char *s /* input name of the character set */
);
FRIBIDI_ENTRY const char *fribidi_char_set_name (
FriBidiCharSet char_set
);
FRIBIDI_ENTRY const char *fribidi_char_set_title (
FriBidiCharSet char_set
);
FRIBIDI_ENTRY const char *fribidi_char_set_desc (
FriBidiCharSet char_set
);
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_CHAR_SETS_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,158 @@
/* FriBidi
* fribidi-common.h - common include for library headers
*
* Author:
* Behdad Esfahbod, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_COMMON_H
#define _FRIBIDI_COMMON_H
#ifdef DONT_HAVE_FRIBIDI_CONFIG_H
# define FRIBIDI "fribidi"
# define FRIBIDI_NAME "fribidi"
# define FRIBIDI_VERSION "unknown"
# define FRIBIDI_BUGREPORT "unknown"
# define FRIBIDI_INTERFACE_VERSION_STRING "unknown"
#else /* !DONT_HAVE_FRIBIDI_CONFIG_H */
# include "fribidi-config.h"
#endif /* !DONT_HAVE_FRIBIDI_CONFIG_H */
#ifdef HAVE_FRIBIDI_CUSTOM_H
# include <fribidi-custom.h>
#endif /* HAVE_FRIBIDI_CUSTOM_H */
/* FRIBIDI_ENTRY is a macro used to declare library entry points. */
#ifndef FRIBIDI_LIB_STATIC
# ifndef FRIBIDI_ENTRY
# ifdef _WIN32
# ifdef FRIBIDI_BUILD
# define FRIBIDI_ENTRY __declspec(dllexport)
# else
# define FRIBIDI_ENTRY __declspec(dllimport)
# endif
# elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
# define FRIBIDI_ENTRY __global
# else
# if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__ICC)
# define FRIBIDI_ENTRY __attribute__ ((visibility("default")))
# else
# define FRIBIDI_ENTRY
# endif
# endif
# endif
#else
# ifndef FRIBIDI_ENTRY
# define FRIBIDI_ENTRY
# endif
#endif
#define FRIBIDI_EXTERN extern
#ifdef __ICC
#define FRIBIDI_BEGIN_IGNORE_DEPRECATIONS \
_Pragma ("warning (push)") \
_Pragma ("warning (disable:1478)")
#define FRIBIDI_END_IGNORE_DEPRECATIONS \
_Pragma ("warning (pop)")
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#define FRIBIDI_BEGIN_IGNORE_DEPRECATIONS \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define FRIBIDI_END_IGNORE_DEPRECATIONS \
_Pragma ("GCC diagnostic pop")
#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
#define FRIBIDI_BEGIN_IGNORE_DEPRECATIONS \
__pragma (warning (push)) \
__pragma (warning (disable : 4996))
#define FRIBIDI_END_IGNORE_DEPRECATIONS \
__pragma (warning (pop))
#elif defined (__clang__)
#define FRIBIDI_BEGIN_IGNORE_DEPRECATIONS \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define FRIBIDI_END_IGNORE_DEPRECATIONS \
_Pragma("clang diagnostic pop")
#else
#define FRIBIDI_BEGIN_IGNORE_DEPRECATIONS
#define FRIBIDI_END_IGNORE_DEPRECATIONS
#endif
#if (defined(__GNUC__) && (__GNUC__ > 2)) && ! defined(_WIN32)
# define FRIBIDI_GNUC_WARN_UNUSED __attribute__((__warn_unused_result__))
# define FRIBIDI_GNUC_MALLOC __attribute__((__malloc__))
# define FRIBIDI_GNUC_HIDDEN __attribute__((__visibility__ ("hidden")))
# define FRIBIDI_GNUC_CONST __attribute__((__const__))
# define FRIBIDI_GNUC_DEPRECATED __attribute__((__unused__))
#else /* __GNUC__ */
# define FRIBIDI_GNUC_WARN_UNUSED
# define FRIBIDI_GNUC_MALLOC
# define FRIBIDI_GNUC_HIDDEN
# define FRIBIDI_GNUC_CONST
# define FRIBIDI_GNUC_DEPRECATED
#endif /* __GNUC__ */
/* FRIBIDI_BEGIN_DECLS should be used at the beginning of your declarations,
* so that C++ compilers don't mangle their names. Use FRIBIDI_END_DECLS at
* the end of C declarations. */
#ifndef FRIBIDI_BEGIN_DECLS
# ifdef __cplusplus
# define FRIBIDI_BEGIN_DECLS extern "C" {
# define FRIBIDI_END_DECLS }
# else /* !__cplusplus */
# define FRIBIDI_BEGIN_DECLS /* empty */
# define FRIBIDI_END_DECLS /* empty */
# endif /* !__cplusplus */
#endif /* !FRIBIDI_BEGIN_DECLS */
/* fribidi_debug_status - get current debug state
*
*/
FRIBIDI_ENTRY int fribidi_debug_status (
void
);
/* fribidi_set_debug - set debug state
*
*/
FRIBIDI_ENTRY int
fribidi_set_debug (
int state /* new state to set */
);
#endif /* !_FRIBIDI_COMMON_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,23 @@
/* fribidi-config.h file generated by Meson */
/* Not copyrighted, in public domain. */
#ifndef FRIBIDI_CONFIG_H
#define FRIBIDI_CONFIG_H
#define FRIBIDI "fribidi"
#define FRIBIDI_NAME "GNU FriBidi"
#define FRIBIDI_BUGREPORT "https://github.com/fribidi/fribidi/issues/new"
#define FRIBIDI_VERSION "1.0.12"
#define FRIBIDI_MAJOR_VERSION 1
#define FRIBIDI_MINOR_VERSION 0
#define FRIBIDI_MICRO_VERSION 12
#define FRIBIDI_INTERFACE_VERSION 4
#define FRIBIDI_INTERFACE_VERSION_STRING "4"
/* The size of a `int', as computed by sizeof. */
#define FRIBIDI_SIZEOF_INT 4
/* Define if fribidi was built with MSVC */
#undef FRIBIDI_BUILT_WITH_MSVC
#endif /* FRIBIDI_CONFIG_H */

View File

@ -0,0 +1,175 @@
/* FriBidi
* fribidi-deprecated.h - Deprecated interfaces
*
* Author:
* Behdad Esfahbod, 2004, 2005
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2004, 2005 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_DEPRECATED_H
#define _FRIBIDI_DEPRECATED_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-bidi-types.h"
#include "fribidi-begindecls.h"
/* fribidi_mirroring_status - get current mirroring status
*
* This function is deprecated and only used with other deprecated functions.
*/
FRIBIDI_ENTRY fribidi_boolean fribidi_mirroring_status (
void
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_set_mirroring - set mirroring on or off
*
* This function is used to turn character mirroring on or off.
* Character mirroring is the act of replacing a mirrorable glyph
* (character), eg. left parenthesis, with the matching glyph,
* eg. right parenthesis, in a right-to-left resolved context.
* If your rendering engine does mirroring itself, you may want to
* turn it off here.
*
* This flag is on by default.
* This function is deprecated and only used with other deprecated functions.
*
* Returns: the new mirroring status.
*/
FRIBIDI_ENTRY fribidi_boolean fribidi_set_mirroring (
fribidi_boolean state /* new state to set */
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_reorder_nsm_status - get current marks reordering status
*
* This function is deprecated and only used with other deprecated functions.
*/
FRIBIDI_ENTRY fribidi_boolean fribidi_reorder_nsm_status (
void
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_set_reorder_nsm - set marks reordering on or off
*
* This function is used to turn non-spacing marks reordering on or
* off. Reordering non-spacing marks is the act of placing non-spacing
* marks (bidi class NSM) after their base character in a right-to-left
* resolved context. If your rendering engine expects non-spacing marks
* always after the base character in the memory representation of the
* visual string, you need this option on. An example of where people
* may need it off is when rendering in the console when non-spacing
* marks cannot be applied on top of the base character.
*
* This flag is on by default.
* This function is deprecated and only used with other deprecated functions.
*
* Returns: the new marks reordering status.
*/
FRIBIDI_ENTRY fribidi_boolean fribidi_set_reorder_nsm (
fribidi_boolean state /* new state to set */
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_log2vis_get_embedding_levels - get embedding levels
*
* Deprecated. Replaced by fribidi_get_par_embedding_levels_ex.
*/
FRIBIDI_ENTRY FriBidiLevel
fribidi_log2vis_get_embedding_levels (
const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
fribidi_get_bidi_types() */
const FriBidiStrIndex len, /* input string length of the paragraph */
FriBidiParType *pbase_dir, /* requested and resolved paragraph
* base direction */
FriBidiLevel *embedding_levels /* output list of embedding levels */
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_get_type - get character bidi type
*
* Deprecated. Replaced by fribidi_get_bidi_type.
*/
FRIBIDI_ENTRY FriBidiCharType
fribidi_get_type (
FriBidiChar ch /* input character */
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_get_type_internal - get character bidi type
*
* Deprecated. Replaced by fribidi_get_bidi_type.
*/
FRIBIDI_ENTRY FriBidiCharType
fribidi_get_type_internal (
FriBidiChar ch /* input character */
) FRIBIDI_GNUC_DEPRECATED;
/* fribidi_get_par_embedding_levels - get bidi embedding levels of a paragraph
*
* Deprecated interface to fribidi_get_par_embedding_levels_ex(). Refer to
* it for documentation.
*/
FRIBIDI_ENTRY FriBidiLevel
fribidi_get_par_embedding_levels (
const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
fribidi_get_bidi_types() */
const FriBidiStrIndex len, /* input string length of the paragraph */
FriBidiParType *pbase_dir, /* requested and resolved paragraph
* base direction */
FriBidiLevel *embedding_levels /* output list of embedding levels */
)
FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
#define UNI_MAX_BIDI_LEVEL FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL
#define UNI_LRM FRIBIDI_CHAR_LRM
#define UNI_RLM FRIBIDI_CHAR_RLM
#define UNI_LRE FRIBIDI_CHAR_LRE
#define UNI_RLE FRIBIDI_CHAR_RLE
#define UNI_LRO FRIBIDI_CHAR_LRO
#define UNI_RLO FRIBIDI_CHAR_RLO
#define UNI_LS FRIBIDI_CHAR_LS
#define UNI_PS FRIBIDI_CHAR_PS
#define UNI_ZWNJ FRIBIDI_CHAR_ZWNJ
#define UNI_ZWJ FRIBIDI_CHAR_ZWJ
#define UNI_HEBREW_ALEF FRIBIDI_CHAR_HEBREW_ALEF
#define UNI_ARABIC_ALEF FRIBIDI_CHAR_ARABIC_ALEF
#define UNI_ARABIC_ZERO FRIBIDI_CHAR_ARABIC_ZERO
#define UNI_FARSI_ZERO FRIBIDI_CHAR_PERSIAN_ZERO
#define FRIBIDI_TYPE_WL FRIBIDI_PAR_WLTR
#define FRIBIDI_TYPE_WR FRIBIDI_PAR_WRTL
#define FRIBIDI_TYPE_L FRIBIDI_PAR_LTR
#define FRIBIDI_TYPE_R FRIBIDI_PAR_RTL
#define FRIBIDI_TYPE_N FRIBIDI_PAR_ON
#define FRIBIDI_TYPE_B FRIBIDI_TYPE_BS
#define FRIBIDI_TYPE_S FRIBIDI_TYPE_SS
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_DEPRECATED_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,3 @@
#ifdef FRIBIDI_END_DECLS
FRIBIDI_END_DECLS
#endif /* FRIBIDI_END_DECLS */

View File

@ -0,0 +1,72 @@
/* FriBidi
* fribidi-flags.h - option flags
*
* Author:
* Behdad Esfahbod, 2005
*
* Copyright (C) 2005 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_FLAGS_H
#define _FRIBIDI_FLAGS_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-begindecls.h"
typedef uint32_t FriBidiFlags;
/*
* Define option flags that various functions use. Each mask has
* only one bit set.
*/
#define FRIBIDI_FLAG_SHAPE_MIRRORING 0x00000001
#define FRIBIDI_FLAG_REORDER_NSM 0x00000002
#define FRIBIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
#define FRIBIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
#define FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
#define FRIBIDI_FLAG_REMOVE_BIDI 0x00010000
#define FRIBIDI_FLAG_REMOVE_JOINING 0x00020000
#define FRIBIDI_FLAG_REMOVE_SPECIALS 0x00040000
/*
* And their combinations.
*/
#define FRIBIDI_FLAGS_DEFAULT ( \
FRIBIDI_FLAG_SHAPE_MIRRORING | \
FRIBIDI_FLAG_REORDER_NSM | \
FRIBIDI_FLAG_REMOVE_SPECIALS )
#define FRIBIDI_FLAGS_ARABIC ( \
FRIBIDI_FLAG_SHAPE_ARAB_PRES | \
FRIBIDI_FLAG_SHAPE_ARAB_LIGA )
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_FLAGS_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,44 @@
#ifndef __FRIBIDI_DOC
/* FriBidi
* fribidi-joining-types-list.h - list of joining types
*
* Author:
* Behdad Esfahbod, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2004 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
/* *INDENT-OFF* */
#endif /* !__FRIBIDI_DOC */
#ifndef _FRIBIDI_ADD_TYPE
# define _FRIBIDI_ADD_TYPE(x,y)
#endif
_FRIBIDI_ADD_TYPE (U, '|') /* nUn-joining, e.g. Full Stop */
_FRIBIDI_ADD_TYPE (R, '<') /* Right-joining, e.g. Arabic Letter Dal */
_FRIBIDI_ADD_TYPE (D, '+') /* Dual-joining, e.g. Arabic Letter Ain */
_FRIBIDI_ADD_TYPE (C, '-') /* join-Causing, e.g. Tatweel, ZWJ */
_FRIBIDI_ADD_TYPE (T, '^') /* Transparent, e.g. Arabic Fatha */
_FRIBIDI_ADD_TYPE (L, '>') /* Left-joining, i.e. fictional */
_FRIBIDI_ADD_TYPE (G, '~') /* iGnored, e.g. LRE, RLE, ZWNBSP */
#ifndef __FRIBIDI_DOC
/* *INDENT-ON* */
#endif /* !__FRIBIDI_DOC */

View File

@ -0,0 +1,249 @@
/* FriBidi
* fribidi-joining-types.h - character joining types
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_JOINING_TYPES_H
#define _FRIBIDI_JOINING_TYPES_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-begindecls.h"
/*
* Define bit masks that joining types are based on, each mask has
* only one bit set.
*/
#define FRIBIDI_MASK_JOINS_RIGHT 0x01 /* May join to right */
#define FRIBIDI_MASK_JOINS_LEFT 0x02 /* May join to right */
#define FRIBIDI_MASK_ARAB_SHAPES 0x04 /* May Arabic shape */
#define FRIBIDI_MASK_TRANSPARENT 0x08 /* Is transparent */
#define FRIBIDI_MASK_IGNORED 0x10 /* Is ignored */
#define FRIBIDI_MASK_LIGATURED 0x20 /* Is ligatured */
/*
* Define values for FriBidiJoiningType
*/
/* nUn-joining */
#define FRIBIDI_JOINING_TYPE_U_VAL ( 0 )
/* Right-joining */
#define FRIBIDI_JOINING_TYPE_R_VAL \
( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_ARAB_SHAPES )
/* Dual-joining */
#define FRIBIDI_JOINING_TYPE_D_VAL \
( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
| FRIBIDI_MASK_ARAB_SHAPES )
/* join-Causing */
#define FRIBIDI_JOINING_TYPE_C_VAL \
( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT )
/* Left-joining */
#define FRIBIDI_JOINING_TYPE_L_VAL \
( FRIBIDI_MASK_JOINS_LEFT | FRIBIDI_MASK_ARAB_SHAPES )
/* Transparent */
#define FRIBIDI_JOINING_TYPE_T_VAL \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_ARAB_SHAPES )
/* iGnored */
#define FRIBIDI_JOINING_TYPE_G_VAL ( FRIBIDI_MASK_IGNORED )
enum _FriBidiJoiningTypeEnum
{
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) \
FRIBIDI_JOINING_TYPE_##TYPE = FRIBIDI_JOINING_TYPE_##TYPE##_VAL,
# include "fribidi-joining-types-list.h"
# undef _FRIBIDI_ADD_TYPE
_FRIBIDI_JOINING_TYPE_JUNK /* Don't use this */
};
#ifdef __FRIBIDI_DOC
typedef enum _FriBidiJoiningTypeEnum FriBidiJoiningType;
#else /* !__FRIBIDI_DOC */
typedef uint8_t FriBidiJoiningType;
#endif /* !__FRIBIDI_DOC */
/* FriBidiArabicProp is essentially the same type as FriBidiJoiningType, but
* not limited to the few values returned by fribidi_get_joining_type. */
typedef uint8_t FriBidiArabicProp;
/*
* The equivalent of JoiningType values for ArabicProp
*/
/* Primary Arabic Joining Classes (Table 8-2) */
/* nUn-joining */
#define FRIBIDI_IS_JOINING_TYPE_U(p) \
( 0 == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT ) ) )
/* Right-joining */
#define FRIBIDI_IS_JOINING_TYPE_R(p) \
( FRIBIDI_MASK_JOINS_RIGHT == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT ) ) )
/* Dual-joining */
#define FRIBIDI_IS_JOINING_TYPE_D(p) \
( ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
| FRIBIDI_MASK_ARAB_SHAPES ) == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
| FRIBIDI_MASK_ARAB_SHAPES ) ) )
/* join-Causing */
#define FRIBIDI_IS_JOINING_TYPE_C(p) \
( ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT ) == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
| FRIBIDI_MASK_ARAB_SHAPES ) ) )
/* Left-joining */
#define FRIBIDI_IS_JOINING_TYPE_L(p) \
( FRIBIDI_MASK_JOINS_LEFT == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT ) ) )
/* Transparent */
#define FRIBIDI_IS_JOINING_TYPE_T(p) \
( FRIBIDI_MASK_TRANSPARENT == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED ) ) )
/* iGnored */
#define FRIBIDI_IS_JOINING_TYPE_G(p) \
( FRIBIDI_MASK_IGNORED == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED ) ) )
/* and for Derived Arabic Joining Classes (Table 8-3) */
/* Right join-Causing */
#define FRIBIDI_IS_JOINING_TYPE_RC(p) \
( FRIBIDI_MASK_JOINS_RIGHT == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_RIGHT ) ) )
/* Left join-Causing */
#define FRIBIDI_IS_JOINING_TYPE_LC(p) \
( FRIBIDI_MASK_JOINS_LEFT == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_JOINS_LEFT ) ) )
/*
* Defining macros for needed queries, It is fully dependent on the
* implementation of FriBidiJoiningType.
*/
/* Joins to right: R, D, C? */
#define FRIBIDI_JOINS_RIGHT(p) ((p) & FRIBIDI_MASK_JOINS_RIGHT)
/* Joins to left: L, D, C? */
#define FRIBIDI_JOINS_LEFT(p) ((p) & FRIBIDI_MASK_JOINS_LEFT)
/* May shape: R, D, L, T? */
#define FRIBIDI_ARAB_SHAPES(p) ((p) & FRIBIDI_MASK_ARAB_SHAPES)
/* Is skipped in joining: T, G? */
#define FRIBIDI_IS_JOIN_SKIPPED(p) \
((p) & (FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED))
/* Is base that will be shaped: R, D, L? */
#define FRIBIDI_IS_JOIN_BASE_SHAPES(p) \
( FRIBIDI_MASK_ARAB_SHAPES == ( (p) & \
( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED \
| FRIBIDI_MASK_ARAB_SHAPES ) ) )
#define FRIBIDI_JOINS_PRECEDING_MASK(level) \
(FRIBIDI_LEVEL_IS_RTL (level) ? FRIBIDI_MASK_JOINS_RIGHT \
: FRIBIDI_MASK_JOINS_LEFT)
#define FRIBIDI_JOINS_FOLLOWING_MASK(level) \
(FRIBIDI_LEVEL_IS_RTL (level) ? FRIBIDI_MASK_JOINS_LEFT \
: FRIBIDI_MASK_JOINS_RIGHT)
#define FRIBIDI_JOIN_SHAPE(p) \
((p) & ( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT ))
/* Functions finally */
/* fribidi_get_joining_type - get character joining type
*
* This function returns the joining type of a character as defined in Table
* 8-2 Primary Arabic Joining Classes of the Unicode standard available at
* http://www.unicode.org/versions/Unicode4.0.0/ch08.pdf#G7462, using data
* provided in file ArabicShaping.txt and UnicodeData.txt of the Unicode
* Character Database available at
* http://www.unicode.org/Public/UNIDATA/ArabicShaping.txt and
* http://www.unicode.org/Public/UNIDATA/UnicodeData.txt.
*
* There are a few macros defined in fribidi-joining-types.h for querying a
* joining type.
*/
FRIBIDI_ENTRY FriBidiJoiningType
fribidi_get_joining_type (
FriBidiChar ch /* input character */
) FRIBIDI_GNUC_CONST;
/* fribidi_get_joining_types - get joining types for an string of characters
*
* This function finds the joining types of an string of characters. See
* fribidi_get_joining_type for more information about the joining types
* returned by this function.
*/
FRIBIDI_ENTRY void fribidi_get_joining_types (
const FriBidiChar *str, /* input string */
const FriBidiStrIndex len, /* input string length */
FriBidiJoiningType *jtypes /* output joining types */
);
/* fribidi_get_joining_type_name - get joining type name
*
* This function returns the joining type name of a joining type. The
* returned string is a static string and should not be freed.
*
* The type names are the same as ones defined in Table 8-2 Primary Arabic
* Joining Classes of the Unicode standard available at
* http://www.unicode.org/versions/Unicode4.0.0/ch08.pdf#G7462.
*/
FRIBIDI_ENTRY const char *fribidi_get_joining_type_name (
FriBidiJoiningType j /* input joining type */
) FRIBIDI_GNUC_CONST;
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_JOINING_TYPES_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,74 @@
/* FriBidi
* fribidi-joining.h - Arabic joining algorithm
*
* Authors:
* Behdad Esfahbod, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2004 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_JOINING_H
#define _FRIBIDI_JOINING_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-bidi-types.h"
#include "fribidi-joining-types.h"
#include "fribidi-begindecls.h"
/* fribidi_join_arabic - do Arabic joining
*
* This function does the Arabic joining algorithm. Means, given Arabic
* joining types of the characters in ar_props (don't worry,
* FriBidiJoiningType can be casted to FriBidiArabicProp automagically), this
* function modifies this properties to grasp the effect of neighboring
* characters. You probably need this information later to do Arabic shaping.
*
* This function implements rules R1 to R7 inclusive (all rules) of the Arabic
* Cursive Joining algorithm of the Unicode standard as available at
* http://www.unicode.org/versions/Unicode4.0.0/ch08.pdf#G7462. It also
* interacts correctly with the bidirection algorithm as defined in Section
* 3.5 Shaping of the Unicode Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/#Shaping.
*
* There are a few macros defined in fribidi-joining-types.h for querying the
* Arabic properties computed by this function.
*/
FRIBIDI_ENTRY void fribidi_join_arabic (
const FriBidiCharType *bidi_types, /* input list of bidi types as
returned by
fribidi_get_bidi_types() */
const FriBidiStrIndex len, /* input string length */
const FriBidiLevel *embedding_levels, /* input list of embedding
levels, as returned by
fribidi_get_par_embedding_levels */
FriBidiArabicProp *ar_props /* Arabic properties to analyze, initialized by
joining types, as returned by
fribidi_get_joining_types */
);
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_JOINING_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,86 @@
/* fribidi-mirroring.h - get mirrored character
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001, 2002, 2004 Behdad Esfahbod
* Copyright (C) 1999, 2000, 2017 Dov Grobgeld
*
* This file is part of GNU FriBidi.
*
* GNU FriBidi is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* GNU FriBidi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with GNU FriBidi; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For licensing issues, contact <fribidi.license@gmail.com> or write to
* Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
*
* Author(s):
* Behdad Esfahbod, 2001, 2002, 2004
* Dov Grobgeld, 1999, 2000
*/
#ifndef _FRIBIDI_MIRRORING_H
#define _FRIBIDI_MIRRORING_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-bidi-types.h"
#include "fribidi-begindecls.h"
/* fribidi_get_mirror_char - get mirrored character
*
* This function finds the mirrored equivalent of a character as defined in
* the file BidiMirroring.txt of the Unicode Character Database available at
* http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt.
*
* If the input character is a declared as a mirroring character in the
* Unicode standard and has a mirrored equivalent. The matching mirrored
* character is put in the output, otherwise the input character itself is
* put.
*
* Returns: if the character has a mirroring equivalent or not.
*/
FRIBIDI_ENTRY fribidi_boolean fribidi_get_mirror_char (
FriBidiChar ch, /* input character */
FriBidiChar *mirrored_ch /* output mirrored character */
);
/* fribidi_shape_mirroring - do mirroring shaping
*
* This functions replaces mirroring characters on right-to-left embeddings in
* string with their mirrored equivalent as returned by
* fribidi_get_mirror_char().
*
* This function implements rule L4 of the Unicode Bidirectional Algorithm
* available at http://www.unicode.org/reports/tr9/#L4.
*/
FRIBIDI_ENTRY void fribidi_shape_mirroring (
const FriBidiLevel *embedding_levels, /* input list of embedding
levels, as returned by
fribidi_get_par_embedding_levels */
const FriBidiStrIndex len, /* input string length */
FriBidiChar *str /* string to shape */
);
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_MIRRORING_H */
/* Editor directions:
* Local Variables:
* mode: c
* c-basic-offset: 2
* indent-tabs-mode: t
* tab-width: 8
* End:
* vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
*/

View File

@ -0,0 +1,71 @@
/* FriBidi
* fribidi-shape.h - shaping
*
* Author:
* Behdad Esfahbod, 2004, 2005
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2004, 2005 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_SHAPE_H
#define _FRIBIDI_SHAPE_H
#include "fribidi-types.h"
#include "fribidi-flags.h"
#include "fribidi-bidi-types.h"
#include "fribidi-joining-types.h"
#include "fribidi-begindecls.h"
/* fribidi_shape - do bidi-aware shaping
*
* This function does all shaping work that depends on the resolved embedding
* levels of the characters. Currently it does mirroring and Arabic shaping,
* but the list may grow in the future. This function is a wrapper around
* fribidi_shape_mirroring and fribidi_shape_arabic.
*
* The flags parameter specifies which shapings are applied. The only flags
* affecting the functionality of this function are those beginning with
* FRIBIDI_FLAG_SHAPE_. Of these, only FRIBIDI_FLAG_SHAPE_MIRRORING is on
* in FRIBIDI_FLAGS_DEFAULT. For details of the Arabic-specific flags see
* fribidi_shape_arabic. If ar_props is NULL, no Arabic shaping is performed.
*
* Feel free to do your own shaping before or after calling this function,
* but you should take care of embedding levels yourself then.
*/
FRIBIDI_ENTRY void fribidi_shape (
FriBidiFlags flags, /* shaping flags */
const FriBidiLevel *embedding_levels, /* input list of embedding
levels, as returned by
fribidi_get_par_embedding_levels */
const FriBidiStrIndex len, /* input string length */
FriBidiArabicProp *ar_props, /* input/output Arabic properties as
* computed by fribidi_join_arabic */
FriBidiChar *str /* string to shape */
);
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_SHAPE_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,79 @@
/* FriBidi
* fribidi-types.h - define data types for the rest of the library
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc.
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_TYPES_H
#define _FRIBIDI_TYPES_H
#include "fribidi-common.h"
#include "fribidi-begindecls.h"
# if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
defined (_sgi) || defined (__sun) || defined (sun) || \
defined (__digital__) || defined (__HP_cc)
# include <inttypes.h>
# elif defined (_AIX)
# include <sys/inttypes.h>
# else
# include <stdint.h>
# endif
typedef int fribidi_boolean;
typedef uint32_t FriBidiChar;
typedef int FriBidiStrIndex;
/* The MSB is used to indicate an opening bracket */
typedef FriBidiChar FriBidiBracketType;
/* Use FRIBIDI_NO_BRACKET for assigning to a non-bracket */
#define FRIBIDI_NO_BRACKET 0
/* A few macros for working with bits */
#define FRIBIDI_TEST_BITS(x, mask) (((x) & (mask)) ? 1 : 0)
#define FRIBIDI_INCLUDE_BITS(x, mask) ((x) | (mask))
#define FRIBIDI_EXCLUDE_BITS(x, mask) ((x) & ~(mask))
#define FRIBIDI_SET_BITS(x, mask) ((x) |= (mask))
#define FRIBIDI_UNSET_BITS(x, mask) ((x) &= ~(mask))
#define FRIBIDI_ADJUST_BITS(x, mask, cond) \
((x) = ((x) & ~(mask)) | ((cond) ? (mask) : 0))
#define FRIBIDI_ADJUST_AND_TEST_BITS(x, mask, cond) \
FRIBIDI_TEST_BITS(FRIBIDI_ADJUST_BITS((x), (mask), (cond)), (mask))
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_TYPES_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,10 @@
/* fribidi-unicode-version.h
* generated by gen-unicode-version (fribidi unknown)
* from the file ReadMe.txt */
#define FRIBIDI_UNICODE_VERSION "14.0.0"
#define FRIBIDI_UNICODE_MAJOR_VERSION 14
#define FRIBIDI_UNICODE_MINOR_VERSION 0
#define FRIBIDI_UNICODE_MICRO_VERSION 0
/* End of generated fribidi-unicode-version.h */

View File

@ -0,0 +1,105 @@
/* FriBidi
* fribidi-unicode.h - general Unicode definitions
*
* Author:
* Behdad Esfahbod, 2001, 2002, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
* Copyright (C) 2001,2002 Behdad Esfahbod
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_UNICODE_H
#define _FRIBIDI_UNICODE_H
#include "fribidi-common.h"
#include "fribidi-types.h"
#include "fribidi-begindecls.h"
/* We do not support surrogates yet */
#define FRIBIDI_UNICODE_CHARS (sizeof(FriBidiChar) >= 4 ? 0x110000 : 0xFFFE)
/* Unicode version - FRIBIDI_UNICODE_VERSION */
#ifdef DONT_HAVE_FRIBIDI_UNICODE_VERSION_H
# define FRIBIDI_UNICODE_VERSION "unknown"
#else /* !DONT_HAVE_FRIBIDI_UNICODE_VERSION_H */
# include "fribidi-unicode-version.h"
#endif /* !DONT_HAVE_FRIBIDI_UNICODE_VERSION_H */
/* An string containing the version the Unicode standard implemented,
* in the form of "x.y.z", or "unknown". */
FRIBIDI_ENTRY FRIBIDI_EXTERN const char *fribidi_unicode_version;
/* Unicode Bidirectional Algorithm definitions: */
/* Number of types defined in the bidi algorithm */
#define FRIBIDI_BIDI_NUM_TYPES 19
/* The maximum embedding level value assigned by explicit marks */
#define FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL 125
/* The maximum *number* of different resolved embedding levels: 0-126 */
#define FRIBIDI_BIDI_MAX_RESOLVED_LEVELS 127
/* The maximum *number* of nested brackets: 0-63 */
#define FRIBIDI_BIDI_MAX_NESTED_BRACKET_PAIRS 63
/* A few Unicode characters: */
/* Bidirectional marks */
#define FRIBIDI_CHAR_LRM 0x200E
#define FRIBIDI_CHAR_RLM 0x200F
#define FRIBIDI_CHAR_LRE 0x202A
#define FRIBIDI_CHAR_RLE 0x202B
#define FRIBIDI_CHAR_PDF 0x202C
#define FRIBIDI_CHAR_LRO 0x202D
#define FRIBIDI_CHAR_RLO 0x202E
#define FRIBIDI_CHAR_LRI 0x2066
#define FRIBIDI_CHAR_RLI 0x2067
#define FRIBIDI_CHAR_FSI 0x2068
#define FRIBIDI_CHAR_PDI 0x2069
/* Line and Paragraph Separators */
#define FRIBIDI_CHAR_LS 0x2028
#define FRIBIDI_CHAR_PS 0x2029
/* Arabic Joining marks */
#define FRIBIDI_CHAR_ZWNJ 0x200C
#define FRIBIDI_CHAR_ZWJ 0x200D
/* Hebrew and Arabic */
#define FRIBIDI_CHAR_HEBREW_ALEF 0x05D0
#define FRIBIDI_CHAR_ARABIC_ALEF 0x0627
#define FRIBIDI_CHAR_ARABIC_ZERO 0x0660
#define FRIBIDI_CHAR_PERSIAN_ZERO 0x06F0
/* Misc */
#define FRIBIDI_CHAR_ZWNBSP 0xFEFF
/* Char we place for a deleted slot, to delete later */
#define FRIBIDI_CHAR_FILL FRIBIDI_CHAR_ZWNBSP
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_UNICODE_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,129 @@
/* FriBidi
* fribidi.h - Unicode bidirectional and Arabic joining/shaping algorithms
*
* Author:
* Behdad Esfahbod, 2004
*
* Copyright (C) 2004 Sharif FarsiWeb, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library, in a file named COPYING; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* For licensing issues, contact <fribidi.license@gmail.com>.
*/
#ifndef _FRIBIDI_H
#define _FRIBIDI_H
#include "fribidi-common.h"
#include "fribidi-unicode.h"
#include "fribidi-types.h"
#include "fribidi-flags.h"
#include "fribidi-bidi-types.h"
#include "fribidi-bidi.h"
#include "fribidi-joining-types.h"
#include "fribidi-joining.h"
#include "fribidi-mirroring.h"
#include "fribidi-brackets.h"
#include "fribidi-arabic.h"
#include "fribidi-shape.h"
#include "fribidi-char-sets.h"
#include "fribidi-begindecls.h"
/* fribidi_remove_bidi_marks - remove bidi marks out of an string
*
* This function removes the bidi and boundary-neutral marks out of an string
* and the accompanying lists. It implements rule X9 of the Unicode
* Bidirectional Algorithm available at
* http://www.unicode.org/reports/tr9/#X9, with the exception that it removes
* U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too.
*
* If any of the input lists are NULL, the list is skipped. If str is the
* visual string, then positions_to_this is positions_L_to_V and
* position_from_this_list is positions_V_to_L; if str is the logical
* string, the other way. Moreover, the position maps should be filled with
* valid entries.
*
* A position map pointing to a removed character is filled with \(mi1. By the
* way, you should not use embedding_levels if str is visual string.
*
* For best results this function should be run on a whole paragraph, not
* lines; but feel free to do otherwise if you know what you are doing.
*
* Returns: New length of the string, or \(mi1 if an error occurred (memory
* allocation failure most probably).
*/
FRIBIDI_ENTRY FriBidiStrIndex
fribidi_remove_bidi_marks (
FriBidiChar *str, /* input string to clean */
const FriBidiStrIndex len, /* input string length */
FriBidiStrIndex *positions_to_this, /* list mapping positions to the
order used in str */
FriBidiStrIndex *position_from_this_list, /* list mapping positions from the
order used in str */
FriBidiLevel *embedding_levels /* list of embedding levels */
);
/* fribidi_log2vis - get visual string
*
* This function converts the logical input string to the visual output
* strings as specified by the Unicode Bidirectional Algorithm. As a side
* effect it also generates mapping lists between the two strings, and the
* list of embedding levels as defined by the algorithm.
*
* If NULL is passed as any of the the lists, the list is ignored and not
* filled.
*
* Note that this function handles one-line paragraphs. For multi-
* paragraph texts it is necessary to first split the text into
* separate paragraphs and then carry over the resolved pbase_dir
* between the subsequent invocations.
*
* Returns: Maximum level found plus one, or zero if any error occurred
* (memory allocation failure most probably).
*/
FRIBIDI_ENTRY FriBidiLevel fribidi_log2vis (
const FriBidiChar *str, /* input logical string */
const FriBidiStrIndex len, /* input string length */
FriBidiParType *pbase_dir, /* requested and resolved paragraph
* base direction */
FriBidiChar *visual_str, /* output visual string */
FriBidiStrIndex *positions_L_to_V, /* output mapping from logical to
* visual string positions */
FriBidiStrIndex *positions_V_to_L, /* output mapping from visual string
* back to the logical string
* positions */
FriBidiLevel *embedding_levels /* output list of embedding levels */
);
/* End of functions */
#ifdef FRIBIDI_NO_DEPRECATED
#else
# include "fribidi-deprecated.h"
#endif /* !FRIBIDI_NO_DEPRECATED */
/* An string containing the version information of the library. */
FRIBIDI_ENTRY FRIBIDI_EXTERN const char *fribidi_version_info;
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_H */
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libfribidi</string>
<key>CFBundleIdentifier</key>
<string>com.kintan.ksplayer.libfribidi</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libfribidi</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>87.88.520</string>
<key>CFBundleVersion</key>
<string>87.88.520</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,4 @@
framework module libfribidi [system] {
umbrella "."
export *
}