mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
add julia's utf8proc wcwidth implementation
This commit is contained in:
parent
0d8632943d
commit
b95ce3e812
@ -326,6 +326,11 @@ PKG_CHECK_MODULES([OPENSSL], [openssl], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl **
|
||||||
|
dnl ** utf8proc
|
||||||
|
dnl **
|
||||||
|
AC_CHECK_LIB([utf8proc], [utf8proc_version])
|
||||||
|
|
||||||
dnl **
|
dnl **
|
||||||
dnl ** curses checks
|
dnl ** curses checks
|
||||||
dnl **
|
dnl **
|
||||||
@ -815,7 +820,7 @@ echo "Building with 64bit DCC support .. : $offt_64bit"
|
|||||||
echo "Building with true color support.. : $want_truecolor"
|
echo "Building with true color support.. : $want_truecolor"
|
||||||
echo "Building with GRegex ............. : $want_gregex"
|
echo "Building with GRegex ............. : $want_gregex"
|
||||||
echo "Building with Capsicum ........... : $want_capsicum"
|
echo "Building with Capsicum ........... : $want_capsicum"
|
||||||
|
echo "Building with utf8proc ........... : $ac_cv_lib_utf8proc_utf8proc_version"
|
||||||
if test "x$want_otr" = "xstatic"; then
|
if test "x$want_otr" = "xstatic"; then
|
||||||
echo "Building with OTR support ........ : static (in irssi binary)"
|
echo "Building with OTR support ........ : static (in irssi binary)"
|
||||||
elif test "x$want_otr" = "xmodule"; then
|
elif test "x$want_otr" = "xmodule"; then
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
|
#include <utf8proc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* wcwidth=2 since unicode 5.2.0 */
|
/* wcwidth=2 since unicode 5.2.0 */
|
||||||
#define UNICODE_SQUARE_HIRAGANA_HOKA 0x1F200
|
#define UNICODE_SQUARE_HIRAGANA_HOKA 0x1F200
|
||||||
|
|
||||||
@ -35,7 +39,10 @@
|
|||||||
enum {
|
enum {
|
||||||
WCWIDTH_IMPL_AUTO = 0,
|
WCWIDTH_IMPL_AUTO = 0,
|
||||||
WCWIDTH_IMPL_OLD,
|
WCWIDTH_IMPL_OLD,
|
||||||
WCWIDTH_IMPL_SYSTEM,
|
WCWIDTH_IMPL_SYSTEM
|
||||||
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
|
,WCWIDTH_IMPL_JULIA
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
WCWIDTH_FUNC wcwidth_impl_func = mk_wcwidth;
|
WCWIDTH_FUNC wcwidth_impl_func = mk_wcwidth;
|
||||||
@ -99,13 +106,23 @@ static void read_settings(void)
|
|||||||
case WCWIDTH_IMPL_SYSTEM:
|
case WCWIDTH_IMPL_SYSTEM:
|
||||||
wcwidth_impl_func = &system_wcwidth;
|
wcwidth_impl_func = &system_wcwidth;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
|
case WCWIDTH_IMPL_JULIA:
|
||||||
|
wcwidth_impl_func = (WCWIDTH_FUNC) &utf8proc_charwidth;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wcwidth_wrapper_init(void)
|
void wcwidth_wrapper_init(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
|
settings_add_choice("misc", "wcwidth_implementation", WCWIDTH_IMPL_AUTO, "auto;old;system;julia");
|
||||||
|
#else
|
||||||
settings_add_choice("misc", "wcwidth_implementation", WCWIDTH_IMPL_AUTO, "auto;old;system");
|
settings_add_choice("misc", "wcwidth_implementation", WCWIDTH_IMPL_AUTO, "auto;old;system");
|
||||||
|
#endif
|
||||||
|
|
||||||
read_settings();
|
read_settings();
|
||||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user