[XeTeX] "new-babel", was: Ancient Greek hyphenation

Axel Kielhorn A.Kielhorn at web.de
Tue Apr 24 17:51:17 CEST 2007

Am 23.04.2007 um 22:27 schrieb Jonathan Kew:

> I'm not convinced of this. If I'm using \setmainfont{...} to choose
> my overall document font, I don't want each \selectlanguage{...} for
> various European languages to reset the font to some default for each
> language; I want my chosen font to be used for English, French,
> German, Spanish, etc.

That was my intention:
You set a $mainfont, which becomes the default for every language. But 
you can add font-features. (There are different ligatures in polish 
than in german.) Only if the glyphs you need are not part of the 
$mainfont (greek, cyrillic) you define a different font for that 

> What if I switch to a language such as Vietnamese or something
> African that's much less likely to be adequately covered by many
> Roman fonts? Or to a language written in a non-Roman script? Well, we
> could have font selection built into the language-switching command
> for such languages; but it's always going to be tough deciding which
> ones are sufficiently "exotic" to justify this, and there will be
> situations for which we get it wrong.

No, we won't get it wrong since we won't do it.
The user realizes that there is no $specialglyph in $mainfont and 
selects $exoticfont for this language. There should be a warning and 
maybe a black box in draft mode to show this.

You may know which glyphs are in Deja-Vu now, but you won't know which 
glyphs will be there next year, or which are missing from the 6 month 
old version on my computer.

>  Suppose we make \selectlanguage
> {hindi} automatically switch to a Devanagari font... then the user
> chooses a *different* Devanagari font... then will \selectlanguage
> {nepali} revert to *its* default Devanagari font, rather than keeping
> the user's chosen one? This doesn't feel right to me.

The idea is not to have a default font for {nepali}.
In the preamble you set up several fonts:

\setmainfont % for everything
\setlatinfont % overrides $mainfont for latin scripts
\setgreekfont % overrides $mainfont for greek scripts

Unless you define a script-specific font, $mainfont is used.

If you want a different font for french, but use $mainfont in english, 
you select a font in the french language setup.

> The alternative is that we keep font and language separate, so that
> it's up to me as author to either choose a document font that *does*
> adequately cover all the languages I plan to use, or explicitly
> change fonts for the languages where it's necessary.

And define a shortcut to change both at the same time:-)

>  As author, I can
> of course create personal commands that encapsulate a language switch
> and a font switch, according to the needs of the particular document.

> Or if the language-switching package provides appropriate "hooks", I
> can add my chosen font-switches to it on the fly. But I don't think
> we should have language changes causing font changes by default (as
> some Babel languages currently do, IIRC).

That's one of the things I dislike: Packages trying to be clever:
This doesn't work in CMR, thus I use that instead. Only problem is I'm 
using LMR.

> Maybe it would be clearer if \selectlanguage were renamed
> \selecthyphenation or something like that. "Select language" has too
> many possible interpretations.

One of the nice things about \selectlanguage is that you only have to 
modify the definition in the preamble and keep the babel-style commands 
in the body.


More information about the XeTeX mailing list