Skip to content

pstext -D[j|J] is broken#8921

Open
Chuan1937 wants to merge 5 commits intoGenericMappingTools:masterfrom
Chuan1937:fix
Open

pstext -D[j|J] is broken#8921
Chuan1937 wants to merge 5 commits intoGenericMappingTools:masterfrom
Chuan1937:fix

Conversation

@Chuan1937
Copy link
Member

@Chuan1937 Chuan1937 commented Mar 12, 2026

Add additional check for MC position in gmt_support.

Fixes: #8712
Refixing: #8916

The local test was successful:

The following tests passed:
        doc/scripts/GMT_pstext_clearance.sh
        doc/scripts/GMT_pstext_justify.sh
        test/pstext/ISO-8859-2.sh
        test/pstext/book.sh
        test/pstext/boxtext.sh
        test/pstext/caption.sh
        test/pstext/cliptxtbox.sh
        test/pstext/composite.sh
        test/pstext/corner_justify.sh
        test/pstext/delay.sh
        test/pstext/escape.sh
        test/pstext/filled_font.sh
        test/pstext/labeler.sh
        test/pstext/para_offset.sh
        test/pstext/pstext-l2s.sh
        test/pstext/shade_text.sh
        test/pstext/supersub.sh
        test/pstext/textclip.sh
        test/pstext/utf8.sh

100% tests passed, 0 tests failed out of 19

Total Test time (real) =  16.27 sec

@Chuan1937 Chuan1937 changed the title add additional check for MC position in gmt_support pstext -D[j|J] is broken Mar 12, 2026
@Chuan1937 Chuan1937 requested a review from joa-quim March 12, 2026 13:08
@Chuan1937 Chuan1937 added the bug Something isn't working label Mar 12, 2026
@Chuan1937 Chuan1937 added this to the 6.7.0 milestone Mar 12, 2026
@Chuan1937 Chuan1937 self-assigned this Mar 12, 2026
@joa-quim
Copy link
Member

I still have local failures that seem to be related to this. For example,

        799 - test/psbasemap/radial_labels1.sh (Failed)
        800 - test/psbasemap/radial_labels2.sh (Failed)
        801 - test/psbasemap/radial_labels3.sh (Failed)

They fail because text strings are a bit out of place when compared with references.

@Chuan1937
Copy link
Member Author

I still have local failures that seem to be related to this. For example,

        799 - test/psbasemap/radial_labels1.sh (Failed)
        800 - test/psbasemap/radial_labels2.sh (Failed)
        801 - test/psbasemap/radial_labels3.sh (Failed)

They fail because text strings are a bit out of place when compared with references.

Need to run all the tests, right. I've only run examples related to pstext before. So there are omissions.

@Chuan1937
Copy link
Member Author

In gmt_support.c, the mode property of gmt_smart_justify is extended by adding mode=3/4 as a dedicated branch for pstext -Dj/-DJ. The MC will only trigger on this dedicated branch; the original behavior remains unchanged.

Finally, in three calls in pstext.c, mode is changed from Ctrl->D.justify to Ctrl->D.justify + 2, explicitly routing -Dj/-DJ to the dedicated branch.

Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

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

Now the previously failing test pass.

@seisman
Copy link
Member

seisman commented Mar 14, 2026

But there are still a few new failures in the CI

@Chuan1937
Copy link
Member Author

Chuan1937 commented Mar 14, 2026

But there are still a few new failures in the CI

I can see that CI works. It makes the follow-up easy

@Chuan1937
Copy link
Member Author

Chuan1937 commented Mar 14, 2026

But there are still a few new failures in the CI

@seisman

I don't think these failures are due to my revisions:

The following tests FAILED:
	 80 - doc/scripts/GMT_color_hsv.sh (Failed)
	192 - doc/scripts/GMT_vector.sh (Failed)
	193 - doc/scripts/GMT_vector4.sh (Failed)
	702 - test/mapproject/oblmerc_down.sh (Failed)
	703 - test/mapproject/oblmerc_up.sh (Failed)
Errors while running CTest

@joa-quim
Copy link
Member

I'm afraid they are. If you look on why those tests fail, there is always a text element that changed position.

@Chuan1937
Copy link
Member Author

I tested these 5 tests on the master branch and they all fail there too:

  • GMT_color_hsv.sh (RMS 0.039)
  • GMT_vector.sh (RMS 0.018)
  • GMT_vector4.sh (RMS 0.016)
  • oblmerc_down.sh (RMS 0.011)
  • oblmerc_up.sh (RMS 0.014)

@joa-quim
Copy link
Member

Nope, they pass for me with master.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pstext -D[j|J] is broken

3 participants