Difference between revisions of "Lucida - Old Content"

From Wiki
Jump to navigation Jump to search
Line 215: Line 215:
  
 
Have fun!
 
Have fun!
 +
 +
[[Category:Fonts]]

Revision as of 23:41, 31 July 2008

< Main Page | Fonts >

Installation of YandY+TUG Lucida Bright fonts

according to Sytse Knypstra

  1. Install lucida fonts (unzip to e.g. texmf-local tree)
  2. Copy all lucida related .afm and .pfb files to d:\temp
  3. Open a MS-DOS window; go to directory d:\temp and run
       texfont --fontroot=d:\context\usr\local\context\tex\texmf-local
       --ve=yandy --co=luc --ma --in --expert
       
  4. Copy files from third party modul [1] to d:\context\usr\local\context\tex\texmf-local\
  5. Move personal '\environment files' to d:\context\usr\local\context\tex\texmf-local\tex\context\user
  6. Copy the type-luc file to d:\context\usr\local\context\tex\texmf-local\tex\context\base
  7. Edit the file cont-sys.tex in d:\context\usr\local\context\tex\texmf-local\tex\context\user and add '\usetypescriptfile[type-luc] ' below the line \usetypescriptfile[type-buy]
  8. Run mktexlsr
  9. define a macro \lucida as follows:
    \define[1]\lucida{
      \usetypescript[luc][texnansi]
      \setupformulas[method=bold]
      \setupbodyfont[luc,#1]
      \enablemathcollection[lbr]
      \input math-lbr
      \usemathcollection[lbr]
    }
    
  10. and use it in your document as follows:
    \lucida{10pt}
    

Installation of B&H-flavoured Lucida Bright fonts

Renaud Aubin

Assumptions:

  • GNU/Linux,
  • your B&H Lucida Bright distro unpacks .afm and .pfb files in ./fonts/afm/bh/lucida and fonts/type1/bh/lucida

Procedure:

  • unpack your B&H distro to TEXMFLOCAL,
  • run
     texfont --ve=bh --co=lucida --so=auto --fo=$TEXMFLOCAL --ma --in --expert
  • get the tfm files contained in the third party module [2] and put them to $TEXMFLOCAL/fonts/tfm/bh/lucida
  • uncomment \usetypescriptfile[type-buy] in cont-sys.tex,
  • give it a try with:
    \startMPenvironment[global] % use lucida for metapost too
    \usetypescript[lucida][texnansi]
    \usetypescript[lucidabfm][texnansi] % for bold math
    \usetypescript[lucidaboldmath][texnansi] % for bold math
    \setupbodyfont[lucida,10pt]
    \definebodyfont[17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt][rm][bc=SerifBoldCaps sa 1,
      bca=SerifBoldCaps sa a,
      bcb=SerifBoldCaps sa b,
      bcc=SerifBoldCaps sa c,
      bcd=SerifBoldCaps sa d,
      bcx=SerifBoldCaps sa x,
      bcxx=SerifBoldCaps sa xx] % dunno if required from now
    \stopMPenvironment
    
    
    \starttext
    \input knuth
    
    \setupbodyfont[lucida,10pt,cg]
    \input knuth
    
    \setupbodyfont[lucida,10pt,hw]
    \input knuth
    
    \setupbodyfont[lucida,10pt,sans]
    \input knuth
    
    \setupbodyfont[lucida,10pt,mono]
    \input knuth
    \stoptext
    


Installing Free Lucida fonts that come with Java JRE

If you happen to use Java you might have noticed that it comes with Lucida. Assuming you downloaded the jdk-6u6-linux-x64.bin and extracted it to /opt

$ tree /opt/jdk1.6.0_06/jre/lib/fonts/
/opt/jdk1.6.0_06/jre/lib/fonts/
|-- LucidaBrightDemiBold.ttf
|-- LucidaBrightDemiItalic.ttf
|-- LucidaBrightItalic.ttf
|-- LucidaBrightRegular.ttf
|-- LucidaSansDemiBold.ttf
|-- LucidaSansRegular.ttf
|-- LucidaTypewriterBold.ttf
|-- LucidaTypewriterRegular.ttf
`-- fonts.dir

0 directories, 9 files

and

$ tree /opt/jdk1.6.0_06/jre/lib/oblique-fonts/
/opt/jdk1.6.0_06/jre/lib/oblique-fonts/
|-- LucidaSansDemiOblique.ttf
|-- LucidaSansOblique.ttf
|-- LucidaTypewriterBoldOblique.ttf
|-- LucidaTypewriterOblique.ttf
`-- fonts.dir

0 directories, 5 files

Place the *.ttf files in a dir---you might want to rename the files such that it no longer has uppercase letters---then install the fonts with the following command.

su -c 'texfont --makepath --install --vendor=bandh --co=lucida --show'

You can see if the installation was successful by previewing the resulting pdf, namely texnansi-bandh-lucida.pdf.

Save this with the name type-lucida.tex

\usetypescriptfile[type-lucida]

% how to use
% \usetypescriptfile[type-lucida]
% \usetypescript[Lucida][texnansi]
% \setupbodyfont[MyLucida,10pt] 

\loadmapfile[texnansi-bandh-lucida.map]

\starttypescript [serif] [lucida] [texnansi]
	\definefontsynonym[LucidaBright-Demi][texnansi-lucidabrightdemibold][encoding=texnansi]
	\definefontsynonym[LucidaBright-DemiItalic][texnansi-lucidabrightdemiitalic][encoding=texnansi]
	\definefontsynonym[LucidaBright-Italic][texnansi-lucidabrightitalic][encoding=texnansi]
	\definefontsynonym[LucidaBright][texnansi-lucidabrightregular][encoding=texnansi]
\stoptypescript

\starttypescript [sans] [lucida] [texnansi]
	\definefontsynonym[LucidaSans-Demi][texnansi-lucidasansdemibold][encoding=texnansi]
	\definefontsynonym[LucidaSans-DemiOblique][texnansi-lucidasansdemioblique][encoding=texnansi]
	\definefontsynonym[LucidaSans-Oblique][texnansi-lucidasansoblique][encoding=texnansi]
	\definefontsynonym[LucidaSans][texnansi-lucidasansregular][encoding=texnansi]
\stoptypescript

\starttypescript [mono] [lucida] [texnansi]
	\definefontsynonym[LucidaSans-TypewriterBold][texnansi-lucidatypewriterbold][encoding=texnansi]
	\definefontsynonym[LucidaSans-TypewriterBoldOblique][texnansi-lucidayypewriterboldoblique][encoding=texnansi]
	\definefontsynonym[LucidaSans-TypewriterOblique][texnansi-lucidatypewriteroblique][encoding=texnansi]
	\definefontsynonym[LucidaSans-Typewriter][texnansi-lucidatypewriterregular][encoding=texnansi]
\stoptypescript

\starttypescript [serif] [lucida] [name]
	\usetypescript[serif][fallback]
	\definefontsynonym[Serif]          [LucidaBright]
	\definefontsynonym[SerifBold]      [LucidaBright-Demi]
	\definefontsynonym[SerifItalic]    [LucidaBright-Italic]
	\definefontsynonym[SerifBoldItalic][LucidaBright-DemiItalic]
\stoptypescript

\starttypescript [sans] [lucida] [name]
	\usetypescript[sans][fallback]
	\definefontsynonym[Sans]			[LucidaSans]
	\definefontsynonym[SansItalic]		[LucidaSans-Oblique]
	\definefontsynonym[SansBold]    	[LucidaSans-Demi]
	\definefontsynonym[SansBoldItalic]	[LucidaSans-DemiOblique]
\stoptypescript

\starttypescript [mono] [lucida] [name]
	\usetypescript[mono][fallback]
	\definefontsynonym[Mono]			[LucidaSans-Typewriter]
	\definefontsynonym[MonoItalic]		[LucidaSans-TypewriterOblique]
	\definefontsynonym[MonoBold]		[LucidaSans-TypewriterBold]
	\definefontsynonym[MonoBoldItalic]	[LucidaSans-TypewriterBoldOblique]
\stoptypescript

\starttypescript [Lucida] 
    \definetypeface[MyLucida][rm][serif][lucida][default][encoding=texnansi]
	\definetypeface[MyLucida][ss][sans][lucida][default][encoding=texnansi]
	\definetypeface[MyLucida][tt][mono][lucida][default][encoding=texnansi]
\stoptypescript

Usage

\usetypescriptfile[type-lucida]
\usetypescript[Lucida][texnansi]
\setupbodyfont[MyLucida,10pt] 

Have fun!