Hi, Since most fonts do not have the standard tex ligatures built in, I tend to add them when I load the fonts. Once in a while, I run into fonts where this does not work. See the attached tex/pdf files. I basically load the font as follows: \definefontfeature[tf][arabic][tlig=yes] \definedfont[dejavusansmono*tf] This works fine for DejaVuSansMono and for one Farsi font I use ( https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf) but not for this other Farsi font ( https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf). Perhaps this is because the last font is not standard, but TrueType/OpenType standard is sometimes up for interpretation. I see two strange symptoms here: \showotfcomposition displays the tlig feature differently for the last font. It appears in the "extra" list, not in "basic". Why is that? What does this mean anyway? In the pdf, you see two unicode characters U+647 and U+654 following the numbers and dashes. This usually has a ligature turning the two characters into U+6C0. It happens for VazirRegular but not for Mikhak-Medium. Why is that? I have looked in the font: the ligature exists. I have seen that working in this demo page (https://aminabedi68.github.io/Mikhak/), though it may be hard to spot. Why is that? Is there something about the ordering of OpenType features which causes this behavior, or is there a bug in the font processing code? Best, MHB
On 3/11/2021 2:05 AM, Mohammad Hossein Bateni wrote:
Hi,
Since most fonts do not have the standard tex ligatures built in, I tend to add them when I load the fonts. Once in a while, I run into fonts where this does not work.
See the attached tex/pdf files. I basically load the font as follows:
\definefontfeature[tf][arabic][tlig=yes] \definedfont[dejavusansmono*tf]
This works fine for DejaVuSansMono and for one Farsi font I use (https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf) but not for this other Farsi font (https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf). Perhaps this is because the last font is not standard, but TrueType/OpenType standard is sometimes up for interpretation.
I see two strange symptoms here:
\showotfcomposition displays the tlig feature differently for the last font. It appears in the "extra" list, not in "basic". Why is that? What does this mean anyway?
The font doesn't have endash and emdash so there is nothing to construct from the double - \starttext \definedfont[file:Mikhak-Medium.ttf*default] foo--bar [\char"2013] [\char"2014] \stoptext Just ask the author to add these characters and you're fine. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
That's bad. It seems, I forgot to add the fallbacks properly. I will
reach out to the designer to add those chars.
On Fri, Mar 12, 2021 at 12:32 PM Hans Hagen
On 3/11/2021 2:05 AM, Mohammad Hossein Bateni wrote:
Hi,
Since most fonts do not have the standard tex ligatures built in, I tend to add them when I load the fonts. Once in a while, I run into fonts where this does not work.
See the attached tex/pdf files. I basically load the font as follows:
\definefontfeature[tf][arabic][tlig=yes] \definedfont[dejavusansmono*tf]
This works fine for DejaVuSansMono and for one Farsi font I use ( https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf < https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf>)
but not for this other Farsi font ( https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf < https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf>).
Perhaps this is because the last font is not standard, but TrueType/OpenType standard is sometimes up for interpretation.
I see two strange symptoms here:
\showotfcomposition displays the tlig feature differently for the last font. It appears in the "extra" list, not in "basic". Why is that? What does this mean anyway?
The font doesn't have endash and emdash so there is nothing to construct from the double -
\starttext \definedfont[file:Mikhak-Medium.ttf*default] foo--bar [\char"2013] [\char"2014] \stoptext
Just ask the author to add these characters and you're fine.
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Any idea why the ligature {U+647 and U+654 => U+6C0} does not kick in?
On Fri, Mar 12, 2021 at 7:11 PM Mohammad Hossein Bateni
That's bad. It seems, I forgot to add the fallbacks properly. I will reach out to the designer to add those chars.
On Fri, Mar 12, 2021 at 12:32 PM Hans Hagen
wrote: On 3/11/2021 2:05 AM, Mohammad Hossein Bateni wrote:
Hi,
Since most fonts do not have the standard tex ligatures built in, I tend to add them when I load the fonts. Once in a while, I run into fonts where this does not work.
See the attached tex/pdf files. I basically load the font as follows:
\definefontfeature[tf][arabic][tlig=yes] \definedfont[dejavusansmono*tf]
This works fine for DejaVuSansMono and for one Farsi font I use ( https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf < https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf>)
but not for this other Farsi font ( https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf < https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf>).
Perhaps this is because the last font is not standard, but TrueType/OpenType standard is sometimes up for interpretation.
I see two strange symptoms here:
\showotfcomposition displays the tlig feature differently for the last font. It appears in the "extra" list, not in "basic". Why is that? What does this mean anyway?
The font doesn't have endash and emdash so there is nothing to construct from the double -
\starttext \definedfont[file:Mikhak-Medium.ttf*default] foo--bar [\char"2013] [\char"2014] \stoptext
Just ask the author to add these characters and you're fine.
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Umm... the fallbacks are correct. My conclusion is that tlig does not work
when the character is not in the font itself. Is that the case? Is this a
bug or a feature?
\starttext
\definefontfallback[fall][dejavusansmono][0-0xfffff][check=yes,force=no]
\definefontsynonym[Test][file:Mikhak-Medium.ttf][fallbacks=fall]
\definefontfeature[tf][arabic][tlig=yes]
\definedfont[Test*tf]
foo--bar
[\char"2013]
[\char"2014]
\stoptext
On Fri, Mar 12, 2021 at 7:13 PM Mohammad Hossein Bateni
Any idea why the ligature {U+647 and U+654 => U+6C0} does not kick in?
On Fri, Mar 12, 2021 at 7:11 PM Mohammad Hossein Bateni
wrote: That's bad. It seems, I forgot to add the fallbacks properly. I will reach out to the designer to add those chars.
On Fri, Mar 12, 2021 at 12:32 PM Hans Hagen
wrote: On 3/11/2021 2:05 AM, Mohammad Hossein Bateni wrote:
Hi,
Since most fonts do not have the standard tex ligatures built in, I tend to add them when I load the fonts. Once in a while, I run into fonts where this does not work.
See the attached tex/pdf files. I basically load the font as follows:
\definefontfeature[tf][arabic][tlig=yes] \definedfont[dejavusansmono*tf]
This works fine for DejaVuSansMono and for one Farsi font I use ( https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf < https://github.com/rastikerdar/vazir-font/blob/master/dist/Vazir-Regular.ttf>)
but not for this other Farsi font ( https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf < https://github.com/aminabedi68/Mikhak/blob/master/Font/ttf/Mikhak-Medium.ttf>).
Perhaps this is because the last font is not standard, but TrueType/OpenType standard is sometimes up for interpretation.
I see two strange symptoms here:
\showotfcomposition displays the tlig feature differently for the last font. It appears in the "extra" list, not in "basic". Why is that? What does this mean anyway?
The font doesn't have endash and emdash so there is nothing to construct from the double -
\starttext \definedfont[file:Mikhak-Medium.ttf*default] foo--bar [\char"2013] [\char"2014] \stoptext
Just ask the author to add these characters and you're fine.
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 3/13/2021 2:01 AM, Mohammad Hossein Bateni wrote:
Umm... the fallbacks are correct. My conclusion is that tlig does not work when the character is not in the font itself. Is that the case? Is this a bug or a feature?
\starttext
\definefontfallback[fall][dejavusansmono][0-0xfffff][check=yes,force=no] \definefontsynonym[Test][file:Mikhak-Medium.ttf][fallbacks=fall] \definefontfeature[tf][arabic][tlig=yes] \definedfont[Test*tf] foo--bar [\char"2013] [\char"2014] \stoptext ... or a misunderdstanding:
\starttext \definefontfallback[myfallback][dejavuserif*default][0x02d,0x2013,0x2014][check=yes,force=yes] \definefontsynonym[mytestfont][file:Mikhak-Medium.ttf][fallbacks=myfallback] \definedfont[mytestfont*arabic] foo--ofo---oof [\char"002D] [\char"2013] [\char"2014] \stoptext for a ligature to be made all the glyphs involved have to come from the same font I think you should wikify this (also because the font once complete is a nice one to use in examples), Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Added some notes to the wiki:
https://wiki.contextgarden.net/Featuresets#Open-type_features
On Sat, Mar 13, 2021 at 3:12 AM Hans Hagen
On 3/13/2021 2:01 AM, Mohammad Hossein Bateni wrote:
Umm... the fallbacks are correct. My conclusion is that tlig does not work when the character is not in the font itself. Is that the case? Is this a bug or a feature?
\starttext
\definefontfallback[fall][dejavusansmono][0-0xfffff][check=yes,force=no]
\definefontsynonym[Test][file:Mikhak-Medium.ttf][fallbacks=fall] \definefontfeature[tf][arabic][tlig=yes] \definedfont[Test*tf] foo--bar [\char"2013] [\char"2014] \stoptext
... or a misunderdstanding:
\starttext
\definefontfallback[myfallback][dejavuserif*default][0x02d,0x2013,0x2014][check=yes,force=yes]
\definefontsynonym[mytestfont][file:Mikhak-Medium.ttf][fallbacks=myfallback] \definedfont[mytestfont*arabic] foo--ofo---oof [\char"002D] [\char"2013] [\char"2014] \stoptext
for a ligature to be made all the glyphs involved have to come from the same font
I think you should wikify this (also because the font once complete is a nice one to use in examples),
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 3/13/2021 1:13 AM, Mohammad Hossein Bateni wrote:
Any idea why the ligature {U+647 and U+654 => U+6C0} does not kick in? because it's not defined as ligature
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Mohammad Hossein Bateni