texlive[63233] trunk: luafindfont (5may22)

commits+karl at tug.org commits+karl at tug.org
Thu May 5 22:16:01 CEST 2022


Revision: 63233
          http://tug.org/svn/texlive?view=revision&revision=63233
Author:   karl
Date:     2022-05-05 22:16:01 +0200 (Thu, 05 May 2022)
Log Message:
-----------
luafindfont (5may22)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/luafindfont/luafindfont.lua
    trunk/Master/texmf-dist/doc/man/man1/luafindfont.1
    trunk/Master/texmf-dist/doc/man/man1/luafindfont.man1.pdf
    trunk/Master/texmf-dist/doc/support/luafindfont/CHANGELOG
    trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.pdf
    trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.tex
    trunk/Master/texmf-dist/scripts/luafindfont/luafindfont.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/luafindfont/luafindfont.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/luafindfont/luafindfont.lua	2022-05-05 20:15:32 UTC (rev 63232)
+++ trunk/Build/source/texk/texlive/linked_scripts/luafindfont/luafindfont.lua	2022-05-05 20:16:01 UTC (rev 63233)
@@ -4,10 +4,10 @@
 --         FILE:  luafindfont.lua
 --  DESCRIPTION:  search for fonts in the database
 -- REQUIREMENTS:  luatex v.0.80 or later; packages lualibs, xindex-lapp
---       AUTHOR:  Herbert Voß  (C) 2022-05-01
+--       AUTHOR:  Herbert Voß  (C) 2022-05-05
 -----------------------------------------------------------------------
         luafindfont = luafindfont or { }
-   local version = 0.07
+   local version = 0.08
 luafindfont.version = version
 
 --[[
@@ -42,12 +42,13 @@
 end
 
 local args_verbose = 0
-local args_nosymbolixnames = 0
+local args_nosymbolicnames = false
 local args_otfinfo = 0
 local args_info = 0
+local args_xetex = 0
 local args_max_string = 90
 
-local otfinfo_arg
+local otfinfo_arg = ""
 local fontNo = 0
 
 local i = 1
@@ -61,6 +62,7 @@
     parameter handling
     -h,--help
     -n,--nosymbolicnames
+      ,--no-symbolic-names
     -o,--otfinfo (default 0)
     -i,--info (default 0)
     -x, --xetex 
@@ -69,8 +71,8 @@
     <font> (string)  ]])
   elseif arg[i] == "-v" or arg[i] == "--verbose" then
     args_verbose = 1
-  elseif arg[i] == "-n" or arg[i] == "--nosymbolicnames" then
-    args_nosymbolicnames = 1
+  elseif (arg[i] == "-n") or (arg[i] == "--nosymbolicnames") or (arg[i] == "--no-symbolic-names") then
+    args_nosymbolicnames = true
   elseif arg[i] == "-x" or arg[i] == "--xetex" then
     args_xetex = 1
   elseif arg[i] == "-o" or arg[i] == "--otfinfo" then
@@ -110,6 +112,16 @@
   i = i + 1
 end
 
+if args_verbose > 0 then
+  print("Parameter:")
+  print("args_verbose = "..args_verbose)
+  print("args_nosymbolicnames = "..tostring(args_nosymbolicnames))
+  print("args_xetex = "..args_xetex)
+  print("otfinfo_arg = "..otfinfo_arg)
+  print("fontNo = "..fontNo)
+  print("args_max_string = "..args_max_string)
+end
+  
 if not args_font then
   print("No fontname given, will close ...")
   os.exit()
@@ -124,10 +136,13 @@
 if #font_str == 1 then font_str[2] = "" end
 
 local luaVersion = _VERSION
-print("We are using "..luaVersion)
-if font_str[2] ~= "" then
-  print('Looking for font \"'..font_str[1]..' & '..font_str[2]..'\"')
-else
+if vlevel > 0 then 
+  print("We are using "..luaVersion)
+  if font_str[2] ~= "" then
+     print('Looking for font \"'..font_str[1]..' & '..font_str[2]..'\"')
+  end
+end
+if font_str[1] == "*" or vlevel > 0 then 
   print('Looking for font \"'..font_str[1]..'\"')
 end
 
