Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fontspec and LuaTeX/XeTeX

167 views
Skip to first unread message

Herbert Voss

unread,
Aug 4, 2011, 12:31:35 PM8/4/11
to
In the following example the double accent is missing.
With pdflatex everything is fine.

\documentclass[]{article}

%\usepackage[T1]{fontenc}

\usepackage{fontspec}

\defaultfontfeatures{Mapping=tex-text}


\setmainfont{TeX Gyre Pagella}

%\usepackage{tgpagella}

\def\Thanh{H\`an~Th\^e\llap{\raise
0.5ex\hbox{\'{}}}~Th\`anh}
\begin{document}


\Thanh


\end{document}

Herbert

This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011)
(format=xelatex 2011.6.29) 4 AUG 2011 18:28
entering extended mode

*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty 2011/02/26 v2.1f Advanced font selection for
XeLaTeX/LuaLaTeX
expl3.sty 2011/06/19 v2478 L3 Experimental code bundle wrapper
l3names.sty 2011/06/19 v2478 L3 Experimental namespace for primitives
l3bootstrap.sty 2011/06/19 v2478 L3 Experimental bootstrap code
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
l3basics.sty 2011/07/04 v2493 L3 Experimental basic definitions
l3expan.sty 2011/06/20 v2480 L3 Experimental argument expansion
l3tl.sty 2011/07/09 v2498 L3 Experimental token lists
l3seq.sty 2011/06/19 v2478 L3 Experimental sequences and stacks
l3int.sty 2011/06/19 v2478 L3 Experimental integers
l3quark.sty 2011/06/19 v2478 L3 Experimental quarks
l3prg.sty 2011/07/06 v2495 L3 Experimental control structures
l3clist.sty 2011/07/09 v2498 L3 Experimental comma separated lists
l3token.sty 2011/07/02 v2491 L3 Experimental token manipulation
l3prop.sty 2011/06/19 v2478 L3 Experimental property lists
l3msg.sty 2011/06/19 v2478 L3 Experimental messages
l3io.sty 2011/06/19 v2478 L3 Experimental input-output operations
l3file.sty 2011/06/19 v2478 L3 Experimental file operations
l3skip.sty 2011/06/19 v2478 L3 Experimental dimensions and skips
l3box.sty 2011/06/19 v2478 L3 Experimental boxes
l3keyval.sty 2011/06/19 v2478 L3 Experimental key-value parsing
l3keys.sty 2011/06/19 v2478 L3 Experimental key-value interfaces
l3fp.sty 2011/06/19 v2478 L3 Experimental floating-point operations
l3luatex.sty 2011/06/19 v2478 L3 Experimental LuaTeX-specific functions
l3toks.sty 2011/06/19 v2478 L3 Experimental token registers
xparse.sty 2011/07/02 v2492 L3 Experimental document command parser
xkeyval.sty 2008/08/13 v2.6a package option processing (HA)
xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
fontspec-patches.sty 2011/02/26 v2.1f Advanced font selection for
XeLaTeX/Lu
aLaTeX
fixltx2e.sty 2006/09/13 v1.1m fixes to LaTeX
fontenc.sty
eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty 2010/11/06 v0.96 provides access to latin accents and
many othe
r characters in Unicode lower plane
fontspec.cfg
***********

Ulrike Fischer

unread,
Aug 5, 2011, 3:41:31 AM8/5/11
to
Am Thu, 04 Aug 2011 18:31:35 +0200 schrieb Herbert Voss:

> In the following example the double accent is missing.
> With pdflatex everything is fine.
>
> \documentclass[]{article}
> %\usepackage[T1]{fontenc}
> \usepackage{fontspec}
> \defaultfontfeatures{Mapping=tex-text}
> \setmainfont{TeX Gyre Pagella}
> %\usepackage{tgpagella}
> \def\Thanh{H\`an~Th\^e\llap{\raise
> 0.5ex\hbox{\'{}}}~Th\`anh}\begin{document}
> \Thanh
> \end{document}

Use \textcircumacute:

\documentclass[]{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{TeX Gyre Pagella}
\def\Thanh{H\`an~Th\textcircumacute{e}~Th\`anh}
\begin{document}

\Thanh
\end{document}

--
Ulrike Fischer

Herbert Voss

unread,
Aug 5, 2011, 4:17:54 AM8/5/11
to
Am 05.08.2011 09:41, schrieb Ulrike Fischer:
> Use \textcircumacute:
>
> \documentclass[]{article}
> \usepackage{fontspec}
> \defaultfontfeatures{Ligatures=TeX}
> \setmainfont{TeX Gyre Pagella}
> \def\Thanh{H\`an~Th\textcircumacute{e}~Th\`anh}
> \begin{document}
>
> \Thanh
> \end{document}

thanks Ulrike, but this is not my point. I can also use
H\`an~Th^^^^1ebf~Th\`an


I want to know _why_ it works with the Type 1 but not with
the OpenType version of Pagella. It must be a problem with
the font or with fontspec.

Herbert

Ulrike Fischer

unread,
Aug 5, 2011, 5:45:50 AM8/5/11
to

Well if you push me so. Looking at the definition of \add@UTF@accent
in xunicode and wading through the \if-branches I would say the
reason is that if the argument of \' is \relax or a space the
command boils down to print only the "combining" char and no accent
at all. It looks like a bug to me. It works if I move the ending
#2\char"#1 to the end of the \if switches.


\documentclass{scrartcl}
\usepackage{fontspec}
\makeatletter

\gdef\add@UTF@accent#1#2#3{%
\ifx\relax#2\relax
\char"#3
\else
\ifx\ #2\relax
\char"#3
\else
\expandafter\ifx\UTF@space#2\relax
\char"#3
\else
\ifx~#2\char"#3\else
\char"#3
\fi
\fi
\fi
\fi#2\char"#1\relax} %#2\char"#1 moved

\let\add@encoded@accent\add@UTF@accent


\begin{document}

\def\Thanh{H\`an~Th\^e\llap{\raise

0.5ex\hbox{\'{\empty}}}~Th\`anh}

Herbert Voss

unread,
Aug 5, 2011, 7:36:32 AM8/5/11
to
Am 05.08.2011 11:45, schrieb Ulrike Fischer:

>> I want to know _why_ it works with the Type 1 but not with
>> the OpenType version of Pagella. It must be a problem with
>> the font or with fontspec.
>
> Well if you push me so. Looking at the definition of \add@UTF@accent
> in xunicode and wading through the \if-branches I would say the
> reason is that if the argument of \' is \relax or a space the
> command boils down to print only the "combining" char and no accent
> at all. It looks like a bug to me. It works if I move the ending
> #2\char"#1 to the end of the \if switches.

thanks

Herbert

Will Robertson

unread,
Aug 6, 2011, 2:40:22 AM8/6/11
to
On 2011-08-05 02:01:35 +0930, Herbert Voss
<Herber...@alumni.tu-berlin.de> said:

> In the following example the double accent is missing.
> With pdflatex everything is fine.

I *think* this is due to xunicode:

\documentclass{article}
\usepackage[EU1]{fontenc}
\providecommand{\UTFencname}{EU1}
\usepackage{xunicode}
\begin{document}
[\'x] [\'{}]
\end{document}

I'm not sure why this is happening, though; best to ask Ross Moore
about it, perhaps.

Cheers,
Will

Will Robertson

unread,
Aug 6, 2011, 2:42:38 AM8/6/11
to
On 2011-08-06 16:40:22 +0930, Will Robertson <wsp...@gmail.com> said:

> On 2011-08-05 02:01:35 +0930, Herbert Voss
> <Herber...@alumni.tu-berlin.de> said:
>
>> In the following example the double accent is missing.
>> With pdflatex everything is fine.
>
> I *think* this is due to xunicode:

Oops, I replied but didn't send this until now and I see that Ulrike
has delved into this in a proper amount of detail. Thanks! Has a bug
report been sent to Ross?

Cheers,
Will

0 new messages