Hi again, the LMTX zint module uses libzint, while MkIV calls the zint binary. The latter works for me, the first not. On MacOS, the library is "/opt/local/lib/libzint.dylib"*. I changed that in the source and the file appears to be found. Could you add that, Hans? *) Previously, zint for MacOS was only available via HomeBrew; I don’t know where that would install libzint, probably in /usr/local/lib/ like on Linux. Yesterday a MacPorts port was added that I used; MacPorts install everything under /opt/. But then still zintlib.execute returns nothing. I wonder if this works on Windows? The API docs don’t mention an "execute" function. https://www.zint.org.uk/manual/chapter/5 Hraban
Hello Hraban, On Sun Sep 5, 2021 at 4:15 PM CEST, Henning Hraban Ramm via ntg-context wrote:
Hi again,
the LMTX zint module uses libzint, while MkIV calls the zint binary. The latter works for me, the first not.
On MacOS, the library is "/opt/local/lib/libzint.dylib"*. I changed that in the source and the file appears to be found. Could you add that, Hans?
From libraries-mkiv:
It is best to keep libraries in a place where you can keep an eye on them being updated, like c:/data/tex-context/tex/texmf-win64/bin/lib/luametatex/foo/libfoo.dll You could of course use the ones provided by the system or maybe use symbolic links so that you still keep en eye on changes. On Linux I get: resolvers > libraries > library 'libzint' resolved via 'tds lib' path to '/home/michal/src/context/tex/texmf-linux-64/bin/lib/luametatex/zint/libzint.so' where the file is a copy of the system library. You probably need a similar setup (but you should prefer symlink), also with a ".so" extension as that's what ConTeXt uses on non Windows systems.
*) Previously, zint for MacOS was only available via HomeBrew; I don’t know where that would install libzint, probably in /usr/local/lib/ like on Linux. Yesterday a MacPorts port was added that I used; MacPorts install everything under /opt/.
In libs-ini.lua essentially three ways are tried: 1) TDS search, thats what I used above 2) PATH search (but this will try paths like "/usr/local/bin" not "/usr/local/lib"). 3) Current directory Copying the library file as I did is probably not the best idea in general, since the library can have dependencies (zint requires libpng which in turn needs zlib) and those get loaded from the system paths anyways: 28099: file=/home/michal/src/context/tex/texmf-linux-64/bin/lib/luametatex/zint/libzint.so [0]; dynamically loaded by /home/michal/src/context/tex/texmf-linux-64/bin/luametatex [0] 28099: file=libpng16.so.16 [0]; needed by /home/michal/src/context/tex/texmf-linux-64/bin/lib/luametatex/zint/libzint.so [0] 28099: file=libz.so.1 [0]; needed by /usr/lib/libpng16.so.16 [0] and one would want to ensure ABI compatibility. But then again, same issue applies to the luametatex -> optional library ABI.
But then still zintlib.execute returns nothing.
I can confirm this as well.
I wonder if this works on Windows? The API docs don’t mention an "execute" function. https://www.zint.org.uk/manual/chapter/5
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. Michal
Hi Michal, thank you!
Am 05.09.2021 um 17:51 schrieb Michal Vlasák
: On Sun Sep 5, 2021 at 4:15 PM CEST, Henning Hraban Ramm via ntg-context wrote:
Hi again,
the LMTX zint module uses libzint, while MkIV calls the zint binary. The latter works for me, the first not.
On MacOS, the library is "/opt/local/lib/libzint.dylib"*. I changed that in the source and the file appears to be found. Could you add that, Hans?
From libraries-mkiv:
It is best to keep libraries in a place where you can keep an eye on them being updated, like
c:/data/tex-context/tex/texmf-win64/bin/lib/luametatex/foo/libfoo.dll
Oh, yes, I should still know that from mujs. Works with a symlink. I.e. no need to change that in the module.
But then still zintlib.execute returns nothing.
I can confirm this as well.
I wonder if this works on Windows? The API docs don’t mention an "execute" function. https://www.zint.org.uk/manual/chapter/5
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions.
Hm, ok, but where are the zint API calls defined? Hraban
On Sun Sep 5, 2021 at 6:30 PM CEST, Henning Hraban Ramm via ntg-context wrote:
Am 05.09.2021 um 17:51 schrieb Michal Vlasák
: "execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. Hm, ok, but where are the zint API calls defined?
Sorry, do you mean what zint functions luametatex calls to implement "execute"? Then I don't know. And a quick reverse engineering try didn't turn up anything either. Michal
On 9/5/2021 5:51 PM, Michal Vlasák via ntg-context wrote:
Hello Hraban,
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. does
context libs-imp-zint.mkxl produce something? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Sun Sep 5, 2021 at 7:37 PM CEST, Hans Hagen wrote:
On 9/5/2021 5:51 PM, Michal Vlasák via ntg-context wrote:
Hello Hraban,
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. does
context libs-imp-zint.mkxl
produce something?
Empty page (empty content stream) and Crop/Media/TrimBox is [ 0 0 7.790488 103.5872 ]. The line: local result = zintlib_execute(specification) returns false each time. Michal
Am 05.09.2021 um 19:53 schrieb Michal Vlasák via ntg-context
: On Sun Sep 5, 2021 at 7:37 PM CEST, Hans Hagen wrote:
does
context libs-imp-zint.mkxl
produce something?
Empty page (empty content stream) and Crop/Media/TrimBox is [ 0 0 7.790488 103.5872 ].
The line:
local result = zintlib_execute(specification)
returns false each time.
Same here. HR
On 9/5/2021 7:53 PM, Michal Vlasák wrote:
On Sun Sep 5, 2021 at 7:37 PM CEST, Hans Hagen wrote:
On 9/5/2021 5:51 PM, Michal Vlasák via ntg-context wrote:
Hello Hraban,
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. does
context libs-imp-zint.mkxl
produce something?
Empty page (empty content stream) and Crop/Media/TrimBox is [ 0 0 7.790488 103.5872 ].
The line:
local result = zintlib_execute(specification)
returns false each time. it took me a while to figure it out on a linux box but the following nbeeds to be changed in the texmfcnf.lua file:
CLUAINPUTS = ".;$SELFAUTOLOC/lib/$engine//", kind of subtle ... so no lua path in there (one needs to run mtxrun --genenate after changing this) (it went unnoticed because i have that in my texmf-local tree and as i had patched some files when testing an update i did was fooled by newer timestamps so i ended up in the wrong cache) anyway, zint works on linux (one needs to copy the file to the texm-platform tree and get rid of the version number in the name; long ago i dealt with that so maybe i need to reintroduce that ugly hackery again; installing zint in linux didn't create a simple .so link) so ... i've added some error messages in the process (so that "result, message = ..." can handle it) but no upload yet when it works, you will see some mp magick kicking in (becvause we use the vectorized output) ... if you are bored you can try to make a simple cmake file for compiling zint (i couldn't compile because of some depedencies, i.e. gcc not found by cmake; we don't need all that qt stuff anyway but i didn't want to waste time on that now) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 06.09.2021 um 01:13 schrieb Hans Hagen via ntg-context
: On 9/5/2021 7:53 PM, Michal Vlasák wrote:
On Sun Sep 5, 2021 at 7:37 PM CEST, Hans Hagen wrote:
On 9/5/2021 5:51 PM, Michal Vlasák via ntg-context wrote:
Hello Hraban,
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. does
context libs-imp-zint.mkxl
produce something? Empty page (empty content stream) and Crop/Media/TrimBox is [ 0 0 7.790488 103.5872 ]. The line: local result = zintlib_execute(specification) returns false each time. it took me a while to figure it out on a linux box but the following nbeeds to be changed in the texmfcnf.lua file:
CLUAINPUTS = ".;$SELFAUTOLOC/lib/$engine//",
I changed it in texmf/web2c/texmfcnf.lua as well as in texmf-context/web2c/contextcnf.lua and generated a few times – no change, the PDF is still empty. There’s no other texmfcnf.lua in my trees. Hraban $ context --autopdf=auto ~/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl resolvers | formats | executing runner 'run luametatex format': /Users/hraban/lmtx/tex/texmf-osx-64/bin/luametatex --jobname="/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl" --fmt=/Users/hraban/lmtx/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/Users/hraban/lmtx/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui --c:autopdf="auto" --c:currentrun=1 --c:fulljobname="/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl" --c:input="/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/Users/hraban/lmtx/tex/texmf-osx-64/bin" system > system > ConTeXt ver: 2021.09.03 18:49 LMTX fmt: 2021.9.3 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source > level 1, order 1, name '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint', input '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl', result '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl' resolvers > lua > loading file '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.lmt' succeeded system > continuing input file 'libs-imp-zint.mkxl' fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern-designsize rm 12pt' is loaded optional > using library '/Users/hraban/lmtx/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' backend > xmp > using file '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml' pages > flushing realpage 1, userpage 1, subpage 1 close source > level 1, order 2, name '/Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl' mkiv lua stats > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua mkiv lua stats > used cache path: /Users/hraban/lmtx/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e mkiv lua stats > resource resolver: loadtime 0.007 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 13 found files, scanned paths: <none> mkiv lua stats > stored bytecode data: 498 modules (0.342 sec), 100 tables (0.018 sec), 598 chunks (0.360 sec) mkiv lua stats > traced context: maxstack: 1596, freed: 0, unreachable: 1596 mkiv lua stats > cleaned up reserved nodes: 68 nodes, 9 lists of 434 mkiv lua stats > node memory usage: 10 attribute, 5 attribute_list, 3 glue, 58 glue_spec, 3 kern, 4 penalty, 2 temp mkiv lua stats > node list callback tasks: 10 unique task lists, 7 instances (re)created, 34 calls mkiv lua stats > used backend: pdf (backend for directly generating pdf output) mkiv lua stats > jobdata time: 0.001 seconds saving, 0.001 seconds loading mkiv lua stats > callbacks: file: 121, saved: 175, direct: 4, function: 1110, value: 1, message: 0, bytecode: 598, late 0, total: 2009 (2009 per page) mkiv lua stats > randomizer: resumed with value 0.032879785206596 mkiv lua stats > loaded patterns: en::1, load time: 0.000 mkiv lua stats > loaded fonts: 3 files: latinmodern-math.otf, lmroman12-regular.otf, dejavusansmono.ttf mkiv lua stats > font engine: otf 3.119, afm 1.513, tfm 1.000, 8 instances, 3 shared in backend, 3 common vectors, 0 common hashes, load time 0.228 seconds mkiv lua stats > result saved in file: /Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.pdf, compresslevel 1, objectcompresslevel 3 mkiv lua stats > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entries mkiv lua stats > used platform: osx-64, type: unix, binary subtree: texmf-osx-64 mkiv lua stats > used engine: luametatex version: 2.0921, functionality level: 20210903, format id: 593, compiler: clang mkiv lua stats > tex properties: 740039 hash slots used of 2097152, 46334 control sequences, approximate memory usage: 29 MB mkiv lua stats > lua properties: engine: lua 5.4, used memory: 53 MB, ctx: 50 MB, max: 50 MB, symbol mask: utf (τεχ) mkiv lua stats > runtime: 0.686 seconds, 1 processed pages, 1 shipped pages, 1.459 pages/second mtx-context | pdfview methods: auto default okular pdfxcview sumatra, current method: auto (directives_pdfview_method) pdfview | command: open "libs-imp-zint.pdf" 1>/dev/null 2>/dev/null & mtx-context | pdfview overhead: 0.004 seconds system | total runtime: 0.708 seconds of 0.771 seconds
On 9/6/2021 10:34 AM, Henning Hraban Ramm via ntg-context wrote:
Am 06.09.2021 um 01:13 schrieb Hans Hagen via ntg-context
: On 9/5/2021 7:53 PM, Michal Vlasák wrote:
On Sun Sep 5, 2021 at 7:37 PM CEST, Hans Hagen wrote:
On 9/5/2021 5:51 PM, Michal Vlasák via ntg-context wrote:
Hello Hraban,
"execute" should be a function defined in LuaMetaTeX, that internally calls zint functions. does
context libs-imp-zint.mkxl
new upload, maybe better messages ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Since I got zint running (thanks, Hans!), there’s now a wiki page: https://wiki.contextgarden.net/Barcodes Have fun! Hraban
Am 07.09.2021 um 21:03 schrieb Henning Hraban Ramm via ntg-context
: Since I got zint running (thanks, Hans!), there’s now a wiki page:
I followed you instructions and got zint running with MacPorts: Zint version 2.10.0 And it looks like LMTX finds it: system > system > ConTeXt ver: 2021.09.03 18:49 LMTX fmt: 2021.9.3 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source > level 1, order 1, name '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname './hw265', input './hw265.tex', result './hw265' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './hw265.tex' modules > using user prefixed file 'libs-imp-zint' modules > 'zint' is loaded open source > level 2, order 3, name '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl' resolvers > lua > loading file '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.lmt' succeeded close source > level 2, order 3, name '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl' fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern-designsize rm 12pt' is loaded optional > using library '/usr/local/texlive/LMTX2021/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so‘ ^^^ backend > xmp > using file '/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml' pages > flushing realpage 1, userpage 1, subpage 1 close source > level 1, order 3, name './hw265.tex' system > start used files system > text: hw265 system > stop used files system > start used files system > 1: filename=publ-imp-default.lua filetype=lua foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/publ-imp-default.lua fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/publ-imp-default.lua usedmethod=database system > 2: filename=cont-new.mkxl filetype=tex foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl usedmethod=database system > 3: filename=lang-exc.lua filetype=lua foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/lang-exc.lua fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/lang-exc.lua usedmethod=database system > 4: filename=lang-us.lua filetype=lua foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/patterns/mkiv/lang-us.lua fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/patterns/mkiv/lang-us.lua usedmethod=database system > 5: filename=/Users/axel/Documents/Text/Dokumente_ConTeXt/Beispiele ConTeXt/hw265.tex format=tex foundname=/Users/axel/Documents/Text/Dokumente_ConTeXt/Beispiele ConTeXt/hw265.tex fullname=/Users/axel/Documents/Text/Dokumente_ConTeXt/Beispiele ConTeXt/hw265.tex usedmethod=direct system > 6: filename=libs-imp-zint.mkxl filetype=tex foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.mkxl usedmethod=database system > 7: filename=libs-imp-zint.lmt filetype=tex foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.lmt fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkxl/libs-imp-zint.lmt usedmethod=database system > 8: filename=lm.lfg filetype=tex foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/fonts/mkiv/lm.lfg fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/fonts/mkiv/lm.lfg usedmethod=database system > 9: filename=lmroman12-regular filetype=otf format=otf foundname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf fullname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database system > 10: filename=latinmodern-math.otf filetype=opentypefonts foundname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf fullname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database system > 11: filename=DejaVuSansMono.ttf filetype=ttf format=ttf foundname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/truetype/public/dejavu/DejaVuSansMono.ttf fullname=/usr/local/texlive/LMTX2021/tex/texmf/fonts/truetype/public/dejavu/DejaVuSansMono.ttf usedmethod=database system > 12: filename=libzint filetype=lib format=lib foundname=/usr/local/texlive/LMTX2021/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so fullname=/usr/local/texlive/LMTX2021/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so usedmethod=otherwise system > 13: filename=lpdf-pdx.xml filetype=tex foundname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml fullname=/usr/local/texlive/LMTX2021/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml usedmethod=database system > stop used files system > start commandline options system > currentrun="2" system > fulljobname="./hw265.tex" system > input="./hw265.tex" system > kindofrun="2" system > maxnofruns="9" system > texmfbinpath="/usr/local/texlive/LMTX2021/tex/texmf-osx-64/bin" system > stop commandline options system > start commandline files system > 1: ./hw265.tex system > stop commandline files modules > start used modules modules > loaded : *-libs-imp-zint modules > stop used modules system > [...] mkiv lua stats > loaded tex modules: 1 requested, all found (*-libs-imp-zint) mkiv lua stats > loaded patterns: en::1, load time: 0.000 mkiv lua stats > loaded fonts: 3 files: latinmodern-math.otf, lmroman12-regular.otf, dejavusansmono.ttf mkiv lua stats > font engine: otf 3.119, afm 1.513, tfm 1.000, 8 instances, 3 shared in backend, 3 common vectors, 0 common hashes, load time 0.162 seconds mkiv lua stats > font embedding time: 0.001 seconds, 1 fonts mkiv lua stats > result saved in file: hw265.pdf, compresslevel 1, objectcompresslevel 3 mkiv lua stats > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entries mkiv lua stats > used platform: osx-64, type: unix, binary subtree: texmf-osx-64 mkiv lua stats > used engine: luametatex version: 2.0921, functionality level: 20210903, format id: 593, compiler: clang mkiv lua stats > tex properties: 740039 hash slots used of 2097152, 46321 control sequences, approximate memory usage: 29 MB mkiv lua stats > lua properties: engine: lua 5.4, used memory: 52 MB, ctx: 49 MB, max: 49 MB, symbol mask: utf (τεχ) mkiv lua stats > runtime: 0.485 seconds, 1 processed pages, 1 shipped pages, 2.063 pages/second but I don’t get the barcodes. When I use the —luatex switch I get a draft box and the following message: name: zint-isbn- fe90eda0e93cf020312a79b2c1b0201b.eps file: zint-isbn- fe90eda0e93cf020312a79b2c1b0201b.eps state: unknown Shouldn’t it generate pdf? Do I need an rc file? This is on MacOS 10.13. Greetings Axel
participants (4)
-
Axel Kielhorn
-
Hans Hagen
-
Henning Hraban Ramm
-
Michal Vlasák