texlive[57346] Master/texmf-dist: lua-visual-debug (7jan21)
commits+karl at tug.org
commits+karl at tug.org
Thu Jan 7 23:05:40 CET 2021
Revision: 57346
http://tug.org/svn/texlive?view=revision&revision=57346
Author: karl
Date: 2021-01-07 23:05:40 +0100 (Thu, 07 Jan 2021)
Log Message:
-----------
lua-visual-debug (7jan21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md
trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf
trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex
trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf
trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf
trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua
trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty
Modified: trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md 2021-01-07 22:05:12 UTC (rev 57345)
+++ trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md 2021-01-07 22:05:40 UTC (rev 57346)
@@ -20,9 +20,9 @@
but other engines only show a warning message.
-Copyright 2012–2019 Patrick Gundlach (<patrick at gundla.ch>) and others (see Git information)
+Copyright 2012–2021 Patrick Gundlach (<patrick at gundla.ch>) and others (see Git information)
-Package version: 0.7
+Package version: 0.8
Public repository: <https://github.com/pgundlach/lvdebug>
Modified: trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex 2021-01-07 22:05:12 UTC (rev 57345)
+++ trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex 2021-01-07 22:05:40 UTC (rev 57346)
@@ -1,6 +1,6 @@
\documentclass{article}
\usepackage{graphicx,listings,lmodern,luatextra}
-\newcommand\pkgversion{0.7}
+\newcommand\pkgversion{0.8}
\newcommand*\pgsmall{\fontsize{8.5}{8.7}\selectfont\ttfamily}
\lstset{basicstyle=\pgsmall,
@@ -64,7 +64,7 @@
\section{Copying}
-Copyright 2012–2019 Patrick Gundlach (patrick at gundla.ch) and other authors (see Git for information), licensed under the MIT license. See the Lua file for details.
+Copyright 2012–2021 Patrick Gundlach (patrick at gundla.ch) and other authors (see Git for information), licensed under the MIT license. See the Lua file for details.
\end{document}
Modified: trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua 2021-01-07 22:05:12 UTC (rev 57345)
+++ trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua 2021-01-07 22:05:40 UTC (rev 57346)
@@ -1,6 +1,6 @@
--- Copyright 2012-2019 Patrick Gundlach, patrick at gundla.ch
+-- Copyright 2012-2021 Patrick Gundlach, patrick at gundla.ch
-- Public repository: https://github.com/pgundlach/lvdebug (issues/pull requests,...)
--- Version: 0.7
+-- Version: 0.8
-- 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,
@@ -55,6 +55,7 @@
local HLIST = node.id("hlist")
local VLIST = node.id("vlist")
local RULE = node.id("rule")
+local DIR = node.id("dir")
local DISC = node.id("disc")
local GLUE = node.id("glue")
local KERN = node.id("kern")
@@ -68,10 +69,13 @@
return math.floor(num + 0.5)
end
+local curdir = {}, pardir
function show_page_elements(parent)
local head = parent.list
while head do
+ local has_dir = false
+ if head.dir == "TLT" then table.insert(curdir,"ltr") has_dir=true elseif head.dir == "TRT" then table.insert(curdir,"rtl") has_dir=true end
if head.id == HLIST or head.id == VLIST then
local rule_width = 0.1
@@ -82,6 +86,7 @@
-- recurse into the contents of the box
show_page_elements(head)
local rectangle = node.new("whatsit","pdf_literal")
+ if curdir[#curdir] == "rtl" then wd = wd * -1 end
if head.id == HLIST then -- hbox
rectangle.data = string.format("q 0.5 G %g w %g %g %g %g re s Q", rule_width, -rule_width / 2, -dp, wd, ht)
else
@@ -107,6 +112,19 @@
hyphen_marker.data = "q 0 0 1 RG 0.3 w 0 -1 m 0 0 l S Q"
parent.list = node.insert_before(parent.list,head,hyphen_marker)
+ elseif head.id == DIR then
+ local mode = string.sub(head.dir,1,1)
+ local texdir = string.sub(head.dir,2,4)
+ local ldir
+ if texdir == "TLT" then ldir = "ltr" else ldir = "rtl" end
+ if mode == "+" then
+ table.insert(curdir,ldir)
+ elseif mode == "-" then
+ local x = table.remove(curdir)
+ if x ~= ldir then
+ warning("paragraph direction incorrect, found %s, expected %s",ldir,x)
+ end
+ end
elseif head.id == GLUE then
local head_spec = head.spec
@@ -124,6 +142,8 @@
end
local pdfstring = node.new("whatsit","pdf_literal")
local wd_bp = math.round(wd / number_sp_in_a_pdf_point,2)
+ if curdir[#curdir] == "rtl" then wd_bp = wd_bp * -1 end
+
if parent.id == HLIST then
pdfstring.data = string.format("q %s [0.2] 0 d 0.5 w 0 0 m %g 0 l s Q",color,wd_bp)
else -- vlist
@@ -131,7 +151,6 @@
end
parent.list = node.insert_before(parent.list,head,pdfstring)
-
elseif head.id == KERN then
local rectangle = node.new("whatsit","pdf_literal")
local color = "1 1 0 rg"
@@ -154,6 +173,9 @@
rectangle.data = string.format("q %s 0 w 0 0 1 1 re B Q",color)
parent.list = node.insert_before(parent.list,head,rectangle)
end
+ if has_dir then
+ table.remove(curdir)
+ end
head = head.next
end
return true
Modified: trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty 2021-01-07 22:05:12 UTC (rev 57345)
+++ trunk/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty 2021-01-07 22:05:40 UTC (rev 57346)
@@ -1,7 +1,7 @@
% see lua file for copyright information (MIT License)
-\def\lvdebugpkgdate{2019/01/07}
-\def\lvdebugpkgversion{0.7}
+\def\lvdebugpkgdate{2021/01/07}
+\def\lvdebugpkgversion{0.8}
\ifx\ProvidesPackage\undefined
\input ifluatex.sty\relax
More information about the tex-live-commits
mailing list.