ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* tlig feature sometimes does not work
@ 2021-03-11  1:05 Mohammad Hossein Bateni
  2021-03-12 17:32 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Mohammad Hossein Bateni @ 2021-03-11  1:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1463 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1977 bytes --]

[-- Attachment #2: tlig.tex --]
[-- Type: text/x-tex, Size: 399 bytes --]

\starttext
\def\example{1--2
1---3
هٔ
}
\setupalign[r2l]
\definefontfeature[tf][arabic][tlig=yes]
\definedfont[dejavusansmono*tf]
\example

\definedfont[vazirregular*tf]
\example

\definedfont[mikhak-medium*tf]
\example

\lefttoright
\showotfcomposition{dejavusansmono*tf}{}{1--2 هٔ}
\showotfcomposition{vazirregular*tf}{}{1--2 هٔ}
\showotfcomposition{mikhak-medium*tf}{}{1--2 هٔ}

\stoptext

[-- Attachment #3: tlig.pdf --]
[-- Type: application/pdf, Size: 29762 bytes --]

[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-14  3:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11  1:05 tlig feature sometimes does not work Mohammad Hossein Bateni
2021-03-12 17:32 ` Hans Hagen
2021-03-13  0:11   ` Mohammad Hossein Bateni
2021-03-13  0:13     ` Mohammad Hossein Bateni
2021-03-13  1:01       ` Mohammad Hossein Bateni
2021-03-13  8:12         ` Hans Hagen
2021-03-14  3:18           ` Mohammad Hossein Bateni
2021-03-13  8:00       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).