@@ -243,7 +258,7 @@
 
 if not fontData then   
   print("umghhh ....")
-  print("It does not work! I'll give it up ... :-(")
+  print("It does not work! I cannote find the base data file ... I'll give it up ... :-(")
   os.exit()
 end
 
@@ -290,7 +305,7 @@
 local l_max = {1, 1, 1}
 for i, v in ipairs(fontDataMap) do 
   if v["familyname"] then
-      if (string.find (v["familyname"]:lower(), font_str[1], 1, true)  and string.find (v["basename"]:lower(), font_str[2], 1, true) ) or (font_str == "*") then
+      if (string.find (v["familyname"]:lower(), font_str[1], 1, true)  and string.find (v["basename"]:lower(), font_str[2], 1, true) ) or (font_str[1] == "*") then
 --	print(string.format("%2d. %30s %20s  %50s",j,v["basename"],v["familyname"],v["fullpath"])) 
         fontList[#fontList+1] = v
         local fullpath = getFileParts(v["fullpath"],"path")  -- strip file name
@@ -312,14 +327,15 @@
 local Path = "Path"
 local SymbolicName = "Symbolic Name"
 local lfdNr = "No."
+
 if (font_str ~= "*") and not noSymbolicNames then
-  if args_xetex then
+  if args_xetex > 0 then
     print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s".."%4s",lfdNr,Fontname,SymbolicName,Path,"X")) 
   else      
     print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path)) 
   end
 else
-  if args_xetex then
+  if args_xetex > 0 then
     print(string.format("%5s %"..l_max[1].."s  %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X")) 
   else
     print(string.format("%5s %"..l_max[1].."s  %"..l_max[3].."s",lfdNr,Fontname,Path)) 
@@ -339,13 +355,13 @@
     kpsewhich = "0"
   end
   if (font_str ~= "*") and not noSymbolicNames then
-    if args_xetex then
+    if args_xetex > 0 then
       print(string.format("%4d. %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s".." %3s",i,v["basename"],v["familyname"],path,kpsewhich)) 
     else
       print(string.format("%4d. %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s",i,v["basename"],v["familyname"],path)) 
     end
   else
-    if args_xetex then
+    if args_xetex > 0 then
       print(string.format("%4d. %"..l_max[1].."s  %"..l_max[3].."s".." %3s",i,v["basename"],path,kpsewhich)) 
     else    
       print(string.format("%4d. %"..l_max[1].."s  %"..l_max[3].."s",i,v["basename"],path)) 
@@ -355,7 +371,7 @@
 
 if fontNo > 0 then
   print()
-  print("Run otfinfo -"..otfinfo_arg..": "..fontNo)
+  print("Running otfinfo -"..otfinfo_arg.." on font no."..fontNo)
   local font = fontList[fontNo]["fullpath"]
   print("otfinfo -"..otfinfo_arg.." \""..font.."\"")
   local exrun = io.popen("otfinfo -"..otfinfo_arg.." \""..font.."\"", 'r') -- ".." font may have spaces

Modified: trunk/Master/texmf-dist/doc/man/man1/luafindfont.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/luafindfont.1	2022-05-05 20:15:32 UTC (rev 63232)
+++ trunk/Master/texmf-dist/doc/man/man1/luafindfont.1	2022-05-05 20:16:01 UTC (rev 63233)
@@ -1,6 +1,6 @@
 .\" Manpage for luafindfont.
 .\" Contact hvoss at tug.org to correct errors or typos.
-.TH luafindfont 1 "08 feb 2022" "0.06" "luafindfont man page"
+.TH luafindfont 1 "05 may 2022" "0.08" "luafindfont man page"
 .SH NAME
 luafindfont
 \- retrieve font informations of all installed system and TeX fonts.
