ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] \defineactivecharacter in LMTX + composing characters
@ 2023-08-01 14:18 Hamid,Idris
  2023-08-01 16:09 ` [NTG-context] " Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Hamid,Idris @ 2023-08-01 14:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Dear gang,

It appears that \defineactivecharacter does not work in lmtx:

\starttext
\defineactivecharacter Ḥ  {\d{H}}
\defineactivecharacter ḥ  {\d{h}}
\defineactivecharacter Ṣ  {\d{S}}
\defineactivecharacter ṣ  {\d{s}}
\stoptext

This should not produce any typeset output but in lmtx it does.

Background: The following characters are essential for Arabic transliteration (assuming your email client has the chars):

Ṯṯ Ḥḥ Ḫḫ Ḏḏ Šš Ṣṣ Ḍḍ Ṭṭ Ẓẓ Ġġ Āā Īī Ūū ʿ ʾ

But most really good fonts don't have them, so we have to compose them. Now there are other methods, e.g,

1) \definecharacter Hbottomdot          {\buildtextbottomdot H}

but cannot use it without something like \defineactivecharacter (there's no way we're going back to the bad old days of control sequences for accented chars). That is, we need to be able to say something like

\definecharacter Ḥ          {\buildtextbottomdot H}

But this doesn't work.

The other method

2) \definefontfeature[default][default][compose=yes]

doesn't appear to work either (at least not with, e.g., Minion Pro Opticals).

And even when it used to (somewhat) work (often ugly default results) it did not support utf 02BE and 02BF (ʿ ʾ). So we still need something like

\defineactivecharacter ʿ {\high{c}}
\defineactivecharacter ʾ {\kern.07 em \high{\rotate[rotation=180,location=high]{c}}}

or better

\definecharacter ʿ {\high{c}}
\definecharacter ʾ {\kern.07 em \high{\rotate[rotation=180,location=high]{c}}}

The upshot is that we need a general, configurable solution for this kind of situation.

And please don't say, "Use a different font!" -)

Thank you in advance for any guidance and assistance in this matter.

Best wishes
Idris

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

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

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

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

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

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

* [NTG-context] Re: \defineactivecharacter in LMTX + composing characters
  2023-08-01 14:18 [NTG-context] \defineactivecharacter in LMTX + composing characters Hamid,Idris
@ 2023-08-01 16:09 ` Hans Hagen
  2023-08-02 13:49   ` Hamid,Idris
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2023-08-01 16:09 UTC (permalink / raw)
  To: Hamid,Idris, mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

On 8/1/2023 4:18 PM, Hamid,Idris wrote:
> Dear gang,
> 
> It appears that \defineactivecharacter does not work in lmtx:
> 
> \starttext
> \defineactivecharacter Ḥ  {\d{H}}
> \defineactivecharacter ḥ  {\d{h}}
> \defineactivecharacter Ṣ  {\d{S}}
> \defineactivecharacter ṣ  {\d{s}}
> \stoptext
> 
> This should not produce any typeset output but in lmtx it does.
> 
> Background: The following characters are essential for Arabic transliteration (assuming your email client has the chars):
> 
> Ṯṯ Ḥḥ Ḫḫ Ḏḏ Šš Ṣṣ Ḍḍ Ṭṭ Ẓẓ Ġġ Āā Īī Ūū ʿ ʾ
I'd use a different font but as you want to go cheap ... attached gets 
you going and will give you a few hours playing around with fonts.

Using a scaled c for some c like shape is kind of bad anyway, kind of 
using a comma for an ogonek.

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

[-- Attachment #2: i.tex --]
[-- Type: text/plain, Size: 2142 bytes --]

\startluacode

local function botthing(characters,target,base,accent)
--    if not characters[target] then
        local data1 = characters[base]
        local data2 = characters[accent]
        if data1 and data2 then
            characters[target] = { -- "Ḥ"
                height   = data1.height,
                depth    = (data1.depth or 0) + 0.5*(data2.height or 0),
                width    = data1.width,
                unicode  = target,
                commands = {
                    { "slot", 0, 0x048 },
                    { "left", 0.5*(data2.width  or 0) + 0.5*(data1.width  or 0)},
                    { "down", 0.2*(data2.height or 0) +     (data1.height or 0) },
                    { "slot", 0, 0x2D9, },
                },
            }
        end
--    end
end

local function topthing(characters,target,base,accent)
--    if not characters[target] then
        local data1 = characters[base]
        local data2 = characters[accent]
        if data1 and data2 then
            characters[target] = { -- "Ḥ"
                height   = (data1.height or 0) + 0.5*(data2.height or 0),
                depth    = data1.depth,
                width    = data1.width,
                unicode  = target,
                commands = {
                    { "slot", 0, 0x048 },
                    { "left", 0.5*(data2.width  or 0) + 0.5*(data1.width  or 0) },
                    { "up",   0.5*(data2.height or 0) },
                    { "slot", 0, 0x2D9, },
                },
            }
        end
--    end
end

local function initialize(tfmdata,value)
    if value then
        botthing(tfmdata.characters,0x1E24,0x048,0x2D9)
--        topthing(tfmdata.characters,0x1E24,0x048,0x2D9)
    end
end
local specification = {
    name        = "idrify",
    description = "idrify",
    manipulators = {
        base = initialize,
        node = initialize,
    }
}

fonts.handlers.otf.features.register(specification)
\stopluacode

\definefontfeature[default][default][idrify=yes]

\definedfont[Serif*default @ 11pt]

\showglyphs

Ḥ

\stoptext

[-- Attachment #3: Type: text/plain, Size: 495 bytes --]

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

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

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

* [NTG-context] Re: \defineactivecharacter in LMTX + composing characters
  2023-08-01 16:09 ` [NTG-context] " Hans Hagen
