Skip to content

Commit

Permalink
#2446 - Sub font size is incorrect when save to png (svg) (#2572)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliaksandrDziarkach authored Oct 23, 2024
1 parent 7951191 commit 7b6a23c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/indigo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ jobs:
path: dist/
- name: Test Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
uses: uraimo/run-on-arch-action@v2.0.5
uses: uraimo/run-on-arch-action@v2.8.1
with:
arch: aarch64
distro: ubuntu20.04
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
path: dist/
- name: Test Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
uses: uraimo/run-on-arch-action@v2.0.5
uses: uraimo/run-on-arch-action@v2.8.1
with:
arch: aarch64
distro: ubuntu20.04
Expand Down
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 7b6a23c

Please sign in to comment.