Change markers drawing in SVG/PDF/PS/TeX - #23094
Draft
linev wants to merge 13 commits into
Draft
Conversation
couet
approved these changes
Aug 18, 2026
linev
force-pushed
the
svg_marker
branch
2 times, most recently
from
August 18, 2026 14:05
4d52160 to
8e7df11
Compare
linev
marked this pull request as ready for review
August 18, 2026 14:07
Test Results 22 files 22 suites 3d 12h 51m 6s ⏱️ For more details on these failures, see this check. Results for commit 8c1126c. ♻️ This comment has been updated with latest results. |
linev
marked this pull request as draft
August 20, 2026 06:21
Via unsigned flags argument let specify: * kPreferTriangles - return kShapeTriangles instead of kShapeFilledArea * kDotAsLines - convert small and medium dot into lines which are directly drawn by pixel devices * kDotAsCircle - automatically convert small and medium dots into circles * kUsePSWidthScale - use gStyle->GetLineScalePS() for marker size calculations Depending from graphical engines one may want to handle dots as circles or as lines or directly as sized dots. Move prefer_triangles argument as one of such bits Now method always return pixel size of created markers. Such size can be used for scaling of created points.
Now there are multiple flags and for pixel devices one prefer to convert dots into lines and fill rects
Use segments instead of polyline while many PS engines makes problems to draw line over same points
Use TAttMarker::GetMarkerShape() to retrieve marker shape and draw it with SVG `<path>` expression. Only circles remain drawn as <g> of <circle> to have clear indication Use integer coordinates for relative path movement Add space between markers in path d attribute to have proper line breaks
Use TAttMarker::GetMarkerShape() to plot markers Unify PDF output with other graphics and image engines Increases slightly PDF file sizes while some markers like rectangle now drawn as filled polygon - which is larger
Use GetMarkerShape for markers drawing in PS Like in all other engines, translate marker in simple graphical commands and then directly display them.
When many markers drawn at the same time - reduce size of PS file Also fix direction of markers
While same marker can appear many times in the same document - keep map of already created markers and define each new ones. Name of marker include type and size of the marker. Like "m20_sz200". Default marker size = 1 is not included and marker will be defined as "m20".
Like in PS, define markers once when they really used Reuse same shape for different sizes, but ensure that generated shape does not have roundnig problems Use GetLineScalePS() also for markers in TeX As result, implement lot of missing markers. Other markers like triangles looks identical with PDF/SVG/X11
Both classes were never designed to be used in I/O
Now markers stored differently in SVG
PS and PDF files are changed now while markers created from provided shape
Now markers not automatically defined in PS file, wherefore file size and number of lines does not match to previous values.
couet
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First adjust
TAttMarker::GetMarkerShape()method to support features requires by text outputs.Main difference to X11/Cocoa/GL is how dots are handled.
For PS-based outputs one draw small circles, in X11 - several lines or small rect.
In all
DrawPolyMarkerimplementations nowTAttMarker::GetMarkerShape()is used.In
TSVGstore N markers produced byTSVG::DrawPolyMarkercall in single<path d="..."/>element.This reduce size of SVG file and increase rendering speed.
Only when circles are drawn - as in previous implementation create
<g>with N<circle>In
TPDFjust useGetMarkerShape(), logic and implementation did not change much.In
TPostScriptchanges are significant. Before all markers shaped were predefined and ALWAYS stored in the beginning of the PS file. Now specific marker shape defined ONLY when it used for the first time. Marker definition generated with help ofGetMarkerShape()method. So if markers are not used in the plot - PS file will be smaller than before. But if there are many different markers - size is increased while definition is not that compact as before.In
TTexDumpchanges similar toTPostScript. Define markers only when they are used.Only simple default tex markers
*(filled circle) ando(circle) are re-used, all other markers defined based of provided shape. While marker size is extra parameter - shape defined only once for each marker type.As result - all existing markers now supported in
TTexDump(before only half was there).Update several
test/svg_ref/*.svgfiles because markers implementation was changed.Update
stressGraphics.reffiles while size of PS and PDF files were changed for markersUpdate several other tests where PS output used for testing.
Result of this PR - all existing graphics backends using same code to generate shape of the markers!