16

I was wondering, what if there actually was a way to produce kashida-like typography in Hebrew in LaTeX. Not necessary as paragraph text, even as an image (nobody prints books like that to the best of my knowledge, but just for ethnographic exercise it would be nice).

To give you a sense of what it may look like: a traditional hand-written text:

enter image description here

A (not so modern font, this one however was cast in lead, of that I'm sure) reminiscent of this feature:

enter image description here

barlop
  • 103
wvxvw
  • 769
  • @AlanMunn mmmm no :) This isn't about layout, it's about elongated letters (Hebrew, like Arabic can be written in such way that emphasized letters have their horizontal bars stretched). This doesn't really have use in modern language, but if you wanted to write something that looks traditional, that would be the way to do it. – wvxvw Jan 01 '15 at 19:21
  • Ok. The only implementation of kashida that I know of is implemented in the xepersian package, which of course deals with Arabic script, not Hebrew. I don't know enough to know what would be involved to adapt it, but it's a place to start. The relevant source file is kashida-xepersian.def. – Alan Munn Jan 01 '15 at 19:29
  • @AlanMunn Yes, that package gave the idea that it might be possible, but it's different in Hebrew. In Arabic there's a special character, which you just add more of it, and you get longer letters, e.g. (normal book كتاب book with a very long "t" كتــــاب) But Hebrew Unicode doesn't seem to have such character (or maybe I'm wrong, and would be happy to find that out), or maybe I need to use some special font that has longer characters. – wvxvw Jan 01 '15 at 19:33
  • 4
    afaik it is only permissible to elongate the letters א, ד, ה, כ, ל, ם, ר, ת. Unicode has them as HEBREW LETTER WIDE ALEF etc on FB21--FB28. So it would be possible to use these to a mock the handwriting style. But as your scans show, this is only a crude simplification of the actual tradition and a more flexible solution would be needed. – Florian May 26 '16 at 18:54
  • @Florian oh, that's interesting, thanks for the info! – wvxvw May 27 '16 at 08:06
  • 5
    The Culmus Project has the wide letters of which Florian speaks in its Frank Ruehl CLM, Hadasim CLM, Keter Aram Tsova, Keter YG, Shofar Regular, and Simple CLM, which define a jalt feature for Hebrew justification alternates. One can imagine a font with a range of widths selected through stylistic sets, but it seems not to exist yet. Wide Hebrew letters are found in very few commercial fonts, and often the encoding is wrong, such that the text would be inaccessible. – Thérèse Jul 05 '16 at 01:05
  • 2
    A different approach is to develop a similar package to this https://tug.org/TUGboat/tb35-3/tb111haralambous.pdf, which is for arabic. – yannisl Oct 17 '17 at 05:07
  • 3
    It seems the answer is: Not yet. To summarise: For elongated characters, (a) the font must have the wide characters (e.g., Coelacanth does); (b) the font must have the jalt Justification Alternates font feature (e.g., Shofar does, for script='hebr'); (c) the font feature must be activated (fontspec does not support jalt: Table 5, p 40, v2.7c); (d) the font renderer must be able to handle the feature (e.g., in experiments, Word doesn't, for Hebrew; and HarfBuzz "knows nothing about ... lines", so can't help with justification); (e) there must be a justification context. – Cicada Oct 05 '19 at 06:35

1 Answers1

6

The old-fashioned way, without relying on jalt or renderers:

(1) Using lamed as an example, for a certain size and a certain font, typeset the glyph as a standalone pdf.

the lamed (actual size)

\documentclass[12pt]{standalone}
\usepackage{fontspec}
\setmainfont[Script=Hebrew]{FreeSerif}\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguages{hebrew}

\begin{document}
{\texthebrew{ﬥ}}
\end{document}

(2) Then, with the graphicx package (or adjustbox, an extension of it), includegraphics{} lamed back in again three times, triming the pdf/glyph into three parts: left, middle, and right.

(3) And, lastly, multiply the middle out a number of times.

example wide

(top row: narrow and wide glyphs in the font)

(middle row: wide glyph divided into three parts)

(bottom row: the middle part multiplied)


\documentclass[12pt]{article}
%\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{fontspec}
\setmainfont[Script=Hebrew]{FreeSerif}\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguages{hebrew}

