Commit Graph

152 Commits

Author SHA1 Message Date
Eugene Sandulenko
537e654138
GRAPHICS: TTF: Support loading fixed size fonts 2021-05-01 01:49:46 +02:00
Cameron Cawley
8dda238e6a GRAPHICS: Avoid modifying the built-in Topaz font data 2021-04-18 15:28:51 +02:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Eugene Sandulenko
55ed48afba
GRAPHICS: Fix 16-bpp rendering for AmigaFont 2021-04-15 21:20:35 +02:00
Eugene Sandulenko
4d75629be1
GRAPHICS: Expose first and last character code for AmigaFont 2021-04-15 17:45:37 +02:00
Eugene Sandulenko
12b3708fa1
GRAPHICS: Make AmigaFont universal 2021-04-15 17:45:37 +02:00
Eugene Sandulenko
925d9d250d
GRAPHICS: Fixes to AmigaFont drawing 2021-04-15 17:45:37 +02:00
Eugene Sandulenko
24596bc806
GRAPHICS: Font class for drawing Amiga Topaz font 2021-04-15 17:45:37 +02:00
Torbjörn Andersson
2fb992ed4e GRAPHICS: Clip Mac font glyphs to the destination surface
This was probably causing instabilities in the MacVenture engine. The
engine is pretty broken at the moment, and the command window is so
small that text doesn't fit in it at all. Hopefully this will make the
remaining errors easier to debug... some day.
2021-04-04 10:23:20 +02:00
Thierry Crozat
a3f3d71c57 GRAPHICS: Expose ascent value in font class 2021-03-23 20:25:23 +00:00
Paul Gilbert
4142f7b7f8 GRAPHICS: Allow TTFFont to handle ManagedSurfaces with transparent pixels 2021-02-26 17:58:19 -08:00
Matthew Jimenez
286cccdafe GRAPHICS: Update TTF render color blending to work with any surface alpha level 2021-02-21 15:30:30 +00:00
Matthew Jimenez
85854120fa GRAPHICS: Improve TTF rendering on transparent surfaces.
Update color blending to match blending found in ManagedSurface. TTF rendering assumed the alpha channel of the surface was completely opaque. ULTIMA8 TTF rendering attempts to use a transparent surface and became near-illegible for text on scrolls. This change will affect TTF rendering on surfaces that are not already painted.
2021-02-21 15:30:30 +00:00
Le Philousophe
b093c9d6b5 GRAPHICS: Fix decoding of TTF font names
This fixes a buffer overflow when decoding font Unicode name as length
provided to decodeUTF16BE is in code units and not in bytes (twice less).
2020-12-01 20:03:07 +01:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
Paweł Kołodziejski
d05d4df9e0 GRAPHICS: Added support for stem darkening in TTF 2020-09-23 23:44:35 +02:00
Eugene Sandulenko
b221999e1e GRAPHICS: Allocate more memory on generating scaled Mac fonts 2020-08-17 00:50:56 +02:00
Eugene Sandulenko
a7f73321d5 GRAPHICS: Fix clash with Amiga #define 2020-04-29 00:01:30 +02:00
Eugene Sandulenko
b83494215d GRAPHICS: Correctly initialize BDF fonts when scaling and reading from cache 2020-04-28 10:52:05 +02:00
Thierry Crozat
c421a25b8e GRAPHICS: Fix mismatching malloc/delete[] 2020-04-27 23:06:15 +01:00
Eugene Sandulenko
3199a5e107 GRAPHICS: Properly initialize struct members 2020-04-27 13:57:35 +02:00
Eugene Sandulenko
b9a6b99575 GRAPHICS: Added more sanity checks to BDF font loading 2020-04-27 13:57:35 +02:00
Eugene Sandulenko
b90cf5db81 GRAPHICS: Added sanity check to BDF font scaler 2020-04-27 13:57:35 +02:00
Eugene Sandulenko
2785bdd8c1 GRAPHICS: Fixed potential memory leak in BDF 2020-04-27 13:57:35 +02:00
Eugene Sandulenko
80f1132e22 GRAPHICS: FONTS: Fix Mac outline font generation 2020-03-22 18:08:30 +01:00
Eugene Sandulenko
930cf4df03 GRAPHICS: Generate Mac outline fonts 2020-03-22 17:41:21 +01:00
Eugene Sandulenko
6774d7aced GRAPHICS: MACGUI: Initial code for generating outlined fonts 2020-03-22 01:39:29 +01:00
Le Philousophe
8e156fe37d GRAPHICS: Fix compilation on old FreeType2 versions
Old FreeType2 had FT_Bitmap_New which got renamed later in FT_Bitmap_Init
2020-03-14 16:56:25 +01:00
Le Philousophe
3f7726ea66 GRAPHICS: Fix compilation for Amiga and PSP
Amiga failed because int isn't the same than int32
PSP failed because of an old FreeType version so try to take this
into account
2020-03-14 14:23:34 +01:00
Le Philousophe
ee1aa81063 GRAPHICS: Mimic CreateFont Windows API
Implement a kind of font mapper which takes a list of font files, font
face name, size, slant and weight and finds the best matching face.
Fakes italic and bold if there it isn't available.
This commit adds support for TTC files which contains multiple faces
(used by CJK Windows fonts).
2020-03-14 12:19:21 +01:00
Cameron Cawley
a692905eb2 COMMON: Add a function to simplify loading Windows executables 2020-01-11 17:34:12 +02:00
Cameron Cawley
e49282577f GRAPHICS: Simplify loading Windows fonts 2020-01-11 17:34:12 +02:00
Cameron Cawley
948c555ea6 ALL: Create all instances of NEResources and PEResources using new instead of on the stack
Also adapted WinCursorGroup and MacMenu to reflect this.
2020-01-11 17:34:12 +02:00
Eugene Sandulenko
da8bfeca5e GRAPHICS: FONTS: Improved visuals for generated bold fonts 2020-01-07 22:46:24 +01:00
Eugene Sandulenko
858f8791ec GRAPHICS: FONTS: Fix memory override 2020-01-07 22:09:59 +01:00
Eugene Sandulenko
a98d3832d9 GRAPHICS: FONTS: Fix warnings 2020-01-07 22:00:23 +01:00
Eugene Sandulenko
fc00b78a48 GRAPHICS: FONTS: Implement generation of bold fonts 2020-01-07 21:57:12 +01:00
Eugene Sandulenko
b5a95d4783 GRAPHICS: FONTS: Made scaling form MacFONT as a step 2020-01-07 21:57:12 +01:00
Eugene Sandulenko
90c305c904 GRAPHICS: FONTS: Use better algorithm for MacFONT scaling added debug output 2020-01-07 21:57:12 +01:00
Eugene Sandulenko
f7970c30a4 GRAPHICS: FONTS: Fix BDF font scaling 2020-01-07 21:57:12 +01:00
Eugene Sandulenko
40cb3b8f92 GRAPHICS: FONT: Really fix mismatched new/delete 2019-12-26 17:31:42 +01:00
Eugene Sandulenko
043acc1ccc GRAPHICS: FONTS: Fix mismatched new/delete. 2019-12-26 17:25:31 +01:00
D G Turner
be56e9afed GRAPHICS: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-17 10:11:25 +00:00
Cameron Cawley
8c2b09d919 COMMON: Replace NEResourceType and PEResourceType with a shared enum 2019-05-01 23:52:56 +03:00
Bastien Bouclet
6a231e4b60 GRAPHICS: Look for fonts.dat in extrapath
When running from the source tree, it is convenient to have extrapath
set to dists/engine-data, where fonts.dat is located.
2019-05-01 05:50:08 +02:00
Thanasis Antoniou
672d216d11 GUI: Fix loading new (not already cached) localized fonts 2019-03-12 00:42:58 +02:00
Cameron Cawley
fa60ae728e GRAPHICS: Add a function to load TrueType fonts from fonts.dat 2018-12-25 12:47:42 +01:00
Cameron Cawley
7a437e909c COMMON: Move new_strdup to common/str.cpp 2018-08-18 16:30:05 +02:00
Colin Snover
f7e05a6ace GRAPHICS: Fix incorrect maximum length passed to strlcpy 2018-08-18 16:30:05 +02:00
Colin Snover
c544d8050c GRAPHICS: Remove use of nonstandard strdup API & fix mismatched malloc/delete 2018-08-18 16:30:05 +02:00