Commit Graph

2520 Commits

Author SHA1 Message Date
Alexandre Julliard b67f39ccc6 gdi32: Merge rectangles horizontally when possible in CreatePolyPolygonRgn.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50539
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:21 +01:00
Byeongsik Jeon f026739564 gdi32: Preserve the GGO_UNHINTED bits until used.
Fix a regression caused by 044315c0b3.

Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Nikolay Sivov 016eeb5109 gdi32/uniscribe: Get rid of shaping group values in Arabic shaping data table.
It's not used right now, Syriac specific groups will be accomodated
as additional joining types.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:11:40 +01:00
Nikolay Sivov f734d98a98 gdi32/uniscribe: Merge Arabic joining types C and D.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:11:15 +01:00
Dmitry Timoshkov f45606c5f8 gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:09:48 +01:00
Zebediah Figura 96fdbabc72 gdi32: Do not compare face file names in insert_face_in_family_list() if either is NULL.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50486
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 10:09:47 +01:00
Alexandre Julliard 5e648e8967 gdi32: Don't fail font creation when we are out of handles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50354
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 21:04:55 +01:00
Dmitry Timoshkov 22d776fc1b gdi32/tests: Add some tests to show that GetGlyphIndices() should avoid best fit chars.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:55:53 +01:00
Zhiyi Zhang aa3e02e193 gdi32/tests: Fix test failures on Win10 1909+.
Memory DC, metafile DC and enhanced metafile DC support gamma ramp on Win10 1909+.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:41:46 +01:00
Zhiyi Zhang d93412ca67 gdi32/tests: Fix possible test failures in test_clip_box().
When there are multiple monitors and their monitor region union can still be represented by a simple
rectangle, the clip box region type for the screen DC is still SIMPLEREGION.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:41:43 +01:00
Michael Stefaniuc f6a0c60618 gdi32/tests: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-18 15:21:37 +01:00
Jacek Caban fcf545f449 winapi: Use __alignof__ on clang.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 15:30:07 +01:00
Alexandre Julliard a0559ad5c3 gdi32: Properly fail mapping glyph for invalid characters in fonts without encoding.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50252
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Alexandre Julliard 057b4b4148 gdi32: Don't create font substitutes for identical names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Rémi Bernon 76c9dbd4fb gdi32: Fix gdi font leak in CreateScalableFontResourceW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50273
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-09 22:09:53 +01:00
Rémi Bernon 06206f1628 gdi32: Don't try to get glyph index when default char is 0.
Fixes a regression from 5bdc6e0fe6, this
is what the code was originally doing.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50175
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Rémi Bernon 6245f07201 gdi32/tests: Test GetGlyphIndices with '\0' default and a glyph.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50175
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Alexandre Julliard 5f70191470 gdi32: Always let the Freetype driver fixup the AA flags.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50127
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Rémi Bernon 8aa404bba0 gdi32: Use FreeType as a fallback when loading font faces.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon 3ea171dee5 gdi32: Try to parse font props without FreeType.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon 93ef83e903 gdi32: Try to parse font names without FreeType.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon e338d04697 gdi32: Introduce new opentype font parsing helpers.
Mostly taken from dwrite source, adapted to make it more flexible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon dece7fa9eb gdi32: Store ft_face font props on unix_face.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon dbe4462057 gdi32: Introduce struct unix_face as a ft_face wrapper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon 63de94839c gdi32: Only use the registry cache for application fonts.
And load system fonts outside of the global font mutex. We now only use
the mutex to protect the registry fonts initialization.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 12:35:55 +01:00
Rémi Bernon cae74aa7d9 gdi32: Only request registry font path when necessary.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 12:35:47 +01:00
Rémi Bernon a0b7a0da40 gdi32: Update the external keys after all fonts are loaded.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 12:35:42 +01:00
Rémi Bernon 7f4a889078 gdi32: Index scalable faces by full name in rbtree.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 12:35:28 +01:00
Rémi Bernon 3c0137f81e gdi32: Load registry fonts after system fonts.
This fixes an issue when, if an external font path was modified in the
Windows key, it was then not considered as external anymore, but still
present in the external key, and then dropped from both on update.

This now forcefully updates the font path in both keys if needed.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 12:35:10 +01:00
Rémi Bernon c06cacff11 gdi32: Compare font face names using RtlDowncaseUnicodeChar.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:24 +01:00
Rémi Bernon c57a53147f gdi32/tests: Add locale-dependent face matching test.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Francois Gouget c4310f6943 gdi32/tests: Fix the spelling of an ok() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 22:51:35 +01:00
Bernhard Übelacker 79d8ed4849 gdi32: Avoid crash by initializing variable font_set.
If the call pFcStrListNext returns NULL the loop is never entered and
the variable font_set never gets written, leading to a crash cleaning
up font_set by pFcFontSetDestroy.

Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 16:59:26 +01:00
Rémi Bernon f7e646ccb7 gdi32: Lazily create and cache fontconfig patterns.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon a51d68e35c gdi32: Load font list directly from fontconfig cache.
Instead of going through the -slow- font matching.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon d05e2bcaf6 gdi32: Move FreeType face creation to AddFaceToList.
So we can use it to add individual fontconfig fonts without iterating
all faces. And rename it to add_unix_face.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon 37c72ce2d6 gdi32: Ignore Type 1 fonts in fontconfig enumeration.
Instead of loading the font with FreeType to discard it right away.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Michael Stefaniuc 236fa496da gdi32/uniscribe: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 11:25:18 +01:00
Rémi Bernon c475e5b40c gdi32: Rewrite find_any_face using the rbtree.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-13 13:13:19 +01:00
Rémi Bernon ec646de3aa gdi32: Rewrite find_face_from_filename using the rbtree.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-13 13:13:16 +01:00
Rémi Bernon 5cdd011f4e gdi32: Index font families by name in an rbtree.
Keeping them sorted with the vertical / default family rules.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-13 13:13:12 +01:00
Sven Baars ca96e04637 gdi32/tests: Fix a compiler warning.
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-12 13:58:53 +01:00
Haoyang Chen abd0cddc5f gdi32: Avoid exceeding the actual bitmap height.
The bottom-up case is handled earlier on.  For the top-down
case, 'lines' is left untouched.

Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-12 13:58:33 +01:00
Francois Gouget dd51cd8d00 gdi32/tests: Avoid a D3DKMTOpenAdapterFromHdc() crash on Windows 10 >= 2004.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Nikolay Sivov b9178da586 gdi32: Merge in Uniscribe functionality.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 20:15:11 +01:00
Rémi Bernon cb1ff768ac gdi32: Implement GdiDllInitialize stub.
This is required by several Call of Duty games that are calling this
directly after loading gdi32.dll from disk.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48171
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-06 18:20:32 +01:00
Akihiro Sagawa 308a0cf72d gdi32: Fix font rendering issue when child font is used.
Otherwise, freetype_get_glyph_outline() fails at FT_Load_Glyph due to
combination of base_font's ft_face and child font's glyph index.

Fixes a regression introduced by 044315c0b3.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-06 17:34:27 +01:00
Alexandre Julliard a56487732e gdi32: Initialize the font gamma ramp with the other font options.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-06 17:34:27 +01:00
Alexandre Julliard b1d920bb9f gdi32: Use wide-character string literals.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-06 17:34:27 +01:00
Alexandre Julliard aa90a5969f gdi32: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:44:16 +01:00