diff options
author | stevenhoefel | 2017-01-14 15:02:58 +1100 |
---|---|---|
committer | stevenhoefel | 2017-01-14 15:02:58 +1100 |
commit | aecafd473cbb0f7424567b5cac9738b56187aa48 (patch) | |
tree | d8b77b4ae663e2f21ce921cb80a89acaa6519ddd /engines | |
parent | 4f1cbddbc3533059c05e760eedcaee7bb9b6936e (diff) | |
download | scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.tar.gz scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.tar.bz2 scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.zip |
DIRECTOR: Load fonts by name if exists from map.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/frame.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index eeecc0f29a..7e7180b001 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -880,14 +880,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo int width = _sprites[spriteId]->_width; if (_vm->getVersion() >= 4 && !isButtonLabel) width = textCast->initialRect.right; - Graphics::MacFont macFont(textCast->fontId, textCast->fontSize, textCast->textSlant); - if (_vm->_currentScore->_fontMap.contains(textCast->fontId)) { - // Override - //macFont.setName(_vm->_currentScore->_fontMap[textCast->fontId]); - //TODO: this still needs to take font style and size into account! + // We need to make sure that teh Shared Cast fonts have been loaded in? + //might need a mapping table here of our own. + textCast->fontId = _vm->_wm->_fontMan->getFontIdByName(_vm->_currentScore->_fontMap[textCast->fontId]); } + Graphics::MacFont macFont = Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant); + const Graphics::Font *font = _vm->_wm->_fontMan->getFont(macFont); height = font->getFontHeight(); @@ -917,19 +917,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo width += padding * 2; height += padding; - if (textCast->textAlign == kTextAlignLeft) - textX += padding; - else if (textCast->textAlign == kTextAlignRight) - textX -= padding; - + if (textCast->textAlign == kTextAlignLeft) textX += padding; + else if (textCast->textAlign == kTextAlignRight) textX -= padding; //TODO: alignment issue with odd-size-width center-aligned text //else if (textCast->textAlign == kTextAlignCenter && ((borderSize + padding) % 2 == 1)) textX--; - textY += padding / 2; } - if (textCast->textAlign == kTextAlignRight) - textX -= 1; + if (textCast->textAlign == kTextAlignRight) textX -= 1; if (textShadow > 0) { if (borderSize == 0 && _vm->getVersion() > 3) |