TransWikia.com

How to set drop case to a different font in ConTeXt?

TeX - LaTeX Asked on December 30, 2020

I set my font in ConTeXt like this:

starttypescript[serif]                         [garamond]
    definefontsynonym[Serif]                   [file:~/.fonts/11/EBGaramond12-Regular.otf]
    definefontsynonym[SerifBold]               [file:~/.fonts/11/EBGaramond12-AllSC.otf]
    definefontsynonym[SerifItalic]             [file:~/.fonts/11/EBGaramond12-Italic.otf]
    definefontsynonym[SerifBoldItalic]         [file:~/.fonts/11/EBGaramond12-AllSC.otf]
stoptypescript

starttypescript[sans]                          [garamond]
    definefontsynonym[Sans]                    [file:~/.fonts/11/EBGaramond12-Regular.otf]
    definefontsynonym[SansBold]                [file:~/.fonts/11/EBGaramond12-AllSC.otf]
    definefontsynonym[SansItalic]              [file:~/.fonts/11/EBGaramond12-Italic.otf]
    definefontsynonym[SansBoldItalic]          [file:~/.fonts/11/EBGaramond12-AllSC.otf]
stoptypescript

starttypescript[garamond]
    definetypeface[garamond]                   [rm][serif][garamond][default]
    definetypeface[garamond]                   [ss][sans][garamond][default]
    definetypeface[garamond]                   [mm][math][modern][default]
stoptypescript

I would like to use a different font, at ~/.fonts/11/EBGaramond-Initials.otf for the drop caps:

starttext

placeinitial
input knuth

stoptext

How can I get ConTeXt to change for that font just for the drop caps?

One Answer

Passing a font via style is a quick way to do it:

setuppapersize[A6]
%Adjust font size ad libitum
definefont[myfont][dejavuserif at 50pt]
starttext
setupinitial[style=myfont]
placeinitial
input knuth
stoptext

enter image description here

Correct answer by Jairo A. del Rio on December 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP