summaryrefslogtreecommitdiff
path: root/mkluatexfontdb.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-16 23:31:17 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-16 23:31:17 +0200
commit40357dc146ef31132d4144e072bb2062dba228d9 (patch)
tree355b687f06ee999afc5ad3f98c807cdf13f8e990 /mkluatexfontdb.lua
parent234ab2f267f9b42c4464e379c15644d570647b1c (diff)
downloadluaotfload-40357dc146ef31132d4144e072bb2062dba228d9.tar.gz
add option --find="font name" to mkluatexfontdb.lua for querying the db from cli
Diffstat (limited to 'mkluatexfontdb.lua')
-rwxr-xr-xmkluatexfontdb.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/mkluatexfontdb.lua b/mkluatexfontdb.lua
index 5f27d92..d11db53 100755
--- a/mkluatexfontdb.lua
+++ b/mkluatexfontdb.lua
@@ -55,6 +55,8 @@ Valid options:
-vvv print all steps of directory searching
-V --version print version and exit
-h --help print this message
+
+ --find="font name" query the database for a font name
--log=stdout redirect log output to stdout
The font database will be saved to
@@ -115,6 +117,22 @@ actions.generate = function (job)
end
actions.query = function (job)
+ local tmpspec = {
+ name = job.query,
+ lookup = "name",
+ specification = "name:"..job.query,
+ }
+ local foundname, _whatever, success = fonts.names.resolve(nil, nil, tmpspec)
+ if success then
+ logs.names_report(false, 0,
+ "resolve", "Font “%s” found!", job.query)
+ logs.names_report(false, 0,
+ "resolve", "Resolved file name “%s”:", foundname)
+ else
+ logs.names_report(false, 0,
+ "resolve", "Cannot find “%s”.", job.query)
+ end
+ texiowrite_nl""
return true, true
end
@@ -189,7 +207,7 @@ local main = function ( ) -- unit -> int
local retval = 0
local job = process_cmdline()
--- inspect(action_pending)
+ --inspect(action_pending)
for i=1, #action_sequence do
local actionname = action_sequence[i]