Skip to content

Commit

Permalink
Backmerge: #2446 - Sub font size is incorrect when save to png (svg)
Browse files Browse the repository at this point in the history
Backmerge to master
  • Loading branch information
AliaksandrDziarkach committed Oct 23, 2024
1 parent d807ea1 commit 4362813
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/tests/integration/tests/rendering/acs_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
indigo.setOption("render-hash-spacing", "10")
indigo.setOption("render-stereo-bond-width", "30")
indigo.setOption("render-font-size", "20")
indigo.setOption("render-font-size-sub", "30")
renderer.renderToFile(mol, joinPathPy("out/acs_style_changed.png", __file__))
print(checkImageSimilarity("acs_style_changed.png"))

Expand All @@ -89,6 +90,7 @@
renderer.renderToFile(mol, joinPathPy("out/" + pngname, __file__))
print(checkImageSimilarity(pngname))


if isIronPython():
renderer.Dispose()
indigo.Dispose()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/mac/acs_style_changed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/win/acs_style_changed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/render2d/src/render_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void RenderSettings::init(float relativeThickness, float bondLineWidthFactor, Ac
static constexpr float TWO_DIV_THREE = 2.0f / 3.0f;
fzz[FONT_SIZE_LABEL] = label_font_size;
if (acs != nullptr && acs->fontSizeSubAngstrom > 0)
fzz[FONT_SIZE_ATTR] = acs->fontSizeAngstrom;
fzz[FONT_SIZE_ATTR] = acs->fontSizeSubAngstrom;
else
fzz[FONT_SIZE_ATTR] = label_font_size * TWO_DIV_THREE; // unit * 8; // Subscript
fzz[FONT_SIZE_RGROUP_LOGIC] = label_font_size;
Expand Down

0 comments on commit 4362813

Please sign in to comment.