@@ -23,10 +23,10 @@
 .IP -v,--verbose  Verbosity level
 Give more informations, by now only -v works
 .IP -x,--xetex  
-test, if font is found by xetex via kpsewhich
+test, if font is found by xetex via kpsewhich 0->no; 1->yes
 .IP -m,--max_string (default 90)
 The maximum of the stringlength of the full path of fonts
-.IP -n,--nosymbolicnames
+.IP -n,--no-symbolic-names  (altenatively --nosymbolicnames)
 The fontlist contains only fontfile and fontpath
 .IP <fontname> 
 Can be a substring, e.g. times,  or a combination of two substrings 
@@ -34,7 +34,7 @@
 All strings are not case sensitive. Upper and lowercase can be mixed.
 .SH EXAMPLES
 
-$ luafindfont libertinssans
+$ luafindfont libertinussans
 
 .Pp 
 Lists all fonts which have names or part of like libertinussans 
@@ -41,14 +41,12 @@
 
 .nf
 .ft CW
-We are using Lua 5.3
-Check for file /usr/local/texlive/texmf-var/luatex-cache/generic/names/luaotfload-names
- 1.    LibertinusSans-Bold.otf libertinussans                          /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Bold.otf
- 2.    LibertinusSans-Bold.otf libertinussans  /usr/local/texlive/texmf-d...onts/opentype/public/libertinus-fonts/LibertinusSans-Bold.otf
- 3.  LibertinusSans-Italic.otf libertinussans                        /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Italic.otf
- 4.  LibertinusSans-Italic.otf libertinussans  /usr/local/texlive/texmf-d...ts/opentype/public/libertinus-fonts/LibertinusSans-Italic.otf
- 5. LibertinusSans-Regular.otf libertinussans                       /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Regular.otf
- 6. LibertinusSans-Regular.otf libertinussans  /usr/local/texlive/texmf-d...s/opentype/public/libertinus-fonts/LibertinusSans-Regular.otf
+bash-3.2$ ./luafindfont.lua libertinussans
+  No.                   Fontname  Symbolic Name                                                                        Path
+   1.    LibertinusSans-Bold.otf libertinussans  /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/libertinus-fonts/
+   2.  LibertinusSans-Italic.otf libertinussans  /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/libertinus-fonts/
+   3. LibertinusSans-Regular.otf libertinussans  /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/libertinus-fonts/
+
 .ft R
 .fi
 
@@ -62,8 +60,6 @@
 
 .nf
 .ft CW
-We are using Lua 5.3
-Check for file /usr/local/texlive/texmf-var/luatex-cache/generic/names/luaotfload-names
  1.    LibertinusSans-Bold.otf libertinussans                          /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Bold.otf
  2.    LibertinusSans-Bold.otf libertinussans  /usr/local/texlive/texmf-d...onts/opentype/public/libertinus-fonts/LibertinusSans-Bold.otf
  3.  LibertinusSans-Italic.otf libertinussans                        /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Italic.otf
@@ -71,7 +67,7 @@
  5. LibertinusSans-Regular.otf libertinussans                       /Users/voss/Library/Fonts/libertinus-fonts/LibertinusSans-Regular.otf
  6. LibertinusSans-Regular.otf libertinussans  /usr/local/texlive/texmf-d...s/opentype/public/libertinus-fonts/LibertinusSans-Regular.otf
 
-Run otfinfo:3
+Running otfinfo on font no.3
 Family:              Libertinus Sans
 Subfamily:           Italic
 Full name:           Libertinus Sans Italic
@@ -90,7 +86,7 @@
 .fi
 
 .Pp
-The --nosymbilcnames:
+The --no-symbolc-names:
 
 $ luafindfont -n 
 
@@ -100,8 +96,6 @@
 .nf
 .ft CW
 bash-3.2$ luafindfont -n minion
