Commit Graph

2502 Commits

Author SHA1 Message Date
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
Alexandre Julliard 60ef5b0182 gdi32: Move OSMesa support to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:41:12 +01:00
Alexandre Julliard 3cfafab38b gdi32: Move FreeType support to a new Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:32:04 +01:00
Alexandre Julliard 54a01ea1ec gdi32: Use ntdll functions for heap allocations.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:31:02 +01:00
Alexandre Julliard 013f1033c0 gdi32: Use ntdll functions for locale support.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:30:56 +01:00
Alexandre Julliard acc1f6545f gdi32: Use ntdll functions for DOS<->Unix path conversions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:30:50 +01:00
Alexandre Julliard 8db165000d gdi32: Use ntdll functions for codepage conversions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:06:26 +01:00
Alexandre Julliard fd9e1612d9 gdi32: Use FT_MulDiv() instead of the kernel32 function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 10:01:32 +01:00
Alexandre Julliard 8768f60527 gdi32: Store scale as an integer.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 09:59:32 +01:00
Alexandre Julliard fe6bb5f723 gdi32: Don't abort enumeration if a font fails to load.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-05 09:59:22 +01:00
Alexandre Julliard e1b193d8ba gdi32: Make a few definitions private to font.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard 53acdd5a8a gdi32: Move the SelectFont() implementation out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard 3b87839ec9 gdi32: Move the rest of the font matching code out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard 4cddf0d47d gdi32: Move the handling of font family fallbacks out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard caf0b9c082 gdi32: Add some helper functions for font matching.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard 6c5dc58a82 gdi32: Move the remove_font() function out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-04 21:11:44 +01:00
Alexandre Julliard 000e32f183 gdi32: Update the Windows font registry keys only when they have changed.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 14:53:34 +01:00
Alexandre Julliard a6f0349e84 gdi32: Add a helper function to create a face.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 14:53:34 +01:00
Alexandre Julliard 19d13d0004 gdi32: Move the font cache out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 11:26:39 +01:00