summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-fil.mkvi
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-10-12 20:30:59 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-10-12 20:30:59 +0200
commit1964c078d21c5f1d19a84fa6ef5c038f8ee80652 (patch)
tree833b3c9c678bcc7043560ab2e83daeeb395d6d7c /tex/context/base/mkiv/font-fil.mkvi
parent236690a6367b25187d37013e1e7fc196c5c44eb8 (diff)
downloadcontext-1964c078d21c5f1d19a84fa6ef5c038f8ee80652.tar.gz
2016-10-12 17:32:00
Diffstat (limited to 'tex/context/base/mkiv/font-fil.mkvi')
-rw-r--r--tex/context/base/mkiv/font-fil.mkvi115
1 files changed, 59 insertions, 56 deletions
diff --git a/tex/context/base/mkiv/font-fil.mkvi b/tex/context/base/mkiv/font-fil.mkvi
index 26751531b..fbe4b8442 100644
--- a/tex/context/base/mkiv/font-fil.mkvi
+++ b/tex/context/base/mkiv/font-fil.mkvi
@@ -185,70 +185,73 @@
% todo: replace * by ... less messy with features
-% \def\truefontname#name%
-% {\expandafter\font_helpers_true_fontname#name*\empty*\relax}
-%
-% \def\font_helpers_true_fontname#name*#first#rest*#crap\relax
-% {\ifcsname\??fontfile\fontclass#name\endcsname
-% \ifx#first\empty
-% %\expandafter\truefontname\csname\??fontfile\fontclass#name\endcsname
-% \expandafter\truefontname\lastnamedcs
-% \else
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname*#first#rest%
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
-% \fi
-% \else\ifcsname\??fontfile\defaultfontclass#name\endcsname
-% \ifx#first\empty
-% %\expandafter\truefontname\csname\??fontfile\defaultfontclass#name\endcsname
-% \expandafter\truefontname\lastnamedcs
-% \else
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname*#first#rest%
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
-% \fi
-% \else\ifcsname\??fontfile#name\endcsname
-% \ifx#first\empty
-% %\expandafter\truefontname\csname\??fontfile#name\endcsname
-% \expandafter\truefontname\lastnamedcs
-% \else
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname*#first#rest%
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
-% \fi
-% \else
-% #name\ifx#first\empty\else*#first#rest\fi
-% \fi\fi\fi}
-%
-% \def\font_helpers_true_fontname_check#name%
-% {\expandafter\font_helpers_true_fontname_check_indeed#name*\relax}
-%
-% \def\font_helpers_true_fontname_check_indeed#name*#crap\relax
-% {\ifcsname\??fontfile\fontclass#name\endcsname
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs
-% \else\ifcsname\??fontfile\defaultfontclass#name\endcsname
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs
-% \else\ifcsname\??fontfile#name\endcsname
-% %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname
-% \expandafter\font_helpers_true_fontname_check\lastnamedcs
-% \else
-% #name%
-% \fi\fi\fi}
-
\def\truefontname#name%
- %{\normalexpanded{\noexpand\font_helpers_true_fontname{\clf_truefontname{#name}}}}
- {\expandafter\expandafter\expandafter\font_helpers_true_fontname\expandafter\expandafter\expandafter{\clf_truefontname{#name}}}
+ {\expandafter\font_helpers_true_fontname#name*\empty*\relax}
-\def\font_helpers_true_fontname#name%
+\def\font_helpers_true_fontname#name*#first#rest*#crap\relax
{\ifcsname\??fontfile\fontclass#name\endcsname
- \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+ \ifx#first\empty
+ %\expandafter\truefontname\csname\??fontfile\fontclass#name\endcsname
+ \expandafter\truefontname\lastnamedcs
+ \else
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname*#first#rest%
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
+ \fi
\else\ifcsname\??fontfile\defaultfontclass#name\endcsname
- \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+ \ifx#first\empty
+ %\expandafter\truefontname\csname\??fontfile\defaultfontclass#name\endcsname
+ \expandafter\truefontname\lastnamedcs
+ \else
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname*#first#rest%
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
+ \fi
\else\ifcsname\??fontfile#name\endcsname
- \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+ \ifx#first\empty
+ %\expandafter\truefontname\csname\??fontfile#name\endcsname
+ \expandafter\truefontname\lastnamedcs
+ \else
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname*#first#rest%
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
+ \fi
\else
- \clf_truefontname{#name}%
+ #name\ifx#first\empty\else*#first#rest\fi
\fi\fi\fi}
+\def\font_helpers_true_fontname_check#name%
+ {\expandafter\font_helpers_true_fontname_check_indeed#name*\relax}
+
+\def\font_helpers_true_fontname_check_indeed#name*#crap\relax
+ {\ifcsname\??fontfile\fontclass#name\endcsname
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs
+ \else\ifcsname\??fontfile\defaultfontclass#name\endcsname
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs
+ \else\ifcsname\??fontfile#name\endcsname
+ %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname
+ \expandafter\font_helpers_true_fontname_check\lastnamedcs
+ \else
+ #name%
+ \fi\fi\fi}
+
+% ok when the last lookup is not stripped .. we ned to be able to define synonyms for symbols
+%
+% \def\truefontname#name%
+% %{\normalexpanded{\noexpand\font_helpers_true_fontname{\clf_truefontname{#name}}}}
+% {\expandafter\expandafter\expandafter\font_helpers_true_fontname\expandafter\expandafter\expandafter{\clf_truefontname{#name}}}
+%
+% \def\font_helpers_true_fontname#name%
+% {\ifcsname\??fontfile\fontclass#name\endcsname
+% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+% \else\ifcsname\??fontfile\defaultfontclass#name\endcsname
+% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+% \else\ifcsname\??fontfile#name\endcsname
+% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
+% \else
+% % \clf_truefontname{#name}%
+% #name% so the last one can have features !
+% \fi\fi\fi}
+
\def\expandfontsynonym#command#name% one level expansion
{\ifcsname\??fontfile\fontclass#name\endcsname
%\expandafter\normaldef\expandafter#command\expandafter{\csname\??fontfile\fontclass#name\endcsname}%