Amir Karger wrote:
> 
> On Tue, Sep 11, 2001 at 12:43:05PM +0300, Robin Turner wrote:
> > On Tuesday 11 September 2001 02:59, John Levon wrote:
> > >
> > > this sounds like a great idea !
> >
> > How should I submit it? As an attached .lyx doc?
> 
> Probably easiest if you just submit a Word file, so everyone will be able to
> read it.

[repeats the incantation against trolls]

Here it is. The first letter is a bit of frivolity which not all readers
may like. 

Robin
#LyX 1.2 created this file. For more info see http://www.lyx.org/
\lyxformat 220
\textclass article
\language english
\inputencoding latin5
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Subsection

Using different fonts in LyX
\layout Standard

by 
\noun on 
Robin Turner
\layout Standard


\begin_inset ERT
status Open

\layout Standard

\backslash 
newfont{
\backslash 
yinit}{yinit scaled
\backslash 
magstep1} 
\backslash 
yinit
\end_inset 


\layout Standard

L
\begin_inset ERT
status Open

\layout Standard

\backslash 
normalfont
\end_inset 

 yX currently uses a fairly limited selection of fonts.
 While it may come as a disappointment to people used to the thousands of
 fonts available to conventional word processors, there are in fact good
 reasons for this choice.
 LyX has no fonts of its own; for the screen it uses whatever fonts are
 available to the X-window system, and for output it uses the fonts of the
 TeX setup it is operating with.
 The selection of default faults correspond to the most useful and commonly
 found fonts available in TeX.
 For example, the first letter of this section, uses the Initial (yinit)
 font.
 You have 
\emph on 
probably
\emph default 
 got this in your TeX distribution, so it 
\emph on 
should
\emph default 
 come out as a big pretty gothic letter, but if you haven't, it won't.
 Another factor is that the profusion of fonts which TrueType brought about
 has generally had a bad effect on desktop publishing, leading to documents
 with inappropriate, badly-scaled or simply too many fonts.
 You should therefore think carefully before using a different default font,
 or mixing font families in the same document.
\layout Standard


\noun on 
Note
\noun default 
: When trying out the various methods here, it's a good idea to make up
 a test file containing a variety of headings and character styles, so that
 you can see the effect different font commands have; for example, many
 fonts will refuse to do headings.
\layout Subsubsection

Changing the default font
\layout Standard

The easiest and most reliable way to change the default font is from within
 LyX, through 
\family sans 
Layout\SpecialChar \menuseparator
Document\SpecialChar \menuseparator
Fonts
\family default 
.
 The next easiest is to use a package contained in your TeX distribution.
 For example, the rather pretty Pandora font family can be accessed simply
 by putting 
\family typewriter 

\backslash 
usepackage{pandora}
\family default 
 in your LaTeX preamble (
\family sans 
Layout\SpecialChar \menuseparator
LaTeX\SpecialChar ~
preamble
\family default 
).
 Similarly, 
\family typewriter 

\backslash 
usepackage{oldgerm}
\family default 
 in the preamble gives you access to Yannis Haralambous' Old German (Gothisch)
 fonts via the specially-defined 
\family typewriter 

\backslash 
gothfamily
\family default 
, 
\family typewriter 

\backslash 
swabfamily
\family default 
, and 
\family typewriter 

\backslash 
frakfamily 
\family default 
commands, which you insert in your document (as TeX) to obtain the desired
 font (note that nothing will change in your screen display, which considering
 the difficulty involved in reading some of these fonts is just as well).
 Other useful packages are 
\family typewriter 
concrete
\family default 
, which gives access to both the Concrete Roman and the Euler math fonts,
 and 
\family typewriter 
chancery
\family default 
, which gives you the Zapf Chancery fonts.
\layout Standard

A less reliable method is the
\family typewriter 
 
\backslash 
familydefault
\family default 
 command.
 If you have a font installed and know its family name, you can put something
 like 
\layout Quote


\family typewriter 

\backslash 
renewcommand{
\backslash 
familydefault}{rpxppl} 
\layout Standard

in the preamble (
\begin_inset Quotes eld
\end_inset 

rpxppl
\begin_inset Quotes erd
\end_inset 

 is the family name for the Palladio fonts).
 
\layout Standard