-We are using Lua 5.3
-Check for file /usr/local/texlive/texmf-var/luatex-cache/generic/names/luaotfload-names
  Nr.                 Fontname                                   Path
    1.      MinionMath-Bold.otf  /Users/voss/Library/Fonts/MinionMath/
    2.   MinionMath-Regular.otf  /Users/voss/Library/Fonts/MinionMath/

Modified: trunk/Master/texmf-dist/doc/man/man1/luafindfont.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/luafindfont/CHANGELOG
===================================================================
--- trunk/Master/texmf-dist/doc/support/luafindfont/CHANGELOG	2022-05-05 20:15:32 UTC (rev 63232)
+++ trunk/Master/texmf-dist/doc/support/luafindfont/CHANGELOG	2022-05-05 20:16:01 UTC (rev 63233)
@@ -1,3 +1,5 @@
+0.08  2022-05-05  - added --no-symbolic-names as a synonym
+                    edited some output messages
 0.07  2022-05-01  - added -x option for a kpsewhich test
 0.06  2022-02-08  - small fix for output log
 0.05  2021-12-04  - use always lowercase for internal search

Modified: trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.tex	2022-05-05 20:15:32 UTC (rev 63232)
+++ trunk/Master/texmf-dist/doc/support/luafindfont/luafindfont-doc.tex	2022-05-05 20:16:01 UTC (rev 63233)
@@ -37,7 +37,9 @@
 \usepackage{xltabular,pdflscape}
 \usepackage{hvlogos} % for Wikipedia W
 \usepackage{listings}
-\usepackage{hvextern} % for Wikipedia W
+\usepackage{hvextern}
+
+\setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename=false}
 \lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX}
 \usepackage{ragged2e}
 \usepackage{makeidx}\makeindex
@@ -77,9 +79,9 @@
 \def\setVersion#1{\setVVersion#1!!}
 \def\setVVersion#1=#2!!{\def\luafindfontVersion{#2}} 
 
-\setVersion{version = 0.07}%  can be automatically changed by perl
+\setVersion{version = 0.08}%  can be automatically changed by perl
 
-\setkeys{hv}{cleanup=true,force}
+\setkeys{hv}{cleanup={},force}
 
 \title{Program \texttt{luafindfont} \\--\\ \normalsize \luafindfontVersion\ (\today)}
 \author{\shortstack{Herbert Voß\\\small \href{mailto:hvoss at tug.org}{hvoss at tug.org}}}
@@ -93,6 +95,7 @@
 \vfill
 Thanks to: \\
 Gerhard Bachmaier;
+Karl Berry;
 Rolf Niepraschk;
 \clearpage
 
@@ -103,53 +106,31 @@
 the search-interface is somewhat cryptic and too complex for a user, who wants only to know
 if a font is present or not. And if present, where can it be found. For example:
 
-\begin{Verbatim}[frame=lines,label=luaotfload-tool]
-H-MacBook:~ voss$ 
-H-MacBook:~ voss$ luaotfload-tool --find=times
-luaotfload | resolve : Font "times" found!
-luaotfload | resolve : Resolved file name "/System/Library/Fonts/Times.ttc", subfont nr. 0
-H-MacBook:~ voss
-H-MacBook:~ voss$ luaotfload-tool --fuzzy --find="times new roman"
-luaotfload | resolve : Font "times new roman" found!
-luaotfload | resolve : Resolved file name "/System/Library/Fonts/Supplemental/Times New Roman.ttf"
-H-MacBook:~ voss$ 
-\end{Verbatim}
 
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luaotfload-tool --find=times
+#StopVisibleMain
+\end{externalDocument}
+
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luaotfload-tool --fuzzy --find="times new roman"
+#StopVisibleMain
+\end{externalDocument}
+
+
+
+
 But that are not \emph{all} Times fonts. Compare it with the output of \Lprog{luafindfont},
 where the searchname \emph{times} must only be a part of a longer name:
 
-\begin{Verbatim}[frame=lines,label=luafindfont times]
-bash-3.2$ luafindfont times
-We are using Lua 5.3
-Check for file /usr/local/texlive/texmf-var/luatex-cache/generic/names/luaotfload-names
- Nr.                         Fontname      Symbolic Name                                 Path
-   1.  Times New Roman Bold Italic.ttf      timesnewroman     /Users/voss/Library/Fonts/Times/
-   2.  Times New Roman Bold Italic.ttf      timesnewroman  /System/Library/Fonts/Supplemental/
-   3.         Times New Roman Bold.ttf      timesnewroman  /System/Library/Fonts/Supplemental/
-   4.         Times New Roman Bold.ttf      timesnewroman     /Users/voss/Library/Fonts/Times/
-   5.       Times New Roman Italic.ttf      timesnewroman  /System/Library/Fonts/Supplemental/
-   6.       Times New Roman Italic.ttf      timesnewroman     /Users/voss/Library/Fonts/Times/
-   7.              Times New Roman.ttf      timesnewroman  /System/Library/Fonts/Supplemental/
-   8.              Times New Roman.ttf      timesnewroman     /Users/voss/Library/Fonts/Times/
-   9.                        Times.ttc              times               /System/Library/Fonts/
-  10.             Times_Sans_Serif.ttf     timessansserif     /Users/voss/Library/Fonts/Times/
-  11.      TimesNewRomanMTStd-Bold.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  12.  TimesNewRomanMTStd-BoldCond.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  13.    TimesNewRomanMTStd-BoldIt.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  14.      TimesNewRomanMTStd-Cond.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  15.    TimesNewRomanMTStd-CondIt.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  16.    TimesNewRomanMTStd-Italic.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  17.           TimesNewRomanMTStd.otf timesnewromanmtstd     /Users/voss/Library/Fonts/Times/
-  18. TimesNewRomanPS-BoldItalicMT.otf  timesnewromanpsmt     /Users/voss/Library/Fonts/Times/
-  19.       TimesNewRomanPS-BoldMT.otf  timesnewromanpsmt     /Users/voss/Library/Fonts/Times/
-  20.            TimesNewRomanPSMT.otf  timesnewromanpsmt     /Users/voss/Library/Fonts/Times/
-  21.      TimesNewRomanPSStd-Bold.otf timesnewromanpsstd     /Users/voss/Library/Fonts/Times/
-  22.    TimesNewRomanPSStd-BoldIt.otf timesnewromanpsstd     /Users/voss/Library/Fonts/Times/
-  23.    TimesNewRomanPSStd-Italic.otf timesnewromanpsstd     /Users/voss/Library/Fonts/Times/
-  24.   TimesNewRomanPSStd-Regular.otf timesnewromanpsstd     /Users/voss/Library/Fonts/Times/
-\end{Verbatim}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont times
+#StopVisibleMain
+\end{externalDocument}
 
-%$
 
 
 \subsection{Syntax}
@@ -167,10 +148,10 @@
     -o,--otfinfo (default 0)
     -i,--info (default 0)
     -x,--xetex
-    -n,--nosymbolicnames
+    -n,--no-symbolic-names
     -v...          Verbosity output
     -m,--max_string (default 90)
-    <font> (string)  
+    <(partial) fontname>  
 \end{Verbatim}
 
 For example:
@@ -225,42 +206,14 @@
 \end{Verbatim}
 
 
-\begin{Verbatim}[frame=lines,label=luafindfont -o 2f "myriad \& semibold"]
-bash-3.2$ luafindfont -o 2f "myriad & semibold"
-We are using Lua 5.3
-Looking for font "myriad & semibold"
-Check for file /usr/local/texlive/2021/texmf-var/luatex-cache/generic/names/luaotfload-names
- No.                        Fontname Symbolic Name                                  Path
-   1.          MyriadPro-Semibold.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   2.      MyriadPro-SemiboldCond.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   3.    MyriadPro-SemiboldCondIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   4.        MyriadPro-SemiboldIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   5.    MyriadPro-SemiboldSemiCn.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   6.  MyriadPro-SemiboldSemiCnIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   7.   MyriadPro-SemiboldSemiExt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   8. MyriadPro-SemiboldSemiExtIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
 
