ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Character translation with Luaotfload
@ 2017-04-15  8:42 Hans Åberg
  2017-04-16 10:51 ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Åberg @ 2017-04-15  8:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Since Luaotfload is extracted from ConTeXt, I figure people here will know this:

In the code below, math mode '.' and ',' are translated into ':'and ';', which seems to occur because that is what ASCII/Unicode has in those positions, unlike CMMI. So how to correct this?

The issue is really trying to find get texinfo.tex working with Unicode fonts using LuaTeX, as it probably does not work with ConTeXt. (Later versions of the former use LuaTeX UTF-8 directly without translations.)

----
\input luaotfload.sty

\font\stix={file:STIX-Regular.otf} at 10pt
\font\stixit={name:STIXMath-Regular} at 10pt
\font\stixsc={file:STIX-Regular.otf} at 7pt
\font\stixscsc={file:STIX-Regular.otf} at 5pt
\stix

\textfont0=\stix
\textfont1=\stixit  % Translates ',' into ';'.
\scriptfont0=\stixsc
\scriptscriptfont0=\stixscsc
\scriptfont1=\stixsc
\scriptscriptfont1=\stixscsc
\textfont2=\stix
\textfont3=\stix

Hello 𝑃, ±, $𝑥 = ±𝑦_𝑃$,
$$𝑃_0, …, 𝑃_{𝑘 - 1} ⊢ 𝑃.$$

\end
----

___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-15  8:42 Character translation with Luaotfload Hans Åberg
@ 2017-04-16 10:51 ` Hans Hagen
  2017-04-16 13:06   ` Hans Åberg
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2017-04-16 10:51 UTC (permalink / raw)
  To: ntg-context

On 4/15/2017 10:42 AM, Hans Åberg wrote:
> Since Luaotfload is extracted from ConTeXt, I figure people here will know this:
>
> In the code below, math mode '.' and ',' are translated into ':'and ';', which seems to occur because that is what ASCII/Unicode has in those positions, unlike CMMI. So how to correct this?
>
> The issue is really trying to find get texinfo.tex working with Unicode fonts using LuaTeX, as it probably does not work with ConTeXt. (Later versions of the former use LuaTeX UTF-8 directly without translations.)
>
> ----
> \input luaotfload.sty
>
> \font\stix={file:STIX-Regular.otf} at 10pt
> \font\stixit={name:STIXMath-Regular} at 10pt
> \font\stixsc={file:STIX-Regular.otf} at 7pt
> \font\stixscsc={file:STIX-Regular.otf} at 5pt
> \stix
>
> \textfont0=\stix
> \textfont1=\stixit  % Translates ',' into ';'.
> \scriptfont0=\stixsc
> \scriptscriptfont0=\stixscsc
> \scriptfont1=\stixsc
> \scriptscriptfont1=\stixscsc
> \textfont2=\stix
> \textfont3=\stix
>
> Hello 𝑃, ±, $𝑥 = ±𝑦_𝑃$,
> $$𝑃_0, …, 𝑃_{𝑘 - 1} ⊢ 𝑃.$$

There is a luatex-math.tex file in the context distribution that you can 
look in .. basically you need to define the proper math character 
mapping (context ship swith a plain setup too).

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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 10:51 ` Hans Hagen
@ 2017-04-16 13:06   ` Hans Åberg
  2017-04-16 13:49     ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Åberg @ 2017-04-16 13:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


> On 16 Apr 2017, at 12:51, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 4/15/2017 10:42 AM, Hans Åberg wrote:
>> Since Luaotfload is extracted from ConTeXt, I figure people here will know this:
>> 
>> In the code below, math mode '.' and ',' are translated into ':'and ';', which seems to occur because that is what ASCII/Unicode has in those positions, unlike CMMI. So how to correct this?
>> 
>> The issue is really trying to find get texinfo.tex working with Unicode fonts using LuaTeX, as it probably does not work with ConTeXt. (Later versions of the former use LuaTeX UTF-8 directly without translations.)
> 
> There is a luatex-math.tex file in the context distribution that you can look in .. basically you need to define the proper math character mapping (context ship swith a plain setup too).

It works with texinfo: just include it, but it seems keeping luatex-math.lua in the directory speeds up compilation. I used the code below at the beginning of the .texi file.

----
\input luaotfload.sty
\input luatex-math.tex

\font\stix={file:STIX-Regular.otf}

