Commit Graph

595 Commits

Author SHA1 Message Date
Jactry Zeng 89926751ff gdi32: Fix a typo in unix_face_create().
This also fixes test failures in test_lang_names() when on Japanese system.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51382
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit aee7d560ae)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
2021-10-30 18:05:13 +02:00
Haoyang Chen 328d834ad9 gdi32: Fix a memory leak.
Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 4b9c4e4201)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
2021-07-26 22:32:41 +02:00
Akihiro Sagawa bc76df8934 gdi32: Move otmEMSquare initialization to freetype_load_font.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 8f6f1c8f7a)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
2021-07-08 00:03:31 +02: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 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
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
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 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 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
Alexandre Julliard a84c60ed2a gdi32: Add a separate backend function to load the font list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 11:26:12 +01:00
Alexandre Julliard fc44dcdd03 gdi32: Move the font list reordering out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 11:25:47 +01:00
Alexandre Julliard de63a647d5 gdi32: Move the default AA flags handling out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 11:25:30 +01:00
Alexandre Julliard 356ad03fcf gdi32: Move the font enumeration out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 16:01:23 +01:00
Alexandre Julliard c9b21a5707 gdi32: Add a helper function to create a font from a face.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 16:01:23 +01:00
Alexandre Julliard ef77b38888 gdi32: Move the dumping of the font list out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 16:01:23 +01:00
Alexandre Julliard 8d4336c5fa gdi32: Move the creation of the child font list out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 16:01:22 +01:00
Alexandre Julliard bc19adf474 gdi32: Move the font link support out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-31 18:33:33 +01:00
Alexandre Julliard 74ea8d8c42 gdi32: Make the family replacement point to the family object.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 14:40:11 +01:00
Alexandre Julliard d27a9d77ee gdi32: Move the loading of font replacements out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 14:40:11 +01:00
Alexandre Julliard 5537f38e97 gdi32: Move the face data structure out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 14:35:47 +01:00
Alexandre Julliard 6a1cdd98fa gdi32: Move the font family list out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 14:22:51 +01:00
Alexandre Julliard 7e51cc8308 gdi32: Move the font substitution list out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 14:15:55 +01:00
Alexandre Julliard 402281b668 gdi32: Add a helper to get the FreeType face and cleanup private data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 20:19:12 +01:00
Alexandre Julliard 044315c0b3 gdi32: Move the glyph index mapping for GetGlyphOutline() out of freetype.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 20:19:12 +01:00
Alexandre Julliard 54bdbd3c03 gdi32: Store child font objects directly on the child font list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 15:39:29 +01:00