<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
David,<br>
<br>
<blockquote cite="mid:4C93218C.3020702@ucl.ac.uk" type="cite">OK -
major progress in that I have it all working for the single character
α! But do I /really/ have to go through all 50 odd characters an assign
them to my \greekclass individually? Or is there some sort of
automation mechanism?<br>
</blockquote>
<br>
There are ways to automate the process, but I pretty much already wrote
those, so I might as well put up the package I have sitting here...
it's currently on <a
 href="http://projects.nihongoresources.com/downloadables/ucharclasses.tgz">projects.nihongoresources.com/downloadables/ucharclasses.tgz</a>.
The package supports setting fonts for Unicode "blocks" as well as
informal groups, so you will probably want to simply bind your fonts of
choice to informal "Latin" and "Cyrillic" groups:<br>
<br>
\documentclass{article}<br>
\usepackage{fontspec}<br>
\newfontfamily{\latin}{Times New Roman}<br>
\newfontfamily{\cyrillic}{FreeSerif}<br>
\setmainfont{Times New Roman}<br>
\usepackage{ucharclasses}<br>
\setTransitionsForLatin{\latin}{}<br>
\setTransitionsForCJK{\cyrillic}{}<br>
\begin{document}<br>
This is some Engish text, Αυτό είναι ένα κείμενο στην ελληνική γλώσσα
and then back to English without any explicit font markup.<br>
\end{document}<br>
<br>
The package may throw a warning about the fact that the
"newXeTeXintercharclass" is already defined - I wrote it when that
function was just landing in XeTeX, so the
\RequirePackage{newxetexintercharclass} line in the ucharclasses.sty
file can at this point safely be removed, and
newxetexintercharclass.sty deleted.<br>
<br>
I'll try to clean up the code at least so that it's
current-XeTeX-compatible and put it on CTAN, then see if I can ditch
the forloop package in favour of TeX looping, to speed things up a
little bit. Although likely not by much - until XeTeX supports binding
token sets to a class, rather than individual tokens, and does so using
ranges, it's simply going to bind the entire Unicode range. Package
loading options should help, so that if specific blocks/groups are
specified, only those are loaded and the rest of Unicode is left
untouched, but that'll come later.<br>
<br>
- Mike "Pomax" Kamermans<br>
nihongoresources.com<br>
</body>
</html>