Sunday, 2 June 2013

fontspec setmainfont working

fontspec setmainfont working

Here is a minimal problem example
\ProvidesClass{cvMinimal}[2012/04/30 CV class]
\NeedsTeXFormat{LaTeX2e}

\LoadClass{article}


%%%%%%%%%%
% Colors %
%%%%%%%%%%

\RequirePackage{xcolor}
\definecolor{green}{HTML}{C2E15F}
\definecolor{gray}{HTML}{4D4D4D}

%%%%%%%%%
% Fonts %
%%%%%%%%%

\RequirePackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=gray]{Helvetica Neue Light}

%%%%%%%%%%
% Header %
%%%%%%%%%%

\RequirePackage{tikz}
    \usetikzlibrary{positioning}

\newcommand{\header}[0]{%
    \begin{tikzpicture}[remember picture, overlay]
        \node[](name){\fontsize{24pt}{72pt}\selectfont\color{green}{My Name}};  %
    \end{tikzpicture} 
    }
produces a gray "My name" wheras I would expect to produce a green one. Commenting the line setmainfont solves the problem.
Can someone explain me what do I do wrong ? And how to get what I want without commenting the setmainfontline which is important in the rest of my document?
I know it is possible since it is achieved in the cv here.

No comments:

Post a Comment