[XeTeX] need help to define Fontfamily

Ross Moore ross at maths.mq.edu.au
Thu Sep 23 07:29:36 CEST 2004


Hi Dalyoung,


On 23/09/2004, at 3:03 PM, Dalyoung wrote:

> I tested to define a font family. It looks like working except both 
> 'italic' and 'slanted'.
>
> I got the error to compile the following text, but no errors at all if 
> I commented out the "\item {\it .....}".
> Is there a way to cure this error?
>
> best regards,
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass[10pt,a4paper]{book}
>
> {\catcode`\# = 12
>  \gdef\fontname{#PilGi Regular}}
          ^^^^^^^^----------  this is a big  No! No!

\fontname  is actually the command for a TeX primitive.
If you make this definition, then you'll make the TeX
command inaccessible...

>
>  \font\B="\fontname" at 12pt
>
> % \def\fontname{SMMyungjo DemiBold}
> % \font\C="\fontname" at 10pt
>
> \DeclareFontFamily{U}{\fontname}{}
> \DeclareFontShape{U}{\fontname}{m}{n}%
>      {<-> "\fontname"}{}
> \DeclareFontShape{U}{\fontname}{m}{it}%
>      {<-> ssub * \fontname/m/n}{}

     ... which then kills this  ssub

> \DeclareFontShape{U}{\fontname}{m}{sl}%
>      {<-> ssub * \fontname/m/n}{}

    ... and this one ...

> \DeclareFontShape{U}{\fontname}{m}{sc}%
>      {<-> ssub * \fontname/m/n}{}

    ... and this one.

That probably explains why \it and \sl  don't work for you.
Also  \textsc  should fail.

Since TeX is case-sensitive, try using  \FontName  instead,
for the name of your own macro.



Hope this helps,

	Ross


> \DeclareFontShape{U}{\fontname}{bx}{n}%
>      {<-> "SMMyungjo\space Bold"}{}
> \DeclareFontShape{U}{\fontname}{b}{n}%
>      {<-> "SMMyungjo\space DemiBold"}{}
> \DeclareFontShape{U}{\fontname}{bx}{it}%
>      {<-> "smGType\space Regular"}{}
> \DeclareFontShape{U}{\fontname}{b}{it}%
>      {<-> ssub * \fontname/m/n}{}
>
> \renewcommand{\encodingdefault}{U}
> \renewcommand{\rmdefault}{\fontname}
>
> \setcounter{secnumdepth}{-2}
>
> \title{ TEST}
> \author{ Author}
> \date{}
>
> \begin{document}
>
> %\maketitle
>
> \chapter{Chapter Test}
>
> \section{ Section}
> \subsection{ Subsection}
>
> \begin{enumerate}
> \item This is the \fontname.
> \item {\bf This is the bold face.}
> \item {\B This is 12pt size.}
> \item {\it Is it italic?}
> \end{enumerate}
> \end{document}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> error message
>
> ################## - Compiling booktest
> #  CUSTOM
> This is XeTeXk, Version 3.14159-2.1-0.87 (Web2C 7.5.2)
>  %&-line parsing enabled.
> entering extended mode
> (./booktest.tex
> LaTeX2e <2001/06/01>
> Babel <v3.7h> and hyphenation patterns for american, nohyphenation, 
> loaded.
> (/usr/local/teTeX/share/texmf.tetex/tex/latex/base/book.cls
> Document Class: book 2001/04/21 v1.4e Standard LaTeX document class
> (/usr/local/teTeX/share/texmf.tetex/tex/latex/base/bk10.clo)) 
> (./booktest.aux)kpathsea: Illegal fontname `#PilGi': contains '#'
>
> ! Font \U/#PilGi Regular/m/n/10=#PilGi not loadable: Metric (TFM) file 
> or ATSUI
>  font not found.
> <to be read again>
>                    R
> l.51 \item {\it
>                 Is it italic?}
> ?
>
> ---------------------------------
> If the line 51 was commented out, then it yields the following output.
>
> <test.tiff>_______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list