[lltx] fontspec push

Khaled Hosny khaledhosny at eglug.org
Mon Mar 8 12:51:45 CET 2010


On Mon, Mar 08, 2010 at 08:09:24PM +1030, Will Robertson wrote:
> Hi,
> 
> Found some time to concentrate on fontspec for a little while this
> evening. (Khaled, I'm sorry to keep doing this to you, but does this
> work under LuaTeX yet? I'm still having issues with luaotfload and
> external fonts on Mac OS X. I've been working with the code that was
> breaking before, so I might have fixed things up
> accidentally-on-purpose.)

The original issue with setting script/language is now fixed.

> Added the following "programmer's interface" with, I suspect, more to
> come eventually. Does this all make sense? More importantly, does
> fontspec even compile documents for you still?

This code doesn't work, I get:

! Undefined control sequence.
\fontspec_check_lang:n ...,"\l_fontspec_script_tl 
                                                  ")}
l.9 \fontspec_if_language:nTF {ROM}
                                    {True}{False?}/
? 

It seems \l_fontspec_script_tl is undefined by the time this function is
called.
I think a cleaner aproach is to call fontspec.check_ot_lang() etc.
directly instead of \fontspec_check_lang:n, i.e:

--- a/fontspec.dtx
+++ b/fontspec.dtx
@@ -2378,7 +2378,11 @@ command should be used to declare a new, \eg,
\feat{PurpleColor} feature:
     \ifzf at icu
       \int_set:Nn \c at zf@script
         {\use:c {g_fontspec_script_num_(\zf at family)_tl}}
-      \fontspec_check_lang:n {#1}
+      \xetex_or_luatex:nn {
+        \fontspec_check_lang:n {#1}
+      }{
+        \luadirect{fontspec.check_ot_lang("zf at basefont", "#1", "latn")}
+      }
       \if at tempswa
         \prg_return_true:
       \else

(it can be done in a better way, but I think you got the idea. You
should not be afraid of using lua ;)
Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer



More information about the lualatex-dev mailing list