Skip to content

SVG/PNG export does not preserve axis/tick font settings and clips axis label #4388

Open

Description

@Kenichi-Endo

Current behavior

When exporting a spectrum as SVG or PNG, the exported figure does not preserve the font settings used in the NMRium display.

This may be related to #3529, which concerns customization of font size and font family. In the current UI, these settings affect the on-screen spectrum, but they are not reproduced correctly in the exported figure.

Observed behavior:

  • Tick-label font size in the exported image differs from the size shown/configured in NMRium.
  • Axis-label font size is not preserved.
  • The font family changes during export.
  • The x-axis label (δ [ppm]) extends beyond the image boundary and is partially clipped.
  • The problem occurs with both SVG and PNG export.

Steps to reproduce

  1. Open a 1D spectrum.
  2. Change the axis/tick-label font settings.
  3. Confirm that the new settings are visible in the NMRium display.
  4. Export the spectrum as SVG or PNG.
  5. Compare the exported figure with the on-screen spectrum.

Expected behavior

  • SVG/PNG export should preserve the configured font size and font family for axis and tick labels.
  • The exported figure should visually match the spectrum shown in NMRium.
  • Axis labels should remain fully inside the exported image frame.

Screenshots

NMRium display

The configured axis and tick-label font settings are visible in the NMRium interface.

Image

Exported PNG

The exported figure uses different font sizing/font rendering, and the x-axis label is clipped at the bottom.

Image

Related issue

Activity

  1. hamed-musallam commented on Nov 4, 2026

    @hamed-musallam
    Member

    Hello @Kenichi-Endo

    We have addressed the font and axis label issues you reported. Could you test the updated version here: https://svg-png-export.nmrium.pages.dev/?

    Please check the 1D and 2D views and SVG/PNG exports, especially with larger axis fonts. Let us know if you still see any overlap or clipping.

  2. Kenichi-Endo commented on Nov 6, 2026

    @Kenichi-Endo
    Author

    Thank you very much for fixing this issue. I confirmed that SVG/PNG exports of 1D/2D spectra use the expected font and size, with no overlap or clipping, in this instance. I look forward to the deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions