I would like to add one char from otf font in xelatex as ligature. 'łł' = 'some char number in font' How make it? How tell for xelatex this char is a ligature of two letter 'ł' and 'ł'
Find on your system the file tex-text.map
and copy it in the working directory under the name bardzo.map
(or whatever you want). Then append to it a line so that it looks like
; TECkit mapping for TeX input conventions <-> Unicode characters
LHSName "TeX-text"
RHSName "UNICODE"
pass(Unicode)
; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash
U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote
U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote
U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question
; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET
; additions by Bardzo
U+0142 U+0142 <> U+019C ; łł -> LATIN CAPITAL LETTER TURNED M
Of course, instead of U+019C you use the code for your chosen character.
Then run
teckit_compile bardzo.map
which will create a file named bardzo.tec
. Here is a test file:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Heuristica}[Mapping=bardzo]
\begin{document}
``This is an exampłe of `łł' that's transformed.''
\end{document}
If the bardzo.tec
file is in the same directory, this will be the output
-
in my opinion \setmainfont[Mapping=bardzo]{Heuristica} and add it in any othe font for example \newfontfamily\greekfont[Script=Greek,Mapping=bardzo]{FontName} ... – bardzo Dec 18 '14 at 8:17
-
@bardzo Yes, add it to all the definitions of fonts where you need the new ligature. – egreg Dec 18 '14 at 10:17
-
in my system \setmainfont[Mapping=bardzo]{Heuristica} working \setmainfont{Heuristica}[Mapping=bardzo] not working – bardzo Dec 22 '14 at 14:57
-
Am I correct in assuming that this only works with target glyphs that are assigned some Unicode point (be it regular or PUA) in the employed font? – Wrzlprmft Sep 26 '15 at 18:14
-
Ba{\char"XXXX}a
, withXXXX
pointing to whichever character code this glyph has in your font. – Sverre Dec 16 '14 at 22:13