Skip to content

annotation_demo: Missing annotations in PNG, rendering issues in PDF #1415

@krystophny

Description

@krystophny

Problem Description

The annotation_demo example has rendering issues in both PNG and PDF backends:

PNG Backend Issues:

  • No annotations visible - annotations are completely missing from PNG output
  • Only the plot lines and axes are rendered

PDF Backend Issues:

  • Strange character rendering - some text appears as "?" characters
  • Incorrect positioning - some annotations are placed in wrong locations
  • Partial rendering compared to intended output

Expected Behavior

All annotations should render correctly with:

  • Proper text display (no "?" characters)
  • Correct positioning for all coordinate types (COORD_DATA, COORD_FIGURE, COORD_AXIS)
  • Consistent rendering across PNG and PDF backends

Evidence

PNG Output: file:///home/ert/code/fortplot/output/example/fortran/annotation_demo/annotation_demo.png

  • Annotations completely missing

PDF Output: file:///home/ert/code/fortplot/output/example/fortran/annotation_demo/annotation_demo.pdf

  • Some annotations visible but with rendering issues
  • Character encoding problems ("?" instead of proper characters)
  • Positioning inconsistencies

Files Involved

  • Example: example/fortran/annotation_demo/annotation_demo.f90
  • PNG rendering: src/backends/raster/ (annotation rendering)
  • PDF rendering: src/backends/vector/fortplot_pdf.f90, src/text/fortplot_annotation_rendering.f90

Impact

  • Users cannot rely on annotation functionality
  • Examples do not demonstrate working features
  • Documentation/tutorial value compromised

Related

This is a separate issue from #1413 which was focused on PDF rendering artifacts (contours, streamlines, mathtext). The annotation coordinate transformation in #1413 fixed some PDF positioning but did not address PNG backend or character encoding issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions