[XeTeX] kpathsea: Invalid fontname `[/Library/Fonts/MyriadPro-Cond', contains '['

Adam Twardoch (List) list.adam at twardoch.com
Fri Mar 25 20:07:37 CET 2011


My code is:

%!TEX TS-program = xelatex

%!TEX encoding = UTF-8

\documentclass{minimal}

\usepackage[margin=40pt, paperwidth=1024bp, paperheight=768bp]{geometry}

\usepackage{fp}

\usepackage{parskip}

\pagestyle{empty}

\newlength{\testlength}

\newlength{\testfontsize}

\newlength{\linesp}

\setlength{\linesp}{10pt}

\makeatletter

\newcommand{\linetowidth}[2]{%

\setlength{\testfontsize}{10pt}%

\font\samplefont=[#1] at \testfontsize%

\samplefont%

\settowidth{\testlength}{#2}%

\typeout{\the\testlength}%

#2\par%

}

\makeatother

\begin{document}

\openup \linesp

\XeTeXuseglyphmetrics=1

\def \fontfolder{/Library/Fonts}

\linetowidth{\fontfolder/MyriadPro-Cond.otf}{Medical split}%

\end{document}

%%

I'm successfully getting a PDF output but I'm getting the following
error in the console:

kpathsea: Invalid fontname `[/Library/Fonts/MyriadPro-Cond', contains '['


Any hints?

Best,
Adam

-- 

May success attend your efforts,
-- Adam Twardoch
(Remove "list." from e-mail address to contact me directly.)



More information about the XeTeX mailing list