[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Fix string formatting of version number (5b924e5)

Marcel Fabian Krüger tex at 2krueger.de
Tue Mar 9 16:54:19 CET 2021


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/5b924e53520228f4fa5d9cd2be92f29ab92548af

>---------------------------------------------------------------

commit 5b924e53520228f4fa5d9cd2be92f29ab92548af
Author: Michal Vlasák <lahcim8 at gmail.com>
Date:   Sat Mar 6 16:48:55 2021 +0100

    Fix string formatting of version number
    
    According to Lua 5.3 manual %q is for formatting strings and escaping
    them so that they can be read again by Lua. This particular number is
    however floating point and %q chooses to format it like with %a, that
    means hexadecimal. This greatly reduces the the readability. Because
    ConTeXt's OpenType loader versions are always in the format `x.yyy` we
    can use %.3f directly.
    
    This is the difference in output:
    ```
    luaotfload | init : Context OpenType loader version 0x1.8e76c8b439581p+1
    luaotfload | init : Context OpenType loader version 3.113
    ```
    
    There may be other places where this issue may be relevant, but this
    line is printed to every log file.


>---------------------------------------------------------------

5b924e53520228f4fa5d9cd2be92f29ab92548af
 src/luaotfload-init.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua
index d4ee5c0..a2f5766 100644
--- a/src/luaotfload-init.lua
+++ b/src/luaotfload-init.lua
@@ -394,7 +394,7 @@ local function init_main(early_hook)
   ---load_fontloader_module "font-odv.lua" --- <= Devanagari support from Context
 
   logreport ("log", 0, "init",
-             "Context OpenType loader version %q",
+             "Context OpenType loader version %.3f",
              fonts.handlers.otf.version)
   callback.register = trapped_register
   nodes = context_environment.nodes





More information about the latex3-commits mailing list.