On 2/2/07, Hans Hagen wrote:
> 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:

I would default to "name:"

> 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

Great!

I need to try to run these, but I like the syntax. Although it would
probably make sense to default to "name" (so: no brackets,
\def\fontfilesome#1{"#1"}) under XeTeX. Those fonts that come as .otf
are relatively rare and for those (I have Polish fonts in mind)
ConTeXt can provide ready typescripts with "file:" prefix. I assume
that for most users it would be an overhead having to write "name:"
for each single font that they want to use, and most such fonts are
probably installed on the system.

There is one more thing though. I'm taking these from Adam's notes on the wiki:

\definefontsynonym
    [DidotCaps]
    ['Didot:mapping=tex-text;
         Letter Case=Small Capitals;Ligatures=!Common Ligatures']
    [encoding=uc]

I have to check the state of special features in case of
[this/syntay/for/fonts.otf], but is it possible that the colon might
interfere with definitions such as the one above?

Now I need to actualy run your code on some examples ...

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

Reply via email to