Skip to content

text: Add a new modifier to -D (-D+f<file>)#8965

Merged
joa-quim merged 4 commits intomasterfrom
text-var-offsets
Apr 6, 2026
Merged

text: Add a new modifier to -D (-D+f<file>)#8965
joa-quim merged 4 commits intomasterfrom
text-var-offsets

Conversation

@joa-quim
Copy link
Copy Markdown
Member

@joa-quim joa-quim commented Apr 5, 2026

  • Add new modifier +f to the -D option of text/pstext
  • The file contains one (dx, dy) pair per text record, allowing each label to have its own displacement instead of a single fixed offset
  • File reading uses GMT_Read_Data so the feature works transparently with GMT.jl in-memory datasets (virtual files)
  • Values in the file are in the current length unit (PROJ_LENGTH_UNIT)
  • Added shell test test/pstext/var_offset.sh

Example

  # offsets.txt has one dx,dy per label
  gmt text -R... -J... -F+f12p+jCM -D0+foffsets.txt << EOF
  -3  -3  SW corner
   3   3  NE corner
  EOF

Mostly written by Claude.

@joa-quim joa-quim requested a review from a team April 5, 2026 22:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added test/baseline/pstext/var_offset.ps
modified test/baseline/pstext/

Image diff(s)

Details

Added images

  • test/baseline/pstext/var_offset.png

Modified images

Path Old New

Report last updated at commit ef6fc0b

Copy link
Copy Markdown
Contributor

@remkos remkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I see that en passant you fixed a few other things.

@joa-quim
Copy link
Copy Markdown
Member Author

joa-quim commented Apr 6, 2026

OK I'll merge it, but I will need that some change the mode of the var_offset.sh script.

@joa-quim joa-quim merged commit 7e40e67 into master Apr 6, 2026
10 of 15 checks passed
@joa-quim joa-quim deleted the text-var-offsets branch April 6, 2026 10:28
@Esteban82 Esteban82 added enhancement Improving an existing feature add-changelog Add PR to the changelog labels Apr 6, 2026
@Esteban82
Copy link
Copy Markdown
Member

Just for the record, I run the test and looks good to me.

@seisman seisman changed the title Add a new modifier to -D (-D+f<file>) text: Add a new modifier to -D (-D+f<file>) Apr 7, 2026
@seisman
Copy link
Copy Markdown
Member

seisman commented Apr 7, 2026

PR titles would be more informative if they adopted a format such as

module: description of the change.

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

Labels

add-changelog Add PR to the changelog enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants