# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/bicon/01-patch-option-reshape.patch # Copyright (C) 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- diff --git a/bicon/bicon.c b/bicon/bicon.c index 80e57e1..d1a4586 100644 --- a/bicon/bicon.c +++ b/bicon/bicon.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "pty_spawn.h" #include "bicon_read.h" @@ -22,9 +23,16 @@ main ( } else { - for (i = 1; i < argc; i++) - args[i - 1] = argv[i]; - args[argc - 1] = NULL; + int args_start; + if (strcmp(argv[1], "--reshape-only") == 0) { + bicon_options = B_LOGICAL_OUTPUT_LOG2CUNI | B_NO_LA_LIGATURE; + args_start = 2; + } else { + args_start = 1; + } + for (i = args_start; i < argc; i++) + args[i - args_start] = argv[i]; + args[argc - args_start] = NULL; } if (!bicon_read_init ()) { diff --git a/bicon/bicon_read.h b/bicon/bicon_read.h index c828a3f..1956364 100644 --- a/bicon/bicon_read.h +++ b/bicon/bicon_read.h @@ -1,6 +1,8 @@ #ifndef __BICON_READ_H #define __BICON_READ_H +int bicon_options; + ssize_t bicon_read ( int fd, void *buf, diff --git a/bjoining/bjoining.h b/bjoining/bjoining.h index 78b0774..be30676 100644 --- a/bjoining/bjoining.h +++ b/bjoining/bjoining.h @@ -16,6 +16,7 @@ typedef FriBidiChar unichar; /* Options that bjoining functions handle. */ #define B_KEEP_BIDI_MARKS 0x00000001 /* Do not remove bidi marks (LRM, RLM, ...). */ #define B_LOGICAL_OUTPUT 0x00000002 /* Do not perform bidi, just joining stuff. */ +#define B_LOGICAL_OUTPUT_LOG2CUNI 0x00000004 /* Do not perform bidi, just joining stuff. In log2cuni */ #define B_KEEP_JOINING_MARKS 0x00000010 /* Do not remove joining marks (ZWJ, ZWNJ). */ #define B_NO_LA_LIGATURE 0x00000020 /* Do not make LAM-ALEF ligature. */ #define B_NO_ZWJZWNJZWJ 0x00000040 /* Do not interpret ZWJ+ZWNJ+ZWJ sequences. */ diff --git a/bjoining/bjoining_log2cuni.c b/bjoining/bjoining_log2cuni.c index 61148fb..7c2f54c 100644 --- a/bjoining/bjoining_log2cuni.c +++ b/bjoining/bjoining_log2cuni.c @@ -18,7 +18,7 @@ bjoining_log2cuni ( unichar *vis = malloc ((len + 1) * sizeof (unichar)); f = f && bjoining_compose (str, &len); - if (0 == (options & B_LOGICAL_OUTPUT)) + if (0 == (options & (B_LOGICAL_OUTPUT | B_LOGICAL_OUTPUT_LOG2CUNI))) { f = f && fribidi_log2vis ((FriBidiChar *) str, len, &ptype,