|
From: Harald O. <har...@el...> - 2026-03-11 07:17:09
|
Dear Kevin, I can only encourage you in this action. Unfortunately, we have no MS-Windows Tk Wizard in the community. Ashok does not cover the GUI part. So, little support out there. But I will do what I can to support you. Thanks for all, Harald Am 10.03.2026 um 20:22 schrieb Kevin Walzer: > > It appears I can get a LOT of improvement from the following libraries > for text shaping and bidi: > > Windows: > > open-graph-image.png > Uniscribe - Win32 apps <https://learn.microsoft.com/en-us/windows/win32/ > intl/uniscribe> > learn.microsoft.com <https://learn.microsoft.com/en-us/windows/win32/ > intl/uniscribe> > > <https://learn.microsoft.com/en-us/windows/win32/intl/uniscribe> > > X11: > > kb.png > JimmyLefevre/kb: kb single-header C/C++ libraries <https://github.com/ > JimmyLefevre/kb> > github.com <https://github.com/JimmyLefevre/kb> > > <https://github.com/JimmyLefevre/kb> > > SheenBidi.png > Tehreer/SheenBidi: A sophisticated implementation of Unicode > Bidirectional Algorithm <https://github.com/Tehreer/SheenBidi> > github.com <https://github.com/Tehreer/SheenBidi> > > <https://github.com/Tehreer/SheenBidi> > > Uniscribe is Microsoft’s older API for complex text shaping and bidi. > kb_text_shape.h is a much lighter single header library for text shaping > than harfbuzz, and SheenBidi can handle the bidi part; both are small > enough to bundle with Tk and have permissive licenses. > > Because I want the Wayland port to have modern text display, I think it > makes sense to update Windows and, especially, X11 (since these two > libraries will also help power Wayland’s text display). I’m not even > anticipating any API changes here so I may just base this work on a bug > report and not ask for a TIP. > > Thoughts? > > — > Kevin Walzer kw...@co... > >> On Mar 10, 2026, at 9:35 AM, Harald Oehlmann >> <har...@el...> wrote: >> >> Hi Kevin, >> >> thanks for the great initiative. >> >> This ticket has some information of rendering issues on Windows: >> >> https://core.tcl-lang.org/tk/info/5d0bc3cfec7c1adb >> >> - no color glyphs >> - no unification of composed flag unicode points. >> >> pack [text .t -blockcursor 1] >> .t insert end "\U1F1E9\U1F1EA" >> >> Firefox does it right. I don't know how they do it. >> >> As a side note, this ticket needs a Tk wizard as sponsor. It is >> probably worthwile to be committed. Francois liked it... >> >> Thanks for all, >> Harald >> >> Am 10.03.2026 um 13:51 schrieb Kevin Walzer: >>> >>> Comparing Arabic displayed on Tk's text widget and Notepad on Windows >>> 11 - Tk produces the glyphs and preserves the RTL direction >>> correctly, as far as I can tell. But it looks like a sequence of >>> characters, not words - I think that is the difference that text >>> shaping has. Whatever Tk's text engine uses on Windows, it is not >>> very robust. >>> macOS's Core Text API, whch Tk uses, has full support for RTL >>> languages and text shaping, and the differences in how Arabic is >>> rendered in Tk's text widget and Apple's TextEdit app are far less >>> pronounced - Tk does a good job here. >>> On 3/10/26 7:49 AM, Kevin Walzer wrote: >>>> It might make sense to it be an external dependency on Linux, of >>>> course. And perhaps the native rendering on Windows is good enough? >>>> Im not an expert there. >>>> — >>>> Kevin Wal...@co... >>>> >>>>> On Mar 10, 2026, at 7:33 AM, Kevin Walzer<kw...@co...> wrote: >>>>> >>>>> The other thing about Harfbuzz is that it’s cross-platform, MIT- >>>>> licensed, and possibly small enough to ship directly wirh Tk as a >>>>> support library. So we could incorporate it not just on Linux >>>>> (Wayland/X11) but Windows, where it could help modernize Tk’s >>>>> display of non-Western languages without requiring a full rewrite >>>>> of the GDI-based text API |