\input texinfo @c -*-texinfo-*-
@textfont0=@stix
@textfont1=@stix
@scriptfont1=@stix
@scriptscriptfont1=@stix

----


___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 13:06   ` Hans Åberg
@ 2017-04-16 13:49     ` Hans Hagen
  2017-04-16 14:11       ` Hans Åberg
  2017-04-16 17:06       ` Hans Åberg
  0 siblings, 2 replies; 10+ messages in thread
From: Hans Hagen @ 2017-04-16 13:49 UTC (permalink / raw)
  To: Hans Åberg, mailing list for ConTeXt users

On 4/16/2017 3:06 PM, Hans Åberg wrote:
>
>> On 16 Apr 2017, at 12:51, Hans Hagen <pragma@wxs.nl> wrote:
>>
>> On 4/15/2017 10:42 AM, Hans Åberg wrote:
>>> Since Luaotfload is extracted from ConTeXt, I figure people here will know this:
>>>
>>> In the code below, math mode '.' and ',' are translated into ':'and ';', which seems to occur because that is what ASCII/Unicode has in those positions, unlike CMMI. So how to correct this?
>>>
>>> The issue is really trying to find get texinfo.tex working with Unicode fonts using LuaTeX, as it probably does not work with ConTeXt. (Later versions of the former use LuaTeX UTF-8 directly without translations.)
>>
>> There is a luatex-math.tex file in the context distribution that you can look in .. basically you need to define the proper math character mapping (context ship swith a plain setup too).
>
> It works with texinfo: just include it, but it seems keeping luatex-math.lua in the directory speeds up compilation. I used the code below at the beginning of the .texi file.

i don't understand the speed issue ... maybe you need to adapt the 
texinput path variable so that it can find the file in the tex tree

> ----
> \input luaotfload.sty
> \input luatex-math.tex
>
> \font\stix={file:STIX-Regular.otf}

Just look into the luatex-math.tex file to see how to properly define a 
math family set, you can create a \stix macro analogue to the 
\lucidabright and \latinmodern ones.

fwiw, here i test plain with:

mtxrun --script plain --make

and

mtxrun --script plain somefile

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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 13:49     ` Hans Hagen
@ 2017-04-16 14:11       ` Hans Åberg
  2017-04-16 17:06       ` Hans Åberg
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Åberg @ 2017-04-16 14:11 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


> On 16 Apr 2017, at 15:49, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 4/16/2017 3:06 PM, Hans Åberg wrote:
>> 
>> It works with texinfo: just include it, but it seems keeping luatex-math.lua in the directory speeds up compilation. I used the code below at the beginning of the .texi file.
> 
> i don't understand the speed issue ... maybe you need to adapt the texinput path variable so that it can find the file in the tex tree

I have two LuaTeX, one is from texlive/2016, and the other from you site (on MacOS). The latter does not work on its own, so I must choose the former.

> 
>> ----
>> \input luaotfload.sty
>> \input luatex-math.tex
>> 
>> \font\stix={file:STIX-Regular.otf}
> 
> Just look into the luatex-math.tex file to see how to properly define a math family set, you can create a \stix macro analogue to the \lucidabright and \latinmodern ones.

I may be beyond my programming abilities: The texinfo.tex file overrides the font, it seems, so I just hacked up something that works. :-)


___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 13:49     ` Hans Hagen
  2017-04-16 14:11       ` Hans Åberg
@ 2017-04-16 17:06       ` Hans Åberg
  2017-04-16 17:41         ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Åberg @ 2017-04-16 17:06 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


> On 16 Apr 2017, at 15:49, Hans Hagen <pragma@wxs.nl> wrote:
> 
> Just look into the luatex-math.tex file to see how to properly define a math family set, you can create a \stix macro analogue to the \lucidabright and \latinmodern ones.

This works in the test example, but not the texinfo file, perhaps because it changes the escape character.