You should be aware that these methods may produce strange results if the
 font you have selected does not have the sizes or shapes you want (e.g.
 adding emphasis to text has no effect on Zapf Chancery, and choosing the
 sans serif or typewriter series will cause it to revert to the standard
 font).
\layout Subsubsection

More than one font family in one document
\layout Standard

As I've said, different font families in the same document can spell trouble.
 Unlike many human families, the members of a font family work well together,
 so the eye is not overly disturbed when changing from a medium roman to
 a bold sans serif font, for example.
 Different font families may not have this visual compatibility, and clashing
 fonts are a common reason for amateur publishing looking amateurish.
 (End of sermon.)
\layout Standard

Nevertheless, you may need different fonts for some reason: you may have
 to include a different alphabet, like Elvish or Cuneiform
\begin_inset Foot
collapsed true

\layout Standard

These can be downloaded from CTAN.
 Remember, though, that some 
\begin_inset Quotes eld
\end_inset 

normal
\begin_inset Quotes erd
\end_inset 

 fonts can be turned into a different alphabet by changing the font encoding;
 see a good LaTeX book if you want to do this.
\end_inset 

, or maybe you want a structural effect such as putting poetry in a different
 font from prose, like this:
\layout Standard


\begin_inset ERT
status Open

\layout Standard

\backslash 
newfont{
\backslash 
zapf}{pzcmi}
\layout Standard

\backslash 
zapf
\end_inset 


\layout Verse

Myself when young did eagerly frequent
\newline 
Doctor and Saint, and heard great Argument
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
normalfont
\end_inset 

 One way to do this is to declare your own font commands.
 For example, writing 
\layout Quote


\family typewriter 

\backslash 
newfont{
\backslash 
avant}{pagd} 
\layout Standard

will define a command, 
\family typewriter 

\backslash 
avant
\family default 
, which can be invoked anywhere in your document to change to the 
\begin_inset ERT
status Open

\layout Standard

\backslash 
newfont{
\backslash 
avant}{pagd}
\backslash 
avant
\end_inset 

 Avant Garde font.
 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
normalfont
\end_inset 

 You can return to your default font by typing 
\family typewriter 

\backslash 
normalfont
\family default 
.
\layout Standard


\noun on 
Warning!
\noun default 
 This is a quick fix, and is no substitute for reading a good book on LaTeX.
\begin_inset Foot
collapsed true

\layout Standard

For example, Chapter 7 of Coussens, Mittelbach and Samarin's 
\emph on 
The 
\emph default 
LaTeX
\emph on 
 Companion
\emph default 
 provides a good overall guide.
\end_inset 

 For example, some fonts will need scaling using the 
\family typewriter 
scaled
\backslash 
magstep
\family default 
\emph on 
n
\emph default 
 option, since their idea of, say 10pt, may not be the same as that of your
 default font family.
 
\layout Subsubsection

Finding new fonts
\layout Standard

So where do you find all these exciting new fonts? There are three main
 methods:
\layout Enumerate

Look around in your TeX distribution.
\layout Enumerate

Download TeX fonts.
\layout Enumerate

Convert TrueType fonts to TeX.
\layout Standard

The first stage is as far as most people will want to go.
 Have a look in
\family sans 
 
\family typewriter 
$TEXMF/fonts/tfm
\family default 
 to see what you've got (where 
\family typewriter 
$TEXMF
\family default 
 is the location of your TeX system, usually something like
\family typewriter 
 /usr/share/texmf
\family default 
).
 When you see something that looks promising, test it in a LyX document
 using the method described above, i.e.
 make a new font command and use it on some text, then preview and see what,
 if anything, you get.
 Expect error messages! Note that the font name you want is usually the
 first four letters of the file name, e.g.
 a file named 
\family typewriter 
pncb8a.afm
\family default 
 is actually the bold (b) version of Adobe's (p) New Century (nc) family.
 If in doubt about names, check out the files in 
\family typewriter 
$TEXMF/fontname
\family default 
.
\layout Standard

TeX fonts can be downloaded from your nearest CTAN mirror (e.g.
 
\begin_inset LatexCommand \url{ftp.ivorytower.edu/pub/tex/ctan/fonts}

\end_inset 

).
 At first look for font directories which include a 
