Commit Graph
195 Commits
Author SHA1 Message Date
Cameron Cawley 28d7b361ea COMMON: Move more file format code into common/formats 2022-12-11 22:33:23 +01:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
sluicebox 74d94f14f1 GRAPHICS: Fix WinFontDirEntry parsing regression
Fixes HUGO1 crash on startup

Incorrect offset introduced in 8cb2e1bb07

https://learn.microsoft.com/en-us/windows/win32/menurc/fontdirentry
2022-11-22 00:30:36 -08:00
sluicebox b578f5be7b GRAPHICS: Expose Font leading and descent values
The leading value in Macintosh fonts is the space between lines,
defined as the space between a descent line and the ascent line
below it. Clients need this to draw text and calculate its height
as classic Macintosh did.
2022-11-06 23:05:20 -08:00
sluicebox 2775987cba MACGUI: Expose font families in MacFontManager
MacFontManager didn't have a mechanism to report which fonts it loaded
from an external resource. It also requires that any fonts that aren't
built-in be explicitly registered by name by the client before they can
be used. This combination meant that a client couldn't load fonts from
an external file and use them by their properties (id / size / style).

SCI contains Mac fonts in its executable along with a table that maps
each SCI font id to a Mac font id and size. The font name isn't a part
of this since the Classic Mac Toolbox API took id / size / style as
input when drawing text.

Now MacFontManager exposes the font families it has loaded along with
their names. This allows a client to see which fonts were loaded,
register them by name, and proceed to use them with the existing API.
2022-11-06 23:05:20 -08:00
Le Philousophe 3aa220fdb4 GRAPHICS: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Roland van Laar b517ab6635 GRAPHICS: MACGUI: Fix memory leak in scaleFont
Free all surfaces after use.
2022-09-20 11:04:58 +02:00
Pragyansh Chaturvedi 5c17fe70b8 JANITORIAL: Fix conventions and reimplement MacFontManager::rectifyId() 2022-07-17 13:04:14 +02:00
Pragyansh Chaturvedi c4f6aa89b9 GRAPHICS: Implement assigning of windows font, check for wrong fontId while loading stxt, read name from FON files DIRECTOR 2022-07-17 13:04:14 +02:00
Pragyansh Chaturvedi 8cb2e1bb07 GRAPHICS: Add rectifyId to check for changed font IDs 2022-07-17 13:04:14 +02:00
Donovan Watteau 5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
Thierry Crozat 43acda0c9a GRAPHICS: Add override for TTFont class 2022-04-05 23:18:05 +01:00
Torbjörn Andersson 29a6b30ec3 GRAPHICS: Fix build 2022-03-29 09:01:47 +02: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
Paul Gilbert 15704239b8 AGS: Properly implement alfont_get_name 2022-03-14 22:12:40 -07:00
Paul Gilbert a2a33b8f19 GRAPHICS: Added getFontName method to TTFFont 2022-03-14 21:57:14 -07:00
Le Philousophe a110714141 GRAPHICS: Remove superfluous memset
Surface::create already initialized memory to 0 and getPixels can be
nullptr if bitmap size is 0. In this case memset gets called with
nullptr which is undefined behaviour.
2022-01-06 19:39:05 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Marcus Comstedt 20eb91cb31 GRAPHICS: Add Latin Extended-A to GUI font
This fixes incorrectly rendered characters in the about crawler.

The following BDF file was used as source:
https://opensource.apple.com/source/X11fonts/X11fonts-10.2/font-adobe-75dpi/font-adobe-75dpi-X11R7.0-1.0.0/helvB12.bdf
2021-10-23 09:45:15 +02:00
Thierry Crozat 3e1c61cdb8 GRAPHICS: Support loading a Windows font from an existing stream 2021-09-24 23:42:18 +01:00
ysj1173886760 948604d79d GRAPHICS: MACGUI: text length should not bigger than maxWidth - 1 2021-07-29 12:04:20 +08:00
ysj1173886760 a2d453a8f9 GRAPHICS: MACGUI: don't apply the kerning offset for the generated font
because we have already applied it when we are generating the font.
2021-07-26 20:55:49 +08:00
ysj1173886760 238971bc46 GRAPHICS: MACGUI: initialize slant of macFontfont. 2021-07-23 18:16:22 +08:00
ysj1173886760 7e2f3edc61 GRAPHICS: MACGUI: initialize bitImage to 0. 2021-07-23 17:06:38 +08:00
ysj1173886760 dc8418b547 GRAPHICS: MACGUI: implement shadow font. 2021-07-23 17:06:38 +08:00
ysj1173886760 1d7e82bf3e GRAPHICS: MACGUI: amend makeOutline 2021-07-23 17:06:38 +08:00
ysj1173886760 cae8166101 GRAPHICS: MACGUI: organize the code for extension. 2021-07-23 17:06:38 +08:00
ysj1173886760 822ca12ab2 GRAPHICS: MACGUI: draw the underLine in kerning area when we are dealing with underLine font. 2021-07-23 17:06:38 +08:00
ysj1173886760 0aa7518c5b GRAPHICS: MACGUI: set the kerning offset to 0 when dealing with underLined space. 2021-07-23 17:06:38 +08:00
ysj1173886760 6752b923b9 GRAPHICS: MACGUI: amend makeOutline in macFont. 2021-07-23 17:06:38 +08:00
ysj1173886760 e434198924 GRAPHICS: MACGUI: implement underline font. 2021-07-23 17:06:38 +08:00
ysj1173886760 3d0b7d5130 GRAPHICS: MACGUI: modify the parameter of scaleFont in macFont 2021-07-23 17:06:38 +08:00
ysj1173886760 4dd8e71fb9 GRAPHICS: MACGUI: fix outline style font. 2021-07-22 21:42:19 +08:00
ysj1173886760 e02911f283 GRAPHICS: MACGUI: add 1 to the width of outline font. 2021-07-22 21:42:19 +08:00
ysj1173886760 9ec4a2449e GRAPHICS: MACGUI: using bitmapWidth to replace width when dealing with bitmap. 2021-07-22 21:42:19 +08:00
ysj1173886760 63b9ae3679 GRAPHICS: MACGUI: enhance italic font. Fix the implementation for generating slant fonts. 2021-07-22 21:42:19 +08:00
ysj1173886760 79755cfb02 GRAPHICS: MACGUI: implement basic italic supporting. 2021-07-22 21:42:18 +08:00
ysj1173886760 a319074c86 GRAPHICS: MACGUI: add kerning offset when drawing single char 2021-07-20 16:49:01 +08:00
ysj1173886760 296750d5de GRAPHICS: MACGUI: implement reading styleWidths and glyph-width table for macfont 2021-07-20 16:49:01 +08:00
ysj1173886760 e24b22ed56 GRAPHICS: MACGUI: eliminate some TODO in load macFontFamily 2021-07-20 16:49:01 +08:00
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