TikZ-PGF Xetex Ornaments – How to Draw Special Vintage Borders Ornaments

ornamental-fontspgfornamentpsvectoriantikz-pgfxetex

Hello I would like to do something similar to this image :
enter image description here

My goal is to get the four ornaments in the corner like on the picture, and ornaments on the border joining them. I made the ornaments in the corners with following code :

%% [ESO-PIC & PGFORNAMENT ] %%
\newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{%
 \put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
 }}%
\newcommand\AtPageLowerRight[1]{\AtPageLowerLeft{%
 \put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
 }}%


\AddToShipoutPictureBG{%
   \AtPageUpperLeft{\put(5,-30){\pgfornament[width=1.75cm]{61}}}
   \AtPageUpperRight{\put(-55,-30){\pgfornament[width=1.75cm,symmetry=v]{61}}}
   \AtPageLowerLeft{\put(5,30){\pgfornament[width=1.75cm,symmetry=h]{61}}}
   \AtPageLowerRight{\put(-55,30){\pgfornament[width=1.75cm,symmetry=c]{61}}}
   }

Nevertheless, I struggle to draw the fancy borders : the main one bolder than the second, as on the picture. In the corner the borders get to a shape that I got no idea how to replicate ; plus there are somewhat aligned with the ornament in the corner. Also the thiner border is integrated to the ornament with noticeable small loops.

I'm overwhelmed by all the drawing and got literally no idea how to do it ; much help will be welcomed !

I would prefer a latex-drawned vector version rather than an image placed on the page.

I hope that I made myself clear, thanks in advance and happy sunday 🙂

Best Answer

So, I learned tikz and made the following :

enter image description here

Pretty happy with the result :)

My code is based on the answer by esdd on this post.

\documentclass{article}
\usepackage[margin=4cm,a4paper]{geometry}
\usepackage[object=vectorian]{pgfornament}
\usepackage{xfp}
\usetikzlibrary{calc}
\usepackage{blindtext}
\usepackage[manualmark]{scrlayer-scrpage}
% scrlayer-scrpage %
\clearpairofpagestyles
\addtokomafont{pagehead}{\color{blue!50!green!80!black}\large}
\chead*{The current page style is \toplevelpagestyle{} \ifstr{\toplevelpagestyle}{\currentpagestyle}{}{as alias for \currentpagestyle}.}
\cfoot*{\pagemark}


\newcommand\om{5mm}% ornament margin
\newcommand\ow{2cm}% ornament width
\newcommand\oh{2cm}% ornament height
\newcommand\ols{0mm}% ornament line shift %1.5mm
\newcommand\on{63}% ornament number
\newcommand\magicOrnamentOffset{0.25cm}

\def\lencorner{2}
\def\lencornerdivtwo{\fpeval{\lencorner/{2}}}
\def\lencornerdivthree{\fpeval{\lencorner/{3}}}
\newcommand\lencornerdivthreecm{\lencornerdivthree cm}
\newcommand\lencornerdivtwocm{\lencornerdivtwo cm}


\colorlet{bordercolor}{black}
\tikzset{mainborder/.style={line width=0.65mm}}
\tikzset{thinborder/.style={line width=0.2mm}}

