Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pygmt/src/pygmtlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ def _create_logo( # noqa: PLR0915
pheight = 0.739 # Height of letter "P"
plsb = 0.076 # Left side bearing of letter "P"
pstroke = 0.0735 # Stroke thickness of letter "P"
pygmtwidth = 3.262 # Full width of "PyGMT"

match wordmark:
case "vertical":
args_wordmark = {"x": 0, "y": -4.5, "justify": "CT", "font": f"2.4c,{font}"}
# Ensure the same width for the visual logo and wordmark
fontsize = size * 2.0 / pygmtwidth
args_wordmark = {
"x": -size - fontsize * plsb,
"y": -size * 1.125,
"justify": "TL",
"font": f"{fontsize}c,{font}",
"no_clip": True, # Needed because x<xmin.
}
case "horizontal":
# The stroke width matches the outline thickness.
# The left edge of "P" is aligned at y=size * 1.25.
Expand Down Expand Up @@ -268,6 +277,8 @@ def _compass_lines():
halfheight = pheight / 2.0 * fontsize
fig.hlines(y=[-halfheight, halfheight], xmin=size, pen=pen)
fig.vlines(x=[size * 1.25, size * 1.25 + pstroke * fontsize], pen=pen)
elif wordmark == "vertical":
fig.hlines(y=-size * 1.125, pen=pen)

if figname:
fig.savefig(fname=figname)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: dd09fa24c575eabac7659dc49f313f5f
size: 173671
- md5: affb1d00551312eaaf132e8566dd446b
size: 174450
hash: md5
path: test_pygmtlogo_circle_design_vertical.png
Loading