%D \module %D [ file=typo-itc, %D version=2011.10.08, %D title=\CONTEXT\ Typesetting Macros, %D subtitle=Italic Correction, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. \writestatus{loading}{ConTeXt Typesetting Macros / Italics Corrections} \unprotect %D The brave might try: %D %D \starttyping %D \definefontfeature[default][default][itlc=yes] % is now default %D \setitaliccorrection %D \stoptyping \registerctxluafile{typo-itc}{autosuffix} \installcorenamespace{italics} \def\typo_italic_set#1% {\bitwiseflip\glyphoptions \textcheckitalicglyphoptioncode \bitwiseflip\discretionaryoptions\textcheckitalicdiscoptioncode \clf_setitaliccorrection{#1}} \def\typo_italic_reset {\bitwiseflip\glyphoptions -\textcheckitalicglyphoptioncode \bitwiseflip\discretionaryoptions-\textcheckitalicdiscoptioncode} \permanent\tolerant\protected\def\setitaliccorrection[#1]% {\ifcstok{#1}\v!reset \typo_italic_reset \orelse\ifcsname\??italics#1\endcsname \expandafter\typo_italic_set\expandafter{\lastnamedcs}% \fi} \defcsname\??italics\v!yes \endcsname{0} \defcsname\??italics\v!small \endcsname{0.1} \defcsname\??italics\v!medium\endcsname{0.2} \defcsname\??italics\v!big \endcsname{0.3} \permanent\protected\def\resetitaliccorrection {\typo_italic_reset} \permanent\protected\def\setupitaliccorrection% kind of obsolete {\setitaliccorrection} \permanent\protected\def\italiccorrection {\ifbitwiseand\glyphoptions\textcheckitalicglyphoptioncode\else \normalitaliccorrection \fi} \pushoverloadmode \aliased\let\/\italiccorrection % replaces the primitive % \aliased\let\explicititaliccorrection\italiccorrection % replaces the primitive \popoverloadmode % only for manuals ... obsolete \permanent\protected\def\pushitaliccorrection{}% \typo_italic_reset \permanent\protected\def\popitaliccorrection {}% \typo_italic_set %D Correcting for weird shapes. %D \starttyping %D \showglyphs \showfontitalics \showfontkerns %D %D \setupbodyfont[bonum] %D %D \startTEXpage[offset=1ts,width=5em] %D \setupitaliccorrection[italic] %D \dontleavehmode %D \ruledhbox{\it\shapecorrection[both] f}\quad %D \ruledhbox{\it\shapecorrection[both]ff} %D \stopTEXpage %D \stoptyping \installcorenamespace{shapecorrection} \defcsname\??shapecorrection\v!left \endcsname{\groupedcommandcs\forcedleftcorrection\relax} \defcsname\??shapecorrection\v!right\endcsname{\groupedcommandcs\relax \forcedrightcorrection} \defcsname\??shapecorrection\v!both \endcsname{\groupedcommandcs\forcedleftcorrection\forcedrightcorrection} \defcsname\??shapecorrection \endcsname{\groupedcommandcs\relax \forcedrightcorrection} \permanent\tolerant\protected\def\shapecorrection[#1]{\begincsname\??shapecorrection#1\endcsname} \protect \endinput