Feature: Add -d switch to printtarg for custom target label string #19
Notifications
Due Date
No due date set.
Blocks
Reference: gronod/argyllcms#19
Reference in New Issue
Block a user
Summary
Add a command-line switch
-d "<string>"toprinttargallowing users to supply a custom description/label string to be printed along the page/strip borders on generated test target files (TIFF, PostScript, EPS), replacing the default generated chart identifier label.Motivation & Background
Currently,
printtargautomatically constructs a hardcoded label for each target page/strip intarget/printtarg.c:This text is rendered along the target borders using
tro->vstring(...). In automated profiling workflows, frontends (such as ICCery), proofing suites, and custom calibration jobs, users frequently need to annotate charts with specific profile names, media types, printer settings, or custom identifiers, or omit the text altogether.Command-Line Switch Selection
-d "<string>"-dis currently unused inprinttarg(-Dis used for 8-bit TIFF dithering).-Dincolprof,collink,cctifffor descriptions/display labels).-l(easily confused with1orI),-L(already used for suppressing left border),-B/-H(less standard).Technical Specification & Implementation Plan
1. CLI Parsing (
target/printtarg.c)-dinmain()argument parsing:-dis provided:custom_labelis non-empty, usecustom_labeldirectly aslabel.custom_labelis empty (-d ""), disable label drawing (dopglabel = 0; dorspace = 0;or skiptro->vstringcalls), fulfilling the to-do item atprinttarg.c:L30("Add option to omit labelling").-dis omitted, retain the current defaultsprintf(label, ...).2. Constraints, Edge Cases & Pitfalls
labelbuffer inprinttarg.cis currentlychar label[400].labelbuffer allocation to at least 1024 bytes and use bounded copies (strncpy/snprintf) to guard against arbitrary command-line input lengths.ps_vstring()wraps strings in parentheses:(%s).(,),\must be properly escaped (\(,\),\\) before emitting to PostScript to prevent PostScript syntax errors.\n,\r,\t) which can break PostScript line structuring.add_string2d()uses the built-in 7-bit ASCII font (timesr_b).y2 - y1..ti2Metadata Integration:.ti2CGATS file under theDESCRIPTORorCHART_LABELkeyword for traceability across downstream tools (chartread,colprof).Documentation Updates Required
target/printtarg.c: Updateusage()function banner.doc/printtarg.html:-d "<description>"entry to the summary table and usage details section.-d "").doc/ArgyllDoc.html: Updateprinttargsummary listing.doc/ChangesSummary.html&log.txt: Document the new-dswitch under the latest version change notes.Acceptance Criteria
printtarg -d "My Custom Media - 1440dpi" ...generates TIFF, PS, and EPS charts displaying the custom string.printtarg -d "" ...omits the page/strip label without layout disruption.-d "Test (Sample #1) & 100% Gloss") parses cleanly without PostScript interpreter errors.