I'm just finishing up a project that involved typesetting text in several languages, while outputting an XML file that defined in X/Y coordinates the position and size of the bounding box surrounding each line of text in the PDF. I used Luatex, because that made it possible to call Lua from Luatex using the \directlua{} command) to pass information to Lua, and to return information from Lua to Luatex using tex.print(). I also used Lua to write the XML file.

Too late, I discovered that LuaTeX botches the rendering of one of the languages, Tamil. Tamil has a complex script, with some typical Indic script features; so presumably LuaTeX would also mess up on other languages with complex scripts. XeTeX of course does just fine at rendering text in complex scripts.

As I say, it's too late to change now, but is there any way I could have done something similar using xetex? That is, called another programming language to output box positions and sizes. I suppose it's possible to write to an XML file in xetex natively, but I'm not sure how I could get the positions and sizes of boxes. My style sheet defines a command, \outputpara{}, that requires the user to specify the X-position of the paragraph, and hence of lines in the paragraph, where line breaks are of course decided on the fly. The command optionally specifies the Y-position of the paragraph, but the Y-position of each line in the paragraph--except the first--is determined by the usual TeX algorithms. Getting TeX to tell me those Y-positions, as well as the vertical size of the box, was the difficult part. But maybe I was missing something obvious?

   Mike Maxwell
   University of Maryland


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

Reply via email to