texlive[44746] Master/texmf-dist: combofont (3jul17)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 3 22:59:09 CEST 2017


Revision: 44746
          http://tug.org/svn/texlive?view=revision&revision=44746
Author:   karl
Date:     2017-07-03 22:59:09 +0200 (Mon, 03 Jul 2017)
Log Message:
-----------
combofont (3jul17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/combofont/README.md
    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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
    trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex

Modified: trunk/Master/texmf-dist/doc/lualatex/combofont/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/README.md	2017-07-03 20:58:40 UTC (rev 44745)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/README.md	2017-07-03 20:59:09 UTC (rev 44746)
@@ -2,7 +2,7 @@
 
 An EXPERIMENTAL package to add nfss-declaration of combo fonts to a luaLaTeX document
 
-Version 0.1  Ulrike Fischer 2017-
+Version 0.2 copyright Ulrike Fischer 2017-
 
 
 ## License
@@ -14,6 +14,7 @@
 - Readme.md (this file)
 - combofont.sty (the sty)
 - combofont.tex, combofont.pdf (the docu and example)
+- combofont-test-fira-math.tex and pdf (and example for math)
 
 
 ## Installation

Added: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf	2017-07-03 20:58:40 UTC (rev 44745)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf	2017-07-03 20:59:09 UTC (rev 44746)

Property changes on: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex	2017-07-03 20:59:09 UTC (rev 44746)
@@ -0,0 +1,132 @@
+% !Mode:: "TeX:DE:UTF-8:Main"
+
+\documentclass[parskip=full]{scrartcl}
+
+\usepackage{luacode}
+
+%As a test I patch the FraktionNumeratorShift by a large value
+% and add it to the luaotfload patch_font callback:
+\begin{luacode}
+
+local patch_texgyrepagellamath = function (fontdata)
+ local mathconstants = fontdata.MathConstants
+ if mathconstants and fontdata.psname == "TeXGyrePagellaMath-Regular"
+ then
+    mathconstants.FractionNumeratorDisplayStyleShiftUp=5.5*mathconstants.FractionNumeratorDisplayStyleShiftUp
+    mathconstants.FractionNumeratorShiftUp=5.5*mathconstants.FractionNumeratorShiftUp
+ end
+end
+
+
+luatexbase.add_to_callback
+ (
+  "luaotfload.patch_font",
+  patch_texgyrepagellamath,
+  "change_texgyrepagellamath"
+ )
+\end{luacode}
+
+\usepackage{unicode-math}
+\usepackage{combofont}
+
+\setmainfont{Fira Sans}
+
+
+\setupcombofont{FiraMath}
+ {%
+ file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT; at #1pt,
+ file:firasans-light.otf at #1pt,
+ file:firasans-lightitalic.otf at #1pt
+ }
+ {%
+ {},
+ 0x30-0x39,
+ 0x61-0x7A
+ }
+
+\setupcombofont{FiraMathScript}
+ {%
+ 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
+ }
+ {%
+ {},
+ 0x30-0x39,
+ 0x61-0x7A
+ }
+
+\setupcombofont{FiraMathScriptScript}
+ {%
+ file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT;+ssty=1 at #1pt,
+ file:firasans-semibold.otf at #1pt,
+ file:firasans-semibolditalic.otf at #1pt
+ }
+ {%
+ {},
+ 0x30-0x39,
+ 0x61-0x7A
+ }
+ 
+% 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
+ }
+ {%
+ {},
+ 0x30-0x39,
+ 0x61-0x7A
+ }
+
+
+\DeclareFontFamily{TU}{FiraMath}{}
+\DeclareFontShape {TU}{FiraMath}{m}{n}
+  {
+    <-7> combo*FiraMathScriptScript
+   <7-10>combo*FiraMathScript
+   <10-> combo*FiraMath
+  }{}
+
+\DeclareFontShape {TU}{FiraMath}{bx}{n} {<->combo*FiraMathBold}{}
+
+% better start with a real math font, so that
+% unicode sets everything up
+\setmathfont{TeX Gyre Pagella Math}%
+
+% Perhaps some other symbol fonts will need setup too
+\SetSymbolFont{operators}{normal}{TU}{FiraMath}{m}{n}
+\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]
+
+\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}
+
+$123 - a^{a^a} + 1^{1^1} abc = \sqrt{hhhhhhhhhhh}$
+
+\minisec{Test patching}
+
+$\frac{1}{9}$
+
+\minisec{Test math version}
+
+\mathversion{bold}
+$123 - a^{a^a} + 1^{1^1} abc = \frac{1}{9} $
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/lualatex/combofont/combofont-test-fira-math.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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	2017-07-03 20:58:40 UTC (rev 44745)
+++ trunk/Master/texmf-dist/doc/lualatex/combofont/combofont.tex	2017-07-03 20:59:09 UTC (rev 44746)
@@ -68,9 +68,11 @@
 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.
 
+
 \section{Using combo fonts}
 
 To be able to use a combo font with standard \LaTeX\ font commands you have to do two things (the source code of this documentation is a complete example):
@@ -102,7 +104,9 @@
 \begin{description}
 \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.
+\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.    
 \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:
@@ -140,7 +144,7 @@
 \section{Demonstration}
 
 
-\verb+\fontfamily{combotest}\selectfont+: 
+\verb+\fontfamily{combotest}\selectfont+:
 \fontfamily{combotest}\selectfont
 Some Text with Capital Words!
 Eh bien, mon prince. Gênes et Lueques ne sont plus que des
@@ -171,6 +175,29 @@
 %
 
 \normalfont\normalsize
+
+\section{About Math (new in version 0.2)}\enlargethispage{2\baselineskip}
+
+Combofonts can also be used in math. There is a test file called \texttt{combofont-test-fira-math.tex} which shows how one can combine \textsf{TeX Gyre Pagella Math} with the \textsf{Fira Sans} textfont. It also shows how one can patch the font to adjust values of the math table.
+
+\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  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}
+
+
 \section{Remarks and open questions}
 
 As mentioned in the introduction a combo font only pulls in glyphs. This has a lot of (not all yet understood or seen) side effects. Here a few things that should be considered when building a combo font:

Modified: trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty	2017-07-03 20:58:40 UTC (rev 44745)
+++ trunk/Master/texmf-dist/tex/lualatex/combofont/combofont.sty	2017-07-03 20:59:09 UTC (rev 44746)
@@ -1,5 +1,5 @@
 \RequirePackage{xparse}
-\ProvidesExplPackage {combofont} {2017/05/26} {0.1}
+\ProvidesExplPackage {combofont} {2017/07/03} {0.2}
   {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
 
@@ -19,7 +19,7 @@
    \endinput
  }
 
-\RequirePackage{xfp,l3regex}
+\RequirePackage{xfp}
 
 \cs_generate_variant:Nn \seq_set_split:Nnn {cnV}
 



More information about the tex-live-commits mailing list