diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-05 03:00:50 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-05 03:00:50 +0000 |
commit | 2905ee4c8de47cfdeea4787e465eb827f9b99e8b (patch) | |
tree | 802c26d7002fd7e2188412b5bd1f86cd9ee2c4d6 /macros/luatex | |
parent | 05ad7831f64aa0e2fc9eac63816eeafcb0b09708 (diff) |
CTAN sync 201912050300
Diffstat (limited to 'macros/luatex')
56 files changed, 2017 insertions, 40 deletions
diff --git a/macros/luatex/generic/barracuda/INSTALL.txt b/macros/luatex/generic/barracuda/INSTALL.txt index 55ce68da5c..0c06f98488 100644 --- a/macros/luatex/generic/barracuda/INSTALL.txt +++ b/macros/luatex/generic/barracuda/INSTALL.txt @@ -1,30 +1,37 @@ Installation ------------- +============ Installing `barracuda` for TeX Live +----------------------------------- -If you have TeX Live installed from CTAN or from DVD TeX Collection, check -before any modification to your system if the package is already installed +If you have TeX Live installed from CTAN or from DVD TeX Collection, before +any modification to your system check if the package is already installed looking for `installed` key in the output of the command: -$ tlmgr show barracuda + $ tlmgr show barracuda If `barracuda` is not present, run the command: -$ tlmgr install barracuda + $ tlmgr install barracuda If you have installed TeX Live via Linux OS repository try your distribution's package management system. It's also possible a manual installation: -a. Grab the sources from CTAN or https://github.com/robitex/barracuda . -b. Unzip it at the root of one or your TDS trees. -c. You may need to update some filename database after this, see your TeX - distribution's manual for details. + a. Grab the sources from CTAN or https://github.com/robitex/barracuda . + b. Unzip it at the root of one or your TDS trees. + c. You may need to update some filename database after this running `texhash`, + see your TeX distribution's manual for details. + +Any TeX Live documentation files can be easily opened on screen with the +`texdoc` command line utility (this way is very handy). + + $ texdoc pkgname Installing for Lua +------------------ -Manually copy `src` folder content to a suitable directory of your system that -is reachable to Lua interpreter. +Manually copy the `src` folder content to a suitable directory of your system +that is reachable to a Lua interpreter. diff --git a/macros/luatex/generic/barracuda/README.md b/macros/luatex/generic/barracuda/README.md index e4ca271287..6dc3ccb2db 100644 --- a/macros/luatex/generic/barracuda/README.md +++ b/macros/luatex/generic/barracuda/README.md @@ -3,8 +3,8 @@ This Lua library is for drawing barcode symbols. The project delivers modules to typeset barcode from within a LuaTeX document. Therefore is also possible to use `barracuda` with a Lua standalone interpreter to draw barcodes with -different graphic format such as `SVG`. -The package does not have dependences. +different graphic format such as `SVG` (see an example below). +This package does not have dependences. ![a SVG formatted Code39 symbol](/test/test-ga-svg/test-code39.svg) @@ -14,7 +14,12 @@ complete user control over barcode symbol parameters :thumbsup: . Although development is in beta stage, `barracuda` has a good level of stability. -## Barcode symbologies +## Current version information + +Version: v0.0.9.1 +Date: 2019-12-04 + +## Barcode symbologies list So far, are supported @@ -23,15 +28,15 @@ So far, are supported - Interleaved 2 of 5 - EAN family (EAN8, EAN13, and the add-ons EAN5 and EAN2) -Other 1D encoding format will be added to the project, then it will be the -turn for 2D barcode type. +Other 1D encoding symbology will be added to the project, then it will be the +turn of 2D barcode types like Datamatrix, QRCode or PDF417. ## A very simple LaTeX example The LaTeX package `barracuda.sty` under the cover uses Lua code so you need to compile your source files with LuaTeX or LuajitTeX with the LaTeX format. -For instance here there is a minimal example for LuaLaTeX: +For instance, here there is a minimal example for LuaLaTeX: ```latex % !TeX program = LuaLaTeX @@ -47,7 +52,7 @@ For instance here there is a minimal example for LuaLaTeX: Details and package reference can be found in the manual delivered in the `doc` project directory, even if it is very minimal at the moment. -The directory `test` contains files that can be seen as code examples. +Directory `test` contains files useful also for code examples. ## Installation @@ -58,20 +63,33 @@ your system. Otherwise, you can install the package via `tlmgr` for your TeX Live distribution. If you have installed TeX Live with the `full` schema, `barracuda` is just -available and no further action is required because the last package tagged -version is periodically sent to CTAN. +available and no further action is required. Please, take into account that +only the tagged version (in the `git` sense) of the package will be sent to +CTAN. This means that intermediate development version between consecutive +releases can be found only at https://github.com/robitex/barracuda . TeX Live distribution or Lua interpreter executable are available for a very large number of Operating Systems so it is also for `barracuda`. -More detailed istruction will come soon. +Step by step istruction can be found in the INSTALL.txt file. ## Contribute -Contributes are welcome in any form and for any topics. +Contributes are welcome in any form and for any topics. You can contact me +directly via email at giaconet.mailbox@gmail.com or via a pull request on the +repository https://github.com/robitex/barracuda or writing a public message +via the web page https://github.com/robitex/barracuda/issues for todos, bugs, +feature requests, and more (press the bottom `New issue`). + +Anyway, as a starting point take a look of TODO.txt file for the next +scheduled development tasks. ## License -Please, for more legal details refer to LICENSE.txt file. +`barracuda` project is released under the +[GNU GPL v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). +Please, for more legal details refer to LICENSE.txt file or visit the web page +https://www.gnu.org/licenses/old-licenses/gpl-2.0.html Copyright (C) 2019 Roberto Giacomelli + diff --git a/macros/luatex/generic/barracuda/TODO.txt b/macros/luatex/generic/barracuda/TODO.txt new file mode 100644 index 0000000000..5b1970810c --- /dev/null +++ b/macros/luatex/generic/barracuda/TODO.txt @@ -0,0 +1,92 @@ +Development Program Task Table + +Hypothetical developing tasks list: + +__.__: 20__-__-__: [dev] TiKz driver +__.__: 20__-__-__: [dev] debug driver, ga code pretty printing +__.__: 20__-__-__: [dev] make thing happen: font property for text +__.__: 20__-__-__: [dev] develop LaTeX user package +__.__: 20__-__-__: [dev] coherent error management +__.__: 20__-__-__: [dev] proportional options +__.__: 20__-__-__: [dev] a number parameter can be a string? unit measure... +__.__: 20__-__-__: [prj] a command line program to print barcodes +__.__: 20__-__-__: [man] put ga-asm-spec together with the manual +__.__: 2019-__-__: [dev] guard text in EAN simbology +__.__: 2019-__-__: [dev] ISBN support +__.__: 2019-__-__: [dev] UPC support +__.__: 2019-__-__: [dev] make optional file name in all the Driver methods +__.__: 2019-__-__: [prj] use l3build for testing and CTAN files packaging + +Scheduled tasks (What we are working on): +[ ] <v0.1> 2019-__-__: Data Matrix 2D symbology + +__.__: 2019-__-__: [dmx] data matrix first run +__.__: 2019-__-__: [dmx] ecc200 error correction code +__.__: 2019-__-__: [svg] opcode for grids +__.__: 2019-__-__: [pdf] opcode for grids +__.__: 2019-__-__: [gas] ga-asm grid opcode +__.__: 2019-__-__: [geo] grid vector object +_1.__: 2019-__-__: [dev] init source file encoder for Data Matrix + +[🎉] <v0.0.9.1> 2019-12-04: prelude to version v0.1 +09.15: 2019-11-29: [prj] upload to CTAN version v0.0.9.1 (CTAN conditions) +09.14: 2019-11-29: [prj] upload to CTAN version v0.0.9 +09.13: 2019-11-26: [man] say something about barracuda.sty +09.12: 2019-11-26: [man] edit the section 'A more deep look' for clearness +09.11: 2019-11-26: [prj] reformat todo file: no more date at line end +09.10: 2019-11-26: [svg] take dimensions as scaled point and then mm +09.09: 2019-11-26: [prj] every dev task ends with a repository commit +09.08: 2019-11-25: [prj] .gitignore .out file +09.07: 2019-11-25: [svg] support for text +09.06: 2019-11-25: [man] time to get an usable manual even if minimal +09.05: 2019-11-23: [chk] some new test files +09.04: 2019-11-23: [dev] new barracuda methods save() and hbox() +09.03: 2019-11-20: [svg] driver first run +09.02: 2019-11-10: [dev] implement ga opcode for line-join style and line-cap style +09.01: 2019-11-10: [prj] make lib-parseopt a separated project + +Completed tasks: + +<Version 0.0.8> move costructors to the barcode abstract class 🎉 2019-11-09 +Task 8.5: adopted new Barcode costructors in the EAN encoder 2019-11-09 +Task 8.4: adopted new Barcode costructors in the ITF encoder 2019-11-09 +Task 8.3: adopted new Barcode costructors in the Code128 encoder 2019-11-09 +Task 8.2: adopted new Barcode costructors in the Code39 encoder 2019-11-04 +Task 8.1: new costructor method in the barcode superclass 2019-11-04 + +<Version 0.0.7> code refactoring for ga-canvas 🎉 2019-11-02 +Task 7.5: recompile all the test files 2019-11-02 +Task 7.4: new functions canvas:encode_<obj>() 2019-11-02 +Task 7.3: text position options for Code39 became two indipendent 2019-11-02 +Task 7.2: added a new code39 test file (and bugs fixed) 2019-11-02 +Task 7.1: added subdirectories in the test tree 2019-11-02 + +<Version 0.0.6> implement Interleaved 2 of 5 encoder 🎉 2019-07-02 +Task 6.4: test files 2019-07-02 +Task 6.3: add bearer bars for itf encoder 2019-07-02 +Task 6.2: check digit capability for itf 2 of 5 encoder 2019-07-02 +Task 6.1: implement basic Interleaved 2 of 5 encoder 2019-06-29 + +<Version 0.0.5> implement Code128 and EAN family encoders 🎉 2019-01-27 +Task 5.5: test file 2019-01-27 +Task 5.4: implement EAN2 variant 2019-01-26 +Task 5.3: implement EAN5 variant 2019-01-26 +Task 5.2: new family encoder concept 2019-01-25 +Task 5.1: implement EAN13 encoder 2019-01-12 +Task 4.4: refactoring param iterator 2018-12-30 +Task 4.3: test the local system of option set up for Code128 2018-12-30 +Task 4.2: test the local system of option set up for Code39 2018-12-30 +Task 4.1: test for ga-canvas 2018-12-29 +Task 3.3: opt in Code 39 and Code 128 symbol constructors 2018-12-24 +Task 3.2: focus on a new constructor in Barcode Class for + better encoder implementation 2018-12-21 +Task 3.1: import and refactoring previous Code128 encoder code 2018-12-16 + +<Version 0.0.2> 🎉 2018-12-11 +Task 2.5: option text_gap for code39 2018-12-11 +Task 2.4: resolved the horizontal correction in spaced text 2018-12-11 +Task 2.3: further text option for the Code39 encoder 2018-12-06 +Task 2.2: include minimal text ability to the system +Task 2.1: design and implement a basic framework + +<Version 0.0.1> open 0.0.1 alpha dev master branch 🎉 2018-11-30 diff --git a/macros/luatex/generic/barracuda/barracuda.pdf b/macros/luatex/generic/barracuda/barracuda.pdf Binary files differdeleted file mode 100644 index 3554d40a4a..0000000000 --- a/macros/luatex/generic/barracuda/barracuda.pdf +++ /dev/null diff --git a/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.pdf b/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.pdf Binary files differnew file mode 100644 index 0000000000..18ba18b9c2 --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.pdf diff --git a/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.tex b/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.tex new file mode 100644 index 0000000000..1c403455f8 --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/barracuda-ga-asm.tex @@ -0,0 +1,148 @@ +% !TeX program = LuaLaTeX +% Copyright (C) 2019 Roberto Giacomelli + +\documentclass{article} + +\usepackage{fontspec} +\setmainfont{Libertinus Serif} + +\usepackage[margin=18mm]{geometry} +\usepackage{array} +\usepackage{booktabs} + +\newcolumntype{C}{>{\ttfamily}c} +\newcolumntype{L}{>{\ttfamily}l} + +\begin{document} +Goal: describe geometrical object like lines and rectangles +mainly for a barcode drawing library. + + + +\section{\texttt{ga} instruction set} + +A graphic data specification format called '\texttt{ga}' \emph{graphic alchemy}, +or if you want \emph{generic graphic assembler}. + +\begin{verbatim} +ga<DIM, UINT> := generic graphic assembler + <DIM> := numeric type parameter for dimension, for example f64 or i32 + <UINT> := numeric type parameter for quantity, an unsigned integer, i.e. u8 + +ga<DIM, UINT> := +Elem<DIM, UINT> + +Elem<DIM, UINT> := Code<u8> + Args<DIM, UINT> + +Code<u8> := State<u8> | Object<u8> | Fn<u8> + State<u8> := 1 -> 31 -- graphic properties + Object<u8> := 32 -> 239 -- graphic objects + Fn<u8> := 240 -> 255 -- functions + +Args<DIM, UINT> : <x: DIM> | <e: u8> | <n: UINT> | <c: CHARS> + <x: DIM> := a dimension value of type DIM + <e: u8> := an enumeration value of type u8 (unsigned byte) + <n: UINT> := an unsigned integer for multiplicity + <c: CHARS> := chars sequence ended with 0 +\end{verbatim} + + + +\section{Properties} + +Colors, linecap style etc\dots + +\noindent\begin{tabular}{CLlL} +\toprule +OpCode & Mnemonic key & Graphic property & Operands\\ +\midrule + 1 & pen\_thick & Line thick & <w: DIM>\\ + 2 & line\_cap\_style & Line cap style & <e: u8>\\ + 3 & line\_join\_style & Line join style & <e: u8>\\ + 8 & color & ... \\ +\midrule +30 & start\_bbox\_group & Stop to check the bounding box & -\\ +31 & end\_bbox\_group & Set a bounding box and restart to check & <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM>\\ +\bottomrule +\end{tabular} + + + +\section{Objects} + +\subsection{Lines} + +A segment that starts from point P1 (x1, y1) and ends to P2 (x2, y2). + +\noindent\begin{tabular}{CLlL} +\toprule +OpCode & Mnemonic key & Graphic object & Operands\\ +\midrule +32 & line & Line & <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM>\\ +33 & hline & Horizontal line & <x1: DIM> <x2: DIM> <y: DIM>\\ +34 & vline & Vertical line & <y1: DIM> <y2: DIM> <x: DIM>\\ +\midrule +36 & vbar & Vertical bars & <y1: DIM> <y2: DIM> <b: UINT> <x1: DIM> <t1: DIM> ...\\ +37 & hbar & Horizontal bars & <x1: DIM> <x2: DIM> <b: UINT> <y1: DIM> <t1: DIM> ...\\ +\midrule +38 & polyline & Open polyline & <n: UINT> <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM> ...\\ +39 & c\_polyline & Closed polyline & <n: UINT> <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM> ...\\ +\bottomrule +\end{tabular} + + +\subsection{Rectangles} + +\noindent\begin{tabular}{CLlL} +\toprule +OpCode & Mnemonic key & Graphic object & Operands\\ +\midrule + 48 & rect & Rectangle & <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM>\\ + 49 & f\_rect & Filled rectangle & <x1: DIM> <y1: DIM> <x2: DIM> <y2: DIM>\\ + 50 & rect\_size & Rectangle & <x1: DIM> <y1: DIM> <w: DIM> <h: DIM>\\ + 51 & f\_rect\_size & Filled rectangle & <x1: DIM> <y1: DIM> <w: DIM> <h: DIM>\\ + +\bottomrule +\end{tabular} + + +\subsection{Text} + +\noindent\begin{tabular}{CLl} +\toprule +OpCode & Mnemonic key & Graphic object/Operands\\ +\midrule + 130 & text & A text with several glyphs\\ + & & \ttfamily <ax: FLOAT> <ay: FLOAT> <xpos: DIM> <ypos: DIM> <c: CHARS>\\ +\midrule + 131 & text\_xspaced & A text with glyphs equally spaced on its vertical axis\\ + & & \ttfamily <x1: DIM> <xgap: DIM> <ay: FLOAT> <ypos: DIM> <c: CHARS>\\ +\midrule + 132 & text\_xwidth & Glyphs equally spaced on vertical axis between two x coordinates\\ + & & \ttfamily <ay: FLOAT> <x1: DIM> <x2: DIM> <y: DIM> <c: CHARS>\\ +\midrule + & under design assessment\\ + 140 & \_text\_group & Texts on the same baseline \\ + & & \ttfamily <ay: DIM> <y: DIM> <n: UINT> <<xi: DIM> <ai: FLOAT> <ci: CHARS>> \\ +\bottomrule +\end{tabular} + + +\subsection{Function} + + +\noindent\begin{tabular}{CLlL} +\toprule +OpCode & Mnemonic key & Function & Operands\\ +\midrule + 240 & move & Translate objects & <n: UINT> <dx: DIM> <dy: UINT>\\ + 241 & copy & Copy object & <n: UINT> <c: UINT> <dx1: DIM> <dy1: UINT> ...\\ + 242 & and\_copy & Place and copy objects & <n: UINT> <c: UINT> <dx1: DIM> <dy1: UINT> ...\\ + 243 & grid & Copy next \(n\) objects on a grid & <n: UINT> <col: UINT> <row: UINT> <dx: DIM> <dy: DIM>\\ + 244 & sl\_grid\\ + 250 & mirror\\ + 255 & comment & A string comment & <s: STRING>\\ +\bottomrule +\end{tabular} + + +\end{document} diff --git a/macros/luatex/generic/barracuda/doc/barracuda-manual-tool.tex b/macros/luatex/generic/barracuda/doc/barracuda-manual-tool.tex new file mode 100644 index 0000000000..9e5f5f8a47 --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/barracuda-manual-tool.tex @@ -0,0 +1,7 @@ + + + + + + + diff --git a/macros/luatex/generic/barracuda/doc/barracuda.pdf b/macros/luatex/generic/barracuda/doc/barracuda.pdf Binary files differnew file mode 100644 index 0000000000..6472da10ee --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/barracuda.pdf diff --git a/macros/luatex/generic/barracuda/doc/barracuda.tex b/macros/luatex/generic/barracuda/doc/barracuda.tex new file mode 100644 index 0000000000..e5d6b6acdb --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/barracuda.tex @@ -0,0 +1,331 @@ +% !TeX program = LuaLaTeX +% Copyright (C) 2019 Roberto Giacomelli +% Barracuda manual main source file + +\documentclass[11pt]{article} +\usepackage{fontspec} +\usepackage{geometry} +\usepackage{fancyvrb} +\usepackage{graphicx} +\usepackage{hyperref} + +% special macro for manual typesetting +\input{barracuda-manual-tool} + +\hypersetup{ +pdfinfo={ + Title={Barracuda manual}, + Subject={Barcode printing package}, + Author={Roberto Giacomelli}, + Keywords={Barcode EAN Code128 Lua} +}} + +\setmainfont{Libertinus Serif} +\setmonofont{IBM Plex Sans Condensed} +\fvset{ + fontsize=\small, + frame=single, + labelposition=topline, + framesep=6pt +} +\geometry{ + left=32mm, + right=40mm, + top=28mm, + bottom=28mm +} +\newcommand{\code}[1]{\texttt{#1}} +\newcommand{\brcd}{\code{barracuda}} + +\author{Roberto Giacomelli\\\small email: \url{giaconet.mailbox@gmail.com}} +\title{\code{barracuda} manual\\[1ex] +\small \url{https://github.com/robitex/barracuda}} +\date{\small 2019-12-04\\Version v0.0.9.1} + +\begin{document} +\maketitle + +\abstract{% +Welcome to the \brcd{} software project devoted to barcodes printing. + +This manual shows you how to print barcodes in your \TeX{} documents and how to +export such graphic content to an external file, using \brcd{}. + +\brcd{} is written in Lua programming language and is free software released +under the GPL 2 License.% +} + + +\section{Introduction} + +Barcode symbols are usually a sequence of vertical lines representing encoded +data that can be retrived with special laser scanner or more simpler with a +smartphone running dedicated apps. Almost every store item has a label with a +printed barcode for automatic identification purpose. + +So far, \brcd{} supported symbologies are as the following: +\begin{itemize} + \item Code 39, + \item Code 128, + \item EAN family (EAN 8, EAN 13, and the add-ons EAN 2 and EAN 5), + \item ITF 2of5, interleaved Two of Five. +\end{itemize} + +The package provides drivers for different graphic format, at the moment are: +\begin{itemize} + \item PDF Portable Document Format (require a modern \TeX{} engine), + \item SVG Scalable Vector Graphic. +\end{itemize} + +The name \brcd{} is an assonance with the name Barcode. I started the project +back in 2016 for getting barcode in my \TeX{} generated PDF documents, studying +the Lua\TeX{} technology. + + +\subsection{Manual Content} + +The manual is divided into three parts. At section~\ref{secEnter} the first look +gives to the user a proof of concept to how to use and how works the package +while the next parts present details like how to change the \emph{module} width +of a EAN-13 barcode or how to implement a barcode symbology not already included +in the package. + +The plan of the manual is (but some sections are not completed yet): +\begin{description} +\item[Part 1:] Get started +\begin{itemize} + \item print your first barcode \( \to \) \ref{secEnter} + \item installing \brcd{} on your system \( \to \) \ref{secInstall} + \item \brcd{} \LaTeX{} package \( \to \) \ref{secLaTeXPkg} +\end{itemize} +\item[Part 2:] Advanced Work with \brcd{} +\begin{itemize} + \item Lua framework description \( \to \) \ref{secFramework} + \item working example and use cases \( \to \) \ref{secExample} +\end{itemize} +\item[Part 3:] Reference and parameters +\begin{itemize} + \item barcode symbology reference \( \to \) \ref{secBcRef} + \item \code{ga} specification + \item API reference \( \to \) \ref{secAPI} +\end{itemize} +\end{description} + +\subsection{Required knowledge and useful resources} + +The \brcd{} is a Lua package that can be executed by any Lua interpreter. To use +it, it's necessary some knowledge of Lua programming language and a certain +ability with the terminal of your computer system in order to accomplish command +tasks or software installations. + +It's also possible to run \brcd{} directly from within a \TeX{} source file, +compiled with a suitable typesetting engine like Lua\TeX{}. To do so a minimal +\TeX{} system knowledge is required. As an example of this workflow you simply +can look to this manual because itself is typesetted with LuaLa\TeX{}, running +\brcd{} to include barcodes as a vector graphic object. + +Here is a collection of useful learning resources\dots + +% +% +% +% + + +\section{Get Started with Barracuda} +\label{secEnter} + +The starting point to work with \brcd{} is always a plain text file with some +code, late processed by a command line program with a Lua interpreter. + +As a practical example producing an EAN-13 barcode, in a text editor of your +choice on a empty file called \code{first-run.lua}, type the following two lines +of code: +\medskip +\begin{Verbatim}[label=\footnotesize\code{first-run.lua}] +local barracuda = require "barracuda" +barracuda:save("ean-13", "8006194056290", "my_barcode", "svg") +\end{Verbatim} + +What you have done is to write a \emph{script}. If you have installed a Lua +interpreter and \brcd{}, open a terminal and run the command: +\begin{Verbatim} +$ lua first-run.lua +\end{Verbatim} + +You will see in the same directory of your script, appearing the new file +\code{my\_barcode.svg} with the drawing: +\begin{center} +\includegraphics{image/8006194056290} +\end{center} + +Coming back to the script \code{first-run.lua}, first of all, it's necessary to +load the library with the standard statement \code{require()}. What that Lua +function returns is an object---more precisely a table reference---where are +stored every package features. + +We can now produce the EAN-13 barcode using the method \code{save()} of the +\brcd{} object. The \code{save()} method takes in order the barcode symbology +identifier, the data to be encoded as a string or also a whole number, the +output file name and the optional output format. + + +\subsection{Running Lua\TeX} + +Barracuda can also running inside Lua\TeX{} and the others Lua powered \TeX{} +engine. The text source file is a bit difference respect to a Lua script: Lua +code have to bring place as the argument of directlua primitive... we must use +a box register of type horizontal... + +\begin{Verbatim} +% !TeX program = LuaTeX +\nopagenumbers +\newbox\mybox +\directlua{ + local require "barracuda" + barracuda:hbox("ean-13", "8006194056290", "mybox") +}\box\mybox +\bye +\end{Verbatim} + +The method \code{hbox()} works only with Lua\TeX{}. + + +\subsection{A more deep look} + +Barracuda is designed to be modular and flexible. For example it is possible +to draw different barcodes on the same canvas or tune barcode parameters. + +The main workflow to draw a barcode object reveals more details on internal +structure. In fact, to draw an EAN-13 barcode we must do at least the following +steps: +\begin{enumerate} +\item load the library, +\item get a reference to the \code{Barcode} class, +\item build an EAN encoder, +\item build an EAN symbol passing data to a costructor, +\item get a reference to a new canvas object, +\item draw barcode on canvas, +\item get a reference of driver object, +\item address canvas toward a driver. +\end{enumerate} + +Follow that step by step procedure the corresponding code is in the next +listing: +\begin{Verbatim} +local barracuda = require "barracuda" +local barcode = barracuda:get_barcode_class() + +local ean13, err_enc = barcode:new_encoder("ean-13") +assert(ean13, err_enc) + +local symb, err_symb = ean13:from_string("8006194056290") +assert(symb, err_symb) + +local canvas = barracuda:new_canvas() +symb:append_ga(canvas) + +local driver = barracuda:get_driver() +local ok, err_out = driver:save("svg", canvas, "my_barcode", "svg") +assert(ok, err_out) +\end{Verbatim} + + +\section{Installing} +\label{secInstall} + +\subsection{Installing `barracuda` for TeX Live} + +If you have TeX Live installed from CTAN or from DVD TeX Collection, check +before any modification to your system if the package is already installed +looking for \emph{installed} key in the output of the command: +\begin{Verbatim} +$ tlmgr show barracuda +\end{Verbatim} + +If `barracuda` is not present, run the command: +\begin{Verbatim} +$ tlmgr install barracuda +\end{Verbatim} + +If you have installed TeX Live via Linux OS repository try your distribution's +package management system. + +It's also possible a manual installation: +\begin{enumerate} +\item Grab the sources from CTAN or \url{https://github.com/robitex/barracuda}. +\item Unzip it at the root of one or your TDS trees. +\item You may need to update some filename database after this, see your \TeX{} +distribution's manual for details. +\end{enumerate} + +\subsection{Installing for Lua} + +Manually copy \code{src} folder content to a suitable directory of your system +that is reachable to Lua interpreter. + + +\section{Barracuda \LaTeX{} Package} +\label{secLaTeXPkg} + +The \LaTeX{} package delivered with \brcd{} is still under an early stage of +development. The only macro available is \verb=\barracuda{encoder}{data}=. +A simple example is the following source file for Lua\LaTeX{}: +\begin{Verbatim} +% !TeX program = LuaLaTeX +\documentclass{article} +\usepackage{barracuda} +\begin{document} +\leavevmode +\barracuda{code39}{123ABC}\\ +\barracuda{code128}{123ABC} +\end{document} +\end{Verbatim} + +Every macro \verb=\barracuda= typesets a barcode symbol represented with the +encoder defined in the first argument, the information defined by the second. + + +\section{The Barracuda Framework} +\label{secFramework} + +The \brcd{} package framework consists in indipendet modules: a barcode class +hierarchy encoding a text into a barcode symbology; a geometrical library called +\code{libgeo} representing several graphic object; an encoding library for the +\code{ga} format (graphic assembler) several driver to "print" a ga stream +into a file or a \TeX{} hbox register. + +To implement a barcode encoder you need to write a component called +\emph{encoder} defining every parameters and producing the encoder class, while +a driver must understand ga opcode stream and print the corresponding graphic +object. + +Every barcode encoder come with a set of parameters, some of them can be +reserved and can be setting up by the user only through the encoder. + +So, you can create many instances of the same encoder for a single barcode +type, with its own parameter set. + +The basic idea is getting faster encoder, for which the user may set up +paramenters at any level: barcode abstract class, encoder, down to a single +symbol. + +Barcode class is completely indipendent from the ouput driver and viceversa. + + +\section{Example and use cases} +\label{secExample} + +TODO + +\section{Barcode Reference} +\label{secBcRef} + +TODO + +\section{API reference} +\label{secAPI} + +TODO + +\end{document} diff --git a/macros/luatex/generic/barracuda/doc/image/8006194056290.pdf b/macros/luatex/generic/barracuda/doc/image/8006194056290.pdf Binary files differnew file mode 100644 index 0000000000..8effe87846 --- /dev/null +++ b/macros/luatex/generic/barracuda/doc/image/8006194056290.pdf diff --git a/macros/luatex/generic/barracuda/lib/barracuda.lua b/macros/luatex/generic/barracuda/src/barracuda.lua index 33e81be24f..4d587ef952 100644 --- a/macros/luatex/generic/barracuda/lib/barracuda.lua +++ b/macros/luatex/generic/barracuda/src/barracuda.lua @@ -25,7 +25,7 @@ -- modules. local Barracuda = { - _VERSION = "barracuda v0.0.9", + _VERSION = "barracuda v0.0.9.1", _NAME = "barracuda", _DESCRIPTION = "Lua library for barcode printing", _URL = "https://github.com/robitex/barracuda", @@ -33,9 +33,9 @@ local Barracuda = { } -- essential sub-module loading -Barracuda._libgeo = require "lib-geo.libgeo" -- basic vectorial objects -Barracuda._gacanvas = require "lib-geo.gacanvas" -- ga stream library -Barracuda._barcode = require "lib-barcode.barcode" -- barcode abstract class +Barracuda._libgeo = require "lib-geo.brcd-libgeo" -- basic vectorial objects +Barracuda._gacanvas = require "lib-geo.brcd-gacanvas" -- ga stream library +Barracuda._barcode = require "lib-barcode.brcd-barcode" -- barcode abstract class local Barcode = Barracuda._barcode Barcode._libgeo = Barracuda._libgeo @@ -48,7 +48,7 @@ end -- where we place output driver library function Barracuda:get_driver() --> Driver object, err if not self._lib_driver then - self._lib_driver = require "lib-driver.driver" + self._lib_driver = require "lib-driver.brcd-driver" end return self._lib_driver end diff --git a/macros/luatex/generic/barracuda/lib/lib-barcode/barcode.lua b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-barcode.lua index ed6204528a..415719a2f4 100644 --- a/macros/luatex/generic/barracuda/lib/lib-barcode/barcode.lua +++ b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-barcode.lua @@ -4,7 +4,7 @@ -- Please see LICENSE.TXT for any legal information about present software local Barcode = { - _VERSION = "Barcode v0.0.5", + _VERSION = "Barcode v0.0.9", _NAME = "Barcode", _DESCRIPTION = "Barcode abstract class", } @@ -12,10 +12,10 @@ Barcode.__index = Barcode -- barcode_type/submodule name Barcode._available_enc = {-- keys must be lowercase - code39 = "lib-barcode.code39", - code128 = "lib-barcode.code128", - ean = "lib-barcode.ean", - i2of5 = "lib-barcode.i2of5", -- Interleaved 2 of 5 + code39 = "lib-barcode.brcd-code39", -- Code 39 + code128 = "lib-barcode.brcd-code128", -- Code128 + ean = "lib-barcode.brcd-ean", -- EAN family (ISBN, EAN8, etc) + i2of5 = "lib-barcode.brcd-i2of5", -- Interleaved 2 of 5 } Barcode._builder_instances = {} -- encoder builder instances repository diff --git a/macros/luatex/generic/barracuda/lib/lib-barcode/code128.lua b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-code128.lua index 317b3de8f8..317b3de8f8 100644 --- a/macros/luatex/generic/barracuda/lib/lib-barcode/code128.lua +++ b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-code128.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-barcode/code39.lua b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-code39.lua index a639619c63..a639619c63 100644 --- a/macros/luatex/generic/barracuda/lib/lib-barcode/code39.lua +++ b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-code39.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-barcode/ean.lua b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-ean.lua index 6893550a5c..6893550a5c 100644 --- a/macros/luatex/generic/barracuda/lib/lib-barcode/ean.lua +++ b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-ean.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-barcode/i2of5.lua b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-i2of5.lua index 8097b855f7..8097b855f7 100644 --- a/macros/luatex/generic/barracuda/lib/lib-barcode/i2of5.lua +++ b/macros/luatex/generic/barracuda/src/lib-barcode/brcd-i2of5.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-driver/driver.lua b/macros/luatex/generic/barracuda/src/lib-driver/brcd-driver.lua index 956c1f1e9d..4827a190c5 100644 --- a/macros/luatex/generic/barracuda/lib/lib-driver/driver.lua +++ b/macros/luatex/generic/barracuda/src/lib-driver/brcd-driver.lua @@ -7,7 +7,7 @@ -- All dimensions are in scaled point (sp) local Driver = { - _VERSION = "Driver v0.0.1", + _VERSION = "Driver v0.0.9", _NAME = "Driver", _DESCRIPTION = "Driver for ga graphic assembler stream", } @@ -17,9 +17,8 @@ Driver._drv_instance = {} -- driver instances repository -- driver_type/submodule name Driver._drv_available_drv = { -- lowercase keys please - native = "lib-driver.drv-pdfliteral", -- only LuaTeX driver - svg = "lib-driver.drv-svg", - -- tikz = "lib-driver.drv-tikz", + native = "lib-driver.brcd-drv-pdfliteral", -- only LuaTeX driver + svg = "lib-driver.brcd-drv-svg", } function Driver:_get_driver(id_drv) --> object, err diff --git a/macros/luatex/generic/barracuda/lib/lib-driver/drv-pdfliteral.lua b/macros/luatex/generic/barracuda/src/lib-driver/brcd-drv-pdfliteral.lua index 50baea1472..50baea1472 100644 --- a/macros/luatex/generic/barracuda/lib/lib-driver/drv-pdfliteral.lua +++ b/macros/luatex/generic/barracuda/src/lib-driver/brcd-drv-pdfliteral.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-driver/drv-svg.lua b/macros/luatex/generic/barracuda/src/lib-driver/brcd-drv-svg.lua index 7a2c5ab112..7a2c5ab112 100644 --- a/macros/luatex/generic/barracuda/lib/lib-driver/drv-svg.lua +++ b/macros/luatex/generic/barracuda/src/lib-driver/brcd-drv-svg.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-geo/gacanvas.lua b/macros/luatex/generic/barracuda/src/lib-geo/brcd-gacanvas.lua index cccc68f447..cccc68f447 100644 --- a/macros/luatex/generic/barracuda/lib/lib-geo/gacanvas.lua +++ b/macros/luatex/generic/barracuda/src/lib-geo/brcd-gacanvas.lua diff --git a/macros/luatex/generic/barracuda/lib/lib-geo/libgeo.lua b/macros/luatex/generic/barracuda/src/lib-geo/brcd-libgeo.lua index fd53ca6509..fd53ca6509 100644 --- a/macros/luatex/generic/barracuda/lib/lib-geo/libgeo.lua +++ b/macros/luatex/generic/barracuda/src/lib-geo/brcd-libgeo.lua diff --git a/macros/luatex/generic/barracuda/example/01-latex-code39.pdf b/macros/luatex/generic/barracuda/test/test-barracuda-package/01-barracuda-latex-test.pdf Binary files differindex d40c55f46c..a075d25db1 100644 --- a/macros/luatex/generic/barracuda/example/01-latex-code39.pdf +++ b/macros/luatex/generic/barracuda/test/test-barracuda-package/01-barracuda-latex-test.pdf diff --git a/macros/luatex/generic/barracuda/example/01-latex-code39.tex b/macros/luatex/generic/barracuda/test/test-barracuda-package/01-barracuda-latex-test.tex index c74935ed8d..33a81aeb5d 100644 --- a/macros/luatex/generic/barracuda/example/01-latex-code39.tex +++ b/macros/luatex/generic/barracuda/test/test-barracuda-package/01-barracuda-latex-test.tex @@ -1,14 +1,13 @@ % !TeX program = LuaLaTeX % Copyright (C) 2019 Roberto Giacomelli -\documentclass{article} +% test file: make a Code39 barcodes in a LaTeX document +\documentclass{article} \usepackage{barracuda} \begin{document} - A\barracuda{code39}{123QWE}A - \end{document} diff --git a/macros/luatex/generic/barracuda/example/001-code128-test.lua b/macros/luatex/generic/barracuda/test/test-code128/001-code128-test.lua index 78645612dc..78645612dc 100644 --- a/macros/luatex/generic/barracuda/example/001-code128-test.lua +++ b/macros/luatex/generic/barracuda/test/test-code128/001-code128-test.lua diff --git a/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.pdf b/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.pdf Binary files differnew file mode 100644 index 0000000000..c3c8460bc7 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.pdf diff --git a/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.tex b/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.tex new file mode 100644 index 0000000000..eeaf60e483 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code128/002-code128-test.tex @@ -0,0 +1,125 @@ +% !TeX program = LuaTeX +% Copyright (C) 2019 Roberto Giacomelli + +\newbox\mybox +\nopagenumbers + +Code 128 encoder test. + +Test 1: one simple barcode with default parameter: + +\directlua{ +barracuda = require "barracuda" +} + +\directlua{ +local barcode = barracuda:get_barcode_class() + +local c128, err = barcode:new_encoder("code128") +assert(not err, err) + +local symbo, err = c128:from_string("5465468132546812") +assert(not err, err) + +local canvas = barracuda:new_canvas() +symbo:append_ga(canvas) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\vrule A\vrule\box\mybox \vrule A\vrule + +Test 2: two symbols, different anchor. The first symbol (more longer than the +second one) takes the anchor parameters from the super class Barcode, while +the second one takes anchors from itself: + +\directlua{ +local barcode = barracuda:get_barcode_class() +local ok, err = barcode:set_param{ax = 1, ay = 1} % super class set up +assert(ok, err) +assert(barcode.ax == 1, "barcode ax is "..tostring(barcode.ax)) + +local c128, err = barcode:enc_by_name("code128") +assert(c128.ax == 1, "c128 ax is "..tostring(c128.ax)) + +local s1, err = c128:from_string("12345678901234567890"); assert(s1, err) +local s2, err = c128:from_string("0987654321", {ax = 0, ay = 0}); assert(s2, err) + +local s1_ax = s1:get_param("ax") +assert(s1.ax == 1, "1 ax is "..tostring(s1.ax)) +local s2_ax = s2:get_param("ax") +assert(s2.ax == 0, "0 ax is "..tostring(s2.ax)) + +local canvas = barracuda:new_canvas() +s1:append_ga(canvas) +s2:append_ga(canvas) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +}\box\mybox + +Test 3: play with the barcodes height (ydim parameter). The vertical anchor ay +will take to super class Barcode, previously set to 1.0. So, the symbols will +be aligned to the top: + +\directlua{ +local c128, err = barracuda:get_barcode_class() + :enc_by_name "code128"; assert(c128, err) + +local s, err = c128:from_string("123456"); assert(s, err) +local canvas = barracuda:new_canvas() +s:append_ga(canvas) + +local ok, err = s:set_param("ydim", tex.sp "30mm") +s:append_ga(canvas, tex.sp "20mm") + +local ok, err = s:set_param("ydim", tex.sp "60mm") +s:append_ga(canvas, tex.sp "40mm") + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +}\box\mybox + +Test 4: set up vertical anchor globally to 0.0, locally to the encoder to 0.5 +and locally to 1.0: + +\directlua{ +local barcode = barracuda:get_barcode_class() +% set ay globally to 0.0 +local ok, err = barcode:set_param("ay", 0); assert(ok, err) + +local c128, err = barcode:enc_by_name "code128"; assert(c128, err) +local s, err = c128:from_string("ABCDEFGHI"); assert(s, err) + +local canvas = barracuda:new_canvas() +local _, err = s:append_ga(canvas); assert(not err, err) + +% set ay to 0.5 for the encoder +local ok, err = c128:set_param("ay", 0.5); assert(ok, err) +local _, err = s:append_ga(canvas, tex.sp "30mm"); assert(not err, err) +% set locally to the symbol ay to 1.0 +local ok, err = s:set_param("ay", 1) +local _, err = s:append_ga(canvas, tex.sp "60mm"); assert(not err, err) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +}\box\mybox + +Test 5: uint() costructor and save a file with PDF literal code: + +\directlua{ +local barcode = barracuda:get_barcode_class() +local c128, err = barcode:enc_by_name("code128"); assert(c128, err) +local s, e = c128:from_uint(1234567890); assert(s, e) +local canvas = barracuda:new_canvas() +local _, errc = s:append_ga(canvas); assert(not errc, errc) +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +drv:save("native", canvas, "02-05-pdfliteral") +}\box\mybox + +That's all folk! + +\bye + +function Driver:save(id_drv, ga, filename, ext) --> ok, err
\ No newline at end of file diff --git a/macros/luatex/generic/barracuda/test/test-code128/02-05-pdfliteral.txt b/macros/luatex/generic/barracuda/test/test-code128/02-05-pdfliteral.txt new file mode 100644 index 0000000000..fe16d33c50 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code128/02-05-pdfliteral.txt @@ -0,0 +1,43 @@ +q +-53.574521 -14.173154 1.190545 28.346308 re +-51.788704 -14.173154 0.595272 28.346308 re +-50.002887 -14.173154 1.785817 28.346308 re +f +S +-47.026524 -14.173154 0.595272 28.346308 re +-45.835979 -14.173154 1.190545 28.346308 re +-43.454889 -14.173154 1.785817 28.346308 re +f +S +-40.478527 -14.173154 0.595272 28.346308 re +-38.097437 -14.173154 0.595272 28.346308 re +-36.906892 -14.173154 1.190545 28.346308 re +f +S +-33.930530 -14.173154 1.785817 28.346308 re +-30.358895 -14.173154 0.595272 28.346308 re +-29.168350 -14.173154 1.190545 28.346308 re +f +S +-27.382533 -14.173154 1.190545 28.346308 re +-23.810898 -14.173154 0.595272 28.346308 re +-22.620353 -14.173154 0.595272 28.346308 re +f +S +-20.834536 -14.173154 1.190545 28.346308 re +-19.048719 -14.173154 2.381090 28.346308 re +-16.072356 -14.173154 1.190545 28.346308 re +f +S +-14.286539 -14.173154 0.595272 28.346308 re +-12.500722 -14.173154 2.381090 28.346308 re +-8.929087 -14.173154 0.595272 28.346308 re +f +S +-7.738542 -14.173154 1.190545 28.346308 re +-4.762180 -14.173154 1.785817 28.346308 re +-2.381090 -14.173154 0.595272 28.346308 re +-1.190545 -14.173154 1.190545 28.346308 re +f +S +Q
\ No newline at end of file diff --git a/macros/luatex/generic/barracuda/example/c128-123.svg b/macros/luatex/generic/barracuda/test/test-code128/c128-123.svg index 9f5b5847aa..9f5b5847aa 100644 --- a/macros/luatex/generic/barracuda/example/c128-123.svg +++ b/macros/luatex/generic/barracuda/test/test-code128/c128-123.svg diff --git a/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua new file mode 100644 index 0000000000..e4a8569e93 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua @@ -0,0 +1,41 @@ +-- Copyright (C) 2019 Roberto Giacomelli +-- test Code 39 encoder + +local barracuda = require "barracuda" + +for k, v in pairs(barracuda) do + print(k,v) +end + +local barcode = barracuda:get_barcode_class() + +local c39, err = barcode:new_encoder("code39") +assert(not err, err) + +print(c39._NAME) +print(c39._VERSION) + +local info = c39:info() + +print("encoder name = ", info.name) +print("description = ", info.description) + +for k, tp in ipairs(info.param) do + print(k, tp.name, tp.value) +end + +local symb = c39:from_string("123") + +print("print internal representation of chars") +for _, c in ipairs(symb.code) do + print(c) +end +print() + +local canvas = barracuda:new_canvas() +symb:append_ga(canvas) + +-- native driver +local drv = barracuda:get_driver() + +for _, code in ipairs(canvas._data) do print(code) end diff --git a/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.pdf b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.pdf Binary files differnew file mode 100644 index 0000000000..060a61e892 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.pdf diff --git a/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex new file mode 100644 index 0000000000..73f91aac43 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex @@ -0,0 +1,120 @@ +% !TeX program = LuaTeX +% Copyright (C) 2019 Roberto Giacomelli + +\newbox\mybox +\nopagenumbers + +Test 1: Code 39 symbol with default parameters: + +\directlua{ +local barracuda = require "barracuda" +local c39, err = barracuda:get_barcode_class() + :new_encoder("code39") +assert(not err, err) + +local symbol, err = c39:from_string("ABC12QJ31") +assert(not err, err) + +local canvas = barracuda:new_canvas() +symbol:append_ga(canvas) +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +Test 2: get the reference of the previous encoder and typeset two +Code 39 symbols on the same canvas, one above to the other: + +\directlua{ +local barracuda = require "barracuda" +local c39, err = barracuda:get_barcode_class() + :enc_by_name("code39") + assert(c39, err) + +local s1, err = c39:from_string("ZKPQJ31"); assert(s1, err) +local s2, err = c39:from_string("RTFG746", {text_vpos="top"}); assert(s2, err) + +local canvas = barracuda:new_canvas() +s1:append_ga(canvas) + +local h2 = s2:get_param("height") +s2:append_ga(canvas, 0.0, h2 + tex.sp "5pt") +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +Test 3: with the same encoder print a symbol, change globally the height, +and reprint the same symbol again on the same canvas: + +\directlua{ +local barracuda = require "barracuda" +local c39, err = barracuda:get_barcode_class() + :enc_by_name("code39") + assert(c39, err) + +local s1, err = c39:from_string("ZKPQJ31"); assert(s1, err) + +local canvas = barracuda:new_canvas() +s1:append_ga(canvas) + +local h = s1:get_param("height") +c39:set_param("height", 2*h) +c39:set_param {text_vpos = "top"} + +s1:append_ga(canvas, 0.0, h + tex.sp "5pt") + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +Test 4: do the same in test 3 but change locally parameters as +height and text properties: + +\directlua{ +local barracuda = require "barracuda" +local c39, err = barracuda:get_barcode_class() + :enc_by_name("code39") + assert(c39, err) + +local s1, err = c39:from_string("0123456789"); assert(s1, err) + +local canvas = barracuda:new_canvas() +s1:append_ga(canvas) +local h, err = s1:get_param("height"); assert(h, err) +local ok, err = s1:set_param{ + height = h/2, + text_enabled = true, + text_vpos = "bottom", + text_hpos = "spaced", + text_star = true, + ay = 1, +}; assert(ok, err) +s1:append_ga(canvas, 0.0, - tex.sp "5pt") + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +Test 5: create a new encoder with a large module value: + +\directlua{ +local barracuda = require "barracuda" +local barcode = barracuda:get_barcode_class() + +local c39, err = barcode:new_encoder("code39", "e2", {module = tex.sp "0.5mm"}) +assert(c39, err) + +local s1, err = c39:from_string("02040608"); assert(s1, err) + +local canvas = barracuda:new_canvas() +s1:append_ga(canvas) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +\bye diff --git a/macros/luatex/generic/barracuda/example/003-code39-test.pdf b/macros/luatex/generic/barracuda/test/test-code39/003-code39-test.pdf Binary files differindex 4625a40010..66b04e61e3 100644 --- a/macros/luatex/generic/barracuda/example/003-code39-test.pdf +++ b/macros/luatex/generic/barracuda/test/test-code39/003-code39-test.pdf diff --git a/macros/luatex/generic/barracuda/example/003-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/003-code39-test.tex index a4ba3d6e81..a4ba3d6e81 100644 --- a/macros/luatex/generic/barracuda/example/003-code39-test.tex +++ b/macros/luatex/generic/barracuda/test/test-code39/003-code39-test.tex diff --git a/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.pdf b/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.pdf Binary files differnew file mode 100644 index 0000000000..3c96d9233b --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.pdf diff --git a/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.tex new file mode 100644 index 0000000000..559dc94383 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/004-code39-test.tex @@ -0,0 +1,46 @@ +% !TeX program = LuaTeX +% Copyright (C) 2019 Roberto Giacomelli + +\newbox\mybox +\nopagenumbers + +Test 4: check uint costructor: + +\directlua{ +barracuda = require "barracuda" +local c39, err = barracuda:get_barcode_class() + :new_encoder("code39") +assert(not err, err) +local err +local symbol +symbol, err = c39:from_uint(0, {text_hpos="center"}) +assert(not err, err) + +local canvas = barracuda:new_canvas() +symbol:append_ga(canvas) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +\directlua{ +local c39, err = barracuda:get_barcode_class() + :enc_by_name("code39") +assert(c39, err) +local e +local symbol +symbol, e = c39:from_uint(0123456789, {text_hpos="spaced",text_star=true}) +assert(not e, e) + +local canvas = barracuda:new_canvas() +symbol:append_ga(canvas) + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} +\box\mybox + +\bye + + diff --git a/macros/luatex/generic/barracuda/test/test-code39/005-code39-test.lua b/macros/luatex/generic/barracuda/test/test-code39/005-code39-test.lua new file mode 100644 index 0000000000..4ac0ff171d --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/005-code39-test.lua @@ -0,0 +1,8 @@ + +-- Code 39 test file number 5 + +local barracuda = require "barracuda" +barracuda:save("code39", "ABCDEFG", "my_barcode") + +-- end of test file + diff --git a/macros/luatex/generic/barracuda/example/006-code39-test.lua b/macros/luatex/generic/barracuda/test/test-code39/006-code39-test.lua index d33ad4ffaf..d33ad4ffaf 100644 --- a/macros/luatex/generic/barracuda/example/006-code39-test.lua +++ b/macros/luatex/generic/barracuda/test/test-code39/006-code39-test.lua diff --git a/macros/luatex/generic/barracuda/example/006-six.svg b/macros/luatex/generic/barracuda/test/test-code39/006-six.svg index 25ce8bb34c..25ce8bb34c 100644 --- a/macros/luatex/generic/barracuda/example/006-six.svg +++ b/macros/luatex/generic/barracuda/test/test-code39/006-six.svg diff --git a/macros/luatex/generic/barracuda/test/test-code39/my_barcode.svg b/macros/luatex/generic/barracuda/test/test-code39/my_barcode.svg new file mode 100644 index 0000000000..426fb3de86 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/my_barcode.svg @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Barracuda package (https://github.com/robitex/barracuda) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="27.177857mm" height="10.873169mm" + viewBox="-2.539987 -7.999958 27.177857 10.873169" +> + <g stroke="black"> + <path d="M0.095249 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M0.666746 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M1.142994 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M1.714491 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M2.190738 -7.999958V-0.000000" style="stroke-width:0.190499"/> + </g> + <g stroke="black"> + <path d="M2.666986 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M3.143233 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M3.524231 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M4.095728 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M4.571976 -7.999958V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M5.048223 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M5.524471 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M6.000718 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M6.572215 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M7.048463 -7.999958V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M7.619960 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M8.191457 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M8.667704 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M9.239201 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M9.620199 -7.999958V-0.000000" style="stroke-width:0.190499"/> + </g> + <g stroke="black"> + <path d="M10.001197 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M10.382195 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M10.858443 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M11.525189 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M12.001437 -7.999958V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M12.572934 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M13.049181 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M13.525429 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M14.192175 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M14.573173 -7.999958V-0.000000" style="stroke-width:0.190499"/> + </g> + <g stroke="black"> + <path d="M14.954171 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M15.430419 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M16.001916 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M16.668662 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M17.049660 -7.999958V-0.000000" style="stroke-width:0.190499"/> + </g> + <g stroke="black"> + <path d="M17.430658 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M17.811656 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M18.192654 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M18.859401 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M19.430898 -7.999958V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M19.907145 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M20.478642 -7.999958V-0.000000" style="stroke-width:0.190499"/> + <path d="M20.954890 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M21.526387 -7.999958V-0.000000" style="stroke-width:0.380998"/> + <path d="M22.002634 -7.999958V-0.000000" style="stroke-width:0.190499"/> + </g> + <text x="0.000000" y="2.873212" font-family="Verdana" font-size="2.877000"> + ABCDEFG </text> +</svg> + diff --git a/macros/luatex/generic/barracuda/example/001-13-ean-test.pdf b/macros/luatex/generic/barracuda/test/test-ean/001-13-ean-test.pdf Binary files differindex 925a8ad8f0..0e8abb933f 100644 --- a/macros/luatex/generic/barracuda/example/001-13-ean-test.pdf +++ b/macros/luatex/generic/barracuda/test/test-ean/001-13-ean-test.pdf diff --git a/macros/luatex/generic/barracuda/example/001-13-ean-test.tex b/macros/luatex/generic/barracuda/test/test-ean/001-13-ean-test.tex index c0a4db3894..c0a4db3894 100644 --- a/macros/luatex/generic/barracuda/example/001-13-ean-test.tex +++ b/macros/luatex/generic/barracuda/test/test-ean/001-13-ean-test.tex diff --git a/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.pdf b/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.pdf Binary files differnew file mode 100644 index 0000000000..568050371c --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.pdf diff --git a/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.tex b/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.tex new file mode 100644 index 0000000000..2c82373b61 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ean/002-ean-test.tex @@ -0,0 +1,12 @@ +% !TeX program = LuaTeX +\nopagenumbers +\newbox\mybox +\directlua{ + local barracuda = require "barracuda" + barracuda:hbox("ean-13", "8006194056290", "mybox") +} +\pagewidth=80mm +\pageheight=60mm +\box\mybox +\bye + diff --git a/macros/luatex/generic/barracuda/example/003-ean-test.pdf b/macros/luatex/generic/barracuda/test/test-ean/003-ean-test.pdf Binary files differindex e03c2d48d7..baa5a5b9cd 100644 --- a/macros/luatex/generic/barracuda/example/003-ean-test.pdf +++ b/macros/luatex/generic/barracuda/test/test-ean/003-ean-test.pdf diff --git a/macros/luatex/generic/barracuda/example/003-ean-test.tex b/macros/luatex/generic/barracuda/test/test-ean/003-ean-test.tex index 59b17c4c07..59b17c4c07 100644 --- a/macros/luatex/generic/barracuda/example/003-ean-test.tex +++ b/macros/luatex/generic/barracuda/test/test-ean/003-ean-test.tex diff --git a/macros/luatex/generic/barracuda/example/004-ean-test.lua b/macros/luatex/generic/barracuda/test/test-ean/004-ean-test.lua index 017e0725b8..017e0725b8 100644 --- a/macros/luatex/generic/barracuda/example/004-ean-test.lua +++ b/macros/luatex/generic/barracuda/test/test-ean/004-ean-test.lua diff --git a/macros/luatex/generic/barracuda/example/8006194056290.svg b/macros/luatex/generic/barracuda/test/test-ean/8006194056290.svg index f7965e94d4..f7965e94d4 100644 --- a/macros/luatex/generic/barracuda/example/8006194056290.svg +++ b/macros/luatex/generic/barracuda/test/test-ean/8006194056290.svg diff --git a/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.pdf b/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.pdf Binary files differnew file mode 100644 index 0000000000..b8a7477c7f --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.pdf diff --git a/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.tex b/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.tex new file mode 100644 index 0000000000..1a5ed80d0c --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-pdfliteral/001-ga-pdfliteral-test.tex @@ -0,0 +1,740 @@ +% !TeX program = LuaTeX +% test for ga-canvas pdfliteral driver +% +% Copyright (C) 2019 Roberto Giacomelli +% see LICENSE.txt file + +---ga--- is a binary format as an istruction set similar to +a sort of assembler language that describes simple graphic +objects like lines and rectangles. +This file contains tests aiming to check the pdfliteral +driver capability to render such ga streams---usually a Lua +array. + +The pdfliteral driver directly inserts PDF vector graphic +primitives within the output and should be intented as the +"native" driver of barracuda package. + +The complete reference of the ---ga--- format is available +throgh out the content of the "ga-grammar.tex" file. + +Please note that all dimensions are in scaled point, the +very small \TeX{} internal unit, in fact we have that +65536sp = 1pt. + +Running the source file with luatex. The typesetting engine +executes the directlua macro, so vector graphics appear in +the PDF output file. + +\newbox\mybox +\directlua{ + driver = require [[lib-driver.brcd-driver]] % global Lua variables + pt = tex.sp [[1pt]] % 1pt = 65536sp +} + +Let's start drawing an horizontal line 100pt long: +\directlua{ + local ga = {_data = {33, 0*pt, 100*pt, 0*pt}} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +or two different parallel lines 24pt long: +\directlua{ + local ga = {_data = {33, 0*pt, 24*pt, 0*pt, 33, 0*pt, 24*pt, 5*pt}} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +and again two horizontal lines 10pt thick, touching a corner: +\directlua{ + local ga = {_data = { + 1, 10*pt, + 33, -24*pt, 0*pt, -5*pt, + 33, 0*pt, 24*pt, 5*pt, + }} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +Several vertical lines with its horizontal limits: +\directlua{ + local ga = { _data = { + 34, -20*pt, 20*pt, 0*pt, + 34, -15*pt, 15*pt, 5*pt, + 34, -10*pt, 10*pt, 10*pt, + 34, -5*pt, 5*pt, 15*pt, + 34, -.5*pt, .5*pt, 20*pt, + 34, -5*pt, 5*pt, 25*pt, + 34, -10*pt, 10*pt, 30*pt, + 34, -15*pt, 15*pt, 35*pt, + 34, -20*pt, 20*pt, 40*pt, + 1, .05*pt, + 33, 0*pt, 40*pt, -20*pt, + 33, 0*pt, 40*pt, 20*pt, + }} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +Finally a little rectangle: +\directlua{ + local ga = {_data = { + 1, 5*pt, + 48, 0*pt, 0*pt, 15*pt, 10*pt, + }} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +\bigskip +Test number 1: a vbar 2pt width, 20pt height: +\directlua{ + % vbar: <36> y1 y2 <nbars> x1 w1 x2 w2 ... xn wn + local ga = {_data = {36, 0, 20*pt, 1, 0.0, 2*pt}} + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +\bigskip +Test number 2: ten vbars in a row equally spaced by 10pt: +\directlua{ + local ga = {36, 0, 10*pt, 10,} + for i = 0, 9 do + ga[i*2 + 5] = 5*pt + i*20*pt + ga[i*2 + 6] = 10*pt + end + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 3: two series of vbars 10pt and 5pt large: +\directlua{ + local ga = {36, 0, 10*pt, 10,} + for i = 0, 9 do + ga[i*2 + 5] = 5*pt + i*20*pt + ga[i*2 + 6] = 10*pt + end + ga[25] = 36 % vbar opcode + ga[26] = 2.5*pt % y1 + ga[27] = 7.5*pt % y2 + ga[28] = 9 % number of bars + for i = 0, 8 do + ga[i*2 + 29] = 15*pt + i*20*pt + ga[i*2 + 30] = 5*pt + end + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 4: a bunch of thin vertical bars (25): +\directlua{ + local ga = {} + ga[1] = 36 % vbar opcode + ga[2] = 5*pt % y1 + ga[3] = 25*pt % y2 + ga[4] = 25 % number of bars + for i = 0, 24 do + ga[i*2 + 5] = 1*pt + i*4*pt + ga[i*2 + 6] = 2*pt + end + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule A\box\mybox A\vrule + +\bigskip +Test number 5: two rows of a bunch of thin bars: +\directlua{ + local ga = {} + ga[1] = 36 % vbar opcode + ga[2] = 5*pt % y1 + ga[3] = 25*pt % y2 + ga[4] = 25 % number of bars + for i = 0, 24 do + ga[i*2 + 5] = 1*pt + i*4*pt + ga[i*2 + 6] = 2*pt + end + ga[55] = 36 % vbar opcode + ga[56] = 25*pt % y1 + ga[57] = 45*pt % y2 + ga[58] = 24 % number of bars + for i = 0, 23 do + ga[i*2 + 59] = 3*pt + i*4*pt + ga[i*2 + 60] = 2*pt + end + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 6: staircase of Vbars (manually data definition): +\directlua{ + local ga = { + 36, % vbar opcode + 0*pt, % y1 + 20*pt, % y2 + 1, % number of bars + 5*pt, % x + 10*pt, % w + 36, % vbar opcode + 20*pt, % y1 + 40*pt, % y2 + 1, % number of bars + 15*pt, % x + 10*pt, % w + 36, % vbar opcode + 40*pt, % y1 + 60*pt, % y2 + 1, % number of bars + 25*pt, % x + 10*pt, % w + } + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 7: vbars with spaced text, in three different rows: +\directlua{ + local ga = {} + ga[1] = 36 % vbar opcode + ga[2] = 0*pt % y1 + ga[3] = 20*pt % y2 + ga[4] = 8 % number of bars + for i = 1,8 do + ga[3 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[4 + i*2] = 5*pt % bar width + end + ga[21] = 36 % vbar opcode + ga[22] = 30*pt % y1 + ga[23] = 50*pt % y2 + ga[24] = 8 % number of bars + for i = 1,8 do + ga[23 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[24 + i*2] = 5*pt % bar width + end + % 131 <x1: FLOAT> <xgap: FLOAT> <ay: DIM> <ypos: DIM> <c: CHARS> + ga[41] = 131 % opcode text_xspaced + ga[42] = 10*pt % x coordinate of the first glyph axis + ga[43] = 10*pt % x gap among glyphs + ga[44] = 0.5 % half height + ga[45] = 25*pt % y coordinate of glyps + ga[46] = 65 % A + ga[47] = 66 % B + ga[48] = 67 % C + ga[49] = 68 % D + ga[50] = 69 % E + ga[51] = 70 % F + ga[52] = 71 % G + ga[53] = 72 % H + ga[54] = 0 + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 8: spaced text (checking the correct vertical alignment): +\directlua{ + local ga = {} + ga[1] = 36 % vbar opcode + ga[2] = 0*pt % y1 + ga[3] = 20*pt % y2 + ga[4] = 8 % number of bars + for i = 1,8 do + ga[3 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[4 + i*2] = 1*pt % bar width + end + ga[21] = 36 % vbar opcode + ga[22] = 40*pt % y1 + ga[23] = 60*pt % y2 + ga[24] = 8 % number of bars + for i = 1,8 do + ga[23 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[24 + i*2] = 1*pt % bar width + end + % 131 <x1: FLOAT> <xgap: FLOAT> <ay: DIM> <ypos: DIM> <c: CHARS> + ga[41] = 131 % opcode text_xspaced + ga[42] = 10*pt % x coordinate of the first glyph axis + ga[43] = 10*pt % x gap among glyphs + ga[44] = 0.0 % half height + ga[45] = 30*pt % y coordinate of glyps + ga[46] = 65 % A + ga[47] = 66 % B + ga[48] = 67 % C + ga[49] = string.byte("Q") + ga[50] = 69 % E + ga[51] = 70 % F + ga[52] = 71 % G + ga[53] = 72 % H + ga[54] = 0 + ga[55] = 131 % opcode text_xspaced + ga[56] = 10*pt % x coordinate of the first glyph axis + ga[57] = 10*pt % x gap among glyphs + ga[58] = 1.0 % half height + ga[59] = 30*pt % y coordinate of glyps + ga[60] = 49 % 1 + ga[61] = 50 % 2 + ga[62] = 51 % 3 + ga[63] = 52 % 4 + ga[64] = 53 % 5 + ga[65] = 54 % 6 + ga[66] = 55 % 7 + ga[67] = 56 % 8 + ga[68] = 0 + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 9: spaced text, check correct vertical alignment: +\directlua{ + local ga = {} + ga[1] = 36 % vbar opcode + ga[2] = 0*pt % y1 + ga[3] = 20*pt % y2 + ga[4] = 8 % number of bars + for i = 1,8 do + ga[3 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[4 + i*2] = 8*pt % bar width + end + ga[21] = 36 % vbar opcode + ga[22] = 40*pt % y1 + ga[23] = 60*pt % y2 + ga[24] = 8 % number of bars + for i = 1,8 do + ga[23 + i*2] = i * 2 * 5*pt % x coordinate of bar axis + ga[24 + i*2] = 8*pt % bar width + end + % 131 <x1: FLOAT> <xgap: FLOAT> <ay: DIM> <ypos: DIM> <c: CHARS> + ga[41] = 131 % opcode text_xspaced + ga[42] = 10*pt % x coordinate of the first glyph axis + ga[43] = 10*pt % x gap among glyphs + ga[44] = 0.0 % half height + ga[45] = 20*pt % y coordinate of glyps + ga[46] = 65 % A + ga[47] = 66 % B + ga[48] = 67 % C + ga[49] = 68 % D + ga[50] = 69 % E + ga[51] = 70 % F + ga[52] = 71 % G + ga[53] = 72 % H + ga[54] = 0 + ga[55] = 131 % opcode text_xspaced + ga[56] = 10*pt % x coordinate of the first glyph axis + ga[57] = 10*pt % x gap among glyphs + ga[58] = 1.0 % half height + ga[59] = 40*pt % y coordinate of glyps + ga[60] = 49 % 1 + ga[61] = 50 % 2 + ga[62] = 51 % 3 + ga[63] = 52 % 4 + ga[64] = 53 % 5 + ga[65] = 54 % 6 + ga[66] = 55 % 7 + ga[67] = 56 % 8 + ga[68] = 0 + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 10: two centered texts aligned to the baseline: +\directlua{ + local ga = {} + % 130 <ax: FLOAT> <ay: FLOAT> <xpos: DIM> <ypos: DIM> <c: CHARS> + ga[ 1] = 130 % opcode text + ga[ 2] = 0.5 % ax relative x coordinate + ga[ 3] = 1.0 % ay relative y coordinate + ga[ 4] = 0.0 % x position + ga[ 5] = 0.0 % y position + ga[ 6] = 65 % A + ga[ 7] = string.byte("Q") % Q depth glyph + ga[ 8] = 67 % C + ga[ 9] = 0 + ga[10] = 130 % opcode text + ga[11] = 0.5 % ax + ga[12] = 0.0 % ay + ga[13] = 0.0 % x + ga[14] = 0.0 % y + ga[15] = 48 % 0 + ga[16] = 49 % 1 + ga[17] = 50 % 2 + ga[18] = 51 % 3 + ga[19] = 52 % 4 + ga[20] = 53 % 5 + ga[21] = 54 % 6 + ga[22] = 55 % 7 + ga[23] = 56 % 8 + ga[24] = 57 % 9 + ga[25] = 0 + driver:ga_to_hbox({_data = ga}, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +So far, we have manually build data for ga stream. Next we are going to +use the ga-canvas library. + +\bigskip +In fact, all the previous tests are rebuild with the ga-canvas library. + +Test 1: a vbar 2pt width, 20pt height: +\directlua{ + gacanvas = require "lib-geo.brcd-gacanvas" + local ga = gacanvas:new() + local vbar = {_yline = {0.0, 2*pt}} + local err = ga:encode_Vbar(vbar, 0.0, 0.0, 20*pt) % x, w + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\box\mybox + +\bigskip +Test 2: ten vbars equally spaced by 10pt: +\directlua{ + local ga = gacanvas:new() + local data = {} + for i = 0, 9 do + data[i*2 + 1] = 5*pt + i*20*pt % x + data[i*2 + 2] = 10*pt % w + end + local bars = {_yline = data} + local err = ga:encode_Vbar(bars, 0.0, 0.0, 10*pt) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test 3: two series of vbars 10pt and 5pt large: +\directlua{ + local b1 = {} + for i = 0, 9 do + b1[i*2 + 1] = i*20*pt + b1[i*2 + 2] = 10*pt + end + local b2 = {} + for i = 0, 8 do + b2[i*2 + 1] = i*20*pt + b2[i*2 + 2] = 5*pt + end + local ga = gacanvas:new() + local err = ga:encode_Vbar({_yline=b1}, 0.0, 0.0, 10*pt) + assert(not err, err) + err = ga:encode_Vbar({_yline=b2}, 10.0*pt, 2.5*pt, 7.5*pt) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test 4: a bunch of thin bars: +\directlua{ + local b = {} + for i = 0, 24 do + b[i*2 + 1] = 1*pt + i*4*pt + b[i*2 + 2] = 2*pt + end + local ga = gacanvas:new() + local err = ga:encode_Vbar({_yline=b}, 0.0, 5*pt, 25*pt) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule{ }\box\mybox{ }\vrule + +\bigskip +Test 5: two levels of a bunch of thin bars: +\directlua{ + local b = {} + for i = 0, 24 do + b[i*2 + 1] = i*4*pt + b[i*2 + 2] = 2*pt + end + local b = {_yline=b} + local ga = gacanvas:new() + local err = ga:encode_Vbar(b, 0.0, 5*pt, 25*pt) + assert(not err, err) + err = ga:encode_Vbar(b, 2*pt, 25*pt, 45*pt, b) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 6: staircase of bars (manual insertion of data): +\directlua{ + local b = {_yline={0.0, 10*pt}} + local ga = gacanvas:new() + local err = ga:encode_Vbar(b, 0.0, 0.0, 20*pt) + assert(not err, err) + err = ga:encode_Vbar(b, 10*pt, 20*pt, 40*pt) + assert(not err, err) + err = ga:encode_Vbar(b, 20*pt, 40*pt, 60*pt) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 7: vbars with spaced text, all in three rows: +\directlua{ + local b = {} + for i = 0,7 do + b[i*2+1] = i*10*pt + b[i*2+2] = 5*pt + end + local vb = {_yline=b} + local ga = gacanvas:new() + local err = ga:encode_Vbar(vb, 0.0, 0.0, 20*pt) + assert(not err, err) + local err = ga:encode_Vbar(vb, 0.0, 30*pt, 50*pt) + assert(not err, err) + local txt = {codepoint = { + 65, % A + 66, % B + 67, % C + 68, % D + 69, % E + 70, % F + 71, % G + 72, % H + }} + err = ga:encode_Text_xspaced(txt, 0.0, 10*pt, 25*pt, 0.5) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test 8: spaced text, check correct vertical alignment: +\directlua{ + local b = {} + for i = 0,7 do + b[i*2+1] = i*10*pt + b[i*2+2] = 2*pt + end + b = {_yline=b} + local ga = gacanvas:new() + local err = ga:encode_Vbar(b, 0.0, 0.0, 20*pt) + assert(not err, err) + local err = ga:encode_Vbar(b, 0.0, 40*pt, 60*pt) + assert(not err, err) + local c = { codepoint = { + 65, % A + 66, % B + 67, % C + string.byte("Q"), + 69, % E + 70, % F + 71, % G + 72, % H + }} + err = ga:encode_Text_xspaced(c, 0.0, 10*pt, 30*pt, 0.0) + assert(not err, err) + local n = { codepoint = { + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + }} + err = ga:encode_Text_xspaced(n, 0.0, 10*pt, 30*pt, 1.0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 9: spaced text, check correct vertical alignment: +\directlua{ + local b = {} + for i = 0,7 do + b[i*2+1] = i*10*pt + b[i*2+2] = 8*pt + end + b = {_yline = b} + local ga = gacanvas:new() + local err = ga:encode_Vbar(b, 0.0, 0.0, 20*pt) + assert(not err, err) + local err = ga:encode_Vbar(b, 0.0, 40*pt, 60*pt) + assert(not err, err) + local c = { codepoint = { + 65, % A + 66, % B + 67, % C + string.byte("Q"), + 69, % E + 70, % F + 71, % G + 72, % H + }} + err = ga:encode_Text_xspaced(c, 0.0, 10*pt, 20*pt, 0.0) + assert(not err, err) + local n = { codepoint = { + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + }} + err = ga:encode_Text_xspaced(n, 0.0, 10*pt, 40*pt, 1.0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule{ }\box\mybox{ }\vrule + +\bigskip +Test number 10: two centered texts and baseline aligned: +\directlua{ + local n = { codepoint = { + 48, % 0 + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + 57, % 9 + }} + local ga = gacanvas:new() + local err = ga:encode_Text(n, 0, 0, 0.5, 0) + assert(not err, err) + local a = { codepoint = { + 65, % A + string.byte("Q"), % Q + 67, % C + }} + err = ga:encode_Text(a, 0, 0, 0.5, 1) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 11: two centered texts aligned: +\directlua{ + local n = { codepoint = { + 48, % 0 + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + 57, % 9 + }} + local ga = gacanvas:new() + local err = ga:encode_Text(n, 0, 0, 0.5, 1) + assert(not err, err) + local a = { codepoint = { + 65, % A + string.byte("Q"), % Q + 67, % C + }} + err = ga:encode_Text(a, 0, 0, 0.5, 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 12: text\_xwidth opcode: + +\directlua{ + local n = { codepoint = { + 48, % 0 + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + 57, % 9 + }} + local ga = gacanvas:new() + local err = ga:encode_Text_xwidth(n, 0, tex.sp "5cm", 0, 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\vrule\hbox to 5cm{0 \hfill9}\vrule + +\bigskip +Test number 13: text\_xwidth with different size: +\smallskip + +\directlua{ + local n = {codepoint = { + 48, % 0 + 49, % 1 + 50, % 2 + 51, % 3 + 52, % 4 + 53, % 5 + 54, % 6 + 55, % 7 + 56, % 8 + 57, % 9 + }} + local ga = gacanvas:new() + % (txt, x1, x2, ypos, ay) --> err + local err = ga:encode_Text_xwidth(n, tex.sp "0mm", tex.sp "50mm", 0, 0) + assert(not err, err) + local err = ga:encode_Text_xwidth(n, tex.sp "5mm", tex.sp "45mm", tex.sp "3mm", 0) + assert(not err, err) + local err = ga:encode_Text_xwidth(n, tex.sp "10mm", tex.sp "40mm", tex.sp "6mm", 0) + assert(not err, err) + local err = ga:encode_Text_xwidth(n, tex.sp "15mm", tex.sp "35mm", tex.sp "9mm", 0) + assert(not err, err) + local err = ga:encode_Text_xwidth(n, tex.sp "20mm", tex.sp "30mm", tex.sp "12mm", 0) + assert(not err, err) + local err = ga:encode_Text_xwidth(n, tex.sp "24mm", tex.sp "26mm", tex.sp "15mm", 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 14: place bars and text as text\_xwidth: +\smallskip + +\directlua{ + local b = {} + for i = 0, 9 do + b[i*2 + 1] = i*12*pt + b[i*2 + 2] = 0.4*pt + end + b = {_yline = b} + local n = {codepoint = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,}} + local ga = gacanvas:new() + % (vbar, x0, y1, y2) --> err + local err = ga:encode_Vbar(b, 0.0, 0*pt, 25*pt) + local err = ga:encode_Vbar(b, 0.0, 32*pt, 42*pt) + assert(not err, err) + % (txt, x1, x2, ypos, ay) --> err + local err = ga:encode_Text_xwidth(n, 0*pt, 108*pt, 25*pt, 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\smallskip +\directlua{ + local b = {} + for i = 0, 8 do + b[i*2 + 1] = i*12*pt + b[i*2 + 2] = 0.2*pt + end + b = {_yline = b} + local n = { 48, 49, 50, 51, string.byte([[x]]), 53, 54, 55, 56,} + n = {codepoint = n} + local ga = gacanvas:new() + % x0, y1, y2, bars + local err = ga:encode_Vbar(b, 0.0, 0*pt, 25*pt) + local err = ga:encode_Vbar(b, 0.0, 32*pt, 42*pt) + assert(not err, err) + % (txt, x1, x2, ypos, ay) --> err + local err = ga:encode_Text_xwidth(n, 0*pt, 96*pt, 25*pt, 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bigskip +Test number 15: place text\_xwidth when text is only two chars long: + +\directlua{ + local n = {codepoint = { 48, 56,}} % 0 and 8 + local ga = gacanvas:new() + % (txt, x1, x2, ypos, ay) --> err + local err = ga:encode_Text_xwidth(n, 0*pt, 32*pt, 25*pt, 0) + assert(not err, err) + driver:ga_to_hbox(ga, [[mybox]]) +}\vrule\box\mybox\vrule + +\bye diff --git a/macros/luatex/generic/barracuda/test/test-ga-svg/001-ga-svg-test.lua b/macros/luatex/generic/barracuda/test/test-ga-svg/001-ga-svg-test.lua new file mode 100644 index 0000000000..2f932235cb --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-svg/001-ga-svg-test.lua @@ -0,0 +1,28 @@ +-- test SVG driver output + +local barracuda = require "barracuda" +local driver = barracuda:get_driver() + +local mm = 186467.9811 -- 1 mm in sp +local ga1 = { _data = { 1, 1*mm, + 34, 10*mm, 100*mm, 0*mm, -- vline, y1, y2, x + 34, 20*mm, 90*mm, 10*mm, + 34, 30*mm, 80*mm, 20*mm, + 34, 40*mm, 70*mm, 30*mm, + 34, 50*mm, 60*mm, 40*mm, +}} + +driver:save("svg", ga1, "test-01") + +local ga2 = { _data = { + 1, 5*mm, + 34, 0*mm, 50*mm, 2.5*mm, + 33, 0*mm, 50*mm, 40*mm, +}} + +driver:save("svg", ga2, "test-02") + + + + + diff --git a/macros/luatex/generic/barracuda/test/test-ga-svg/002-ga-svg-test.lua b/macros/luatex/generic/barracuda/test/test-ga-svg/002-ga-svg-test.lua new file mode 100644 index 0000000000..8f10d6dfbf --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-svg/002-ga-svg-test.lua @@ -0,0 +1,18 @@ +-- test SVG driver output + +local barracuda = require "barracuda" +local barcode = barracuda:get_barcode_class() +local driver = barracuda:get_driver() + +local opt = {module = 15 * 0.0254 * 186467, height = 12 * 186467} + +local c39, err = barcode:new_encoder("code39", nil, opt) +assert(not err, err) + +local symbol, err = c39:from_string("ABC000Z") +assert(not err, err) + +local canvas = barracuda:new_canvas() +symbol:append_ga(canvas) + +driver:save("svg", canvas, "test-code39")
\ No newline at end of file diff --git a/macros/luatex/generic/barracuda/test/test-ga-svg/test-01.svg b/macros/luatex/generic/barracuda/test/test-ga-svg/test-01.svg new file mode 100644 index 0000000000..77e3ba6e0c --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-svg/test-01.svg @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Barracuda package (https://github.com/robitex/barracuda) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="41.000000mm" height="90.000000mm" + viewBox="-0.500000 -100.000000 41.000000 90.000000" +> + <path d="M0.000000 -100.000000V-10.000000" + style="stroke:#000000;stroke-width:1.000000" + /> + <path d="M10.000000 -90.000000V-20.000000" + style="stroke:#000000;stroke-width:1.000000" + /> + <path d="M20.000000 -80.000000V-30.000000" + style="stroke:#000000;stroke-width:1.000000" + /> + <path d="M30.000000 -70.000000V-40.000000" + style="stroke:#000000;stroke-width:1.000000" + /> + <path d="M40.000000 -60.000000V-50.000000" + style="stroke:#000000;stroke-width:1.000000" + /> +</svg> + diff --git a/macros/luatex/generic/barracuda/test/test-ga-svg/test-02.svg b/macros/luatex/generic/barracuda/test/test-ga-svg/test-02.svg new file mode 100644 index 0000000000..ff7862b12f --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-svg/test-02.svg @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Barracuda package (https://github.com/robitex/barracuda) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="50.000000mm" height="50.000000mm" + viewBox="0.000000 -50.000000 50.000000 50.000000" +> + <path d="M2.500000 -50.000000V-0.000000" + style="stroke:#000000;stroke-width:5.000000" + /> + <path d="M0.000000 -40.000000H50.000000" + style="stroke:#000000;stroke-width:5.000000" + /> +</svg> + diff --git a/macros/luatex/generic/barracuda/test/test-ga-svg/test-code39.svg b/macros/luatex/generic/barracuda/test/test-ga-svg/test-code39.svg new file mode 100644 index 0000000000..8453a6bdeb --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-ga-svg/test-code39.svg @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Barracuda package (https://github.com/robitex/barracuda) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="51.815727mm" height="14.873148mm" + viewBox="-3.809980 -11.999937 51.815727 14.873148" +> + <g stroke="black"> + <path d="M0.190499 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M1.333493 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M2.285988 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M3.428982 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M4.381477 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M5.333972 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M6.286467 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M7.048463 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M8.191457 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M9.143952 -11.999937V-0.000000" style="stroke-width:0.761996"/> + </g> + <g stroke="black"> + <path d="M10.096447 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M11.048942 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M12.001437 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M13.144431 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M14.096926 -11.999937V-0.000000" style="stroke-width:0.761996"/> + </g> + <g stroke="black"> + <path d="M15.239920 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M16.382914 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M17.335409 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M18.478403 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M19.240399 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M20.002395 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M20.764391 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M22.097884 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M23.240878 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M24.193373 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M24.955369 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M25.717365 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M27.050858 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M28.193852 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M29.146347 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M29.908343 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M30.670339 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M32.003832 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M33.146826 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M34.099321 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M34.861317 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M36.194810 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M37.337804 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M38.290299 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M39.052295 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <g stroke="black"> + <path d="M39.814291 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M40.957285 -11.999937V-0.000000" style="stroke-width:0.380998"/> + <path d="M41.909779 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M43.052773 -11.999937V-0.000000" style="stroke-width:0.761996"/> + <path d="M44.005268 -11.999937V-0.000000" style="stroke-width:0.380998"/> + </g> + <text x="0.000000" y="2.873212" font-family="Verdana" font-size="2.877000"> + ABC000Z </text> +</svg> + diff --git a/macros/luatex/generic/barracuda/example/001-i2of5-test.pdf b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf Binary files differindex c46bb12d50..3aa107681c 100644 --- a/macros/luatex/generic/barracuda/example/001-i2of5-test.pdf +++ b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf diff --git a/macros/luatex/generic/barracuda/example/001-i2of5-test.tex b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex index 43c652d66a..43c652d66a 100644 --- a/macros/luatex/generic/barracuda/example/001-i2of5-test.tex +++ b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex |