Mojca Miklavec wrote:
> ... much much text .. begging for []'s ...
>
How about this ... no quotes in specs, only file: or name: in front of 
the name, and for xetex we default to filenames using file:

It means that existing defs need to be adapted, but this syntax is 
better than funny " [ ] etc and more extensible (i can intercept the 
prefixes in luatex and treat them accordingly)

\unprotect

\def\donoparsefontspec % #1 == \cs
  {\edef\fontfile{\truefontname\somefontname}%
   \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi
   \checkfontfilename
   \edef\lastfontname{\fontfile\somefontspec}%
   \ifx\fontclass\empty
     \expandafter\definefontlocal
   \else
     \expandafter\definefontglobal
   \fi} % #1 == \cs

\ifnum\contextmarkmode=4

    \let\checkfontfilename\relax

\else

    \def\checkfontfilename
      {\expandafter\docheckfontfilename\fontfile:\empty:\empty\relax}

    \def\docheckfontfilename#1:#2:#3#4\relax
      {\edef\temp{#1}%
       \ifx\temp\v!file
          \edef\fontfile{\fontfilefile{#2}}%
       \else\ifx\temp\v!name
          \edef\fontfile{\fontfilename{#2}}%
       \else
          \edef\fontfile{\fontfilesome{#2}}%
       \fi\fi}

    \def\fontfilename#1{"#1"}
    \def\fontfilefile#1{"#1"}
    \def\fontfilesome#1{"#1"}

    \beginXETEX

        \def\fontfilename#1{"#1"}
        \def\fontfilefile#1{"[#1]"}
        \def\fontfilesome#1{"[#1]"}

    \endXETEX

\fi

\protect

\starttext
    \definefont
        [blabla]
        [name:Latin Modern Something]
    \definefont
        [blabla]
        [file:texnansi-lmr10]
    \blabla test
\stoptext


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to