Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b24848ca5c | ||
|
|
25aa00a192 | ||
|
|
d45b73c8c1 | ||
|
|
a29d97846d |
@@ -74,7 +74,7 @@ regression oracle for every layout or style change.
|
||||
`core/text/text.c` and drawn from the custom command it swaps in for
|
||||
Nuklear's text command, so a change to how Nuklear or the renderer places
|
||||
glyphs does not reach it. Its bidi levels are matched to mojibake's by order:
|
||||
mojibake 0.4.1 records `byte_offset` at a character's last byte.
|
||||
mojibake 0.5.0 records `byte_offset` at a character's last byte.
|
||||
- **Only Nuklear's active window gets input.** Every other window carries a
|
||||
sticky `NK_WINDOW_ROM` until a click or hover activates it inside
|
||||
`nk_begin`. A layer that must not take input is begun
|
||||
|
||||
+11
-19
@@ -271,14 +271,15 @@ static void
|
||||
levels(const char *s, int len, int n)
|
||||
{
|
||||
mjb_bidi_paragraph p;
|
||||
mjb_text text = mjb_text_utf8(s, (size_t)len);
|
||||
int i, k = 0;
|
||||
|
||||
for (i = 0; i < n && g_ch[i].cp < 0x0590; i++) {}
|
||||
if (i == n ||
|
||||
mjb_bidi_resolve(s, (size_t)len, MJB_ENC_UTF_8, MJB_DIRECTION_AUTO, &p)
|
||||
mjb_bidi_resolve(&text, MJB_DIRECTION_AUTO, &p)
|
||||
!= MJB_STATUS_OK)
|
||||
return;
|
||||
/* mojibake 0.4.1 puts byte_offset at a character's last byte. */
|
||||
/* mojibake 0.5.0 puts byte_offset at a character's last byte. */
|
||||
for (i = 0; i < n; i++) {
|
||||
if (k < (int)p.count && (int)p.chars[k].codepoint == g_ch[i].cp)
|
||||
g_ch[i].level = p.chars[k++].level;
|
||||
@@ -878,25 +879,16 @@ reaktor_text_prepare(struct nk_context *ctx, struct SDL_Renderer *renderer)
|
||||
int
|
||||
reaktor_text_break(const char *s, int len, int limit)
|
||||
{
|
||||
mjb_next_line_state st;
|
||||
mjb_break_type t;
|
||||
int best = 0;
|
||||
mjb_text text = mjb_text_utf8(s, (size_t)len);
|
||||
mjb_line_break_state st;
|
||||
mjb_break_type t;
|
||||
int best = 0;
|
||||
|
||||
if (len <= 0 || limit <= 0) return 0;
|
||||
st.index = 0;
|
||||
while ((t = mjb_next_line_break(s, (size_t)len, MJB_ENC_UTF_8, &st))
|
||||
!= MJB_BT_NOT_SET) {
|
||||
/* The boundary is before the character ending at st.index. */
|
||||
int at = (int)st.index;
|
||||
|
||||
if (at > len) {
|
||||
at = len;
|
||||
} else {
|
||||
at--;
|
||||
while (at > 0 && ((unsigned char)s[at] & 0xC0) == 0x80) at--;
|
||||
}
|
||||
if (at > limit) break;
|
||||
if (t == MJB_BT_ALLOWED || t == MJB_BT_MANDATORY) best = at;
|
||||
SDL_zero(st);
|
||||
while ((t = mjb_line_break_next(&text, &st)) != MJB_BT_NOT_SET) {
|
||||
if ((int)st.position > limit) break;
|
||||
if (t == MJB_BT_ALLOWED || t == MJB_BT_MANDATORY) best = (int)st.position;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
@@ -1427,7 +1427,7 @@ so Nuklear measures as it will draw. Before the frame becomes vertices,
|
||||
custom command in the same place, whose callback adds the glyph quads.
|
||||
Shaping is cached by string and font, glyphs by font, glyph and size; each
|
||||
cache starts over when full. Its bidi levels match mojibake's by order, since
|
||||
mojibake 0.4.1 records `byte_offset` at a character's last byte.
|
||||
mojibake 0.5.0 records `byte_offset` at a character's last byte.
|
||||
|
||||
**Fonts are the application's.** The showcase ships M PLUS 1p for Japanese, as
|
||||
a `.font_fallbacks` entry; Arabic, Hebrew or an Indic script needs a font that
|
||||
|
||||
Vendored
+1
-1
Submodule external/kb updated: cc63806775...7d811ad802
Vendored
+1
-1
Submodule external/mojibake updated: aa3cc68b9b...ad2831dedd
Vendored
+1
-1
Submodule external/onlay updated: 0c75a1f91b...877047c09d
Reference in New Issue
Block a user