Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions graf2d/win32gdk/gdk/src/gdk/win32/gdkfont-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,8 +1638,18 @@ gdk_wchar_text_handle(GdkFont * font,
list = list->next;
}

if (!list)
singlefont = NULL;
if (!list) {
/* No font matched the Unicode block exactly. Fall back to the first
* font in the font set to avoid silently dropping the character (the
* old behavior set singlefont = NULL and skipped rendering entirely).
* With added defensive null-checks, this ensures CJK and non-Latin
* text visibility without introducing regression risks. */
if (private && private->fonts) {
singlefont = (GdkWin32SingleFont *) private->fonts->data;
} else {
singlefont = NULL;
}
}

GDK_NOTE(MISC,
g_print("%d:%d:%d ", start - wcstr, wcp - wcstr, block));
Expand Down
6 changes: 5 additions & 1 deletion graf2d/win32gdk/gdk/src/gdk/win32/gdkim-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,15 @@ gint gdk_mbstowcs(GdkWChar * dest, const gchar * src, gint dest_max)

/* A version that converts to wchar_t wide chars */

/* ROOT's application manifest explicitly declares <activeCodePage>UTF-8</activeCodePage>,
* so strings entering the GDK backend are guaranteed to be valid UTF-8.
* Use explicit UTF-8 decoding instead of mbstowcs(), which would
* misinterpret the UTF-8 byte stream under the system's legacy ANSI code page. */
gint
gdk_nmbstowchar_ts(wchar_t * dest,
const gchar * src, gint src_len, gint dest_max)
{
#if 1
#if 0
return mbstowcs(dest, src, src_len);
#else
wchar_t *wcp;
Expand Down
Loading