Skip to content

Commit

Permalink
Fixed build with IMGUI_ENABLE_FREETYPE (#8346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jan 25, 2025
1 parent afb6e9a commit 96e3b14
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2819,6 +2819,13 @@ void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsig
*data = table[*data];
}

void ImFontAtlasBuildGetOversampleFactors(const ImFontConfig* cfg, int* out_oversample_h, int* out_oversample_v)
{
// Automatically disable horizontal oversampling over size 36
*out_oversample_h = (cfg->OversampleH != 0) ? cfg->OversampleH : (cfg->SizePixels * cfg->RasterizerDensity > 36.0f || cfg->PixelSnapH) ? 1 : 2;
*out_oversample_v = (cfg->OversampleV != 0) ? cfg->OversampleV : 1;
}

#ifdef IMGUI_ENABLE_STB_TRUETYPE
// Temporary data for one source font (multiple source fonts can be merged into one destination ImFont)
// (C++03 doesn't allow instancing ImVector<> with function-local types so we declare the type here.)
Expand Down Expand Up @@ -2857,13 +2864,6 @@ static void UnpackBitVectorToFlatIndexList(const ImBitVector* in, ImVector<int>*
out->push_back((int)(((it - it_begin) << 5) + bit_n));
}

void ImFontAtlasBuildGetOversampleFactors(const ImFontConfig* cfg, int* out_oversample_h, int* out_oversample_v)
{
// Automatically disable horizontal oversampling over size 36
*out_oversample_h = (cfg->OversampleH != 0) ? cfg->OversampleH : (cfg->SizePixels * cfg->RasterizerDensity > 36.0f || cfg->PixelSnapH) ? 1 : 2;
*out_oversample_v = (cfg->OversampleV != 0) ? cfg->OversampleV : 1;
}

static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
{
IM_ASSERT(atlas->ConfigData.Size > 0);
Expand Down

0 comments on commit 96e3b14

Please sign in to comment.