* unicode subscripts
@ 2010-05-29 16:58 Yury G. Kudryashov
2010-05-30 13:35 ` Hans Hagen
0 siblings, 1 reply; 6+ messages in thread
From: Yury G. Kudryashov @ 2010-05-29 16:58 UTC (permalink / raw)
To: ntg-context
Hi!
Unicode subscripts do not work (at least, in math):
\starttext
$a₀₁₂₃₄₅₆₇₈₉₋₌₊$
\stoptext
prints only "a". The file char-def.lua contains block like this:
[0x2080]={
category="no",
description="SUBSCRIPT ZERO",
direction="en",
linebreak="al",
specials={ "sub", 0x0030 },
unicodeslot=0x2080,
},
Which file should handle this "specials={ "sub", 0x0030 }"?
P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.
___________________________________________________________________________________
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] 6+ messages in thread
* Re: unicode subscripts
2010-05-29 16:58 unicode subscripts Yury G. Kudryashov
@ 2010-05-30 13:35 ` Hans Hagen
2010-05-30 14:52 ` Yury G. Kudryashov
2010-05-30 15:01 ` Khaled Hosny
0 siblings, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2010-05-30 13:35 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Yury G. Kudryashov
[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]
On 29-5-2010 6:58, Yury G. Kudryashov wrote:
> Hi!
>
> Unicode subscripts do not work (at least, in math):
>
> \starttext
> $a₀₁₂₃₄₅₆₇₈₉₋₌₊$
> \stoptext
>
> prints only "a". The file char-def.lua contains block like this:
> [0x2080]={
> category="no",
> description="SUBSCRIPT ZERO",
> direction="en",
> linebreak="al",
> specials={ "sub", 0x0030 },
> unicodeslot=0x2080,
> },
>
> Which file should handle this "specials={ "sub", 0x0030 }"?
>
> P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.
in which case ... do you expect that glyph? or maybe one special for
math? and does its size match the other superscripts that are not in the
font? these super/sub things are historic ballast and not that useful
anyhow, attached a way to deal with it in your document, but you have to
load it explicitly with \usemodule[mathcrap]
as soon as math-stream interpretation (as for instance in msword) is
introduced in mkiv i might consider some collapsing mechanism
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
-----------------------------------------------------------------
[-- Attachment #2: m-mathcrap.mkiv --]
[-- Type: text/plain, Size: 3654 bytes --]
%D \module
%D [ file=m-mathcrap,
%D version=2010.05.30,
%D title=\CONTEXT\ Modules,
%D subtitle=Math Crap,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=PRAGMA ADE]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
%D This is meant for those who want to use the (incomplete and sort of useless)
%D unicode superscripts and subscripts. We should look ahead and collapse them
%D but I will only implement that in calcmath when the need is there. Now the
%D spacing can be somewhat non optimal but probably that does not matter here.
%D
%D \startbuffer
%D $aââââââ
âââââââ$
%D \stopbuffer
%D
%D \typebuffer \blank \getbuffer \blank
\unprotect
\unexpanded\def\mathunicodesupercrap#1{\mathortext{{^{#1}}}{\high{#1}}}
\unexpanded\def\mathunicodesubcrap #1{\mathortext{{_{#1}}}{\low {#1}}}
\ifdefined\installanddefineactivecharacter\else
\def\installanddefineactivecharacter #1 #2% we need this as command
{\normalexpanded{\noexpand\installactivecharacter \utfchar{#1} }%
\defineactivecharacter #1 {#2}}
\fi
\installanddefineactivecharacter "2070 {\mathunicodesupercrap 0}
\installanddefineactivecharacter "00B9 {\mathunicodesupercrap 1}â
\installanddefineactivecharacter "00B2 {\mathunicodesupercrap 2}â
\installanddefineactivecharacter "00B3 {\mathunicodesupercrap 3}â
\installanddefineactivecharacter "2074 {\mathunicodesupercrap 4}
\installanddefineactivecharacter "2075 {\mathunicodesupercrap 5}
\installanddefineactivecharacter "2076 {\mathunicodesupercrap 6}
\installanddefineactivecharacter "2077 {\mathunicodesupercrap 7}
\installanddefineactivecharacter "2078 {\mathunicodesupercrap 8}
\installanddefineactivecharacter "2079 {\mathunicodesupercrap 9}
\installanddefineactivecharacter "207A {\mathunicodesupercrap +}
\installanddefineactivecharacter "207B {\mathunicodesupercrap -}
\installanddefineactivecharacter "207C {\mathunicodesupercrap =}
\installanddefineactivecharacter "207D {\mathunicodesupercrap (}
\installanddefineactivecharacter "207E {\mathunicodesupercrap )}
\installanddefineactivecharacter "207F {\mathunicodesupercrap n}
\installanddefineactivecharacter "2080 {\mathunicodesubcrap 0}
\installanddefineactivecharacter "2081 {\mathunicodesubcrap 1}
\installanddefineactivecharacter "2082 {\mathunicodesubcrap 2}
\installanddefineactivecharacter "2083 {\mathunicodesubcrap 3}
\installanddefineactivecharacter "2084 {\mathunicodesubcrap 4}
\installanddefineactivecharacter "2085 {\mathunicodesubcrap 5}
\installanddefineactivecharacter "2086 {\mathunicodesubcrap 6}
\installanddefineactivecharacter "2087 {\mathunicodesubcrap 7}
\installanddefineactivecharacter "2088 {\mathunicodesubcrap 8}
\installanddefineactivecharacter "2089 {\mathunicodesubcrap 9}
\installanddefineactivecharacter "208A {\mathunicodesubcrap +}
\installanddefineactivecharacter "208B {\mathunicodesubcrap -}
\installanddefineactivecharacter "208C {\mathunicodesubcrap =}
\installanddefineactivecharacter "208D {\mathunicodesubcrap (}
\installanddefineactivecharacter "208E {\mathunicodesubcrap )}
\installanddefineactivecharacter "2090 {\mathunicodesubcrap A}
\installanddefineactivecharacter "2091 {\mathunicodesubcrap E}
\installanddefineactivecharacter "2092 {\mathunicodesubcrap O}
\installanddefineactivecharacter "2093 {\mathunicodesubcrap X}
%installanddefineactivecharacter "2094 {\mathunicodesubcrap ?} % SCHWAA
\protect \endinput
[-- Attachment #3: Type: text/plain, Size: 486 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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unicode subscripts
2010-05-30 13:35 ` Hans Hagen
@ 2010-05-30 14:52 ` Yury G. Kudryashov
2010-05-30 15:22 ` Hans Hagen
2010-05-30 15:01 ` Khaled Hosny
1 sibling, 1 reply; 6+ messages in thread
From: Yury G. Kudryashov @ 2010-05-30 14:52 UTC (permalink / raw)
To: ntg-context
Hans Hagen wrote:
> On 29-5-2010 6:58, Yury G. Kudryashov wrote:
>> Hi!
>>
>> Unicode subscripts do not work (at least, in math):
>>
>> P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.
>
> in which case ... do you expect that glyph? or maybe one special for
> math? and does its size match the other superscripts that are not in the
> font? these super/sub things are historic ballast and not that useful
>
> anyhow, attached a way to deal with it in your document, but you have to
> load it explicitly with \usemodule[mathcrap]
OK, I shall replace all unicode sub/sup scripts with _ and ^.
Is it possible to print some warnings/errors for such crappy characters? As
a user, I don't know in advance which characters are crappy.
___________________________________________________________________________________
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] 6+ messages in thread
* Re: unicode subscripts
2010-05-30 13:35 ` Hans Hagen
2010-05-30 14:52 ` Yury G. Kudryashov
@ 2010-05-30 15:01 ` Khaled Hosny
2010-05-30 15:19 ` Hans Hagen
1 sibling, 1 reply; 6+ messages in thread
From: Khaled Hosny @ 2010-05-30 15:01 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Yury G. Kudryashov
On Sun, May 30, 2010 at 03:35:12PM +0200, Hans Hagen wrote:
> On 29-5-2010 6:58, Yury G. Kudryashov wrote:
> >Hi!
> >
> >Unicode subscripts do not work (at least, in math):
> >
> >\starttext
> >$a₀₁₂₃₄₅₆₇₈₉₋₌₊$
> >\stoptext
> >
> >prints only "a". The file char-def.lua contains block like this:
> > [0x2080]={
> > category="no",
> > description="SUBSCRIPT ZERO",
> > direction="en",
> > linebreak="al",
> > specials={ "sub", 0x0030 },
> > unicodeslot=0x2080,
> > },
> >
> >Which file should handle this "specials={ "sub", 0x0030 }"?
> >
> >P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.
>
> in which case ... do you expect that glyph? or maybe one special for
> math? and does its size match the other superscripts that are not in
> the font? these super/sub things are historic ballast and not that
> useful
>
> anyhow, attached a way to deal with it in your document, but you
> have to load it explicitly with \usemodule[mathcrap]
>
> as soon as math-stream interpretation (as for instance in msword) is
> introduced in mkiv i might consider some collapsing mechanism
Those characters are not intended for use as real sub/superscripts, they
are their for "round trip compatibility" (AKA the source of all Unicode
discrepancies).
--
Khaled Hosny
Arabic localiser and member of Arabeyes.org team
Free font developer
___________________________________________________________________________________
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] 6+ messages in thread
* Re: unicode subscripts
2010-05-30 15:01 ` Khaled Hosny
@ 2010-05-30 15:19 ` Hans Hagen
0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2010-05-30 15:19 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Yury G. Kudryashov
On 30-5-2010 5:01, Khaled Hosny wrote:
> Those characters are not intended for use as real sub/superscripts, they
> are their for "round trip compatibility" (AKA the source of all Unicode
> discrepancies).
indeed, which is why using them is on user's own risk
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] 6+ messages in thread
* Re: unicode subscripts
2010-05-30 14:52 ` Yury G. Kudryashov
@ 2010-05-30 15:22 ` Hans Hagen
0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2010-05-30 15:22 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Yury G. Kudryashov
On 30-5-2010 4:52, Yury G. Kudryashov wrote:
> Hans Hagen wrote:
>
>> On 29-5-2010 6:58, Yury G. Kudryashov wrote:
>>> Hi!
>>>
>>> Unicode subscripts do not work (at least, in math):
>>>
>>> P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.
>>
>> in which case ... do you expect that glyph? or maybe one special for
>> math? and does its size match the other superscripts that are not in the
>> font? these super/sub things are historic ballast and not that useful
>>
>> anyhow, attached a way to deal with it in your document, but you have to
>> load it explicitly with \usemodule[mathcrap]
> OK, I shall replace all unicode sub/sup scripts with _ and ^.
>
> Is it possible to print some warnings/errors for such crappy characters? As
> a user, I don't know in advance which characters are crappy.
there are
\checkcharactersinfont
\removemissingcharacters
(long time not tested)
for sure we can add some checking (for which i need to flag those code
points in the char-def file)
-----------------------------------------------------------------
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] 6+ messages in thread
end of thread, other threads:[~2010-05-30 15:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 16:58 unicode subscripts Yury G. Kudryashov
2010-05-30 13:35 ` Hans Hagen
2010-05-30 14:52 ` Yury G. Kudryashov
2010-05-30 15:22 ` Hans Hagen
2010-05-30 15:01 ` Khaled Hosny
2010-05-30 15:19 ` 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).