Difference between revisions of "Pseudo Small Caps"

From Wiki
Jump to navigation Jump to search
Line 55: Line 55:
 
\usetypescript[modern][ec]
 
\usetypescript[modern][ec]
 
\setupbodyfont[10pt,rm]
 
\setupbodyfont[10pt,rm]
 +
 +
\def\sc{\Var[SmallCaps]}
  
 
\starttext
 
\starttext
{Ahoj \Var[SmallCaps] Ahoj}\par
+
{   Ahoj \sc Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
+
{\it Ahoj \sc Ahoj}\par
{\bf Ahoj \Var[SmallCaps] Ahoj}\par
+
{\bf Ahoj \sc Ahoj}\par
{\bi Ahoj \Var[SmallCaps] Ahoj}\par
+
{\bi Ahoj \sc Ahoj}\par
  
 
{\tt
 
{\tt
{Ahoj \Var[SmallCaps] Ahoj}\par
+
{   Ahoj \sc Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
+
{\it Ahoj \sc Ahoj}\par
 
}
 
}
  
 
{\ss
 
{\ss
{Ahoj \Var[SmallCaps] Ahoj}\par
+
{   Ahoj \sc Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
+
{\it Ahoj \sc Ahoj}\par
{\bf Ahoj \Var[SmallCaps] Ahoj}\par
+
{\bf Ahoj \sc Ahoj}\par
 
}
 
}
 
\stoptext
 
\stoptext
 
</texcode>
 
</texcode>

Revision as of 21:59, 29 June 2005

< Visuals < Fonts

Your font has no Small Caps variant? Do you need Small Caps switching depending on the \it, \bf, \bi, \tt, \ss, ... ? Here is the recipe for generating and installing Pseudo Small Caps (small letters are scaled down versions of capitals - typographicaly not clear solution but if the font has no real Small Caps...). The example is done on Latin Modern family but can be applied to another Type1 or TTF font type.

1. Pseudo Small Caps generation. All commands (txt)

texfont --fontroot=X:\ --en=ec --ve=public --co=lm --source=auto --ca=0.8 lmbx10


2. Typescript definitions. Complete type script (copy URL to browser?!)

a) Metric file correspondencies:
\starttypescript [all] [latin-modern,computer-modern] [texnansi,ec,qx,pl0,il2,t5]
...
  \definefontsynonym [cmtcsc10]  [\typescriptthree-lmtcsc10]  [encoding=\typescriptthree]
...
  \definefontsynonym [cmcscbx10] [\typescriptthree-lmbx10-capitalized-800] [encoding=\typescriptthree]
\stoptypescript


b) Making \Var[SmallCaps] in Serif, Sans, and Mono:
\starttypescript [serif] [computer-modern,latin-modern] [default]
  ...
  \definefontsynonym [SerifRegular]                      [ComputerModern]
  \definefontsynonym [SerifBold]                         [ComputerModern-Bold]
  \definefontsynonym [SerifItalic]                       [ComputerModern-Italic]
  \definefontsynonym [SerifBoldItalic]                   [ComputerModern-BoldItalic]
  \definefontsynonym [SerifRegularCaps]	                 [ComputerModern-Caps]

  \definefontsynonym [SerifSmallCaps]	                 [ComputerModern-Caps]
  \definefontsynonym [SerifItalicSmallCaps]              [cmcsci10]
  \definefontsynonym [SerifBoldSmallCaps]                [cmcscbx10]
  \definefontsynonym [SerifBoldItalicSmallCaps]          [cmcscbxi10]

  \definefontsynonym [SerifRegular]                      [Serif]
  \definefontsynonym [SerifRegularSmallCaps]             [SerifSmallCaps]

  \definefontvariant [Serif] [SmallCaps] [SmallCaps]
\stoptypescript

\starttypescript [sans] [computer-modern,latin-modern] [default]
  ...
\stoptypescript

\starttypescript [mono] [computer-modern,latin-modern] [default]
  ...
\stoptypescript


3. Usage. PDF Source (copy URL to browser?!)

\usetypescriptfile[type-lm-var]
\usetypescript[all][computer-modern,latin-modern][ec]
\usetypescript[serif][computer-modern,latin-modern][default]
\usetypescript[sans][computer-modern,latin-modern][default]
\usetypescript[mono][computer-modern,latin-modern][default]
\usetypescript[modern][ec]
\setupbodyfont[10pt,rm]

\def\sc{\Var[SmallCaps]}

\starttext
{    Ahoj \sc Ahoj}\par
{\it Ahoj \sc Ahoj}\par
{\bf Ahoj \sc Ahoj}\par
{\bi Ahoj \sc Ahoj}\par

{\tt
{    Ahoj \sc Ahoj}\par
{\it Ahoj \sc Ahoj}\par
}

{\ss
{    Ahoj \sc Ahoj}\par
{\it Ahoj \sc Ahoj}\par
{\bf Ahoj \sc Ahoj}\par
}
\stoptext