@ 2023-08-02 13:49   ` Hamid,Idris
  0 siblings, 0 replies; 3+ messages in thread
From: Hamid,Idris @ 2023-08-02 13:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen


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

On Aug 1, 2023, 10:09 AM -0600, Hans Hagen <j.hagen@xs4all.nl>, wrote:
** Caution: EXTERNAL Sender **

On 8/1/2023 4:18 PM, Hamid,Idris wrote:
Dear gang,

It appears that \defineactivecharacter does not work in lmtx:

\starttext
\defineactivecharacter Ḥ {\d{H}}
\defineactivecharacter ḥ {\d{h}}
\defineactivecharacter Ṣ {\d{S}}
\defineactivecharacter ṣ {\d{s}}
\stoptext

This should not produce any typeset output but in lmtx it does.

Background: The following characters are essential for Arabic transliteration (assuming your email client has the chars):

Ṯṯ Ḥḥ Ḫḫ Ḏḏ Šš Ṣṣ Ḍḍ Ṭṭ Ẓẓ Ġġ Āā Īī Ūū ʿ ʾ
I'd use a different font but as you want to go cheap ... attached gets
you going and will give you a few hours playing around with fonts.

Many thanks. It would be great to see this developed into a module; see below:
Using a scaled c for some c like shape is kind of bad anyway, kind of
using a comma for an ogonek.

The issue is this: The use of 02BE and 02BF (ʿ ʾ) to transliterate the two glottal stops in Arabic is now standard in scholarship, but the default shape of these two characters is unattractive. So some typesetters began replacing the default half-ring looks with superscript 'c' and superscript mirrored c. Here is a article about this:

http://andreasmhallberg.github.io/typographyofaynandhamza/

Now, as the author notices, the TeX Gyre fonts render 02BE and 02BF as superscript 'c'. (That was added to TeX Gyre at our request many years ago.)

Linked below is a pdf that shows some font rendering of Latin Modern, Pagella, Brill - a nice gratis font for download but with a strange license, so dangerous to use for real work -, and Minion. It also includes a table of composition analysis for each of the transliteration characters.

https://www.dropbox.com/scl/fi/m1e3quht30auzi3rxyhzb/test-transliteration.pdf?rlkey=o18dlm85q2ie80iv0004lynlv&dl=0

Here is the test string:

Ṯṯ Ḥḥ Ḫḫ Ḏḏ Šš Ṣṣ Ḍḍ Ṭṭ Ẓẓ Ġġ Āā Īī Ūū ʿ ʾ

ʿAyn QURʾĀN

The TeX Gyre fonts use superscript c; Brill tries to make the half-rings elegant, and Minion is missing many characters.

Another approach might be to use a breve shape (rotated 90 degrees in either direction) instead of superscript c to represent the half rings. In any case, a good module would facilitate exploration of such possibilities.

Thanks again, Hans.

Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523







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

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

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

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

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

end of thread, other threads:[~2023-08-02 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01 14:18 [NTG-context] \defineactivecharacter in LMTX + composing characters Hamid,Idris
2023-08-01 16:09 ` [NTG-context] " Hans Hagen
2023-08-02 13:49   ` Hamid,Idris

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).