Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow FONT_LOGO to change font color #7125

Closed
seisman opened this issue Nov 30, 2022 · 5 comments · Fixed by #7127
Closed

Allow FONT_LOGO to change font color #7125

seisman opened this issue Nov 30, 2022 · 5 comments · Fixed by #7127
Labels
feature request Request a new feature

Comments

@seisman
Copy link
Member

seisman commented Nov 30, 2022

Description of the problem

As shown in the example below, FONT_LOGO can't change the size and color of the timestamp and label.

gmt basemap -R0/10/0/5 -JX5c/3c -Baf -UMylabel --FONT_LOGO=20p,Times-Bold,red -png map

map

Here are two issues:

  1. I understand that the font size can't be changed because the size of the timestamp strings must match the height of the graphic "GMT" logo, but why can't the font color be changed?

  2. The gmt.conf documentation says

    Font to use for text plotted as part of the GMT time logo [theme dependent]. Choose auto for automatic scaling with plot size."

    The description is inaccurate and misleading because the font size can't be scaled automatically.

@seisman seisman added the bug Something isn't working label Nov 30, 2022
@PaulWessel
Copy link
Member

We could change things so that the time stamp, or just the custom label, could take on the color of LOGO_FONT. But I suspect some of the documentation here is stale anyway: The timestamp is a fixed size item that only makes sense for paper copy figures and the size is fixed at 8 points. However, while the width of the time-stamp box is adjusted to fit the font type we could allow the color to change.

Would you just want the -U label to change color or also the date?

So potential changes:

  1. Fix the documentation to state this default only changes the font and the color but not the size which is fixed at 8 points.
  2. Use FONT_LOGO to set the color of the user label
  3. If you agree, also use FONT_LOGO to set the color of the date clock string.

What say you @joa-quim ?

@joa-quim
Copy link
Member

I say that I want something more and had even implemented it but can't find it right now. It was something to add a author, probably in the place of time.
-U is useful for more than just printing.

Will search better tonight.

@joa-quim
Copy link
Member

OK, found it

image

I made it with this syntax -UJ.L.+tGMTSAR+o0/0. I.e., replaced the date-time with something else.

@PaulWessel
Copy link
Member

I suppose we can consider that as a modifier addition. Bedtime up north though.

@seisman seisman added feature request Request a new feature and removed bug Something isn't working labels Dec 1, 2022
@seisman
Copy link
Member Author

seisman commented Dec 1, 2022

  • Fix the documentation to state this default only changes the font and the color but not the size which is fixed at 8 points.
  • Use FONT_LOGO to set the color of the user label
  • If you agree, also use FONT_LOGO to set the color of the date clock string.

Yes, I think these changes all make sense.

I made it with this syntax -UJ.L.+tGMTSAR+o0/0. I.e., replaced the date-time with something else.

The +t modifier also sounds good.

PaulWessel added a commit that referenced this issue Dec 1, 2022
See #7125 for background.  This PR implements the +ttext modifier where text overrides the UNIX time stamp in the box.  Closes #7125.
PaulWessel added a commit that referenced this issue Dec 1, 2022
* Let -U take +ttext to override time stamp

See #7125 for background.  This PR implements the +ttext modifier where text overrides the UNIX time stamp in the box.  Closes #7125.

* Update explain_-U.rst_

* Update gmt_common_longoptions.h

* LOGO not sizeable

* More updates

Remove from list of auto sized features and the corresponding coding.

* Update gmt_init.c

One more fix

* Update doc/rst/source/gmt.conf.rst

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@seisman seisman changed the title Fix the description for FONT_LOGO Allow FONT_LOGO to change font color Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants