ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mohammad Hossein Bateni <bateni@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: tlig feature sometimes does not work
Date: Wed, 10 Mar 2021 20:05:36 -0500	[thread overview]
Message-ID: <CAMHZ1dZQ5Vw9X5NqcgUgXQKKAv5ooWvmDkr8xqhSdahJ6uCH5g@mail.gmail.com> (raw)


[-- 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
___________________________________________________________________________________

             reply	other threads:[~2021-03-11  1:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  1:05 Mohammad Hossein Bateni [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMHZ1dZQ5Vw9X5NqcgUgXQKKAv5ooWvmDkr8xqhSdahJ6uCH5g@mail.gmail.com \
    --to=bateni@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).