latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
243 stars 28 forks source link

'dtls' OpenType feature #34

Open khaledhosny opened 14 years ago

khaledhosny commented 14 years ago

OpenType math specification suggests using a single substitution ('dtls') feature to map dotless forms for math accent placement. It would be nice if unicode-math can use that feature so that \hat{i}, for example, would work without the need to explicitly specify dotless form which might be impossible for some characters (math bold i or j for example as dotless forms of both has no unicode code points AFAIK).

wspr commented 14 years ago

Yes, you're right. Should this be active at all times or only when placing the accent?

khaledhosny commented 14 years ago

Since this is a single substitution table (no context checking etc. on font side), it should be activated conditionally when placing accents.

wspr commented 14 years ago

This may be difficult, then. I can't see an easy way this will work; it's unknown whether an accent will be being placed onto a glyph that is part of the same font.

I suppose when the fonts are being defined another "accent font" can be defined as well that uses +dtls, and then \hat (etc.) could switch fonts only if the accent font exists when it reads its argument.

For now I might simply provide an option to load the font with dtls and leave this bug open for future consideration.

khaledhosny commented 14 years ago

but simply loading the font with +dtls will give dotless i and j every where, why any one would need this. For now, I think (re)defining \i and \j to use a +dtls font if present would be usable enough, assuming this is easy to do.

wspr commented 14 years ago

Oh, whoops! Yes, definitely do not want to turn on +dtls unconditionally :)

I'll look into whether it's possible to switch it on when applying accents only. Thanks again.

wspr commented 14 years ago

I think you mean \imath and \jmath instead of \i and \j. Although I don't see why the latter couldn't also be defined for math-mode. (Opening issue #42 was a mistake on my part. \i and \j don't work in maths even in regular LaTeX.)

khaledhosny commented 14 years ago

I see, though I think if there is no good reason for \i and \j not to work in math, then we would support it as a bonus; much less typing.

wspr commented 14 years ago

Yep, I agree.

khaledhosny commented 13 years ago

I was thinking, we can just define additional font (three fonts for text and scripts) with the dtls feature on by default and then set \imath and sisters to use that font. Automatic use of \imath when an i is followed by accent can be then implemented by some TeX macro magic, though I don't think it is worth the trouble and I recall reading somewhere that should not be done because one might want to accent a dotted glyph.

sergey-s-betke commented 8 years ago

I think, this is font designer task. May be, in .fea font file:

lookup ij_to_dotless {
    lookupflag IgnoreLigatures, MarkAttachmentType @TopMarks;
    sub [i j]' @TopMarks by [dotlessi dotlessj];
} ij_to_dotless;

feature ccmp {
    script DFLT;
        ....;
        lookup ij_to_dotless;
        ....;
script latn;
    language HUN;
                ....;
                lookup ij_to_dotless;
    language DEU;
                ....;
    language PLK;
                ....;
    language ROM;
                ....;
                lookup ij_to_dotless;
    language CSY exclude_dflt;
                ....;
                lookup ij_to_dotless;
    language SKY exclude_dflt;
                ....;
                lookup ij_to_dotless;
script cyrl;
    language RUS;
                lookup cyr_accented_rus;
} ccmp;