Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2446 - Sub font size is incorrect when save to png (svg) #2572

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading