Skip to content

Instantly share code, notes, and snippets.

@dohyunkim
Last active August 20, 2026 03:13
Show Gist options
  • Select an option

  • Save dohyunkim/30c8fce6dcb6d44ed8d5fbcc959a7d4c to your computer and use it in GitHub Desktop.

Select an option

Save dohyunkim/30c8fce6dcb6d44ed8d5fbcc959a7d4c to your computer and use it in GitHub Desktop.
lazy mimicking of daum logo
\documentclass[a4paper]{article}
\usepackage{luamplib}
\pagestyle{empty}
\begin{document}
\mpfig
picture pic; path p[]; color c[];
c1 = (1, 0.4, 0.4);
c2 = (1, 0.8, 0.3);
c3 = (0.3, 0.8, 0.3);
c4 = (0.3, 0.5, 1);
pic = mplibglyph "D" of "lmsans10-bold.otf" scaled 1/5;
i:=0; for item within pic: p[incr i] = pathpart item; endfor
fill bbox pic withcolor 1/5white;
mplibdrawglyph pic withshadingmethod "coons"
withcoonspatchinit(
llcorner pic -- point 7 of p1 -- subpath(1,2) of p2 -- cycle,
c1, 1/2[c1,c2], 1/2[c1,c2], c1)
withcoonspatchinit(
subpath(7,7.5) of p1 -- subpath(1/2,1) of p2 -- cycle,
1/2[c1,c2], c2, c2, 1/2[c1,c2])
withcoonspatchinit(
subpath(7.5,8) of p1 -- subpath(0,1/2) of p2 -- cycle,
c2, 1/2[c2,c3], 1/2[c2,c3], c2)
withcoonspatchinit(
subpath(0,1) of p1 -- subpath(4.5,5) of p2 -- cycle,
1/2[c2,c3], c3, c3, 1/2[c2,c3])
withcoonspatchinit(
subpath(1,2) of p1 -- subpath(4,4.5) of p2 -- cycle,
c3, 1/2[c3,c4], 1/2[c3,c4], c3)
withcoonspatchinit(
point 2 of p1 -- ulcorner pic -- subpath(3,4) of p2 -- cycle,
1/2[c3,c4], c4, c4, 1/2[c3,c4])
withcoonspatchinit(
ulcorner pic -- llcorner pic -- subpath(2,3) of p2 -- cycle,
c4, c1, c1, c4)
;
\endmpfig
\mpfig
fill bbox pic withcolor 1/5white;
mplibdrawglyph pic
withshadingmethod "coons"
withcoonspatchinit(boundingbox pic, c1, c2, c3, c4)
;
\endmpfig
\mpfig
for i=0 upto length p1 - 1:
drawdot point i of p1 withpen pencircle scaled 2;
label.urt("$"& decimal i & "$", point i of p1);
endfor
drawarrow p1;
for i=0 upto length p2 - 1:
drawdot point i of p2 withpen pencircle scaled 2;
label.urt("$"& decimal i & "$", point i of p2);
endfor
drawarrow p2;
\endmpfig
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment