ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [***SPAM***] \setscript blocking \hskip functionality
@ 2013-04-13  2:44 hwitloc
  2013-04-13 11:30 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: hwitloc @ 2013-04-13  2:44 UTC (permalink / raw)
  To: ntg-context


I found that using \setscript{nihongo} breaks the functioning of \hskip.
Here is a minimal example.  MKIV required.  Text source is UTF-8 encoded text.

In the first case without \setscript the Japanese \hskip properly functions, but just after the \setscript macro it fails (without err or mention).  However, it is interesting to note that \hfill does work in both cases with standard alphabet text.


%--------------------------------
\usemodule[simplefonts]
\setmainfont[ipaexm]	% using a font having Japanese characters 

\starttext
\underbars{Without setscript:}

Alphabet\hskip 2cm text
 
    漢字\hskip 2cm 文書

\setscript[nihongo] 
\underbars{With setscript:}

Alphabet\hskip 2cm text 

    漢字\hskip 2cm 文書

\stoptext
%-------------------------------- 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: [***SPAM***] \setscript blocking \hskip functionality
  2013-04-13  2:44 [***SPAM***] \setscript blocking \hskip functionality hwitloc
@ 2013-04-13 11:30 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2013-04-13 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/13/2013 4:44 AM, hwitloc@gmail.com wrote:
>
> I found that using \setscript{nihongo} breaks the functioning of \hskip.
> Here is a minimal example.  MKIV required.  Text source is UTF-8 encoded text.
>
> In the first case without \setscript the Japanese \hskip properly functions, but just after the \setscript macro it fails (without err or mention).  However, it is interesting to note that \hfill does work in both cases with standard alphabet text.
>
>
> %--------------------------------
> \usemodule[simplefonts]
> \setmainfont[ipaexm]	% using a font having Japanese characters
>
> \starttext
> \underbars{Without setscript:}
>
> Alphabet\hskip 2cm text
>
>      漢字\hskip 2cm 文書
>
> \setscript[nihongo]
> \underbars{With setscript:}
>
> Alphabet\hskip 2cm text
>
>      漢字\hskip 2cm 文書
>
> \stoptext
> %-------------------------------- end

It's because spaces are stripped and there is currently no distinction 
in luatex (on the todo list is to tag glue coming from spaces with their 
own subtype). I made a cheat. For the moment only in the japanese 
analyzer but it might also be needed for korean and chinese, so can you 
check that with cjk context users?

\usemodule[art-01]

\enabletrackers[scripts.*]

\definefont[testfont][ipaexm.ttf][script=kana,language=jan]

\startTEXpage
     \startformula test \stopformula \par
     \testfont \startscript[nihongo]\ruledhbox{漢字\hskip 2cm 文 
書}\stopscript\par
     \testfont \startscript[nihongo]\ruledhbox to 7cm{漢字\hfill 文 
書}\stopscript\par
     \testfont \startscript[nihongo]\ruledhbox{漢字文書}\stopscript\par
     \testfont \startscript[nihongo]\ruledhbox{漢字 文書}\stopscript\par
     \testfont \startscript[nihongo]\ruledhbox{漢字\kern 2cm 文 
書}\stopscript\par
     \testfont \startscript[nihongo]\ruledhbox{\hskip 2cm 漢字文 
書}\stopscript\par
\stopTEXpage

\stoptext

I'll upload a new beta.

Btw, what gives these threads a spam subject.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2013-04-13 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-13  2:44 [***SPAM***] \setscript blocking \hskip functionality hwitloc
2013-04-13 11:30 ` 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).