Skip to content

Commit

Permalink
TeX : nfssext : use fnt prefix for lua fns and vars in code (docs nee…
Browse files Browse the repository at this point in the history
…d updating)
  • Loading branch information
Clea F. Rees committed Jan 29, 2025
1 parent 8392254 commit 1db2ff0
Show file tree
Hide file tree
Showing 21 changed files with 476 additions and 410 deletions.
32 changes: 17 additions & 15 deletions arkandis/adforn/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for adfornadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -11,27 +11,28 @@
--]]
-------------------------------------------------
-- copy non-public things from l3build
local os_newline_cp = "\n"
if os.type == "windows" then
if tonumber(status.luatex_version) < 100 or
(tonumber(status.luatex_version) == 100
and tonumber(status.luatex_revision) < 4) then
os_newline_cp = "\r\n"
end
end
-- local os_newline_cp = "\n"
-- if os.type == "windows" then
-- if tonumber(status.luatex_version) < 100 or
-- (tonumber(status.luatex_version) == 100
-- and tonumber(status.luatex_revision) < 4) then
-- os_newline_cp = "\r\n"
-- end
-- end
-------------------------------------------------
--
ctanpkg = "adforn"
maindir = "../.."
module = "adforn"
textfiles = {"*.md","*.txt","COPYING","NOTICE"}
vendor = "arkandis"
autotestfds = { "uornementsadf.fd" }
keepfiles = { "*.map", "*.tfm" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "uornementsadf.fd" }
fnt.keepfiles = { "*.map", "*.tfm" }
-- RHAID ei osod cyn i ddarllen fntbuild.lua!
afmtotfm = true
fnt.afmtotfm = true
dofile(maindir .. "/fontscripts/fntbuild.lua")
function fnt_test (fntpkgname,fds,content,maps,fdsdir)
function fnt.test (fntpkgname,fds,content,maps,fdsdir)
return 0
end
typesetdeps = {maindir .. "/nfssext-cfr", maindir .. "/cfr-lm"}
Expand Down Expand Up @@ -64,7 +65,8 @@ uploadconfig = {
-- curlopt_file
}
--
noautotest = true
arkandis = arkandis or {}
arkandis.noautotest = true
dofile(maindir .. "/arkandis/arkandis-manifest.lua")
-- os.execute ("printenv")
-- vim: ts=2:sw=2:tw=80:nospell
40 changes: 21 additions & 19 deletions arkandis/adfsymbols/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for adfsymbols
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -11,31 +11,32 @@
--]]
-------------------------------------------------
-- copy non-public things from l3build
local os_newline_cp = "\n"
if os.type == "windows" then
if tonumber(status.luatex_version) < 100 or
(tonumber(status.luatex_version) == 100
and tonumber(status.luatex_revision) < 4) then
os_newline_cp = "\r\n"
end
end
-- local os_newline_cp = "\n"
-- if os.type == "windows" then
-- if tonumber(status.luatex_version) < 100 or
-- (tonumber(status.luatex_version) == 100
-- and tonumber(status.luatex_revision) < 4) then
-- os_newline_cp = "\r\n"
-- end
-- end
-------------------------------------------------
--
ctanpkg = "adfsymbols"
maindir = "../.."
module = "adfsymbols"
textfiles = {"*.md","*.txt","COPYING","NOTICE"}
vendor = "arkandis"
autotestfds = { "uarrowsadf.fd" , "ubulletsadf.fd" }
keepfiles = { "*.map", "*.tfm" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "uarrowsadf.fd" , "ubulletsadf.fd" }
fnt.keepfiles = { "*.map", "*.tfm" }
-- RHAID ei osod cyn i ddarllen fntbuild.lua!
afmtotfm = true
fntencs = fntencs or {}
fntencs["ArrowsADF"] = "SymbolsADF.enc"
fntencs["BulletsADF"] = "SymbolsADF.enc"
print(fntencs["ArrowsADF"])
fnt.afmtotfm = true
fnt.encs = fnt.encs or {}
fnt.encs["ArrowsADF"] = "SymbolsADF.enc"
fnt.encs["BulletsADF"] = "SymbolsADF.enc"
print(fnt.encs["ArrowsADF"])
dofile(maindir .. "/fontscripts/fntbuild.lua")
function fnt_test (fntpkgname,fds,content,maps,fdsdir)
function fnt.test (fntpkgname,fds,content,maps,fdsdir)
return 0
end
typesetdeps = {maindir .. "/nfssext-cfr", maindir .. "/cfr-lm"}
Expand Down Expand Up @@ -69,7 +70,8 @@ uploadconfig = {
-- curlopt_file
}
--
noautotest = true
arkandis = arkandis or {}
arkandis.noautotest = true
dofile(maindir .. "/arkandis/arkandis-manifest.lua")
-- os.execute ("printenv")
-- vim: ts=2:sw=2:tw=80:nospell
17 changes: 10 additions & 7 deletions arkandis/arkandis-manifest.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: arkandis-manifest.lua 10612 2024-11-12 17:21:11Z cfrees $
-- $Id: arkandis-manifest.lua 10743 2025-01-29 02:29:53Z cfrees $
---------------------------------------------------------------------
---------------------------------------------------------------------
-- local derivedfiles = derivedfiles or {"*.cls","*.enc","*.fd","*.map","*.sty","*.tfm","*.vf"}
Expand All @@ -17,6 +17,7 @@
-- a few files!!
----------------------------------------------------------------------
----------------------------------------------------------------------
local arkandis = arkandis or {}
local fnttestfiles = fnttestfiles or "* fnt-tests.tex\n* fnt-test.lvt"
local fnttablestemplate = fnttablestemplate or "\n* fnt-tables.tex"
local sourcefiledir = sourcefiledir or "."
Expand All @@ -28,7 +29,7 @@ local derivedfiles = derivedfiles or {}
table.insert(derivedfiles,"*-tables.tex")
----------------------------------------------------------------------
----------------------------------------------------------------------
function idxfiles(dir,globs)
local function idxfiles(dir,globs)
local m_files = {}
globs = globs or {"*.*"}
local t = {}
Expand All @@ -53,7 +54,7 @@ function idxfiles(dir,globs)
return m_files
end
----------------------------------------------------------------------
function idxexcl(dir,files,exclfiles)
local function idxexcl(dir,files,exclfiles)
local m_files = idxfiles(dir,files)
local tmpt = {}
if exclfiles ~= nil then
Expand All @@ -80,7 +81,7 @@ function idxexcl(dir,files,exclfiles)
return m_files
end
----------------------------------------------------------------------
function idxtable(tble)
local function idxtable(tble)
local t = {}
for i,j in pairs(tble) do
table.insert(t,i)
Expand All @@ -92,7 +93,7 @@ end
-- concatenating strings is slow
-- concatenating tables is fast
-- https://www.lua.org/pil/11.6.html
function bullets(items,idx)
local function bullets(items,idx)
local bulleted = {}
local first = true
-- table.insert(bulleted,"")
Expand Down Expand Up @@ -120,7 +121,7 @@ function bullets(items,idx)
end
----------------------------------------------------------------------
----------------------------------------------------------------------
function populatescripts()
local function populatescripts()
local arkandisdir = arkandisdir or maindir .. "/arkandis"
local sourcefiledir = sourcefiledir or "."
if buildscripts == nil then
Expand All @@ -140,6 +141,7 @@ function populatescripts()
end
----------------------------------------------------------------------
----------------------------------------------------------------------
-- override l3build
function manifest_write_opening(filehandle)
local date = date or os.date()
filehandle:write( "# Manifest for " .. ctanpkg .. "\n\nCopyright (C) " .. date .. " Clea F. Rees\n\n" )
Expand Down Expand Up @@ -171,6 +173,7 @@ end
-- return f
-- end
---------------------------------------------------------------------
-- override l3build
function manifest_setup ()
if not ( fileexists(unpackdir .. "/" .. module .. ".sty") or fileexists(unpackdir .. "/" .. ctanpkg .. ".sty") ) then
unpack()
Expand Down Expand Up @@ -221,7 +224,7 @@ function manifest_setup ()
-- the current method doesn't work a bit quicker
local buildscripts = populatescripts()
---------------------------------------------------------------------
if noautotest then fnttestfiles = "" end
if arkandis.noautotest then fnttestfiles = "" end
---------------------------------------------------------------------
-- I have no idea how to sort them (without gnu, that is)
local groups = {
Expand Down
7 changes: 4 additions & 3 deletions arkandis/baskervaldadf/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for baskervaldadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -14,8 +14,9 @@ ctanpkg = "baskervaldadf"
maindir = "../.."
module = "baskervald"
textfiles = {"*.md","*.txt","COPYING"}
vendor = "arkandis"
autotestfds = { "t1ybv.fd", "t1ybvw.fd" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "t1ybv.fd", "t1ybvw.fd" }
dofile(maindir .. "/fontscripts/fntbuild.lua")
-- local srcfiles = {"dotsc2.etx", "dotscbuild.mtx", "dotscmisc.mtx", "newlatin-dotsc.mtx", "t1-dotinf.etx", "t1-dotsup.etx", "ts1-dotinf.etx", "ts1-dotsup.etx"}
-- for i,j in ipairs(srcfiles) do table.insert(sourcefiles,j) end
Expand Down
56 changes: 29 additions & 27 deletions arkandis/berenisadf/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10732 2025-01-26 09:06:04Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for berenisadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -11,46 +11,47 @@
--]]
-------------------------------------------------
-- copy non-public things from l3build
local os_newline_cp = "\n"
if os.type == "windows" then
if tonumber(status.luatex_version) < 100 or
(tonumber(status.luatex_version) == 100
and tonumber(status.luatex_revision) < 4) then
os_newline_cp = "\r\n"
end
end
-- local os_newline_cp = "\n"
-- if os.type == "windows" then
-- if tonumber(status.luatex_version) < 100 or
-- (tonumber(status.luatex_version) == 100
-- and tonumber(status.luatex_revision) < 4) then
-- os_newline_cp = "\r\n"
-- end
-- end
-------------------------------------------------
ctanpkg = "berenisadf"
maindir = "../.."
module = "berenis"
vendor = "arkandis"
autotestfds = { "ly1ybd.fd", "ly1ybd2.fd", "ly1ybd2j.fd", "ly1ybd2jw.fd", "ly1ybd2w.fd", "ly1ybdj.fd", "ly1ybdjw.fd", "ly1ybdw.fd", "t1ybd.fd", "t1ybd2.fd", "t1ybd2j.fd", "t1ybdj.fd" }
keepfiles = { "ybd.map", "*.afm", "*.pfb", "*.tfm" , "ts1ybd2w.fd", "ts1ybd2jw.fd", "ts1ybdjw.fd", "ts1ybdw.fd" }
keeptempfiles = { "*.pl" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "ly1ybd.fd", "ly1ybd2.fd", "ly1ybd2j.fd", "ly1ybd2jw.fd", "ly1ybd2w.fd", "ly1ybdj.fd", "ly1ybdjw.fd", "ly1ybdw.fd", "t1ybd.fd", "t1ybd2.fd", "t1ybd2j.fd", "t1ybdj.fd" }
fnt.keepfiles = { "ybd.map", "*.afm", "*.pfb", "*.tfm" , "ts1ybd2w.fd", "ts1ybd2jw.fd", "ts1ybdjw.fd", "ts1ybdw.fd" }
fnt.keeptempfiles = { "*.pl" }
dofile(maindir .. "/fontscripts/fntbuild.lua")
-- START doc eg
-- require(kpse.lookup("fntbuild.lua"))
autotcfds ={ "ts1ybd2j.fd", "ts1ybd2.fd", "ts1ybdj.fd", "ts1ybd.fd" }
function fntmake (dir,mode)
dir = dir or fntdir
fnt.autotcfds ={ "ts1ybd2j.fd", "ts1ybd2.fd", "ts1ybdj.fd", "ts1ybd.fd" }
local function fntmake (dir,mode)
dir = dir or fnt.fntdir
mode = mode or "errorstopmode --halt-on-error"
buildinit()
fnt.buildinit()
print("Running make. Please be patient ...\n")
errorlevel = run(dir, "chmod +x ff-ybd.pe")
local errorlevel = run(dir, "chmod +x ff-ybd.pe")
if errorlevel ~=0 then
gwall("Attempt to make fontforge script executable ", dir, errorlevel)
fnt.gwall("Attempt to make fontforge script executable ", dir, errorlevel)
else
errorlevel = run(dir, "make -f Makefile.make all")
if errorlevel ~= 0 then
gwall("make ", dir, errorlevel)
fnt.gwall("make ", dir, errorlevel)
end
-- make ts1 swash families so tc commands pick up the characters in ly1
-- we don't need t1 versions of these families as there's no room for swash
-- there
-- ideally, we could just tell latex to use the non-swash families for the
-- tc encoding, but that doesn't seem possible without rewriting more
-- internal stuff than seems altogether wise ...
for i, j in ipairs(autotcfds) do
for i, j in ipairs(fnt.autotcfds) do
local jfam = string.gsub(j, "^ts1(.*)%.fd$", "%1")
local jnewfam = jfam .. "w"
local jnew = string.gsub(j, "(%.fd)$", "w%1")
Expand All @@ -69,22 +70,23 @@ function fntmake (dir,mode)
new_content = string.gsub(new_content, "(TS1/ybd[a-z0-9]*)", "%1w")
f = assert(io.open(dir .. "/" .. jnew,"w"))
-- this somehow removes the second value returned by string.gsub??
f:write((string.gsub(new_content,"\n",os_newline_cp)))
f:write((string.gsub(new_content,"\n",fnt.os_newline_cp)))
f:close()
end
errorlevel = fntkeeper()
errorlevel = fnt.fntkeeper()
if errorlevel ~= 0 then
gwall("FONT KEEPER FAILED! DO NOT MAKE STANDARD TARGETS WITHOUT RESOLVING!! ",
fnt.gwall("FONT KEEPER FAILED! DO NOT MAKE STANDARD TARGETS WITHOUT RESOLVING!! ",
dir, errorlevel
)
end
end
return nifergwall
return fnt.nifergwall
end
fnt.fntmake = fntmake
-- fntmake must be specified first
-- it just ain't TeX
target_list[ntarg] = {
func = fntmake,
target_list[fnt.ntarg] = {
func = fnt.fntmake,
desc = "Creates TeX font files",
pre = function(names)
if names then
Expand Down
7 changes: 4 additions & 3 deletions arkandis/electrumadf/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for electrumadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -13,8 +13,9 @@
ctanpkg = "electrumadf"
maindir = "../.."
module = "electrum"
vendor = "arkandis"
autotestfds = { "t1yes.fd", "t1yesj.fd", "t1yesjw.fd", "t1yesw.fd" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "t1yes.fd", "t1yesj.fd", "t1yesjw.fd", "t1yesw.fd" }
textfiles = {"*.md","*.txt","COPYING"}
dofile(maindir .. "/fontscripts/fntbuild.lua")
-- local srcfiles = {"dotsc2.etx", "dotscbuild.mtx", "dotscmisc.mtx", "newlatin-dotsc.mtx", "t1-dotinf.etx", "t1-dotsup.etx", "ts1-dotinf.etx", "ts1-dotsup.etx"}
Expand Down
7 changes: 4 additions & 3 deletions arkandis/librisadf/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for librisadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -13,8 +13,9 @@
ctanpkg = "libris"
maindir = "../.."
module = "libris"
vendor = "arkandis"
autotestfds = { "t1yly.fd", "t1ylyw.fd" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "t1yly.fd", "t1ylyw.fd" }
dofile(maindir .. "/fontscripts/fntbuild.lua")
-- local srcfiles = {"t1-cfr.etx", "ts1-euro.etx", "t1-cfr.enc", "ts1-euro.enc"}
-- for i,j in ipairs(srcfiles) do table.insert(sourcefiles,j) end
Expand Down
7 changes: 4 additions & 3 deletions arkandis/romandeadf/build.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- $Id: build.lua 10649 2024-11-19 06:08:49Z cfrees $
-- $Id: build.lua 10743 2025-01-29 02:29:53Z cfrees $
-- Build configuration for romandeadf
-- l3build.pdf listing 1 tudalen 9
--[[
Expand All @@ -13,8 +13,9 @@
ctanpkg = "romandeadf"
maindir = "../.."
module = "romande"
vendor = "arkandis"
autotestfds = { "t1yrd.fd", "t1yrda.fd", "t1yrdaw.fd", "t1yrdw.fd" }
fnt = {}
fnt.vendor = "arkandis"
fnt.autotestfds = { "t1yrd.fd", "t1yrda.fd", "t1yrdaw.fd", "t1yrdw.fd" }
dofile(maindir .. "/fontscripts/fntbuild.lua")
-- local srcfiles = { "ts1-euro.etx", "ts1-euro.enc" }
-- for i,j in ipairs(srcfiles) do table.insert(sourcefiles,j) end
Expand Down
Loading

0 comments on commit 1db2ff0

Please sign in to comment.