[Scummvm-git-logs] scummvm master -> d7e00a9f87366f7d272ac467751da4417eb78d70
eriktorbjorn
noreply at scummvm.org
Sun Mar 3 18:50:15 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5117adc24c GRAPHICS: MACGUI: Give loaded fonts their correct ID
d7e00a9f87 SCUMM: No longer register the Indy and Loom fonts
Commit: 5117adc24c61c6a155bc8ab174ce04d89de19780
https://github.com/scummvm/scummvm/commit/5117adc24c61c6a155bc8ab174ce04d89de19780
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-03-03T19:49:00+01:00
Commit Message:
GRAPHICS: MACGUI: Give loaded fonts their correct ID
When loading other fonts than the system ones, they would get ID -1, not
the one from their resource ID. Even if you later registered the font
name, the old font entries would still be wrong. Another possibility
would be to update _fontRegistry when registering fonts, but sev was ok
with this way so let's go with it for now.
It does not consider the possibility of ID collisions the way
registerFontName() does, but apparently there shouldn't be much risk of
that.
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 1a2d50d35f0..3e92c92b84f 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -415,6 +415,24 @@ void MacFontManager::loadFonts(Common::MacResManager *fontFile) {
delete fontstream;
+ Common::String name = fontFamily->getName();
+
+ if (!_fontIds.contains(name)) {
+ int id = fontFamily->getFontFamilyId();
+
+ FontInfo *info = new FontInfo;
+ info->name = fontFamily->getName();
+ if (id >= 0x4000) {
+ info->lang = Common::JA_JPN;
+ info->encoding = Common::kWindows932;
+ } else {
+ info->encoding = Common::kMacRoman;
+ }
+
+ _fontIds[name] = id;
+ _fontInfo[id] = info;
+ }
+
Common::String fontName = Common::String::format("%s-%d-%d", familyName.c_str(), (*assoc)[i]._fontStyle | familySlant, (*assoc)[i]._fontSize);
macfont = new MacFont(_fontIds.getValOrDefault(familyName, kMacFontNonStandard), (*assoc)[i]._fontSize, (*assoc)[i]._fontStyle | familySlant);
Commit: d7e00a9f87366f7d272ac467751da4417eb78d70
https://github.com/scummvm/scummvm/commit/d7e00a9f87366f7d272ac467751da4417eb78d70
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-03-03T19:49:00+01:00
Commit Message:
SCUMM: No longer register the Indy and Loom fonts
With the recent change to the Mac font manager, the font is registered
when it's loaded. All we need is the correct ID, because we don't want
to hard code that.
Changed paths:
engines/scumm/macgui/macgui_impl.cpp
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index fc94f03e9e6..bef2520f1f7 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -233,7 +233,7 @@ void MacGuiImpl::initialize() {
for (uint i = 0; i < fontFamilies.size(); i++) {
if (fontFamilies[i]->getName() == fontFamily) {
- _gameFontId = _windowManager->_fontMan->registerFontName(fontFamily, fontFamilies[i]->getFontFamilyId());
+ _gameFontId = fontFamilies[i]->getFontFamilyId();
break;
}
}
More information about the Scummvm-git-logs
mailing list