-Run otfinfo -f: 2
-otfinfo -f "/Users/voss/Library/Fonts/MyriadPro/MyriadPro-SemiboldCond.otf"
-aalt	Access All Alternates
-case	Case-Sensitive Forms
-cpsp	Capital Spacing
-dnom	Denominators
-fina	Terminal Forms
-frac	Fractions
-kern	Kerning
-liga	Standard Ligatures
-lnum	Lining Figures
-numr	Numerators
-onum	Oldstyle Figures
-ordn	Ordinals
-pnum	Proportional Figures
-sinf	Scientific Inferiors
-sups	Superscript
-tnum	Tabular Figures
-zero	Slashed Zero
-\end{Verbatim}
 
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -o 2f "myriad & semibold"
+#StopVisibleMain
+\end{externalDocument}
+
 if no parameter is given, then \texttt{-i} is assumed.
 
 
@@ -269,25 +222,13 @@
 and which correspond to the font number. This is useful if a fontname doesn't has the style in its name or
 only in short form.
 
-\begin{Verbatim}[frame=lines,label=luafindfont -i 4 "myriad \& semibold"]
-bash-3.2$ luafindfont -i 4 "myriad & semibold"
-We are using Lua 5.3
-Looking for font "myriad & semibold"
-Check for file /usr/local/texlive/2021/texmf-var/luatex-cache/generic/names/luaotfload-names
- No.                        Fontname Symbolic Name                                  Path
-   1.          MyriadPro-Semibold.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   2.      MyriadPro-SemiboldCond.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   3.    MyriadPro-SemiboldCondIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   4.        MyriadPro-SemiboldIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   5.    MyriadPro-SemiboldSemiCn.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   6.  MyriadPro-SemiboldSemiCnIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   7.   MyriadPro-SemiboldSemiExt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
-   8. MyriadPro-SemiboldSemiExtIt.otf myriadpro  /Users/voss/Library/Fonts/MyriadPro/
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -i 4 "myriad & semibold"
+#StopVisibleMain
+\end{externalDocument}
 
-Font: myriadpro
 
-Fonttype otf(system) --> | Regular | Bold | Italic | BoldItalic |
-\end{Verbatim}
 
 For the font number 4 there also exists a Regular, Bold, and a Italic font. The font no 4 itself
 is a BoldItalic version.
@@ -303,14 +244,11 @@
 
 
 
-\begin{Verbatim}
-bash-3.2$ ./luafindfont.lua -x PStricksdotfont
-We are using Lua 5.3
-Looking for font "pstricksdotfont"
-No.            Fontname   Symbolic Name                                             Path   X
-  1.          myFont.otf pstricksdotfont   /usr/local/texlive/texmf-local/fonts/opentype/  0
-  2. PSTricksDotFont.otf pstricksdotfont   /usr/local/texlive/texmf-local/fonts/opentype/  1
-\end{Verbatim}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -x PStricksdotfont
+#StopVisibleMain
+\end{externalDocument}
 
 
 The font \texttt{myFont.otf} is found by \LuaTeX\ but not by \XeTeX.
@@ -320,32 +258,41 @@
 
 \section{Examples}
 
-\begin{Verbatim}
-bash-3.2$ luafindfont segoe
-\end{Verbatim}
 
-\VerbatimInput{Examples/exa01.txt}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont segoe
+#StopVisibleMain
+\end{externalDocument}
 
-\begin{Verbatim}
-bash-3.2$ luafindfont -m 40 libertinus
-\end{Verbatim}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -m 40 libertinus
+#StopVisibleMain
+\end{externalDocument}
 
