|
|
@ -2984,8 +2984,8 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) |
|
|
|
int unscaled_ascent, unscaled_descent, unscaled_line_gap; |
|
|
|
int unscaled_ascent, unscaled_descent, unscaled_line_gap; |
|
|
|
stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap); |
|
|
|
stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap); |
|
|
|
|
|
|
|
|
|
|
|
const float ascent = ImTrunc(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1)); |
|
|
|
const float ascent = ImCeil(unscaled_ascent * font_scale); |
|
|
|
const float descent = ImTrunc(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1)); |
|
|
|
const float descent = ImFloor(unscaled_descent * font_scale); |
|
|
|
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent); |
|
|
|
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent); |
|
|
|
const float font_off_x = cfg.GlyphOffset.x; |
|
|
|
const float font_off_x = cfg.GlyphOffset.x; |
|
|
|
const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent); |
|
|
|
const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent); |
|
|
|