summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/blopentype
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-07-01 03:01:25 +0000
committerNorbert Preining <norbert@preining.info>2023-07-01 03:01:25 +0000
commit3a29216caca37803e25b84a50fd5f7f91ebc04d3 (patch)
tree45c329c33b2bc8601810e0983b3590448a3279ec /macros/luatex/generic/blopentype
parent711112a97f2a98854236304a216213632d61eeb7 (diff)
CTAN sync 202307010301
Diffstat (limited to 'macros/luatex/generic/blopentype')
-rw-r--r--macros/luatex/generic/blopentype/LICENSE21
-rw-r--r--macros/luatex/generic/blopentype/README.md15
-rw-r--r--macros/luatex/generic/blopentype/blopentype.md36
-rw-r--r--macros/luatex/generic/blopentype/luatex/blot-fonts.lua19
-rw-r--r--macros/luatex/generic/blopentype/luatex/blot.tex8
5 files changed, 77 insertions, 22 deletions
diff --git a/macros/luatex/generic/blopentype/LICENSE b/macros/luatex/generic/blopentype/LICENSE
new file mode 100644
index 0000000000..bfed4c5d96
--- /dev/null
+++ b/macros/luatex/generic/blopentype/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Luis Rivera
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/macros/luatex/generic/blopentype/README.md b/macros/luatex/generic/blopentype/README.md
index 4a0a3930f2..c93988bad1 100644
--- a/macros/luatex/generic/blopentype/README.md
+++ b/macros/luatex/generic/blopentype/README.md
@@ -1,5 +1,5 @@
# blopentype
-Basic LuaTeX OpenType Handler
+Basic LuaTeX OpenType Manager
# Description
@@ -11,9 +11,9 @@ In his terse documentation for `PiTeX`, Paul Isambert lists, among the "mandator
| fonts.ptxlua | The Lua fontloader; should become independant some day. |
| foundry-settings.lua | Default settings for the fontloader. |
-Well: the day has come, and the fontloader has now become `blopentype`: a *Basic LuaTeX OpenType Handler*.
+Well: the day has come, and the fontloader has now become `blopentype`: a *Basic LuaTeX OpenType Manager*.
-The basic code is copied almost verbatim from Isambert's `PiTeX`, save the adoption of the filename extensions `ltm` for *LuaTeX macros*, `lts` for *LuaTeX scripts*, and `blot-sets.lua` for the basic basic settings.
+The basic code is copied almost verbatim from Isambert's `PiTeX`, save the adoption of the canonical filename extensions `tex` for *LuaTeX macros*, `lua` for *LuaTeX scripts*, and `blot-sets.lua` for the basic basic settings.
The required dependencies are Isambert packages [texapi](https://ctan.org/pkg/texapi), [YaX](https://ctan.org/pkg/yax) and [Gates](https://ctan.org/pkg/gates), as stated in `DEPENDS.txt`.
You may find an example of usage in the `blottest.[tex|pdf]` files, and some basic documentation in `blopentype.md`.
@@ -22,16 +22,17 @@ You may find an example of usage in the `blottest.[tex|pdf]` files, and some bas
The macros are still barely documented, and massively keep the names of their parent (`PiTeX`) package; that may be fixed some day.
-The font database is loaded at `$HOME/texmf/luatex/foundry/readable.txt`; it is not updated automatically after installing new fonts: you have to edit it manually, or else delete/rename(backup) it and rerun LuaTeX to rebuild it.
+The font database is stored at `$TEXMFLOCAL/texmf/luatex/blotfonts/readable.txt`.
+It is updated automatically after installing *and using* new fonts, but you may edit it, or else delete/rename(backup) the database by hand, and rerun LuaTeX to rebuild it.
-The character table for each typeface is stored in the `luatex/foundry` directory as a flat `lua` file; it would be nice to have it compiled as a `luac` file to save some space.
+The character table for each typeface is stored in the `luatex/blotfonts` directory as a flat `lua` file; it would be nice to have it compiled as a `luac/luc` file to save some space, some day.
Good luck, and happy LuaTeXing
# Authors
-Version 0.0.0 (C) 2022 Paul Isambert (massively) and Luis Rivera (minor surgeon; or rather: kludger).
+Version 0.0.2 (C) 2023 Paul Isambert (author) and Luis Rivera (maintainer).
LaTeX Project Public License, LPPL Version 1.3c 2008-05-04 or MIT License
-December 28, 2022 \ No newline at end of file
+June 29, 2023
diff --git a/macros/luatex/generic/blopentype/blopentype.md b/macros/luatex/generic/blopentype/blopentype.md
index a42d55ec48..651f57f281 100644
--- a/macros/luatex/generic/blopentype/blopentype.md
+++ b/macros/luatex/generic/blopentype/blopentype.md
@@ -1,24 +1,38 @@
-# Basic LuaTeX OpenType Handler Minimal User Guide
+# Basic LuaTeX OpenType Manager Minimal User Guide
-As for version 0.0.0 December 2022
+As of version 0.0.1 May 2023
-Fonts (fonts.ltm and fonts.lts)
-==================================
+Loading the macros
+==================
+
+This is a Plain TeX macro package, so simply type
+
+```
+\input blot
+```
+
+and you are halfway through: there are font parameter defaults, but no font is loaded
+automatically, since it must depend on your system; so you have to load fonts
+on your own.
+
+Fonts
+=====
The fontloader uses gates, but only superficially. They won't be
documented here.
To load a given font, you define it in YaX syntax with the `\setfont` command.
+Thus, the instruction:
-```\setfont <command>:<attributes>```
+```\setfont <fontcommand>:<attributes>```
-Sets <command> to call the font described in <attributes>; all defaults
-to the values of the `metafont` parameter. If `<command>` is `\mainfont`,
-as the name of the main font for the document, the font is called at once;
-any other `\command` requires explicit calls.
+sets <fontcommand> to call the font described in <attributes>; all new fonts default
+to the values of the `metafont` parameter described elsewhere.
+If `<fontcommand>` is `\mainfont`, the font is called at once;
+any other `\fontcommand` requires an explicit call.
-You may thing of `\setfont <command>` as similar to DEKTeX's `\font\cmr10 at 12pt`
-or whatever font definition, but now the call is to an array of font attributes.
+You may thing of `\setfont <fontcommand>` as similar to DEKTeX's `\font<fontcommand> <parameters>`,
+but now the call is to an array of font attributes, enumerated below.
`name`
The family name of the font; e.g. Palatino Linotype for the main text of
diff --git a/macros/luatex/generic/blopentype/luatex/blot-fonts.lua b/macros/luatex/generic/blopentype/luatex/blot-fonts.lua
index 638f83e984..940fc5de2d 100644
--- a/macros/luatex/generic/blopentype/luatex/blot-fonts.lua
+++ b/macros/luatex/generic/blopentype/luatex/blot-fonts.lua
@@ -129,6 +129,7 @@ local lfs = get_locals {lfs = "dir isdir isfile mkdir", kpse = "expand_var show_
-- Returns anything after the last dot, i.e. an extension.
function lfs.extension (s)
return str.lower(str.match(s, "%.([^%.]*)$"))
+-- return str.match(s, "%.([^%.]*)$")
end
local extensions = {
@@ -220,8 +221,8 @@ local normal_names = {}
for _, name in ipairs(settings.normal) do
normal_names[name] = true
end
-local local_path = lfs.expand_var("$TEXMFHOME")
-local foundry_path = lfs.ensure_dir (local_path, "tex", "luatex", "foundry")
+local local_path = lfs.expand_var("$TEXMFLOCAL")--:gsub(":",";")
+local foundry_path = lfs.ensure_dir (local_path, "tex", "luatex", "blotfonts")
-- local local_path = lfs.expand_var("$TEXMFHOME")
-- local foundry_path = lfs.ensure_dir (local_path, "fonts", "truetype", "public", "gfs")
local library_file = foundry_path .. "/" .. "readable.txt"
@@ -244,13 +245,19 @@ local function extract_font (file, names)
fi = fl.open
end
if not fi then
- fl.error("Can't open %s", file)
+-- fl.error("Can't open %s", file)
+ fl.error("\nCannot open file", file)
return
end
end
subname = name
else
fi = fl.open(file)
+ -- blot-fonts.lua:257: attempt to index a nil value (local 'fi')
+ if not fi then
+ print("\nCannot open file", file)
+ return
+ end
end
-- Getting the most precise information. Not necessarily the best
-- solution, but since the user can modify the library, it's not so bad.
@@ -282,6 +289,7 @@ end
-- only those that arent in the libraries are considered.
local fonts_done = {}
local function check_fonts (rep, tb)
+ if lfs.isdir(rep) then
for f in lfs.dir (rep) do
if f ~= "." and f ~= ".." then
f = str.gsub(rep, "/$", "") .. "/" .. f
@@ -308,6 +316,7 @@ local function check_fonts (rep, tb)
end
end
end
+ end
end
-- Writes the library to an external file.
@@ -355,6 +364,7 @@ end
-- If there is no library, we create it.
local font_paths = lfs.show_path("opentype fonts")
+font_paths = str.gsub(font_paths, ":", ";")
font_paths = str.gsub(font_paths, "\\", "/")
font_paths = str.gsub(font_paths, "/+", "/")
font_paths = str.gsub(font_paths, "!!", "")
@@ -398,6 +408,9 @@ local function load_library (lib)
LIB = str.gsub(LIB, ";%s*;", ";;")
LIB = str.gsub(LIB, ";+", ";")
LIB = str.gsub(LIB, "^;", "")
+ LIB = str.gsub(LIB, ":%s*:", "::")
+ LIB = str.gsub(LIB, ":+", ":")
+ LIB = str.gsub(LIB, "^:", "")
LIB = str.gsub(LIB, "%s+", " ")
LIB = lp.match(explode_semicolon, LIB)
diff --git a/macros/luatex/generic/blopentype/luatex/blot.tex b/macros/luatex/generic/blopentype/luatex/blot.tex
index 44a89e553e..bad87626b1 100644
--- a/macros/luatex/generic/blopentype/luatex/blot.tex
+++ b/macros/luatex/generic/blopentype/luatex/blot.tex
@@ -1,10 +1,11 @@
% blopentype: a basic luatex open type loader
%
% some (most) pitex macros still in place.- 30.12.2022
+% check history after `\endinput`
%
% User interface
%
-\message{This is blopentype, v0.0.0 December 2022}
+\message{This is blopentype, v0.0.2 June 2023}
\input luatex85.sty % deprecated 30.12.2022
\input yax % which itself \input's texapi
@@ -252,3 +253,8 @@
%
%
% Date: November 2011.
+%
+% --- blopentype history
+%
+% 28-06-2023 fixed bug in blot-fonts.lua which affected nix systems.
+% thanks to david.carlisle for useful patch. \ No newline at end of file