-\VerbatimInput{Examples/exa02.txt}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -i 9 sego
+#StopVisibleMain
+\end{externalDocument}
 
 
-\begin{Verbatim}
-bash-3.2$ luafindfont -i 9 sego
-\end{Verbatim}
+\begin{landscape}
 
-\VerbatimInput{Examples/exa04.txt}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont -o 6 arial
+#StopVisibleMain
+\end{externalDocument}
 
 
-\begin{landscape}
-\begin{Verbatim}[fontsize=\small]
-bash-3.2$ luafindfont -o 6 arial
-\end{Verbatim}
+\begin{externalDocument}[redirect,includegraphic=false,force,code,docType=sh,ext=sh,compiler=sh]{exa}
+#StartVisibleMain
+luafindfont --no-symbolic-names minion
+#StopVisibleMain
+\end{externalDocument}
 
-\VerbatimInput[fontsize=\small]{Examples/exa03.txt}
 
 
 \section{List of all fonts}
@@ -363,16 +310,6 @@
 \end{landscape}
 
 
-\begin{Verbatim}[fontsize=\small]
-bash-3.2$ luafindfont -n minion
-\end{Verbatim}
-
-\VerbatimInput[fontsize=\small]{Examples/exa06.txt}
-
-
-
-
-
 \printindex
 
 \end{document}

Modified: trunk/Master/texmf-dist/scripts/luafindfont/luafindfont.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/luafindfont/luafindfont.lua	2022-05-05 20:15:32 UTC (rev 63232)
+++ trunk/Master/texmf-dist/scripts/luafindfont/luafindfont.lua	2022-05-05 20:16:01 UTC (rev 63233)
@@ -4,10 +4,10 @@
 --         FILE:  luafindfont.lua
 --  DESCRIPTION:  search for fonts in the database
 -- REQUIREMENTS:  luatex v.0.80 or later; packages lualibs, xindex-lapp
---       AUTHOR:  Herbert Voß  (C) 2022-05-01
+--       AUTHOR:  Herbert Voß  (C) 2022-05-05
 -----------------------------------------------------------------------
         luafindfont = luafindfont or { }
-   local version = 0.07
+   local version = 0.08
 luafindfont.version = version
 
 --[[
@@ -42,12 +42,13 @@
 end
 
 local args_verbose = 0
-local args_nosymbolixnames = 0
+local args_nosymbolicnames = false
 local args_otfinfo = 0
 local args_info = 0
+local args_xetex = 0
 local args_max_string = 90
 
-local otfinfo_arg
+local otfinfo_arg = ""
 local fontNo = 0
 
 local i = 1
@@ -61,6 +62,7 @@
     parameter handling
     -h,--help
     -n,--nosymbolicnames
+      ,--no-symbolic-names
     -o,--otfinfo (default 0)
     -i,--info (default 0)
     -x, --xetex 
@@ -69,8 +71,8 @@
     <font> (string)  ]])
   elseif arg[i] == "-v" or arg[i] == "--verbose" then
     args_verbose = 1
-  elseif arg[i] == "-n" or arg[i] == "--nosymbolicnames" then
-    args_nosymbolicnames = 1
+  elseif (arg[i] == "-n") or (arg[i] == "--nosymbolicnames") or (arg[i] == "--no-symbolic-names") then
+    args_nosymbolicnames = true
   elseif arg[i] == "-x" or arg[i] == "--xetex" then
     args_xetex = 1
   elseif arg[i] == "-o" or arg[i] == "--otfinfo" then
@@ -110,6 +112,16 @@
   i = i + 1
 end
 
+if args_verbose > 0 then
+  print("Parameter:")
+  print("args_verbose = "..args_verbose)
+  print("args_nosymbolicnames = "..tostring(args_nosymbolicnames))
+  print("args_xetex = "..args_xetex)
+  print("otfinfo_arg = "..otfinfo_arg)
+  print("fontNo = "..fontNo)
+  print("args_max_string = "..args_max_string)
+end
+  
 if not args_font then
   print("No fontname given, will close ...")
   os.exit()
