texlive[51348] Master/texmf-dist: combofont (8jun19)
commits+karl at tug.org
commits+karl at tug.org
Sat Jun 8 23:43:10 CEST 2019
Revision: 51348
http://tug.org/svn/texlive?view=revision&revision=51348
Author: karl
Date: 2019-06-08 23:43:09 +0200 (Sat, 08 Jun 2019)
Log Message:
-----------
combofont (8jun19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/lualatex/combofont/README.md
trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex
trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.pdf
trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.tex
trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty
Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/README.md 2019-06-08 21:42:57 UTC (rev 51347)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/README.md 2019-06-08 21:43:09 UTC (rev 51348)
@@ -2,7 +2,8 @@
An EXPERIMENTAL package to add nfss-declaration of combo fonts to a luaLaTeX document
-Version 0.2 copyright Ulrike Fischer 2017-
+Version 0.3 2019/06/08
+copyright Ulrike Fischer
## License
Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex 2019-06-08 21:42:57 UTC (rev 51347)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex 2019-06-08 21:43:09 UTC (rev 51348)
@@ -1,5 +1,5 @@
% !Mode:: "TeX:DE:UTF-8:Main"
-
+%% Date 2017/07/03 Version 0.2 combofont example
\documentclass[parskip=full]{scrartcl}
\usepackage{luacode}
@@ -26,7 +26,7 @@
)
\end{luacode}
-\usepackage{unicode-math}
+\usepackage[math-style=upright]{unicode-math}
\usepackage{combofont}
\setmainfont{Fira Sans}
@@ -41,7 +41,7 @@
{%
{},
0x30-0x39,
- 0x61-0x7A
+ 0x61-0x7A*0x03B1-0x03C9
}
\setupcombofont{FiraMathScript}
@@ -48,12 +48,12 @@
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT;+ssty=0 at #1pt,
file:firasans-regular.otf at #1pt,
- file:firasans-regularitalic.otf at #1pt
+ file:firasans-italic.otf at #1pt
}
{%
{},
0x30-0x39,
- 0x61-0x7A
+ 0x61-0x7A*0x03B1-0x03C9
}
\setupcombofont{FiraMathScriptScript}
@@ -65,20 +65,20 @@
{%
{},
0x30-0x39,
- 0x61-0x7A
+ 0x61-0x7A*0x03B1-0x03C9
}
-
-% Mathversion bold need Script and ScriptScript declarations too!
+
+% Mathversion bold need Script and ScriptScript declarations too!
\setupcombofont{FiraMathBold}
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT; at #1pt,
file:firasans-regular.otf at #1pt,
- file:firasans-regularitalic.otf at #1pt
+ file:firasans-italic.otf at #1pt
}
{%
{},
0x30-0x39,
- 0x61-0x7A
+ 0x61-0x7A*0x03B1-0x03C9
}
@@ -101,19 +101,12 @@
\SetSymbolFont{operators}{bold}{TU}{FiraMath}{bx}{n}
-% Map a etc to the ascii range. Original values can be found with
-% [\Umathcharclass `\a] [\Umathcharfam `\a] [\Umathcharslot `\a]
+% Map "a" etc to the ascii range. Original values can be found with
+%[\Umathcharclass `\a] [\Umathcharfam `\a] [\Umathcharslot `\a]
+% not needed because of math-style=upright
+%\Umathcode `\a = "7 "0 "61
-\Umathcode `\a = "7 "0 "61
-\Umathcode `\b = "7 "0 "62
-\Umathcode `\c = "7 "0 "63
-\Umathcode `\d = "7 "0 "64
-\Umathcode `\e = "7 "0 "65
-\Umathcode `\f = "7 "0 "66
-\Umathcode `\g = "7 "0 "67
-\Umathcode `\h = "7 "0 "68
-
\begin{document}
\minisec{Test some symbols}
Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.tex 2019-06-08 21:42:57 UTC (rev 51347)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.tex 2019-06-08 21:43:09 UTC (rev 51348)
@@ -1,8 +1,9 @@
% !Mode:: "TeX:DE:UTF-8:Main"
-\RequirePackage{luatex85}
\documentclass[parskip=half-,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage{combofont}
\usepackage{ydoc-code,ydoc-desc}
+\usepackage[english]{babel}
+\usepackage[autostyle]{csquotes}
\usepackage{fontspec}
\usepackage{xcolor}
@@ -38,7 +39,9 @@
\DeclareFontShape{TU} {combotest}{m}{n}{<->combo*combotest-regular}{}
\DeclareFontShape{TU} {combotest}{bx}{n}{<->combo*combotest-bold}{}
-\title{The \texttt{combofont} package}
+\title{The \texttt{combofont} package \\
+{\normalsize Version \csname UlrikeFischer at package@ufcombofont at version\endcsname\
+from \csname UlrikeFischer at package@ufcombofont at date\endcsname}}
\author{Ulrike Fischer\thanks{fischer at troubleshooting-tex.de}}
\newcommand\package[1]{\texttt{#1}}
\begin{document}
@@ -46,22 +49,22 @@
\section{Status: EXPERIMENTAL}
-This is a EXPERIMENTAL package.
+This is an EXPERIMENTAL package.
-It can disappear without notice e.\,g. if the \package{luaotfload} changes so that it no longer work, or if luatex changes, or if \package{fontspec} includes the code.
+It can disappear without notice e.\,g. if the \package{luaotfload} changes so that it no longer works, or if luatex changes, or if \package{fontspec} includes the code.
-It is also possible that syntax and commands change in a incompatible way. So if you use it in a production environment: \textbf{You have been warned}.
+It is also possible that syntax and commands change in an incompatible way. So if you use it in a production environment: \textbf{You have been warned}.
\section{Introduction}
-In version 2.7. \package{luaotfload} supports combining characters from multiple fonts into a single virtualized one.
+In version 2.7 \package{luaotfload} supports combining characters from multiple fonts into a single virtualized one.
That means that one can build a font that takes e.g. the capital letters from a sans serif font and the lowercase letters from a serif font. Or a font that pulls in missing greek or cyrillic glyphs from another font.
-The methods pulls in \emph{only} glyphs. It is not suitable for every imaginable font combination -- some drawbacks are described below -- and one should use it with care. Nevertheless it is a quite neat extension of the tools to manipulate fonts.
+The method pulls in \emph{only} glyphs. It is not suitable for every imaginable font combination -- some drawbacks are described below -- and one should use it with care. Nevertheless it is a quite neat extension of the tools to manipulate fonts.
-The main problem with the examples in the \package{luaotfload} manual is that it creates fonts of a fix size. This means that they don't respond to command like \verb+\large+ or \verb+\footnotesize+.
+The main problem with the examples in the \package{luaotfload} manual is that they create fonts of a fix size. This means that they don't respond to command like \verb+\large+ or \verb+\footnotesize+.
-After trying around a bit and then asking a question (https://tex.stackexchange.com/questions/371647/call-a-luatex-combo-font-through-nfss) I got from David Carlisle the idea to use a \texttt{size}-Funktion which one define with \verb+\DeclareSizeFunction+ to inject the needed code to size the combo-font in a nfss-\verb+\DeclareFontShape+-command.
+After trying around a bit and then asking a question (https://tex.stackexchange.com/questions/371647/call-a-luatex-combo-font-through-nfss) I got from David Carlisle the idea to use a \texttt{size}-Funktion which one defines with \verb+\DeclareSizeFunction+ to inject the needed code to size the combo-font in a nfss-\verb+\DeclareFontShape+-command.
\package{combofont.sty} is the result.
@@ -68,7 +71,7 @@
It is not meant as a production package but as package that helps to exploit the use of combo fonts.
\section{Requirements}
-You need at least an up-to-date TeXLive 2016. TeXLive 2017 with luatex 1.0.4. or a current miktex is better.
+You need at least an up-to-date TeXLive 2016. TeXLive 2017 with luatex 1.0.4 or a current miktex is better.
\textbf{Change Version 0.2, 3.7.2017}: The style no longer loads the now obsolete \texttt{l3regex}, it assumes that it is loaded by \texttt{expl3}. In older \TeX-systems you will have to load the package.
@@ -88,7 +91,7 @@
\DescribeMacro\setupcombofont{<name>}{<comma list of basefonts>}{<comma list of ranges and code-points>}
\begin{description}
- \item[\marg{name}] is the name of the font. It should be some unique ascii-string without spaces. If you intent to define lots of fonts it would be a good idea to think about a sensible naming sheme. In the example here I simply used \texttt{combotest-regular} and \texttt{combotest-bold}.
+ \item[\marg{name}] is the name of the font. It should be some unique ascii-string without spaces. If you intend to define lots of fonts it would be a good idea to think about a sensible naming sheme. In the example here I simply used \texttt{combotest-regular} and \texttt{combotest-bold}.
\item[\marg{comma list of basefonts}] This should be a list of font declarations you want to use to build your combo font. The syntax used is described in the \package{luaotfload} manual. Example:
@@ -105,8 +108,8 @@
\item[Order of the fonts] The first font is the main font which will receive the glyphs. So think carefully which font is should be and setup its font features correctly. \package{combofont} defines as a helper command \verb+\combodefaultfeat+ which sets \texttt{mode=node;script=latn;language=DFLT;+tlig;}.
\item[Size declaration] The font description should end with a size declaration line \verb+at #1pt+. When processing the font \verb+#1+ will be replaced by the current font size. As you can see in the second font you can do calculations. \emph{Don't forget the size declaration!}
-
-\item Be careful with the commas: there shouldn't be one after the last font.
+
+\item Be careful with the commas: there shouldn't be one after the last font.
\end{description}
\item[\marg{comma list of ranges and code-points}] This is a comma list of settings which describe which glyphs are taken from the respective font. Example:
@@ -124,13 +127,13 @@
\item There should be as many settings as there are fonts.
\item Empty entries should be marked with a pair of braces (normally the first entry is empty).
\item You can add ranges of code points and single code points. Blocks are separated by an asterix \verb+*+. The example set the uppercase letters and the exclamation and the question mark.
-\item The keyword \texttt{fallback} means that this font is used for „missing glyphs“ (in the example for the cyrillic glyphs).
+\item The keyword \texttt{fallback} means that this font is used for \enquote{missing glyphs} (in the example for the cyrillic glyphs).
\end{enumerate}
\end{description}
\subsection{Write \texttt{nfss}-declarations}
-After all the fonts you need have been setup, you can write suitable \texttt{nfss}-declaration which make it possible to call the font by family and other font commands. Example:
+After all the fonts you need have been setup, you can write suitable \texttt{nfss}-declarations which make it possible to call the font by family and other font commands. Example:
\begin{verbatim}
\DeclareFontFamily{TU}{combotest}{}
@@ -183,17 +186,17 @@
\minisec{Important points:}
\begin{enumerate}
\item This a first try to get something working in math. It is in no way finished or complete, I'm rather certain that something will be missing or even faulty.
-\item Start with a real math font with a math constants table.
-\item Don't expect to get a perfect sans serif math font this way without work. It can take quite some time to adjust everything. Also a text font is not really meant to be used as math font.
+\item Start with a real math font with a math constants table.
+\item Don't expect to get a perfect sans serif math font this way without work. It can take quite some time to adjust everything. Also a text font is not really meant to be used as math font.
\item The lua-code for the font patch compares \texttt{fontdata.psname} with the string \\\texttt{TeXGyrePagellaMath-Regular} to restrict the patch to the specific font.
The font name database of luaotfload-names.lua contains for \textsf{TeX Gyre Pagella Math} these entries:
-
+
\begin{verbatim}
["plainname"]="TeXGyrePagellaMath-Regular",
["psname"]="texgyrepagellamathregular",
\end{verbatim}
-
+
As you can see the correct string for the comparision with \texttt{fontdata.psname} is in \verb+["plainname"]+ and not in \verb+["psname"]+. Don't ask me why. \texttt{luaotfload} seems to copy the infos around quite a lot. So when adapting the code to other fonts, test with various font names if it seems not to work.
\end{enumerate}
Modified: trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty 2019-06-08 21:42:57 UTC (rev 51347)
+++ trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty 2019-06-08 21:43:09 UTC (rev 51348)
@@ -1,14 +1,22 @@
+% !Mode:: "TeX:DE:UTF-8:Main"
+%28.05.2018
+\def\UlrikeFischer at package@ufcombofont at date{2019/06/08}\def\UlrikeFischer at package@ufcombofont at version{0.3}
+
\RequirePackage{xparse}
-\ProvidesExplPackage {combofont} {2017/07/03} {0.2}
+\ProvidesExplPackage {combofont} {\UlrikeFischer at package@ufcombofont at date}{\UlrikeFischer at package@ufcombofont at version}
{An EXPERIMENTAL package to add nfss-declaration of combo fonts to a luaLaTeX document}
% highly experimental! Comments to Ulrike Fischer. fischer at troubleshooting-tex.de
+\prop_if_exist:NT \g_msg_module_name_prop
+ {
+ \prop_gput:Nnn \g_msg_module_name_prop { ufcombo }{ combofont }
+ }
-\msg_new:nnn {combo} {need-luatex}
+\msg_new:nnn {ufcombo} {need-luatex}
{
The~ combofont~package~requires~LuaLaTeX.~Quitting.
}
-\msg_new:nnn {combo} {combofont-already-exists}
+\msg_new:nnn {ufcombo} {combofont-already-exists}
{
The~combofont~#1~has~already~been~set~up.~I~won't~overwrite~it
}
@@ -15,7 +23,7 @@
\sys_if_engine_luatex:F
{
- \msg_fatal:nn {combo} {need-luatex}
+ \msg_fatal:nn {ufcombo} {need-luatex}
\endinput
}
@@ -28,29 +36,29 @@
\tl_set:Nn\l_tmpa_tl { #2 }
\regex_replace_all:nnN {\#1} {\c{f at size}} \l_tmpa_tl
% \tl_show:N\l_tmpa_tl
- \seq_if_exist:cTF { l__combo_#1_basefonts_seq }
+ \seq_if_exist:cTF { l__ufcombo_#1_basefonts_seq }
{
- \msg_warning:nnn { combo} {combofont-already-exists} { #1 }
+ \msg_warning:nnn { ufcombo} {combofont-already-exists} { #1 }
}
{
- \seq_new:c { l__combo_#1_basefonts_seq }
- \seq_set_split:cnV { l__combo_#1_basefonts_seq } { , }\l_tmpa_tl
- %%\seq_show:c {l__combo_#1_basefonts_seq }
- \seq_new:c { l__combo_#1_combodesc_seq }
- \seq_set_from_clist:cn { l__combo_#1_combodesc_seq } { #3 }
- %%\seq_show:c { l__combo_#1_combodesc_seq }
- \__combo_build_combodesc:n { #1 }
+ \seq_new:c { l__ufcombo_#1_basefonts_seq }
+ \seq_set_split:cnV { l__ufcombo_#1_basefonts_seq } { , }\l_tmpa_tl
+ %%\seq_show:c {l__ufcombo_#1_basefonts_seq }
+ \seq_new:c { l__ufcombo_#1_combodesc_seq }
+ \seq_set_from_clist:cn { l__ufcombo_#1_combodesc_seq } { #3 }
+ %%\seq_show:c { l__ufcombo_#1_combodesc_seq }
+ \__ufcombo_build_combodesc:n { #1 }
}
}
-\cs_new:Nn \__combo_call_basefonts:n
+\cs_new:Nn \__ufcombo_call_basefonts:n
{
\int_zero:N \l_tmpa_int
- \seq_map_inline:cn {l__combo_#1_basefonts_seq}
+ \seq_map_inline:cn {l__ufcombo_#1_basefonts_seq}
{
\int_incr:N \l_tmpa_int
- \exp_args:Nc \font { l_combo_tmpfont_\int_to_roman:n{\l_tmpa_int}_tl } = ##1
+ \exp_args:Nc \font { l__ufcombo_tmpfont_\int_to_roman:n{\l_tmpa_int}_tl } = ##1
}
}
@@ -59,38 +67,38 @@
-\cs_new:Nn \__combo_build_combodesc:n
+\cs_new:Nn \__ufcombo_build_combodesc:n
{
- \tl_new:c { l__combo_#1_combodesc_tl }
- \tl_set:cx { l__combo_#1_combodesc_tl } { \tl_to_str:n { " } combo \tl_to_str:n { : }~ }
- \int_step_inline:nnnn { 1 } { 1 } { \seq_count:c { l__combo_#1_basefonts_seq } }
+ \tl_new:c { l__ufcombo_#1_combodesc_tl }
+ \tl_set:cx { l__ufcombo_#1_combodesc_tl } { \tl_to_str:n { " } combo \tl_to_str:n { : }~ }
+ \int_step_inline:nnnn { 1 } { 1 } { \seq_count:c { l__ufcombo_#1_basefonts_seq } }
{
- \tl_put_right:cn { l__combo_#1_combodesc_tl } { ##1~->~\fontid }
- \exp_args:Nnc \tl_put_right:cn { l__combo_#1_combodesc_tl }
+ \tl_put_right:cn { l__ufcombo_#1_combodesc_tl } { ##1~->~\fontid }
+ \exp_args:Nnc \tl_put_right:cn { l__ufcombo_#1_combodesc_tl }
{
- l_combo_tmpfont_\int_to_roman:n{##1}_tl
+ l__ufcombo_tmpfont_\int_to_roman:n{##1}_tl
}
- \tl_set:Nx\l_tmpa_tl { \seq_item:cn {l__combo_#1_combodesc_seq } {##1} }
+ \tl_set:Nx\l_tmpa_tl { \seq_item:cn {l__ufcombo_#1_combodesc_seq } {##1} }
\tl_if_empty:NF \l_tmpa_tl
{
- \tl_put_right:cx { l__combo_#1_combodesc_tl}
+ \tl_put_right:cx { l__ufcombo_#1_combodesc_tl}
{
- ,~ \seq_item:cn {l__combo_#1_combodesc_seq } {##1}
+ ,~ \seq_item:cn {l__ufcombo_#1_combodesc_seq } {##1}
}
}
- \tl_put_right:cx { l__combo_#1_combodesc_tl} {\tl_to_str:n{;}}
+ \tl_put_right:cx { l__ufcombo_#1_combodesc_tl} {\tl_to_str:n{;}}
}
- \tl_put_right:cx { l__combo_#1_combodesc_tl } { \tl_to_str:n { " } }
- %% \tl_show:c { l__combo_#1_combodesc_tl }
+ \tl_put_right:cx { l__ufcombo_#1_combodesc_tl } { \tl_to_str:n { " } }
+ %% \tl_show:c { l__ufcombo_#1_combodesc_tl }
}
-\DeclareSizeFunction{combo}{\__combo_sfcnt:}
+\DeclareSizeFunction{combo}{\__ufcombo_sfcnt:}
-\cs_new:Nn\__combo_sfcnt:
+\cs_new:Nn\__ufcombo_sfcnt:
{
- % \tl_show:c {l__combo_\use:c{mandatory at arg}_combodesc_tl}
- \__combo_call_basefonts:n { \mandatory at arg }
- \tl_set_eq:Nc \external at font { l__combo_\use:c{mandatory at arg}_combodesc_tl}
+ % \tl_show:c {l__ufcombo_\use:c{mandatory at arg}_combodesc_tl}
+ \__ufcombo_call_basefonts:n { \mandatory at arg }
+ \tl_set_eq:Nc \external at font { l__ufcombo_\use:c{mandatory at arg}_combodesc_tl}
}%
\tl_new:N\combodefaultfeat
More information about the tex-live-commits
mailing list