Skip to content

Commit

Permalink
Do not add foundry to font search pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Nov 16, 2024
1 parent 7212358 commit 2ed31ad
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions rts/Rendering/Fonts/CFontTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,6 @@ bool FtLibraryHandlerProxy::CheckGenFontConfigFull(bool console)
/*******************************************************************************/

#ifndef HEADLESS
static bool IsFoundryOkay(std::string_view foundry)
{
/* These foundry codes are defaults from some editors and can make pattern
* search fail to provide proper results on the first items.
*/
if (foundry.starts_with(std::string_view{"UKWN"}) || foundry.starts_with(std::string_view{"ukwn"}))
return false;
return true;
}

static inline uint64_t GetKerningHash(char32_t lchar, char32_t rchar)
{
RECOIL_DETAILED_TRACY_ZONE;
Expand Down Expand Up @@ -436,7 +426,6 @@ static std::shared_ptr<FontFace> GetFontForCharacters(const std::vector<char32_t
FcBool outline = FcFalse;

FcChar8* family = nullptr;
FcChar8* foundry = nullptr;

const FcChar8* ftname = reinterpret_cast<const FcChar8*>("not used");

Expand All @@ -457,7 +446,6 @@ static std::shared_ptr<FontFace> GetFontForCharacters(const std::vector<char32_t
FcPatternGetDouble( origPattern, FC_PIXEL_SIZE, 0, &pixelSize);

FcPatternGetString( origPattern, FC_FAMILY , 0, &family );
FcPatternGetString( origPattern, FC_FOUNDRY, 0, &foundry);

}

Expand All @@ -470,8 +458,6 @@ static std::shared_ptr<FontFace> GetFontForCharacters(const std::vector<char32_t

if (family)
FcPatternAddString(pattern, FC_FAMILY, family);
if (foundry && IsFoundryOkay(reinterpret_cast<const char*>(foundry)))
FcPatternAddString(pattern, FC_FOUNDRY, foundry);
}

FcDefaultSubstitute(pattern);
Expand Down

0 comments on commit 2ed31ad

Please sign in to comment.