-
Notifications
You must be signed in to change notification settings - Fork 39
Home
Libunibreak is an implementation of Unicode line and word breaking algorithms. It is the successor of liblinebreak. Yongwei Wu wrote the original liblinebreak code according to Unicode Standard Annex 14, and Tom Hacohen and Andreas Röver added the implementation of the word breaking and grapheme breaking algorithms according to Unicode Standard Annex 29. It is designed to be used in a generic text renderer. FBReader is one real-world example, and the Enlightenment Foundation Libraries are another. You may also check out our test code and breaktext for some sample code.
The latest version (4.1) of libunibreak can be download here, and you may want to check What’s New if you are an existing user.
Obviously, you can grab the files from here.
This library is released under an open-source licence, the zlib/libpng licence. Please check the file LICENCE for details.
Apart from using the algorithm, part of the code is derived from the Unicode Online Data, and the Unicode Terms of Use may apply.
There are three ways to build the library:
-
On *NIX systems supported by the autoconfiscation tools, do the normal
./configure make sudo make install
to build and install both the dynamic and static libraries. In addition, one may
- type
make doc
to generate the doxygen documentation; or - type
make linebreakdata
to regenerate linebreakdata.c from LineBreak.txt. - type
make wordbreakdata
to regenerate wordbreakdata.c from WordBreakProperty.txt.
- type
-
On systems where GCC and Binutils are supported, one can type
cd src cp -p Makefile.gcc Makefile make
to build the static library. In addition, one may
- type
make debug
ormake release
to explicitly generate the debug or release build; - type
make doc
to generate the doxygen documentation; or - type
make linebreakdata
to regenerate linebreakdata.c from LineBreak.txt. - type
make wordbreakdata
to regenerate wordbreakdata.c from WordBreakProperty.txt.
- type
-
On Windows, apart from using method 1 (Cygwin/MSYS) and method 2 (MinGW), MSVC can also be used. Type
cd src nmake -f Makefile.msvc
to build the static library. By default the debug release is built. To build the release version
nmake -f Makefile.msvc CFG="libunibreak - Win32 Release"
Check the generated document doc/html/linebreak_8h.html, doc/html/wordbreak_8h.html, and doc/html/graphemebreak_8h.html in the downloaded file for the public interfaces exposed to applications.