Hack to prevent font oversampling for low-memory graphics card.

This commit is contained in:
brunoherbelin
2020-10-10 10:48:39 +02:00
parent af11408ee9
commit 31ebccd248

View File

@@ -751,6 +751,8 @@ void ImGuiToolkit::SetFont(ImGuiToolkit::font_style style, const std::string &tt
ImFontConfig font_config;
fontname.copy(font_config.Name, 40);
font_config.FontDataOwnedByAtlas = false; // data will be copied in font atlas
if ( max * max < 16777216 ) // hack: try to avoid font textures too larges by disabling oversamplig
oversample = 1;
font_config.OversampleH = CLAMP( oversample, 1, 5 );
font_config.OversampleV = CLAMP( oversample, 1, 5 );