summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-fil.mkvi
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/font-fil.mkvi')
-rw-r--r--tex/context/base/mkiv/font-fil.mkvi33
1 files changed, 18 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/font-fil.mkvi b/tex/context/base/mkiv/font-fil.mkvi
index 01fa4a338..16ce57f8a 100644
--- a/tex/context/base/mkiv/font-fil.mkvi
+++ b/tex/context/base/mkiv/font-fil.mkvi
@@ -42,19 +42,17 @@
%
% \setupbodyfont[palatino]
-\let\fontclass\empty
-
\unexpanded\def\startfontclass
{\dosingleempty\font_basics_start_font_class}
\def\font_basics_start_font_class[#class]%
- {\pushmacro\fontclass
+ {\push_macro_fontclass
\doifelse{#class}\v!each
{\let\fontclass\empty}
{\doifsomething{#class}{\def\fontclass{#class}}}}
\unexpanded\def\stopfontclass
- {\popmacro\fontclass}
+ {\pop_macro_fontclass}
\def\classfont#class#name{#class#name} % \definefont[whatever][\classfont{xx}{yy} at 10pt]
@@ -109,11 +107,14 @@
\let\p_designsize\undefined
\expandafter\font_basics_get_font_parameter_yes#specification,]=,}
+% todo: check if we can use \edef but then we need to protect \mathsizesuffix .. in fact that
+% can be default then: \let\mathsizesuffix\relax .. i need to play with it first
+
\def\font_basics_get_font_parameter_nop#key=#value,%
{\if]#key%
\font_basics_get_font_parameter_nop_finish
\else
- \expandafter\normaldef\csname p_#key\endcsname{#value}%
+ \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
\expandafter\font_basics_get_font_parameter_nop
\fi}
@@ -121,13 +122,13 @@
{\if]#key%
\font_basics_get_font_parameter_yes_finish
\else
- \expandafter\normaldef\csname p_#key\endcsname{#value}%
+ \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
\expandafter\font_basics_get_font_parameter_yes
\fi}
% helpers, some day these will be toks and counts
-% \def\fntsetdefname {\global\let\somefontname\defaultfontfile}
+% \def\fntsetdefname {\glet\somefontname\defaultfontfile}
% \def\fntsetsomename{\gdef\somefontname} % takes argument
% \def\fntsetnopsize {\let\somefontsize\empty}
% \def\fntsetsomesize{\def\somefontsize} % takes argument
@@ -145,10 +146,10 @@
\expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\undefined}
\def\font_basics_define_font_synonym_yes_nil
- {\global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\undefined}
+ {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\undefined}
\def\font_basics_get_font_parameter_nop_finish
{\expandafter\let\csname\??fontfile\m_font_name\s!features \endcsname\p_features
@@ -157,10 +158,10 @@
\expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\p_designsize}
\def\font_basics_get_font_parameter_yes_finish
- {\global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\p_features
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\p_fallbacks
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\p_goodies
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\p_designsize}
+ {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\p_features
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\p_fallbacks
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\p_goodies
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\p_designsize}
%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
%
@@ -306,6 +307,8 @@
#2%
\fi\fi}
+\installmacrostack\fontclass
+
%D Files or names can have properties and these need to be consulted
%D at some point. They can inherit them.