On bug#27641: an editor should use the indic font when indic typing is being done
Hi, I can still reproduce this issue on the latest master at the time of writing this. For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead. Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all. My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry. How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach? -- समीरसिंह
Hi, I think the correct solution very much depends on what API is being used to draw the text. Also, the fallbacks are defined in this table, iirc. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/gdi32/uniscribe/usp10... -- Bernhard Am So., 5. Apr. 2026 um 13:05 Uhr schrieb समीर सिंह Sameer Singh via Wine-Devel <wine-devel@list.winehq.org>:
Hi, I can still reproduce this issue on the latest master at the time of writing this.
For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead.
Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all.
My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry.
How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach?
-- समीरसिंह
Uniscribe functionality, especially on supporting devanagari, would require Harfbuzz, besides and beyond fontconfig and freetype. Is Harfbuzz an (optional?) dependency of wine these days? On Sunday, 5 April 2026 at 19:23:54 BST, Bernhard Kölbl via Wine-Devel <wine-devel@list.winehq.org> wrote: Hi, I think the correct solution very much depends on what API is being used to draw the text. Also, the fallbacks are defined in this table, iirc. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/gdi32/uniscribe/usp10... -- Bernhard Am So., 5. Apr. 2026 um 13:05 Uhr schrieb समीर सिंह Sameer Singh via Wine-Devel <wine-devel@list.winehq.org>:
Hi, I can still reproduce this issue on the latest master at the time of writing this.
For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead.
Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all.
My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry.
How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach?
-- समीरसिंह
Hin-Tak Leung <htl10@users.sourceforge.net> writes:
Uniscribe functionality, especially on supporting devanagari, would require Harfbuzz, besides and beyond fontconfig and freetype. Is Harfbuzz an (optional?) dependency of wine these days?
After grepping the wine codebase, I could not see that it uses harfbuzz as a dependancy. Wine uses its own in-house shaping code, see: dlls/gdi32/uniscribe/shape.c and dlls/dwrite/shape.c as an example. Also uniscribe has support for devanagari AFAICS, the shaping it does produces correct output. The only problem is that while typing in devanagari the system does not correctly switch to a correct font. Once I manually set the text to an appropriate font, I can see the correct shaping.
On Sunday, 5 April 2026 at 19:23:54 BST, Bernhard Kölbl via Wine-Devel <wine-devel@list.winehq.org> wrote:
Hi,
I think the correct solution very much depends on what API is being used to draw the text.
Also, the fallbacks are defined in this table, iirc. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/gdi32/uniscribe/usp10...
-- Bernhard
Am So., 5. Apr. 2026 um 13:05 Uhr schrieb समीर सिंह Sameer Singh via Wine-Devel <wine-devel@list.winehq.org>:
Hi, I can still reproduce this issue on the latest master at the time of writing this.
For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead.
Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all.
My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry.
How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach?
-- समीरसिंह
-- समीरसिंह
Bernhard Kölbl <besentv@gmail.com> writes:
Hi,
I think the correct solution very much depends on what API is being used to draw the text.
I am only focusing on uniscribe for the time being. I did not get much chance to look into what, for example, dwrite does for fallback.
Also, the fallbacks are defined in this table, iirc. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/gdi32/uniscribe/usp10...
This table has hard-coded font names that are not installed on a Linux system by default. Does this mean that for font fallbacks to work, these fonts have to be installed beforehand? If yes, then would the better solution not be to use whichever fonts the user already has on their machine?
-- Bernhard
Am So., 5. Apr. 2026 um 13:05 Uhr schrieb समीर सिंह Sameer Singh via Wine-Devel <wine-devel@list.winehq.org>:
Hi, I can still reproduce this issue on the latest master at the time of writing this.
For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead.
Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all.
My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry.
How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach?
-- समीरसिंह
-- समीरसिंह
Bernhard Kölbl <besentv@gmail.com> writes:
Hi,
I think the correct solution very much depends on what API is being used to draw the text.
Also, the fallbacks are defined in this table, iirc. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/gdi32/uniscribe/usp10...
I see that in dwrite, the Noto family of fonts are defined as fallbacks: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/dwrite/analyzer.c?ref... Using the same fonts for the uniscribe fallback in the table you linked above would solve the problem, without needing to mess around with registry editing stuff. _But_ is there a reason that these specific microsoft fonts were used here? Or no one just got around to update the table?
-- Bernhard
Am So., 5. Apr. 2026 um 13:05 Uhr schrieb समीर सिंह Sameer Singh via Wine-Devel <wine-devel@list.winehq.org>:
Hi, I can still reproduce this issue on the latest master at the time of writing this.
For example open: wine notepad and type something like: देवनागरी Instead of the program falling back to an appropriate font, "tofu" blocks are shown instead.
Now, in ./dlls/gdi32/uniscribe/usp10.c I can see a function named: "find_fallback_font" which looks for a fallback font under Software\Wine\Uniscribe\Fallback in HKEY_CURRENT_USER. But I did not find this entry populated at all.
My solution is: Define a table which has a representative char for each script, now when a new wine environment is being created, query the system using FontConfig to find fonts which contains the representative chars and then populate the registry entry.
How does this sound? I have a rough working version right now, should I send a patch or is something missing in my current approach?
-- समीरसिंह
-- समीरसिंह
participants (3)
-
Bernhard Kölbl -
Hin-Tak Leung -
समीर सिंह Sameer Singh