@@ -124,10 +136,13 @@
 if #font_str == 1 then font_str[2] = "" end
 
 local luaVersion = _VERSION
-print("We are using "..luaVersion)
-if font_str[2] ~= "" then
-  print('Looking for font \"'..font_str[1]..' & '..font_str[2]..'\"')
-else
+if vlevel > 0 then 
+  print("We are using "..luaVersion)
+  if font_str[2] ~= "" then
+     print('Looking for font \"'..font_str[1]..' & '..font_str[2]..'\"')
+  end
+end
+if font_str[1] == "*" or vlevel > 0 then 
   print('Looking for font \"'..font_str[1]..'\"')
 end
 
@@ -243,7 +258,7 @@
 
 if not fontData then   
   print("umghhh ....")
-  print("It does not work! I'll give it up ... :-(")
+  print("It does not work! I cannote find the base data file ... I'll give it up ... :-(")
   os.exit()
 end
 
@@ -290,7 +305,7 @@
 local l_max = {1, 1, 1}
 for i, v in ipairs(fontDataMap) do 
   if v["familyname"] then
-      if (string.find (v["familyname"]:lower(), font_str[1], 1, true)  and string.find (v["basename"]:lower(), font_str[2], 1, true) ) or (font_str == "*") then
+      if (string.find (v["familyname"]:lower(), font_str[1], 1, true)  and string.find (v["basename"]:lower(), font_str[2], 1, true) ) or (font_str[1] == "*") then
 --	print(string.format("%2d. %30s %20s  %50s",j,v["basename"],v["familyname"],v["fullpath"])) 
         fontList[#fontList+1] = v
         local fullpath = getFileParts(v["fullpath"],"path")  -- strip file name
@@ -312,14 +327,15 @@
 local Path = "Path"
 local SymbolicName = "Symbolic Name"
 local lfdNr = "No."
+
 if (font_str ~= "*") and not noSymbolicNames then
-  if args_xetex then
+  if args_xetex > 0 then
     print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s".."%4s",lfdNr,Fontname,SymbolicName,Path,"X")) 
   else      
     print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path)) 
   end
 else
-  if args_xetex then
+  if args_xetex > 0 then
     print(string.format("%5s %"..l_max[1].."s  %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X")) 
   else
     print(string.format("%5s %"..l_max[1].."s  %"..l_max[3].."s",lfdNr,Fontname,Path)) 
@@ -339,13 +355,13 @@
     kpsewhich = "0"
   end
   if (font_str ~= "*") and not noSymbolicNames then
-    if args_xetex then
+    if args_xetex > 0 then
       print(string.format("%4d. %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s".." %3s",i,v["basename"],v["familyname"],path,kpsewhich)) 
     else
       print(string.format("%4d. %"..l_max[1].."s %"..l_max[2].."s  %"..l_max[3].."s",i,v["basename"],v["familyname"],path)) 
     end
   else
-    if args_xetex then
+    if args_xetex > 0 then
       print(string.format("%4d. %"..l_max[1].."s  %"..l_max[3].."s".." %3s",i,v["basename"],path,kpsewhich)) 
     else    
       print(string.format("%4d. %"..l_max[1].."s  %"..l_max[3].."s",i,v["basename"],path)) 
@@ -355,7 +371,7 @@
 
 if fontNo > 0 then
   print()
-  print("Run otfinfo -"..otfinfo_arg..": "..fontNo)
+  print("Running otfinfo -"..otfinfo_arg.." on font no."..fontNo)
   local font = fontList[fontNo]["fullpath"]
   print("otfinfo -"..otfinfo_arg.." \""..font.."\"")
   local exrun = io.popen("otfinfo -"..otfinfo_arg.." \""..font.."\"", 'r') -- ".." font may have spaces



More information about the tex-live-commits mailing list.