Skip to content

Test texts without frame or GDI: save, export, finalizers (#412, step 9b) - #479

Open
dsn27 wants to merge 3 commits into
feature/gdi-glyph-comparisonfrom
test/headless-text-export
Open

dsn27 wants to merge 3 commits into
feature/gdi-glyph-comparisonfrom
test/headless-text-export

Conversation

@dsn27

@dsn27 dsn27 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Part of #412, step 9 (verification on non-Windows hosts). This PR is stacked on #472 because it needs the font service of the kernel (#468 and its successors). Its base is feature/gdi-glyph-comparison; it will be retargeted as the stack is merged.

What step 9 asks for

Headless tests in the Linux CI that create, measure and export a Text, and check that the process survives the finalizers.

Creating and measuring a text without a frame and without GDI is already tested since #468 (FontProviderTests.TextWorksWithoutFrameAndWithoutGdi, FontCacheHasNoFinalizerThatCanCrashTheProcess). This PR adds the export.

Tests

HeadlessTextExportTests, using the font Liberation Sans from the test fonts:

  • JSON: a text in a project is saved and read back with the same string, the same font and the same extent.
  • DXF: a text is exported with Project.Export(…, "dxf") and imported again. The test checks the string, the size and the location, and that the imported text gets an extent measured by the managed font reader.
  • Finalizers: 20 texts are measured and outlined, then GC.Collect, WaitForPendingFinalizers and GC.Collect run. A finalizer that throws would end the test host and fail the run. That is exactly what the GDI FontCache did on Linux before Get the fonts of texts from a font service of the kernel instead of GDI #468.

STL export is not tested, because PaintToSTL does not triangulate texts (TriangulateText is always false). Texts are left out of STL files on every platform.

Local run (Linux): CADability.Tests: 654 passed, 12 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5


Generated by Claude Code

Step 9 of #412 asks for headless tests in the Linux CI that create,
measure and export a text and check that the process survives the
finalizers. Creating and measuring was already tested with the font
service; these tests add:

- saving a text to JSON and reading it back, with the same extent;
- exporting a text to DXF and reading it back (string, size, location,
  and an extent measured with the managed font reader);
- running the finalizers after texts have been measured and outlined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants