Skip to content

Commit bc3d467

Browse files
authored
pstext: fix -M font colors (#8995)
Fix #8989 Assisted-by: Claude Sonnet 4.6
1 parent 4916de4 commit bc3d467

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pstext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ GMT_LOCAL void pstext_output_words (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
200200
if (T->boxflag & 4) mode = PSL_RECT_ROUNDED;
201201
if (T->boxflag & 8) mode = PSL_RECT_CONCAVE;
202202
if (T->boxflag & 16) mode = PSL_RECT_CONVEX;
203+
gmt_setfont (GMT, &T->font); /* Must set font color before psl_paragraphprocess reads PSL_IS_FONT */
203204
if (Ctrl->S.active) { /* Lay down shaded box first */
204205
PSL_setfill (PSL, Ctrl->S.fill.rgb, 0); /* shade color */
205206
PSL_plotparagraphbox (PSL, x + Ctrl->S.off[GMT_X], y + Ctrl->S.off[GMT_Y], T->font.size, text, T->paragraph_angle, T->block_justify, offset, mode);
@@ -210,7 +211,6 @@ GMT_LOCAL void pstext_output_words (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL,
210211
/* Compute text box, draw/fill it, and in the process store the text in the PS file for next command */
211212
PSL_plotparagraphbox (PSL, x, y, T->font.size, text, T->paragraph_angle, T->block_justify, offset, mode);
212213
/* Passing NULL means we typeset using the last stored paragraph info */
213-
gmt_setfont (GMT, &T->font);
214214
PSL_plotparagraph (PSL, x, y, T->font.size, NULL, T->paragraph_angle, T->block_justify);
215215
}
216216
else { /* No box beneath */

0 commit comments

Comments
 (0)