\newcommand\lleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{lamedw}}
\newcommand\lmid{\includegraphics[clip,trim=0.15em 0em 0.3em 0em]{lamedw}}
\newcommand\lright{\adjincludegraphics[clip,trim=0.4em 0em 0em 0em]{lamedw}}

\begin{document}

\texthebrew{ﬥ}\texthebrew{ל}

\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{lamedw}
\includegraphics[clip,trim=0.15em 0em 0.3em 0em]{lamedw}
\adjincludegraphics[clip,trim=0.4em 0em 0em 0em]{lamedw}
\texthebrew{ﬥ}

\lleft\lmid\lright \lleft\lmid\lmid\lmid\lright
\lleft\lmid\lmid\lmid\lmid\lmid\lmid\lright



\end{document}

Edited to add:

It may be wortwhile to add the code snippets for the others, to save users having to type, because the trim can be slightly different between the glyphs.

This code be done in a loop.

In the preamble:


\newcommand\hleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{hew}}
\newcommand\hmid{\includegraphics[clip,trim=0.16em 0em 0.3em 0em]{hew}}
\newcommand\hright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{hew}}

\newcommand\dleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{daletw}}
\newcommand\dmid{\includegraphics[clip,trim=0.16em 0em 0.3em 0em]{daletw}}
\newcommand\dright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{daletw}}


\newcommand\kleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{kafw}}
\newcommand\kmid{\includegraphics[clip,trim=0.16em 0em 0.3em 0em]{kafw}}
\newcommand\kright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{kafw}}


\newcommand\mleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{memw}}
\newcommand\mmid{\includegraphics[clip,trim=0.16em 0em 0.3em 0em]{memw}}
\newcommand\mright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{memw}}

\newcommand\rleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{reshw}}
\newcommand\rmid{\includegraphics[clip,trim=0.16em 0em 0.3em 0em]{reshw}}
\newcommand\rright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{reshw}}



\newcommand\tleft{\includegraphics[trim=0pt 0pt 6pt -2pt,clip]{tavw}}
\newcommand\tmid{\includegraphics[clip,trim=0.18em 0em 0.3em 0em]{tavw}}
\newcommand\tright{\adjincludegraphics[clip,trim=0.4em 0em -0.10em 0em]{tavw}}

In the document:


\texthebrew{ﬢ}\texthebrew{ד}

\dleft\ 
\dmid\ 
\dright\ 
\texthebrew{ﬢ}

\dleft\dmid\dright \dleft\dmid\dmid\dmid\dright
\dleft\dmid\dmid\dmid\dmid\dmid\dmid\dright


\texthebrew{ﬣ}\texthebrew{ה}

\hleft\ 
\hmid\ 
\hright\ 
\texthebrew{ﬣ}

\hleft\hmid\hright \hleft\hmid\hmid\hmid\hright
\hleft\hmid\hmid\hmid\hmid\hmid\hmid\hright


\texthebrew{ﬤ}\texthebrew{כ}

\kleft\ 
\kmid\ 
\kright\ 
\texthebrew{ﬤ}

\kleft\kmid\kright \kleft\kmid\kmid\kmid\kright
\kleft\kmid\kmid\kmid\kmid\kmid\kmid\kright


\texthebrew{ﬦ}\texthebrew{ם}

\mleft\ 
\mmid\ 
\mright\ 
\texthebrew{ﬦ}

\mleft\mmid\mright \mleft\mmid\mmid\mmid\mright
\mleft\mmid\mmid\mmid\mmid\mmid\mmid\mright



\texthebrew{ﬧ}\texthebrew{ר}

\rleft\ 
\rmid\ 
\rright\ 
\texthebrew{ﬧ}

\rleft\rmid\rright \rleft\rmid\rmid\rmid\rright
\rleft\rmid\rmid\rmid\rmid\rmid\rmid\rright


\texthebrew{ﬨ}\texthebrew{ת}

\tleft\ 
\tmid\ 
\tright\ 
\texthebrew{ﬨ}

\tleft\tmid\tright \tleft\tmid\tmid\tmid\tright
\tleft\tmid\tmid\tmid\tmid\tmid\tmid\tright



dalet wide

he wide

kaf wide

mem wide

resh wide

tav wide

which leaves alef, and its diagonal bar, as a special case.

Cicada
  • 10,129