David,

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?

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 projects.nihongoresources.com/downloadables/ucharclasses.tgz <http://projects.nihongoresources.com/downloadables/ucharclasses.tgz>. 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:

\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\latin}{Times New Roman}
\newfontfamily{\cyrillic}{FreeSerif}
\setmainfont{Times New Roman}
\usepackage{ucharclasses}
\setTransitionsForLatin{\latin}{}
\setTransitionsForCJK{\cyrillic}{}
\begin{document}
This is some Engish text, Αυτό είναι ένα κείμενο στην ελληνική γλώσσα and then back to English without any explicit font markup.
\end{document}

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.

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.

- Mike "Pomax" Kamermans
nihongoresources.com

--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to