Commit Graph
35 Commits
Author SHA1 Message Date
Eugene Sandulenko d0ab65a318 AGS: sprintf -> snprintf 2022-12-16 11:14:41 +01:00
Paweł Kołodziejski b3ee5b54f6 AGS: Fixed compiler warning: "expression result unused" 2022-05-30 07:48:32 +02:00
D G Turner 08759141c1 AGS: Fix Remaining Cast Qualification Warnings in Unicode Font Code
This was due to an issue with C++ which has issues with "const char **"
as a _partially_ constant pointer type and requires this modifying to
"char const* const*" to be fully const which can also be written
as "const char* const*" which fixes the API without requiring excessive
casts and removes the various GCC Compiler Warnings emitted when
-Wcast-qual is passed.
2022-04-04 13:29:30 +01:00
D G Turner 6b2eb7bd42 AGS: Reduce Cast Away Qualifier GCC Compiler Warnings 2022-03-30 12:21:09 +01:00
Paul Gilbert 3989d2652b AGS: Compilation fix 2022-03-28 22:45:52 -07:00
Paul Gilbert accd508b9c GRAPHICS: Create set of wrapper functions for accessing FreeType directly 2022-03-28 20:29:36 -07:00
D G Turner 96fe37a92b AGS: Fix Set But Unused Variable GCC Compiler Warnings 2022-03-28 14:34:25 +01:00
Le Philousophe 28e1ed453d AGS: Add missing shim when FreeType isn't available 2022-03-28 12:51:27 +02:00
Torbjörn Andersson 4322770650 AGS: Hopefully fix build
We have to include scummsys.h before checking if USE_FREETYPE2 is
defined, and we need wchar.h for the wcslen() function. But I don't know
for certain if everything - or even anything - works correctly now.
2022-03-28 11:48:53 +02:00
Paul Gilbert a8fc0f8ec9 AGS: Fixed a use of !(ALFONT_FLG_SELECT_NOMINAL_SZ)
From upstream a0d6a8f6dc7145ad4343110b8e0aefc3fabafbe2
2022-03-27 19:14:53 -07:00
Paul Gilbert 0acbe50dd3 AGS: Added a flag for AGS mode that selects a font by a nominal size
From upstream 48644d35bd912bcb06aebbae2e2a1c9dc24e48d0
2022-03-27 19:14:53 -07:00
Paul Gilbert f4935dbf39 AGS: Force readjust TTF fonts if the OPT_ANTIALIASFONTS changes
From upstream 115119eeb009fc7f2c5820b47bb866acad6498ec
2022-03-27 13:37:13 -07:00
Paul Gilbert f34cf7ce67 AGS: Apply TTF ascender hack only by the engine's request
From upstream 14679a430bf29acb6e511bb3799a5f99d9929463
2022-03-27 13:37:13 -07:00
Paul Gilbert 8e1a3d08db AGS: Add USE_FREETYPE2 guard to alfont 2022-03-27 13:37:13 -07:00
Paul Gilbert 7132742e04 AGS: Reintroduce upstream's full alfont implementation 2022-03-27 13:37:12 -07:00
Paul Gilbert 15704239b8 AGS: Properly implement alfont_get_name 2022-03-14 22:12:40 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Thierry Crozat 07ce31ecae AGS: Try to load font with WinFont as a fallback when TTFFont fails
This fixes bug #12948 AGS: Segfault when picking up at police report.
For that bug the font is properly loaded by FreeType, but it is a
non-scalable Windows font whose size does not match the requested
size. The original AGS handles TTF font sizes differently to how we
do it in TTFFont (and also has some hacks on top of that), and it
was easier here to use WinFont that try to tweak TTFont to work
with this case.
2021-09-24 23:43:33 +01:00
Paul Gilbert 8058862f7d AGS: Precalculate and save font's height on load
From upstream 47001a398a1bc4ad022645ad21e1c891a3757167

Note: Since we don't implement alfont in full, the
referenced methods are stubbed in our alfont.cpp
2021-09-20 17:20:58 -07:00
Paul Gilbert 122acc39b5 AGS: Fix font outlines not drawing correctly 2021-08-25 21:31:40 -07:00
Paul Gilbert 71de3facb2 AGS: Better fix for Gemini Rue German accents 2021-08-07 16:49:37 -07:00
Paul Gilbert 2232f3f3ff AGS: Fix rendering accented characters in Gemini Rue German 2021-08-07 16:21:25 -07:00
Paul Gilbert 0672ca0f2b AGS: Fix rendering purple text that matches the transparent color 2021-07-03 11:49:23 -07:00
Thierry Crozat d8b46ff8c3 AGS: Remove incorrect TODO
The ShouldAntiAliasText check is now done in ALFONT_FONT::getFont()
so we do not need a separate alfont_textout_aa function.
2021-06-14 20:21:10 +01:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00
Thierry Crozat 53432f1153 AGS: Cleanup TTF font rendering a bit
There is no need to test if antialiasing should be used
in two different places.
2021-04-08 22:15:37 +01:00
Thierry Crozat fece6ea40f AGS: Add option to force using antialiasing for text rendering 2021-04-08 00:45:46 +01:00
Thierry Crozat 57710b9648 AGS: Respect the game ANTIALIASFONTS options for TTS rendering 2021-04-08 00:45:46 +01:00
Thierry Crozat 12829b25af AGS: Fix alfont_text_height to match the original
This fixes the line spacing being different in ScummVM
compared to the ags interpreter when displaying
multi-line text with a TTF font. This was for example
easily visible in the letter at the start of Blackwell
Deception.
2021-03-23 20:39:45 +00:00
Thierry Crozat 2201a2d6cf AGS: Fix positioning of text drawn with a TTF font
Allegro does a correction on the text position based
on the font height and character bitmap top. We now
do the same in ScummVM, except we use the font ascent
instead of the character bitmap top as the ScummVM
TTFFont has a correction internally for the difference
between the ascent and character bitmap top.

This change fixes cut text in some games such as in
Order of the Thorne.
2021-03-23 20:34:32 +00:00
Ori Avtalion 39cd0f8522 AGS: Remove pointless Common::String conversion 2021-02-12 21:31:47 +02:00
Ori Avtalion 89d2edf6bd AGS: Fix incorrect string encoding for non-English games
8-bit character encoding is used (ISO 8859 family).
2021-02-12 21:19:41 +02:00
Paul Gilbert 990797000a AGS: Wrap loadTTFFont call in ifdef USE_FREETYPE2 2021-02-07 08:08:34 -08:00
Paul Gilbert c0913b7ed7 AGS: Properly load fonts via asset manager 2021-02-06 16:37:31 -08:00
Paul Gilbert 12dc2c220f AGS: Added shared/font/ folder 2021-02-06 16:37:31 -08:00