Skip to content

Instantly share code, notes, and snippets.

@nst
Created March 24, 2025 11:24
Show Gist options
  • Save nst/382caefb8c766a2c1448557fa470a341 to your computer and use it in GitHub Desktop.
Save nst/382caefb8c766a2c1448557fa470a341 to your computer and use it in GitHub Desktop.
%!PS
% Nicolas Seriot
% 2025-03-24
<< /PageSize [300 300] >> setpagedevice
/datetime (%Calendar%) currentdevparams def
/H datetime /Hour get def
/M datetime /Minute get def
/Times-Roman findfont 24 scalefont setfont
H ( ) cvs 120 30 moveto show
(:) 145 30 moveto show
M ( ) cvs 155 30 moveto show
/x 150 def
/y 170 def
/r 100 def
% Clock circle
newpath
x y r 0 360 arc
stroke
x y translate
% Side marks
gsave
0 1 59 {
r 0 moveto
5 mod 0 eq {
3 setlinewidth
r 0.85 mul 0 lineto
} {
1 setlinewidth
r 0.95 mul 0 lineto
} ifelse
stroke
6 rotate
} for
grestore
% Hours hand
gsave
360 12 div H mul
360 12 div 60 div M mul add
neg rotate
0 0 moveto
0 r 0.5 mul lineto
3 setlinewidth
stroke
grestore
% Minutes hand
gsave
360 60 div M mul
neg rotate
0 0 moveto
0 r 0.8 mul lineto
1 setlinewidth
stroke
grestore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment