4

I'm trying to quote a bible verse in two different languages and using yinipar. The output looks good until I zoom in to the first letter of the verse. It turns out that this big letter has a considerably low quality respect of the rest of the text and the more zoom in, the more the edges and borders look weird. The following image shows the undesired effect. First letter with fewer quality

The question is simple. Is it possible to enhance or improve the quality of the first letter, or is it just a matter of my PDF viewer (in this case Okular)?

Here there's the MWE:

\documentclass[10pt,final]{article}
\usepackage[utf8]{inputenc}
\usepackage{calligra}
\usepackage[paperwidth=21cm, paperheight=10.5cm, top=4mm, left=8mm, right=8mm, bottom=4mm]{geometry}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[object=vectorian]{pgfornament}
\usepackage{tikz}
\usepackage{pgothic}
\usepackage{cinzel}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{yfonts}
\usepackage[protrusion]{microtype}

\usetikzlibrary{positioning,calc}
\colorlet{Verde}{green!55!blue!80!white}
\colorlet{Amarillo}{yellow!10}

\usepackage{background}
\newcommand{\pageornament}{%

\begin{tikzpicture}[remember picture, overlay]
      \coordinate (SI) at ($(current page.north west) + (0.5cm,-0.5cm)$);
      \coordinate (SD) at ($(current page.north east) + (-0.5cm,-0.5cm)$);
      \coordinate (ID) at ($(current page.south east) + (-0.5cm,0.5cm)$);
      \coordinate (II) at ($(current page.south west) + (0.5cm,0.5cm)$);
      \coordinate[below right = 1mm of SI] (RSI);
      \coordinate[below left = 1mm of SD] (RSD);
      \coordinate[above right = 1mm of II] (RII);
      \coordinate[above left = 1mm of ID] (RID);
  \fill[Verde!50,rounded corners=3pt] (SI) rectangle (ID);
\fill[Amarillo,rounded corners=1.5pt] (RSD) rectangle (RII);
     \node[below right=10cm of SI, font=\Huge\calligra, gray] {};
     \node[font=\Huge, below right=5cm of SI] {};

      \node[anchor=north west] at ($(current page.north west) + (0.5cm,-0.5cm)$){%
      \pgfornament[width = 2cm,color = Verde,opacity=0.5]{41}};
      \node[anchor=north east] at ($(current page.north east) + (-0.5cm,-0.5cm)$){%
      \pgfornament[width=2cm,symmetry=v,color = Verde,opacity=0.5]{41}};
      \node[anchor=south west] at ($(current page.south west) + (0.5cm,0.5cm)$){%
      \pgfornament[width=2cm,symmetry=h,color = Verde,opacity=0.5]{41}};
      \node[anchor=south east] at ($(current page.south east) + (-0.5cm,0.5cm)$){%
      \pgfornament[width=2cm,symmetry=c,color = Verde, opacity=0.5]{41}};
      \node[anchor=south] at ($(current page.south) + (0cm,0.5cm)$){%
      \pgfornament[width=0.5\textwidth,color = Verde, opacity=0.5]{88}};  
   \end{tikzpicture}
  }
\begin{document}
\pageornament
\vspace*{2\baselineskip}

 \begin{minipage}[l]{0.43\textwidth}
\yinipar{\color{Verde}D}{och} segen soll über alle kommen, die allein auf mich, den herrn, ihr vertrauen setzen! sie sind wie 
bäume, die am 
wasser stehen und ihre wurzeln zum bach hin ausstrecken. sie fürchten nicht die glühende hitze; ihr laub bleibt grün und frisch. selbst 
wenn der regen ausbleibt, leiden sie keine not. nie hören sie auf, frucht zu tragen.
\end{minipage}
\hspace*{-1cm}\hfil
 \begin{minipage}[r]{0.43\textwidth}
 \vspace*{-\baselineskip}
\yinipar{\color{Verde}B}{endito} el varón que se fía 
en jehová, y cuya confianza es jehová. porque él será como el árbol plantado junto a las aguas, que junto a la 
corriente echará sus raíces, y no verá cuando viniere el calor, sino que su hoja estará verde; y en el año de sequía no se fatigará, ni 
dejará de hacer fruto.
\end{minipage}

\vspace{0.25\baselineskip}
\begin{minipage}[l]{0.45\textwidth}
\centering
\small\calligra{Jeremiah 17:7-8}
\end{minipage}
\hfill
\begin{minipage}[l]{0.45\textwidth}
\centering
\small\calligra{Jeremías 17:7-8}
\end{minipage}
\hfill
\end{document}
5
  • 1
    you must be using xetex or luatex as you use fontspec, so don't load inputenc (it generates a warning about that) Oct 19, 2016 at 20:18
  • 1
    I don't know if the initial font is available in type1 form, the original version was in metafont so bitmaps can be generated at arbitrarily high resolutions but if you decide on say 300dpi then if you scale in it will of course show the pixel resolution Oct 19, 2016 at 20:19
  • 2
    Unfortunately, the yinitas font is only available as bitmap.
    – egreg
    Oct 19, 2016 at 20:21
  • I tried not to load inputenc but the problem persists. It seems I'll have to get used to it.
    – Charlie
    Oct 19, 2016 at 20:22
  • 1
    inputenc isn't related to the fonts used. as you are using xe or lua tex the alternative is just to use any initial font on your system or you find on a web search for free initial fonts, unlike classic tex where metafont fonts were the main option, you can use any font you can find these days, most will be in scalable formats such as type1 or opentype Oct 19, 2016 at 20:24

3 Answers 3

5

As you are using xelatex you can use the otf-version:

\documentclass{article}

\usepackage{fontspec}
\usepackage{xcolor}
\colorlet{Verde}{green!55!blue!80!white}
\newfontface\yinit{Yinit.otf}[Scale=5]
\makeatletter
\newcommand{\yinipar}[1]{\setbox0=\hbox{\yinit{#1}}%
\hangindent=\wd0\hangafter=-4\advance\hangindent by .25em
{\dimen@=-3\baselineskip
\dimen@=\baselinestretch\dimen@
\hskip-\wd0 \hskip-.25em
\raisebox{\dimen@}[0pt][0pt]{\unhbox0}\hskip.25em}}
\begin{document}
\begin{minipage}[l]{0.43\textwidth}
\yinipar{\color{Verde}D}{och} segen soll über alle kommen, die allein auf mich, den herrn, ihr vertrauen setzen! sie sind wie
bäume, die am
wasser stehen und ihre wurzeln zum bach hin ausstrecken. sie fürchten nicht die glühende hitze; ihr laub bleibt grün und frisch. selbst
wenn der regen ausbleibt, leiden sie keine not. nie hören sie auf, frucht zu tragen.
\end{minipage}


\end{document}

enter image description here

3
  • Hi Ulrike, thanks for your answer. Unfortunately, the new font isn't 100% aligned with respect of the following text, as it is shown in the picture I posted above. What can I do?
    – Charlie
    Oct 24, 2016 at 19:56
  • I changed the scale down to 4 and it works, but I guess the font still isn't fully aligned to the text. Probably my eyes just don't realize it.
    – Charlie
    Oct 24, 2016 at 20:01
  • Change the scale factor, it was late and I didn't really try to optimize the size. Or use lettrine as suggested by Beenhard. Oct 24, 2016 at 20:01
4

The yinitas font is only available as bitmap and will be included as a Type3 font. Such fonts can be created at whatever resolution is needed, provided a suitable mode is found.

In your case it seems that 2400dpi is sufficient.

Now the problem is to persuade XeTeX into using such resolution. Here's one.

Prepare a simple file such as

\pdfpkmode={supre}
\pdfpkresolution=2400

\font\x=yinitas \x

A

\bye

and compile it with pdftex. This will automatically run Metafont and create a bitmap font for yinitas at 2400dpi.

Now run XeLaTeX on your document with

xelatex -output-driver="xdvipdfmx -r 2400" charlie

(charlie.tex is the name I used for my test, use the right file name, of course).

I tried with a mode supporting a much higher resolution, but yinitas doesn't compile.

It compiles when the mode is linolttz and the resolution is 3386.

3

There is now an open type version of the font: yinit-otf, so it can be used and zoomed at will with fontspec and xe/lualatex. Here is a code which uses \lettrine rather than the \yinitpar command from yfonts:

\documentclass[10pt,final]{article}
%\usepackage[utf8]{inputenc}
\usepackage{calligra}
\usepackage[paperwidth=21cm, paperheight=10.5cm, top=4mm, left=8mm, right=8mm, bottom=4mm]{geometry}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[object=vectorian]{pgfornament}
\usepackage{tikz}
\usepackage{pgothic}
\usepackage{cinzel}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{yfonts}
\usepackage{lettrine}
 \usepackage[protrusion]{microtype}

\usetikzlibrary{positioning,calc}
\colorlet{Verde}{green!55!blue!80!white}
\colorlet{Amarillo}{yellow!10}

\usepackage{background}
\newcommand{\pageornament}{%

\begin{tikzpicture}[remember picture, overlay]
      \coordinate (SI) at ($(current page.north west) + (0.5cm,-0.5cm)$);
      \coordinate (SD) at ($(current page.north east) + (-0.5cm,-0.5cm)$);
      \coordinate (ID) at ($(current page.south east) + (-0.5cm,0.5cm)$);
      \coordinate (II) at ($(current page.south west) + (0.5cm,0.5cm)$);
      \coordinate[below right = 1mm of SI] (RSI);
      \coordinate[below left = 1mm of SD] (RSD);
      \coordinate[above right = 1mm of II] (RII);
      \coordinate[above left = 1mm of ID] (RID);
  \fill[Verde!50,rounded corners=3pt] (SI) rectangle (ID);
\fill[Amarillo,rounded corners=1.5pt] (RSD) rectangle (RII);
     \node[below right=10cm of SI, font=\Huge\calligra, gray] {};
     \node[font=\Huge, below right=5cm of SI] {};

      \node[anchor=north west] at ($(current page.north west) + (0.5cm,-0.5cm)$){%
      \pgfornament[width = 2cm,color = Verde,opacity=0.5]{41}};
      \node[anchor=north east] at ($(current page.north east) + (-0.5cm,-0.5cm)$){%
      \pgfornament[width=2cm,symmetry=v,color = Verde,opacity=0.5]{41}};
      \node[anchor=south west] at ($(current page.south west) + (0.5cm,0.5cm)$){%
      \pgfornament[width=2cm,symmetry=h,color = Verde,opacity=0.5]{41}};
      \node[anchor=south east] at ($(current page.south east) + (-0.5cm,0.5cm)$){%
      \pgfornament[width=2cm,symmetry=c,color = Verde, opacity=0.5]{41}};
      \node[anchor=south] at ($(current page.south) + (0cm,0.5cm)$){%
      \pgfornament[width=0.5\textwidth,color = Verde, opacity=0.5]{88}};
   \end{tikzpicture}
  }

\newfontface\Yinit{Yinit}
\renewcommand\LettrineFontHook{\color{Verde}\Yinit}

\begin{document}

\pageornament
\vspace*{2\baselineskip}\par
 \begin{minipage}[l]{0.43\textwidth}
\lettrine{D}{och}
segen soll über alle kommen, die allein auf mich, den herrn, ihr vertrauen setzen! sie sind wie
bäume, die am
wasser stehen und ihre wurzeln zum bach hin ausstrecken. sie fürchten nicht die glühende hitze; ihr laub bleibt grün und frisch. selbst
wenn der regen ausbleibt, leiden sie keine not. nie hören sie auf, frucht zu tragen.
\end{minipage}
\hspace*{-1cm}\hfil
 \begin{minipage}[r]{0.43\textwidth}
 \vspace*{-\baselineskip}
\lettrine{B}{endito} el varón que se fía
en jehová, y cuya confianza es jehová. porque él será como el árbol plantado junto a las aguas, que junto a la
corriente echará sus raíces, y no verá cuando viniere el calor, sino que su hoja estará verde; y en el año de sequía no se fatigará, ni
dejará de hacer fruto.
\end{minipage}

\vspace{0.25\baselineskip}
\begin{minipage}[l]{0.45\textwidth}
\centering
\small\calligra{Jeremiah 17:7-8}
\end{minipage}
\hfill
\begin{minipage}[l]{0.45\textwidth}
\centering
\small\calligra{Jeremías 17:7-8}
\end{minipage}
\hfill

\end{document} 

enter image description here enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .