[Scummvm-git-logs] scummvm master -> 952c4c98ee5f28ae4709d9d5251f29224e9eed76
sev-
sev at scummvm.org
Sun Jul 5 20:46:27 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
561052c476 GRAPHICS: MACGUI: Fix bug when we stopped loading font family after TTF font
25c1e4a590 MACGUI: Restrict TTF font generation to regular fonts only
952c4c98ee GRAPHICS: MACGUI: Try to generate different font slant first
Commit: 561052c4768dddd4fa3fb74ba6a7270e6d15a225
https://github.com/scummvm/scummvm/commit/561052c4768dddd4fa3fb74ba6a7270e6d15a225
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-07-05T22:42:49+02:00
Commit Message:
GRAPHICS: MACGUI: Fix bug when we stopped loading font family after TTF font
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 20f5055166..2a76c99cf8 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -268,7 +268,7 @@ void MacFontManager::loadFonts(Common::MacResManager *fontFile) {
// The sfnt resource should be just a copy of a TTF
fontstream = fontFile->getResource(MKTAG('s', 'f', 'n', 't'), (*assoc)[i]._fontID);
_ttfData[_fontIds.getVal(familyName, kMacFontNonStandard)] = fontstream;
- return;
+ continue;
}
#endif
Commit: 25c1e4a5904ca4b0df7826e725cef1af163b0e51
https://github.com/scummvm/scummvm/commit/25c1e4a5904ca4b0df7826e725cef1af163b0e51
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-07-05T22:45:07+02:00
Commit Message:
MACGUI: Restrict TTF font generation to regular fonts only
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 2a76c99cf8..c6cab9d112 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -123,7 +123,7 @@ MacFontManager::MacFontManager(uint32 mode) : _mode(mode) {
MacFontManager::~MacFontManager() {
for (Common::HashMap<int, const Graphics::Font *>::iterator it = _uniFonts.begin(); it != _uniFonts.end(); it++)
- delete it->_value;
+ delete it->_value;
for (Common::HashMap<int, Common::SeekableReadStream *>::iterator it = _ttfData.begin(); it != _ttfData.end(); it++)
delete it->_value;
}
@@ -431,14 +431,14 @@ void MacFontManager::generateFontSubstitute(MacFont &macFont) {
Common::String name;
#ifdef USE_FREETYPE2
- // First check if it's a TTF font
- if (_ttfData.contains(macFont.getId())) {
+ // Checking if it's a TTF font. Restrict it only to regular fonts now
+ if (_ttfData.contains(macFont.getId()) && macFont.getSlant() == kMacFontRegular) {
generateTTFFont(macFont, _ttfData[macFont.getId()]);
return;
}
#endif
- // First we try twice size
+ // Now try twice size
name = getFontName(macFont.getId(), macFont.getSize() * 2, macFont.getSlant());
if (_fontRegistry.contains(name) && !_fontRegistry[name]->isGenerated()) {
generateFONTFont(macFont, *_fontRegistry[name]);
Commit: 952c4c98ee5f28ae4709d9d5251f29224e9eed76
https://github.com/scummvm/scummvm/commit/952c4c98ee5f28ae4709d9d5251f29224e9eed76
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-07-05T22:45:46+02:00
Commit Message:
GRAPHICS: MACGUI: Try to generate different font slant first
Changed paths:
graphics/macgui/macfontmanager.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index c6cab9d112..858b881ece 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -430,6 +430,18 @@ int MacFontManager::getFontIdByName(Common::String name) {
void MacFontManager::generateFontSubstitute(MacFont &macFont) {
Common::String name;
+ // Try to see if we have regular font
+ if (macFont.getSlant() != kMacFontRegular) {
+ name = getFontName(macFont.getId(), macFont.getSize(), kMacFontRegular);
+
+ if (_fontRegistry.contains(name) && !_fontRegistry[name]->isGenerated()) {
+ generateFONTFont(macFont, *_fontRegistry[name]);
+
+ return;
+ }
+ }
+
+
#ifdef USE_FREETYPE2
// Checking if it's a TTF font. Restrict it only to regular fonts now
if (_ttfData.contains(macFont.getId()) && macFont.getSlant() == kMacFontRegular) {
More information about the Scummvm-git-logs
mailing list