Libunibreak is an implementation of the line breaking and word breaking algorithms as described in Unicode Standard Annex 14 and 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 some simple sample code, like showbreak and breaktext.
The latest version (3.0) of libunibreak can be download here.
Git access is provided on GitHub. The main repository was moved there after libunibreak 1.0 was released.
CVS access is provided temporarily (before moving to a more modern code repositorty; code paths are difficult to fix in CVS). Please check the information here. The module path is ‘common/tools/linebreak’.
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:
./configure make sudo make installto build and install both the dynamic and static libraries. In addition, one may
make doc
’ to generate the doxygen
documentation; ormake linebreakdata
’ to regenerate
linebreakdata.c from LineBreak.txt.make wordbreakdata
’ to regenerate
wordbreakdata.c from WordBreakProperty.txt.cp -p Makefile.gcc Makefile maketo build the static library. In addition, one may
make debug
’ or ‘make
release
’ to explicitly generate the debug or release
build;make doc
’ to generate the doxygen
documentation; ormake linebreakdata
’ to regenerate
linebreakdata.c from LineBreak.txt.make wordbreakdata
’ to regenerate
wordbreakdata.c from WordBreakProperty.txt.nmake -f Makefile.msvcto 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 and doc/html/wordbreak_8h.html in the downloaded file for the public interfaces exposed to applications.