diff options
author | Karl Berry <karl@freefriends.org> | 2021-01-07 22:05:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-01-07 22:05:40 +0000 |
commit | 8b89316181191aff78fdf109c7027e7bab311680 (patch) | |
tree | 7812628241692a9b951277e69cf995c2287b230e | |
parent | 307f7f197519e09f94d9dd8bb611fa12ed30166b (diff) |
lua-visual-debug (7jan21)
git-svn-id: svn://tug.org/texlive/trunk@57346 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/luatex/lua-visual-debug/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf | bin | 209760 -> 210686 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf | bin | 49093 -> 49217 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf | bin | 45257 -> 45516 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua | 28 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty | 4 |
7 files changed, 31 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md b/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md index a45bbcb16e6..0e07af14c1e 100644 --- a/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md +++ b/Master/texmf-dist/doc/luatex/lua-visual-debug/README.md @@ -20,9 +20,9 @@ Requirements: The package has only been tested with LuaTeX and but other engines only show a warning message. -Copyright 2012–2019 Patrick Gundlach (<patrick@gundla.ch>) and others (see Git information) +Copyright 2012–2021 Patrick Gundlach (<patrick@gundla.ch>) and others (see Git information) -Package version: 0.7 +Package version: 0.8 Public repository: <https://github.com/pgundlach/lvdebug> diff --git a/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf b/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf Binary files differindex 71b2936a293..c05b287e378 100644 --- a/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf +++ b/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.pdf diff --git a/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex b/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex index c87c2b49a44..736096e2c80 100644 --- a/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex +++ b/Master/texmf-dist/doc/luatex/lua-visual-debug/lvdebug-doc.tex @@ -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 @@ A strut box (zero width box) is marked with a red rule: \section{Copying} -Copyright 2012–2019 Patrick Gundlach (patrick@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@gundla.ch) and other authors (see Git for information), licensed under the MIT license. See the Lua file for details. \end{document} diff --git a/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf b/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf Binary files differindex 2aaafad75f1..6d9b740524d 100644 --- a/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf +++ b/Master/texmf-dist/doc/luatex/lua-visual-debug/sample-plain.pdf diff --git a/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf b/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf Binary files differindex 81cf4fc2230..8583f2d291a 100644 --- a/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf +++ b/Master/texmf-dist/doc/luatex/lua-visual-debug/sample.pdf diff --git a/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua b/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua index b6fb5907c9a..4fb7465a81e 100644 --- a/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua +++ b/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua @@ -1,6 +1,6 @@ --- Copyright 2012-2019 Patrick Gundlach, patrick@gundla.ch +-- Copyright 2012-2021 Patrick Gundlach, patrick@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 number_sp_in_a_pdf_point = 65782 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 @@ function math.round(num, idp) 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 @@ function show_page_elements(parent) -- 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 @@ function show_page_elements(parent) 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 @@ function show_page_elements(parent) 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 @@ function show_page_elements(parent) 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 @@ function show_page_elements(parent) 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 diff --git a/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty b/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty index 9d5b22337a3..8f3aac8ea3b 100644 --- a/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty +++ b/Master/texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty @@ -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 |