# [XeTeX] Very nasty bug with accented greek capitals in some fonts (TL 2010)

Nikos Platis nplatis at freemail.gr
Wed Oct 6 22:49:49 CEST 2010

On Tue, Oct 5, 2010 at 21:26, Alexey Kryukov <anagnost at yandex.ru> wrote:

> I believe this is not a bug but rather the intended behavior. Since
> Greek accented capitals are normally used only in titlecase, some font
> designers map unaccented glyphs to the corresponding slots, while
> contextual rules are used to replace them with accented variants when
> followed by a lowercase letter. Thus the capitalization rules in
> Greek are handled. Particularly I find this approach too extreme (and
> actually wrong), but nevertheless it is quite popular.
>
> Anyway, you can check if this is the case if you type several words
> starting from an accented letter (instead of the accented letter alone)
> and make sure contextual alternates are enabled.
>

This seems to be an issue of contextual rules indeed. However:

a) Greek accented capitals can be used very often: words starting with
an accented vowel can easily be found at the beginning of a sentence,
so the vowel should be accented. (Some greek newspapers and magazines
are removing the accent in this case, possibly for (their own)
aesthetic reasons, but this is clearly wrong.)

b) If I use the font as

\setmainfont[Contextuals=NoAlternate]{Candara}

I am actually getting the intended result. So, under TL2010 (or
probably due to the newer version of fontspec) the default is *to use*
contextual alternates. Under TL2009 the behaviour is reversed, I have
to set "Contextuals=Alternate" to get the outcome originally reported.

I am not sure whether this change of default behaviour is welcome (But
is it a matter of fontspec's defaults or of the font's defaults? -- I
don't know).

c) By enabling contextual alternates one magically gets the correct
capitalization of some difficult cases, for example

\uppercase{γάιδαρος}  gives "ΓΑΪΔΑΡΟΣ"

d) Unfortunately, this whole system does not always work correctly.
The following xelatex document produces the results shown here:
http://img829.imageshack.us/img829/6197/61263374.jpg
Any errors are underlined.

I don't know which of these errors are a result of the rules embedded
in the font or whether some of them are due to xetex/fontspec.
Particularly strange is the behaviour of SmallCaps.
Any info (or pointers on how to find out more) would be appreciated.

Nikos Platis

---------------------
\documentclass[a4paper,10pt]{article}
\usepackage{fontspec}
\setmainfont[Contextuals=Alternate]{Corbel}
\begin{document}
ά Ά έ Έ ή Ή ί Ί ϊ Ϊ ΐ ό Ό ύ Ύ ϋ Ϋ ΰ ώ Ώ

Μαΐου

Όμως

άυλος αυλός

Uppercase: \uppercase{άυλος αυλός γάιδαρος Άυλος Αυλός}

SmallCaps: \textsc{άυλος αυλός γάιδαρος Άυλος Αυλός}
\end{document}
---------------------