\family typewriter 
.sty
\family default 
 file which you can invoked in your preamble, as this will make life easier
 (as in the case of Pandora).
 Failing that, look for directories which give you the full set of TeX font
 files.
 Failing 
\emph on 
that
\emph default 
, look for an 
\family typewriter 
.afm
\family default 
 file and run the program 
\family typewriter 
fontinst
\family default 
 on it (read, or at least skim, the manual first --- you've probably got
 it in 
\family typewriter 
$TEXMF/doc/fontinst/base/fontinst.dvi
\family default 
).
 You should now have a directory filled with downloaded or converted files.
 
\layout Standard

Now you need to put the font files in the right places.
 Unless you're running Windows 9* or have an entire TeX system in your home
 directory, you need to be root to do this.
 The basic rule is to look at the extension of the file and move it to the
 corresponding directory, and put 
\family typewriter 
.sty
\family default 
 files in the 
\family typewriter 
/latex
\family default 
 directory:
\layout Itemize


\family typewriter 
.sty, .cls 
\family default 
or
\family typewriter 
 .fd 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/tex/latex/
\family default 
\emph on 
package_name
\family typewriter 
\emph default 
/
\layout Itemize


\family typewriter 
.dvi, .ps 
\family default 
or
\family typewriter 
 .pdf 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/doc/latex
\family default 
\emph on 
/package_name
\family typewriter 
\emph default 
/
\begin_inset Foot
collapsed false

\layout Standard

These will be documentation files for the font, not fonts themselves.
\end_inset 


\layout Itemize


\family typewriter 
.tfm 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/fonts/tfm/
\family default 
\emph on 
supplier
\family typewriter 
\emph default 
/
\family default 
\emph on 
font_name
\family typewriter 
\emph default 
/
\layout Itemize


\family typewriter 
.vf 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/fonts/vf/
\family default 
\emph on 
supplier
\family typewriter 
\emph default 
/
\family default 
\emph on 
font_name
\family typewriter 
\emph default 
/
\layout Itemize


\family typewriter 
.afm 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/fonts/afm/
\family default 
\emph on 
supplier
\family typewriter 
\emph default 
/
\family default 
\emph on 
font_name
\family typewriter 
\emph default 
/
\layout Itemize


\family typewriter 
.pfb 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/fonts/type1/
\family default 
\emph on 
supplier
\family typewriter 
\emph default 
/
\family default 
\emph on 
font_name
\family typewriter 
\emph default 
/
\layout Itemize


\family typewriter 
.ttf 
\begin_inset Formula $\rightarrow $
\end_inset 

 $TEXMF/fonts/truetype/
\family default 
\emph on 
supplier
\family typewriter 
\emph default 
/
\family default 
\emph on 
font_name
\family typewriter 
\emph default 
/
\layout Standard

If this sounds confusing, check out 
\begin_inset LatexCommand \url{http://www.ctan.org/installationadvice/}

\end_inset 

.
\layout Standard

Thought you were finished? Not quite.
 First you may need to hack the file 
\family typewriter 
$TEXMF/dvips/base/psfonts.map (
\family default 
there is a script to do this in a more orderly manner if you want --- look
 at the comments at the top of the file).
 If the font you've installed isn't there already, you need to add a line
 describing your new font so that 
\family typewriter 
dvips
\family default 
 can recognise it.
 Look at the other lines to get an idea of the format.
 The basic format is:
\layout Quote


\emph on 
TeX name
\emph default 

\hfill 
 
\emph on 
Real name
\emph default 

\hfill 
<
\emph on 
encoding
\emph default 

\hfill 
<
\emph on 
pfb_file
\layout Standard

Now run 
\family typewriter 
texhash
\family sans 
 
\family default 
(as root, of course), or 
\family typewriter 
initexmf -update-fndb
\family default 
, if you're using MikTeX on Windows.
 Take a deep breath and test your font.
\layout Standard

If that wasn't enough for you, you may want to try converting your favourite
 TrueType font into a form that LyX can get at.
 It's a long, tiring process, but if you really want that font, it's worth
 it.
 Have a look at 
\begin_inset LatexCommand 
\url{http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html}

\end_inset 

.
\layout Standard

Just one last word.
 Playing around with fonts is fun, but not always productive, especially
 if you have a day-job.
 
\the_end

Reply via email to