Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

If I use the fontspec package together with the microtype package, the color-feature of fontspec does only colarize the last line of the paragraph instead of the whole paragraph, as the grouped \addfontfeature-command should work.

\documentclass{article}

\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{microtype}

\setmainfont{DejaVu Serif}

\begin{document}
\twocolumn%
Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test.

\begingroup%
    \addfontfeature{Color=blue}%
    Test. Test. Test. Test. Test. Test. 
    Test. Test. Test. Test. Test. Test. 
    Test. Test. Test. Test. Test. Test. 
    Test. Test. Test. Test. Test. Test. 
    Test. Test.
\endgroup%

Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. 
Test. Test.
\end{document}

The result looks like this:

Badly colored paragraph.

I use LuaLaTeX with fontspec.sty (2013/03/16 v2.3a) and microtype.sty (2013/03/13 v2.5).

share|improve this question

closed as too localized by Speravir, Guido, Thorsten, Stefan Kottwitz Mar 27 '13 at 7:40

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
It may be caused by LuaLaTeX. With XeLaTeX it works fine. –  Marc van Dongen Mar 21 '13 at 6:36
    
looks like a problem with package microtype. File a bug report to the author –  Herbert Mar 21 '13 at 7:57
1  
I cannot reproduce the problem with fontspec (2012/05/06 v2.2b) and microtype (2010/01/10 v2.4) on lualatex (beta-0.70.2-2012052410). But I think, this should be posted in the correct bugtrackers or mailing lists. –  Toscho Mar 21 '13 at 8:39
    
Same problem here. Using microtype v2.5 as well. It seems to be related to font expansion. Setting expansion=false makes it disapper. You might want to include that in case you file a bug report. But fontspec might be involved in the problem as well, as it also disappears when we leave expansion on, but use plain old \color instead. –  Nils L Mar 21 '13 at 11:48
add comment

1 Answer

up vote 4 down vote accepted

It is a bug in luaotfload, not in microtype nor fontspec. (@AndrewStacey had already reported this a while ago to me.) The same happens with plain luatex:

\input luaotfload.sty
\font\x="DejaVu Serif":color=FF00FF;expansion=default; \x
\pdfadjustspacing=2
\hsize=7cm
Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. 
Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. Test. 
\bye 

Only those lines appear in colour where no expansion takes place (here, the last line). It seems that the colourizing routine from luaotfload (in file otfl-font-clr.lua) doesn't recognize the expanded fonts as instances of the same base font.

EDIT: This bug has been fixed in luaotfload v2.2, thanks to Élie Roux and Philipp Gesang.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.