summaryrefslogtreecommitdiff
path: root/support/luafindfont
diff options
context:
space:
mode:
Diffstat (limited to 'support/luafindfont')
-rw-r--r--support/luafindfont/CHANGELOG1
-rw-r--r--support/luafindfont/doc/luafindfont-doc.pdfbin98571 -> 98752 bytes
-rw-r--r--support/luafindfont/doc/luafindfont-doc.tex4
-rwxr-xr-xsupport/luafindfont/scripts/luafindfont.lua42
4 files changed, 36 insertions, 11 deletions
diff --git a/support/luafindfont/CHANGELOG b/support/luafindfont/CHANGELOG
index 783f804f29..a629f6617a 100644
--- a/support/luafindfont/CHANGELOG
+++ b/support/luafindfont/CHANGELOG
@@ -1,3 +1,4 @@
+0.14 2024-08-25 - small changes to the output
0.13 2023-06-23 - add exrun:close() for every kpsewhich test
0.12 2023-06-21 - bugfix for undefined exrun (l. 251)
- check for empty font list and given font number
diff --git a/support/luafindfont/doc/luafindfont-doc.pdf b/support/luafindfont/doc/luafindfont-doc.pdf
index 65be6ced10..f51c3478b8 100644
--- a/support/luafindfont/doc/luafindfont-doc.pdf
+++ b/support/luafindfont/doc/luafindfont-doc.pdf
Binary files differ
diff --git a/support/luafindfont/doc/luafindfont-doc.tex b/support/luafindfont/doc/luafindfont-doc.tex
index c10483ce5a..818cd16fbb 100644
--- a/support/luafindfont/doc/luafindfont-doc.tex
+++ b/support/luafindfont/doc/luafindfont-doc.tex
@@ -1,4 +1,4 @@
- %% $Id: luafindfont-doc.tex 648 2022-11-03 19:58:48Z herbert $
+ %% $Id: luafindfont-doc.tex 962 2024-08-25 16:50:54Z herbert $
%
\listfiles\setcounter{errorcontextlines}{100}
\documentclass[paper=a4,fontsize=11pt,DIV=14,parskip=half-,
@@ -81,7 +81,7 @@
\def\setVersion#1{\setVVersion#1!!}
\def\setVVersion#1=#2!!{\def\luafindfontVersion{#2}}
-\setVersion{version = 0.11}% can be automatically changed by perl
+\setVersion{version = 0.14}% can be automatically changed by perl
\setkeys{hv}{cleanup={},force}
diff --git a/support/luafindfont/scripts/luafindfont.lua b/support/luafindfont/scripts/luafindfont.lua
index a1d554b5ae..f77f913a7d 100755
--- a/support/luafindfont/scripts/luafindfont.lua
+++ b/support/luafindfont/scripts/luafindfont.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env texlua
--
--- $Id: luafindfont.lua 735 2023-06-22 19:12:29Z herbert $
+-- $Id: luafindfont.lua 961 2024-08-25 16:47:59Z herbert $
-----------------------------------------------------------------------
-- FILE: luafindfont.lua
-- DESCRIPTION: search for fonts in the database
@@ -8,7 +8,7 @@
-- AUTHOR: Herbert Voß (C) 2023-06-21
-----------------------------------------------------------------------
luafindfont = luafindfont or { }
- local version = 0.13
+ local version = 0.14
luafindfont.version = version
--[[
@@ -31,6 +31,7 @@ Report bugs to hvoss@tug.org
]]
+-- equivilant with ConTeXt, e.g. times
-- mtxrun --script font --list --name --all --pattern=times
kpse.set_program_name("luatex")
@@ -38,8 +39,6 @@ local f = kpse.find_file("lualibs.lua")
require("lualibs") -- all part of LuaTeX
---require("luafindfont-utflib")
-
if #arg == 0 then
print("I need at least one argument or option! Will exit ...")
os.exit()
@@ -282,6 +281,13 @@ function compareEntries(f1, f2)
end
end
+function centerText(text, width)
+ if text == nil then return "" end
+ local spaces = math.floor((width-string.len(text))/2)
+ local len = string.len(text)
+ return ((" "):rep(spaces)..text..(" "):rep(spaces))
+end
+
local fontData = {}
local fontListFile = getFileLocation()
if fontListFile == "" then
@@ -375,20 +381,38 @@ if l_max[3] > maxStrLength then l_max[3] = maxStrLength end
local minChars = 26
local Fontname = "Filename"
local Path = "Path"
-local SymbolicName = "Symbolic name"
+local SymbolicName = "Symbolic"
local lfdNr = "No."
if (font_str ~= "*") and not noSymbolicNames 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"))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,SymbolicName,Path,"X"))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ io.write(centerText(Path,l_max[3]))
+ print("X")
else
- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ print(centerText(Path,l_max[3]))
end
else
if args_xetex > 0 then
- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X"))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X"))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ io.write(centerText(Path,l_max[3]))
+ print("X")
else
- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s",lfdNr,Fontname,Path))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s",lfdNr,Fontname,Path))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ print(centerText(Path,l_max[3]))
end
end