晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /usr/share/doc/fribidi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/fribidi/README
# GNU FriBidi

The Free Implementation of the [Unicode Bidirectional Algorithm].

## Background

One of the missing links stopping the penetration of free software in Middle
East is the lack of support for the Arabic and Hebrew alphabets. In order to
have proper Arabic and Hebrew support, the bidi algorithm needs to be implemented. It is our hope that this library will stimulate more free software in the Middle Eastern countries.

See [`HISTORY`](./HISTORY) on how the project started and evolved.


## Audience

It is our hope that this library will stimulate the implementation of Hebrew and
Arabic support in lots of Free Software. 

GNU FriBidi is already being used in projects like Pango (resulting in [GTK+] and [GNOME] using GNU FriBidi), AbiWord, MLTerm, MPlayer, BiCon, and vlc.

See [`USERS`](./USERS) for a list of projects using GNU FriBidi.


## Dependencies

GNU FriBidi does not depend on any other library. It uses either the GNU Build System or meson for build and installation.


## Downloading

The latest version of GNU FriBidi may be found at:
<https://github.com/fribidi/fribidi>


## Building

Start with running the [`autogen.sh`](./autogen.sh) script and follow the
instructions. Alternatively use `meson`.


## License

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, in a file named COPYING; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

### Commercial licensing

For commercial licensing options, contact <fribidi.license@gmail.com>.

## Implementation

The library implements the algorithm described in the "Unicode Standard Annex
\#9, The Bidirectional Algorithm", available at
<http://www.unicode.org/unicode/reports/tr9/>.

The library uses Unicode (UTF-32) entirely. The character properties are
automatically extracted from the Unicode data files, available from
<http://www.unicode.org/Public/UNIDATA/>. This means that every Unicode
character is treated in strict accordance with the Unicode specification.

There is a limited support for character set conversion from/to the UTF-32
encoding. Data in these character sets must be converted into UTF-32 before the
library may be used. iconv(3) can always do a better job on that, so you may
find that the character sets conversion code is typically turned off on POSIX
machines.


### Conformance Status

GNU FriBidi has been tested exhaustively against the [Unicode Reference Code],
and to the best of our knowledge, it completely conforms to the specification,
always producing the same result as the Reference Code.


### API

The simplest way of accessing the API is through the convenience function `fribibidi_log2vis` which has the following signature:

```c
fribidi_boolean fribidi_log2vis(
    /* input */
    FriBidiChar     *str,
    FriBidiStrIndex len,
    FriBidiCharType *pbase_dir,
    /* output */
    FriBidiChar     *visual_str,
    FriBidiStrIndex *position_L_to_V_list,
    FriBidiStrIndex *position_V_to_L_list,
    FriBidiLevel    *embedding_level_list
)
```

Where...

* `str` is the Unicode input string.
* `len` is the length of the Unicode string (`str`).
* `pbase_dir` is the input and output base direction. If `pbase_dir ==
  FRIBIDI_TYPE_ON` then `fribidi_log2vis()` calculates the base direction on its
  own, according to the bidi algorithm.
* `visual_str` is the reordered output unicode string.
* `position_L_to_V_list` maps the positions in the logical string to positions
  in the visual string.
* `position_V_to_L_list` maps the positions in the visual string to the
  positions in the logical string.
* `embedding_level_list` returns the classification of each character. Here,
  even numerical levels indicate LTR characters, and odd levels indicate RTL
  characters. The main use of this list is in interactive applications where,
  for example, the embedding level determines cursor display.

If any of the output pointers is equal to `NULL`, then that information is not
calculated.

Note that a call to `fribidi_log2vis()` is a convenience function to calling the following three functions in order:

1. `fribidi_get_bidi_types()`
2. `fribidi_get_par_embedding_levels_ex()`
3. `fribidi_reorder_line()`

## How it looks like

Have a look at [`test/`](./test) directory, to see some input and outputs.

The `CapRTL` charset means that CAPITAL letters are right to left, and digits
6, 7, 8, 9 are Arabic digits, try 'fribidi --charsetdesc CapRTL' for the full
description.


## Executable

There is also a command-line utilitity called `fribidi` that loops over the text
of a file and performs the bidi algorithm on each line, also used for testing
the algorithm.

Run `fribidi --help` to learn about usage.

The command-line utility is known to have problems with line-breaking and
logical-to-vertical/vertical-to-logical lists.


## Bug Reports and Feedback

Report bugs and general feedback at: <https://github.com/fribidi/fribidi/issues>

The mailing list is the place for additional technical discussions and user
questions: <https://lists.freedesktop.org/mailman/listinfo/fribidi>


## Maintainers and Contributors

* Dov Grobgeld <dov.grobgeld@gmail.com> - Original author and current maintainer
* Behdad Esfahbod <behdad@gnu.org> - Author of most of the code

See also [`AUTHORS`](./AUTHORS) and [`THANKS`](./THANKS) for the complete list
of contributors.


[Unicode Bidirectional Algorithm]: https://www.unicode.org/reports/tr9/
[Unicode Reference Code]: https://www.unicode.org/reports/tr9/#Reference_Code
[Mirroring]: https://www.unicode.org/reports/tr9/#Mirroring
[GTK+]: https://www.gtk.org/
[GNOME]: https://www.gnome.org/
[GNU Lesser General Public License]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html

haha - 2025