Commit Graph

8 Commits

Author SHA1 Message Date
w1naenator
a6484150bf Add system font path management functions and refactor font directory retrieval 2026-01-16 16:59:39 +02:00
Valdis Bogdāns
d448ddc8ae
Merge branch 'fontfixes' into fontlib 2026-01-16 16:38:06 +02:00
w1naenator
b637cbbd70 Refactor font library functions and improve thread safety
- Updated function signatures in font.h to include the OrbisFontLib parameter for cache clearing and outline buffer management.
- Introduced a mutex in font_internal.cpp to ensure thread safety by protecting access to global font state and library state.
- Added a RemoveState function to safely remove font states.
- Enhanced memory allocation functions in fontft_internal.cpp to use Core::ExecuteGuest for better integration with the guest environment.
- Simplified font loading logic in LibraryOpenFontMemoryStub to improve readability and maintainability.
- Removed redundant code related to file opening and memory allocation, streamlining the font loading process.
This potentially fixes emulator crashes in games that use parallel font initialization, such as Dragon’s Crown.
2026-01-16 13:23:54 +02:00
georgemoralis
11bdfd3a98 using new saving system but i can't understand the fallback mechanism 2026-01-12 19:18:54 +02:00
w1naenator
4ae39ff2df Fix: fypo 2026-01-09 14:39:18 +02:00
w1naenator
78faac52e5 clang 2026-01-09 13:04:48 +02:00
w1naenator
d845b9503d Refactor font rendering and path resolution logic to fix Metaphor: ReFantazio glyphs cropping and anywhereVR "thin" glyphs.
- Updated RenderCodepointToSurface and RenderCodepointToSurfaceWithScale functions to set result->transImage to nullptr instead of result->stage.
- Modified font definitions to use updated font file names for various language sets.
- Introduced ResolveSystemFontPathCandidate function to streamline font path resolution, allowing for better handling of font directories.
- Enhanced LoadFontFile function to check for font files in "font" and "font2" directories based on the parent directory name.
- Improved error logging for font path overrides in ResolveSystemFontPath function.
2026-01-09 13:00:17 +02:00
w1naenator
e9ca20b65d Add internal font handling structures and layout computation functions
This commit introduces a new header file `fontft_internal.h` containing
various structures and functions for managing font handles, layout metrics,
and rendering operations. Key additions include:

- Definitions for `FontHandleOpenInfo`, `FontHandleStyleStateTail`,
  and `FontHandleOpaqueNative` to encapsulate font state and properties.
- Layout-related structures such as `HorizontalLayoutBlocks`,
  `VerticalLayoutBlocks`, and their respective I/O structures for
  managing layout metrics and effects.
- Functions for computing horizontal and vertical layout blocks,
  along with utility functions for handling layout words in byte format.
- Stubs for library functions related to font management and rendering.

These changes aim to enhance the font rendering capabilities of the
shadPS4 Emulator Project, providing a robust foundation for future
font-related features.
2026-01-08 03:08:29 +02:00