summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fontdetection.cpp10
-rw-r--r--src/strings.cpp7
-rw-r--r--src/strings_func.h2
3 files changed, 8 insertions, 11 deletions
diff --git a/src/fontdetection.cpp b/src/fontdetection.cpp
index fd48bd801..570e1aa06 100644
--- a/src/fontdetection.cpp
+++ b/src/fontdetection.cpp
@@ -347,7 +347,7 @@ static int CALLBACK EnumFontCallback(const ENUMLOGFONTEX *logfont, const NEWTEXT
PLOGFONT os_data = MallocT<LOGFONT>(1);
*os_data = logfont->elfLogFont;
info->callback->SetFontNames(info->settings, font_name, os_data);
- if (info->callback->FindMissingGlyphs(nullptr)) return 1;
+ if (info->callback->FindMissingGlyphs()) return 1;
DEBUG(freetype, 1, "Fallback font: %s (%s)", font_name, english_name);
return 0; // stop enumerating
}
@@ -477,7 +477,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
/* Save result. */
callback->SetFontNames(settings, name);
- if (!callback->FindMissingGlyphs(nullptr)) {
+ if (!callback->FindMissingGlyphs()) {
DEBUG(freetype, 2, "CT-Font for %s: %s", language_isocode, name);
result = true;
break;
@@ -488,10 +488,10 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
/* For some OS versions, the font 'Arial Unicode MS' does not report all languages it
* supports. If we didn't find any other font, just try it, maybe we get lucky. */
callback->SetFontNames(settings, "Arial Unicode MS");
- result = !callback->FindMissingGlyphs(nullptr);
+ result = !callback->FindMissingGlyphs();
}
- callback->FindMissingGlyphs(nullptr);
+ callback->FindMissingGlyphs();
return result;
}
@@ -623,7 +623,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
callback->SetFontNames(settings, (const char*)file);
- bool missing = callback->FindMissingGlyphs(nullptr);
+ bool missing = callback->FindMissingGlyphs();
DEBUG(freetype, 1, "Font \"%s\" misses%s glyphs", file, missing ? "" : " no");
if (!missing) {
diff --git a/src/strings.cpp b/src/strings.cpp
index 0f270ca8b..a98d7e966 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1998,11 +1998,9 @@ const char *GetCurrentLanguageIsoCode()
/**
* Check whether there are glyphs missing in the current language.
- * @param[out] str Pointer to an address for storing the text pointer.
* @return If glyphs are missing, return \c true, else return \c false.
- * @post If \c true is returned and str is not nullptr, *str points to a string that is found to contain at least one missing glyph.
*/
-bool MissingGlyphSearcher::FindMissingGlyphs(const char **str)
+bool MissingGlyphSearcher::FindMissingGlyphs()
{
InitFreeType(this->Monospace());
const Sprite *question_mark[FS_END];
@@ -2014,7 +2012,6 @@ bool MissingGlyphSearcher::FindMissingGlyphs(const char **str)
this->Reset();
for (const char *text = this->NextString(); text != nullptr; text = this->NextString()) {
FontSize size = this->DefaultSize();
- if (str != nullptr) *str = text;
for (WChar c = Utf8Consume(&text); c != '\0'; c = Utf8Consume(&text)) {
if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
size = (FontSize)(c - SCC_FIRST_FONT);
@@ -2095,7 +2092,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
{
static LanguagePackGlyphSearcher pack_searcher;
if (searcher == nullptr) searcher = &pack_searcher;
- bool bad_font = !base_font || searcher->FindMissingGlyphs(nullptr);
+ bool bad_font = !base_font || searcher->FindMissingGlyphs();
#if defined(WITH_FREETYPE) || defined(_WIN32)
if (bad_font) {
/* We found an unprintable character... lets try whether we can find
diff --git a/src/strings_func.h b/src/strings_func.h
index 2019b8b36..e4b779105 100644
--- a/src/strings_func.h
+++ b/src/strings_func.h
@@ -277,7 +277,7 @@ public:
*/
virtual void SetFontNames(struct FreeTypeSettings *settings, const char *font_name, const void *os_data = nullptr) = 0;
- bool FindMissingGlyphs(const char **str);
+ bool FindMissingGlyphs();
};
void CheckForMissingGlyphs(bool base_font = true, MissingGlyphSearcher *search = nullptr);