summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/fonts/fonts/fonts-tricks.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-01-17 13:51:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-01-17 13:51:05 +0100
commit84591a31c39887dbf582df5d535f1de1a115fd62 (patch)
tree1c4613a1c79db3cdfb41b977c64e993492fbdd88 /doc/context/sources/general/fonts/fonts/fonts-tricks.tex
parenta16cd078a5cc00d7c789093b5209b6f8d2dfdb1a (diff)
downloadcontext-84591a31c39887dbf582df5d535f1de1a115fd62.tar.gz
2018-01-17 13:16:00
Diffstat (limited to 'doc/context/sources/general/fonts/fonts/fonts-tricks.tex')
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-tricks.tex119
1 files changed, 119 insertions, 0 deletions
diff --git a/doc/context/sources/general/fonts/fonts/fonts-tricks.tex b/doc/context/sources/general/fonts/fonts/fonts-tricks.tex
index 6596a43fb..86517bd57 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-tricks.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-tricks.tex
@@ -180,4 +180,123 @@ controlled by a directive (beware: enabling them is global).
\stopsection
+\startsection[title=Symbols]
+
+You can access glyphs by name but you need to know that name, for example:
+
+\startbuffer
+\definefontsynonym [bends] [file:manfnt.afm]
+
+\startsymbolset [Dangerous Bends]
+ \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}]
+ \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}]
+\stopsymbolset
+
+\setupsymbolset [Dangerous Bends]
+
+Two dangerous bends: \symbol{dbend} and \symbol{lhdbend}.
+\stopbuffer
+
+\typebuffer
+
+You can best save the fonts you use that way in a place that doesn't get
+overwritten because names can change.
+
+\getbuffer
+
+\stopsection
+
+\startsection[title=Alternative styles]
+
+\startbuffer[demo]
+ \start
+ \getbuffer[setup]
+ \subject{[ {\myslanted myslanted} ] [ {\it it} ] [ {\slanted slanted} ] [ $x=1$ ]}
+ [ {\myslanted myslanted} ] [ {\it it} ] [ {\slanted slanted} ] [ $x=1$ ]
+ \typebuffer[setup]
+ \blackrule[width=\hsize,height=1pt,depth=0pt]
+ \stop
+\stopbuffer
+
+In section heads we want a nested style (e.g.\ italic) to adapt to the main font.
+The following definitions shows how you can influence that process. We use the
+following \type {demo} buffer as sample:
+
+\typebuffer[demo]
+
+\startbuffer
+\blackrule[width=\hsize,height=1pt,depth=0pt]
+
+\startbuffer[setup]
+\setuphead[subject][style=\tfb,before=,after=]
+\definealternativestyle [myslanted] [\it] []
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer[setup]
+\setuphead[subject][style=\tfb,before=,after=]
+\definealternativestyle [myslanted] [\it] [\bi]
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer[setup]
+\setuphead[subject][style=\tfb,before=,after=]
+\definealternativestyle [myslanted] [\it] [\tf]
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer[setup]
+\definealternativestyle [myslanted] [\normalitalicface]
+\setuphead[subject][style=bold,before=,after=]
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer[setup]
+\definealternativestyle [myslanted] [\normalitalicface]
+\setuphead[subject][style=\bfd,before=,after=]
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer[setup]
+\definealternativestyle [myslanted] [\slantedface]
+\setuphead[subject][style=boldface,before=,after=]
+\stopbuffer
+
+\getbuffer[demo]
+\stopbuffer
+
+You can influence the main method of operation with:
+
+\starttyping
+\setupalternativestyles[method=normal]
+\setupalternativestyles[method=auto]
+\stoptyping
+
+\startplacefigure[title={Alternative style methods.},reference=fig:alternativestyle]
+ \startcombination
+ {\setupalternativestyles[method=normal]\scale[width=.45\textwidth]{\framed[width=.85\textwidth,align=normal,frame=off,offset=overlay]{\getbuffer}}} {\type{method=normal}}
+ {\setupalternativestyles [method=auto]\scale[width=.45\textwidth]{\framed[width=.85\textwidth,align=normal,frame=off,offset=overlay]{\getbuffer}}} {\type{method=auto}}
+ \stopcombination
+\stopplacefigure
+
+The result is shown in \in {figure} [fig:alternativestyle]. Relevant commands are:
+
+\starttyping
+\emphasistypeface
+\emphasisboldface
+
+\normaltypeface \typeface
+\normalboldface \boldface
+\normalslantedface \slantedface
+\normalitalicface \italicface
+\swaptypeface \swapface
+\stoptyping
+
+\stopsection
+
\stopchapter