Manipulating the font size results in the script_cache going stale. From MSDN[1]
`The application should never pass the same handle for different fonts or different sizes.`
This is however exactly what happens when the font size changes as a result of zooming(both in and out). ScriptShape and relative functions will only inspect the hardware device context only if the required data is not cached[2] and hence the data from a previous call to these functions is retrieved even though the font size has changed hence the bug where text both doesn't wrap and doesn't paint as it should.
In patch one, I have tried to keep track of the script_cache objects alongside the relevant font.
Patch two fixes an issue where the cursor doesn't scale after zooming until after one interacts with the editor.
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com>
1. https://docs.microsoft.com/en-us/windows/win32/intl/caching
2. https://docs.microsoft.com/en-us/windows/win32/intl/script-cache
--
v3: riched20: update caret on zooming
riched20: Cache script_cache alongside font cache
https://gitlab.winehq.org/wine/wine/-/merge_requests/626
On Windows, \Device\NamedPipe\ is the root directory of the named pipe
file system (NPFS), and can be used as RootDirectory to skip its path
when accessing the NPFS namespace.
This introduces a regression that makes it possible to use
\Device\NamedPipe (note the lack of trailing backslash) as RootDirectory
as well, since Wine does not distinguish between \Device\NamedPipe (the
device itself) and \Device\NamedPipe\ (the root directory of the
filesystem).
(Previous iteration of this patch did distinguish between the two, but the method in which it was implemented was deemed hacky.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/498