Pseudo Small Caps

From Wiki
Revision as of 21:28, 29 June 2005 by 62.240.166.134 (talk) (--vz Original page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

< 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

  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

\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]

\starttext
{Ahoj \Var[SmallCaps] Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
{\bf Ahoj \Var[SmallCaps] Ahoj}\par
{\bi Ahoj \Var[SmallCaps] Ahoj}\par

{\tt
{Ahoj \Var[SmallCaps] Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
}

{\ss
{Ahoj \Var[SmallCaps] Ahoj}\par
{\it Ahoj \Var[SmallCaps] Ahoj}\par
{\bf Ahoj \Var[SmallCaps] Ahoj}\par
}
\stoptext