diff --git a/src/common/fonts/font.cpp b/src/common/fonts/font.cpp index a27e7f238..c1373e373 100644 --- a/src/common/fonts/font.cpp +++ b/src/common/fonts/font.cpp @@ -328,14 +328,14 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla auto orig = pic->GetTexture(); auto tex = MakeGameTexture(orig, nullptr, ETextureType::FontChar); - tex->CopySize(pic); + tex->CopySize(pic, true); TexMan.AddGameTexture(tex); Chars[i].OriginalPic = tex; if (!noTranslate) { Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1(orig->GetImage())), nullptr, ETextureType::FontChar); - Chars[i].TranslatedPic->CopySize(pic); + Chars[i].TranslatedPic->CopySize(pic, true); TexMan.AddGameTexture(Chars[i].TranslatedPic); } else @@ -441,9 +441,9 @@ void FFont::ReadSheetFont(TArray &folderdata, int width, int height auto pic = (*lump)->GetTexture(); Chars[i].OriginalPic = (*lump)->GetUseType() == ETextureType::FontChar? (*lump) : MakeGameTexture(pic, nullptr, ETextureType::FontChar); Chars[i].OriginalPic->SetUseType(ETextureType::FontChar); - Chars[i].OriginalPic->CopySize(*lump); + Chars[i].OriginalPic->CopySize(*lump, true); Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1(pic->GetImage())), nullptr, ETextureType::FontChar); - Chars[i].TranslatedPic->CopySize(*lump); + Chars[i].TranslatedPic->CopySize(*lump, true); Chars[i].TranslatedPic->SetUseType(ETextureType::FontChar); if (Chars[i].OriginalPic != *lump) TexMan.AddGameTexture(Chars[i].OriginalPic); TexMan.AddGameTexture(Chars[i].TranslatedPic); @@ -860,7 +860,7 @@ int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const } if (color != nullptr) *color = retcolor; } - if (ActiveColors == 0) + if (ActiveColors == 0 || range == CR_UNDEFINED) return -1; else if (range >= NumTextColors) range = CR_UNTRANSLATED; @@ -977,7 +977,7 @@ FGameTexture *FFont::GetChar (int code, int translation, int *const width, bool if (code < 0) return nullptr; - if (translation == CR_UNTRANSLATED && !forceremap) + if ((translation == CR_UNTRANSLATED || translation == CR_UNDEFINED) && !forceremap) { bool redirect = Chars[code].OriginalPic && Chars[code].OriginalPic != Chars[code].TranslatedPic; if (redirected) *redirected = redirect; diff --git a/src/common/fonts/singlepicfont.cpp b/src/common/fonts/singlepicfont.cpp index 46a723bd1..aefede946 100644 --- a/src/common/fonts/singlepicfont.cpp +++ b/src/common/fonts/singlepicfont.cpp @@ -46,7 +46,7 @@ public: // FFont interface FGameTexture *GetChar(int code, int translation, int *const width, bool *redirected = nullptr) const override; - int GetCharWidth (int code) const; + int GetCharWidth (int code) const override; protected: FTextureID PicNum; diff --git a/src/common/fonts/specialfont.cpp b/src/common/fonts/specialfont.cpp index 4dca54d3f..7e9c0778d 100644 --- a/src/common/fonts/specialfont.cpp +++ b/src/common/fonts/specialfont.cpp @@ -105,13 +105,13 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FGameTexture { auto pic = charlumps[i]; Chars[i].OriginalPic = MakeGameTexture(pic->GetTexture(), nullptr, ETextureType::FontChar); - Chars[i].OriginalPic->CopySize(pic); + Chars[i].OriginalPic->CopySize(pic, true); TexMan.AddGameTexture(Chars[i].OriginalPic); if (!noTranslate) { Chars[i].TranslatedPic = MakeGameTexture(new FImageTexture(new FFontChar1 (charlumps[i]->GetTexture()->GetImage())), nullptr, ETextureType::FontChar); - Chars[i].TranslatedPic->CopySize(charlumps[i]); + Chars[i].TranslatedPic->CopySize(charlumps[i], true); TexMan.AddGameTexture(Chars[i].TranslatedPic); } else Chars[i].TranslatedPic = Chars[i].OriginalPic;