___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 17:06       ` Hans Åberg
@ 2017-04-16 17:41         ` Hans Hagen
  2017-04-16 18:20           ` Hans Åberg
                             ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hans Hagen @ 2017-04-16 17:41 UTC (permalink / raw)
  To: Hans Åberg; +Cc: mailing list for ConTeXt users

On 4/16/2017 7:06 PM, Hans Åberg wrote:
>
>> On 16 Apr 2017, at 15:49, Hans Hagen <pragma@wxs.nl> wrote:
>>
>> Just look into the luatex-math.tex file to see how to properly define a math family set, you can create a \stix macro analogue to the \lucidabright and \latinmodern ones.
>
> This works in the test example, but not the texinfo file, perhaps because it changes the escape character.

maybe .. i never used texinfo myself .. maybe it's not that complex to 
make a context texinfo module that just has what is needed on top of a 
macro package (after all it has a syntax definition so parsing and 
mapping onto some configureable set of context commands is no biug deal) 
... on the other hand,. i think it is meant as stand alone package so 
better try to get opentype fonts working in it

basically you can do this:

-- load a luatex plain
-- load texinfo
-- redefine some macros that deal with fonts

-- load the source to be processed

the texinfo code looks quite clean so overloading some should be doable 
(if you know what to overload)

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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 17:41         ` Hans Hagen
@ 2017-04-16 18:20           ` Hans Åberg
  2017-04-18 16:45           ` Hans Åberg
  2017-06-13 12:51           ` Hans Åberg
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Åberg @ 2017-04-16 18:20 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


> On 16 Apr 2017, at 19:41, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 4/16/2017 7:06 PM, Hans Åberg wrote:
>> 
>>> On 16 Apr 2017, at 15:49, Hans Hagen <pragma@wxs.nl> wrote:
>>> 
>>> Just look into the luatex-math.tex file to see how to properly define a math family set, you can create a \stix macro analogue to the \lucidabright and \latinmodern ones.
>> 
>> This works in the test example, but not the texinfo file, perhaps because it changes the escape character.
> 
> maybe .. i never used texinfo myself .. maybe it's not that complex to make a context texinfo module that just has what is needed on top of a macro package (after all it has a syntax definition so parsing and mapping onto some configureable set of context commands is no biug deal) ... on the other hand,. i think it is meant as stand alone package so better try to get opentype fonts working in it

It is unclear what exact relation it might have to LuaTex and ConTeXt, but an interesting issue, though.

> basically you can do this:
> 
> -- load a luatex plain
> -- load texinfo
> -- redefine some macros that deal with fonts
> 
> -- load the source to be processed
> 
> the texinfo code looks quite clean so overloading some should be doable (if you know what to overload)

Probably best to let the Texinfo people do it, as an important part is to be able to generate a host of different formats.


___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 17:41         ` Hans Hagen
  2017-04-16 18:20           ` Hans Åberg
@ 2017-04-18 16:45           ` Hans Åberg
  2017-06-13 12:51           ` Hans Åberg
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Åberg @ 2017-04-18 16:45 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


> On 16 Apr 2017, at 19:41, Hans Hagen <pragma@wxs.nl> wrote:
> 
> basically you can do this:
> 
> -- load a luatex plain
> -- load texinfo
> -- redefine some macros that deal with fonts
> 
> -- load the source to be processed
> 
> the texinfo code looks quite clean so overloading some should be doable (if you know what to overload)

It probably must be integrated into the Texinfo setup, because though one can hack the .texi source file for LuaTeX, it fails in the generation of other formats.

But it would be nice if one could run ConTeXt and have access to its typesetting capabilities.


___________________________________________________________________________________
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] 10+ messages in thread

* Re: Character translation with Luaotfload
  2017-04-16 17:41         ` Hans Hagen
  2017-04-16 18:20           ` Hans Åberg
  2017-04-18 16:45           ` Hans Åberg
@ 2017-06-13 12:51           ` Hans Åberg
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Åberg @ 2017-06-13 12:51 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


> On 16 Apr 2017, at 19:41, Hans Hagen <pragma@wxs.nl> wrote:
> 
> basically you can do this:
> 
> -- load a luatex plain
> -- load texinfo
> -- redefine some macros that deal with fonts
> 
> -- load the source to be processed
> 
> the texinfo code looks quite clean so overloading some should be doable (if you know what to overload)

Do you have any ideas on how to run .texi files with ConTeXt? The texinfo.tex file has already been hacked for LuaTeX, so it looks complicated to get around that, among other things.


___________________________________________________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2017-06-13 12:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15  8:42 Character translation with Luaotfload Hans Åberg
2017-04-16 10:51 ` Hans Hagen
2017-04-16 13:06   ` Hans Åberg
2017-04-16 13:49     ` Hans Hagen
2017-04-16 14:11       ` Hans Åberg
2017-04-16 17:06       ` Hans Åberg
2017-04-16 17:41         ` Hans Hagen
2017-04-16 18:20           ` Hans Åberg
2017-04-18 16:45           ` Hans Åberg
2017-06-13 12:51           ` Hans Åberg

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