如何用文字装饰页面边框?

如何用文字装饰页面边框?

我想用指定的字体用文字装饰页面边框。在这里,我使用的是Augie。这个答案如何沿着圆圈书写文字?提供了一些指导。我设置了path距离rectangle页面边缘 2.0 厘米的偏移量作为tikz页面节点的偏移量。但是,文本并没有遵循路径,如图所示。任何指导都将不胜感激。

这是 MWE。

\documentclass[a4paper,svgnames,dvipsnames]{article}
\usepackage[margin=2.25cm,showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.text}
\usetikzlibrary{shapes.geometric, arrows, shadows,positioning}
\usetikzlibrary{calc}
\usepackage{emerald}

\pagestyle{empty}
\setlength{\parindent}{0pt}

\begin{document}

\begin{tikzpicture}

\noindent\path 
    [%rotate=190,
     draw=blue,line width=1.0pt,
     postaction={%
        decoration={%
            text along path,
            text={|\ECFAugie\huge\bfseries|
                {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus metus eget lorem ullamcorper auctor. Vivamus vitae porttitor urna. Nunc aliquet, lectus at gravida semper, tortor odio fringilla elit, et elementum tellus neque eu erat. Sed luctus facilisis ex, eu lobortis mi semper ac. Duis fringilla consequat sem, non interdum ante lacinia vitae. Maecenas vel volutpat urna, eu dignissim dolor. Proin sed metus ante. }
                },
           text align=fit to path,
           reverse path
           },
           decorate}]
       ($ (current page.north west) + (2.0cm,-2.0cm) $) rectangle ($ (current page.south east) + (-2.0cm,2.0cm) $)  ;
\end{tikzpicture}
\end{document}

为了回应@esdd 的评论,我像这样重写了代码,但现在根本没有文本。

\begin{tikzpicture}
\noindent\path 
    [%rotate=190,
     draw=blue,line width=1.0pt,
     postaction={decorate,
                 decoration={text along path,
                             text format delimiters={|}{|},            
                             text={|\ECFAugie\huge\bfseries|Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus metus eget lorem ullamcorper auctor. Vivamus vitae porttitor urna. Nunc aliquet, lectus at gravida semper, tortor odio fringilla elit, et elementum tellus neque eu erat.||},
                             text align=fit to path,
                             reverse path
                            },
                }
           ]
       ($ (current page.north west) + (2.0cm,-2.0cm) $) rectangle ($ (current page.south east) + (-2.0cm,2.0cm) $)  ;
\end{tikzpicture}

在此处输入图片描述

答案1

软件包emeraldAugie字体是 MiKTeX 的一部分。您可以使用

text={|\ECFAugie\huge\bfseries|Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ... ||}

并添加remember picture,overlaytikzpicture选项中。

\documentclass[a4paper,svgnames,dvipsnames]{article}
\usepackage[margin=2.25cm,showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.text}
\usetikzlibrary{shapes.geometric, arrows, shadows,positioning}
\usetikzlibrary{calc}
\usepackage{emerald}

\pagestyle{empty}
\setlength{\parindent}{0pt}

\begin{document}

\begin{tikzpicture}[remember picture,overlay]
\path 
    [%rotate=190,
     draw=blue,line width=1.0pt,
     postaction={%
        decoration={%
            text along path,
            text={|\ECFAugie\huge\bfseries|
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus metus eget lorem ullamcorper auctor. Vivamus vitae porttitor urna. Nunc aliquet, lectus at gravida semper, tortor odio fringilla elit, et elementum tellus neque eu erat. Sed luctus facilisis ex, eu lobortis mi semper ac. Duis fringilla consequat sem, non interdum ante lacinia vitae. Maecenas vel volutpat urna, eu dignissim dolor. Proin sed metus ante. ||
                },
           text align=fit to path,
           reverse path
           },
           decorate}]
       ($ (current page.north west) + (2.0cm,-2.0cm) $) rectangle ($ (current page.south east) + (-2.0cm,2.0cm) $)  ;
\end{tikzpicture}
\end{document}

运行两次结果

在此处输入图片描述

请注意,有一个警告,因为字体似乎没有粗体版本Augie

相关内容