% define the border and save it in a box
\newsavebox\border
\sbox\border{%
\tikz[color=bordercolor]{
  \useasboundingbox(0,0)rectangle(\paperwidth,-\paperheight);
  
  % ornaments %
  \foreach[count=\i]\a/\p/\s in {%
  north west/{\om,-\om}/none,
  north east/{{\paperwidth-\om},-\om}/v,
  south east/{{\paperwidth-\om},{-\paperheight+\om}}/c,%
  south west/{\om,{-\paperheight+\om}}/h%
  }\node[anchor=\a](n\i) at (\p){\pgfornament[width=\ow,height=\oh, symmetry=\s]{\on}};

  \begin{scope}[mainborder]
    %% lines %%
    \draw ([yshift=-\ols]n1.north east) -- ([yshift=-\ols]n2.north west);
    \draw ([xshift=-\ols]n2.south east) -- ([xshift=-\ols]n3.north east);
    \draw ([yshift=\ols]n3.south west) -- ([yshift=\ols]n4.south east) ;
    \draw ([xshift=\ols]n4.north west) -- ([xshift=\ols]n1.south west);
    %% corners %%
    % top left %
    \coordinate (B) at ([xshift=-\lencornerdivthreecm, yshift=-\lencornerdivthreecm]n1.north east);
    \coordinate (C) at ([xshift=\lencornerdivthreecm, yshift=-\lencornerdivthreecm]n1.north west);
    \draw (n1.south west) arc (180:90:\lencornerdivthree) -- (C) -- (B) arc (180:90:\lencornerdivthree);
    % bottom left %
    \coordinate (Y) at ([xshift=\lencornerdivthreecm, yshift=\lencornerdivthreecm]n4.south west);
    \coordinate (Z) at ([xshift=-\lencornerdivthreecm, yshift=\lencornerdivthreecm]n4.south east);
    \draw (n4.north west) arc (180:270:\lencornerdivthree) -- (Y) -- (Z) arc (180:270:\lencornerdivthree);
    % top right %
    \coordinate (S) at ([xshift=-\lencornerdivthreecm, yshift=-\lencornerdivthreecm]n2.north east);
    \coordinate (T) at ([xshift=-\lencornerdivthreecm, yshift=\lencornerdivthreecm]n2.south east);
    \draw (n2.north west) arc (90:0:\lencornerdivthree) -- (S) -- (T) arc (90:0:\lencornerdivthree);
    % bottom right %
    \coordinate (F) at ([xshift=-\lencornerdivthreecm, yshift=-\lencornerdivthreecm]n3.north east);
    \coordinate (G) at ([xshift=-\lencornerdivthreecm, yshift=\lencornerdivthreecm]n3.south east);
    \draw (n3.south west) arc (-90:0:\lencornerdivthree) -- (G) -- (F) arc (-90:0:\lencornerdivthree);
  \end{scope}

  %% [thin borders] %%
  \begin{scope}[thinborder]
    % top left
    \coordinate (topLeftBottom) at ([xshift=\ols+3mm, yshift=-3mm]n1.south west); %down
    \coordinate (topLeftTop) at ([xshift=3mm, yshift=\ols-3mm]n1.north east); %up
    \coordinate (topLeftCenter) at ([yshift=-\lencornerdivtwocm-\magicOrnamentOffset, xshift=\lencornerdivtwocm+\magicOrnamentOffset]n1.north west);
    % bottom left
    \coordinate (bottomLeftBottom) at ([xshift=+3mm, yshift=\ols+3mm]n4.south east);
    \coordinate (bottomLeftTop) at ([xshift=\ols+3mm, yshift=3mm]n4.north west);
    \coordinate (bottomLeftCenter) at ([yshift=\lencornerdivtwocm+\magicOrnamentOffset, xshift=\lencornerdivtwocm+\magicOrnamentOffset]n4.south west);
    % bottom right
    \coordinate (bottomRightBottom) at ([xshift=-3mm, yshift=\ols+3mm]n3.south west);
    \coordinate (bottomRightTop) at ([xshift=-\ols-3mm, yshift=3mm]n3.north east);
    \coordinate (bottomRightCenter) at ([yshift=\lencornerdivtwocm+\magicOrnamentOffset, xshift=-\lencornerdivtwocm-\magicOrnamentOffset]n3.south east); 
    % top right
    \coordinate (topRightBottom) at ([xshift=\ols-3mm, yshift=-\ols-3mm]n2.south east);
    \coordinate (topRightTop) at ([xshift=-\ols-3mm, yshift=-\ols-3mm]n2.north west);
    \coordinate (topRightCenter) at ([yshift=-\lencornerdivtwocm-\magicOrnamentOffset, xshift=-\lencornerdivtwocm-\magicOrnamentOffset]n2.north east); 
    %% lines %%
    \draw (topLeftTop) -- (topRightTop); % top
    \draw (bottomRightBottom) -- (bottomLeftBottom) ; % bottom 
    \draw (topRightBottom) -- (bottomRightTop); % right
    \draw (bottomLeftTop) -- (topLeftBottom); % left 
    %% top left %%
    % loops %
    \draw (topLeftBottom) arc (180:0:0.2) arc (0:-180:0.1) coordinate (topLeftLower); % bottom
    \draw (topLeftTop) arc (90:270:0.2) arc (-90:90:0.1) coordinate (topLeftUpper); %top
    % brackets to center %
    \draw (topLeftCenter) to [in=90, out=280] (topLeftLower); % left
    \draw (topLeftUpper) to [in=0, out=175] (topLeftCenter); % right
    %% bottom left %%
    % loops %
    \draw (bottomLeftBottom) arc (270:90:0.2) arc (90:-90:0.1) coordinate (bottomLeftLower);
    \draw (bottomLeftTop) arc (-180:0:0.2) arc (0:180:0.1) coordinate (bottomLeftUpper);
    % brackets to center %
    \draw (bottomLeftCenter) to [in=175, out=0] (bottomLeftLower); % left
    \draw (bottomLeftUpper) to [in=90, out=280] (bottomLeftCenter); % right
    %% bottom right %%
    %% loops %%
    \draw (bottomRightBottom) arc (-90:90:0.2) arc (90:270:0.1) coordinate (bottomRightLower);
    \draw (bottomRightTop) arc (0:-180:0.2) arc (180:0:0.1) coordinate (bottomRightUpper);
    %% brackets to center %
    \draw (bottomRightCenter) to [in=0, out=175] (bottomRightLower);
    \draw (bottomRightUpper) to  [in=90, out=280] (bottomRightCenter);
    %% top right %%
    % loops %
    \draw (topRightBottom) arc (0:180:0.2) arc (-180:0:0.1) coordinate (topRightLower);
    \draw (topRightTop) arc (90:-90:0.2) arc (270:90:0.1) coordinate (topRightUpper);
    % brackets to center %
    \draw (topRightCenter) to [in=90, out=280] (topRightLower);
    \draw (topRightUpper) to  [in=175, out=0] (topRightCenter);
  \end{scope}
}}


% define a switch to enable and disable the border
\newif\ifBorder
% define a new layer
\DeclareNewLayer[{%
    background,
    page,
    contents={\ifBorder\usebox\border\fi}
  }]{border.bg}
% add the border layer to all layer page styles (scrheadings, plain, empty, ...) ...
\AddLayersAtBeginOfPageStyle{@everystyle@}{border.bg}
% but no border on empty pages 
\AddToLayerPageStyleOptions{empty}{oninit=\Borderfalse}

\begin{document}
\Bordertrue

\Blindtext
\clearpage

\pagestyle{empty}
\Blindtext[10]
\clearpage

\pagestyle{plain}
\Blindtext
\end{document}

Feel free to ask questions if needed and if somebody knows a better way to do this or how to improve my code feel free to explain :)

Related Question