rosmord/jsesh

How to render documents from the command line?

Closed this issue · 3 comments

Hi. Thanks for maintaining jsesh over the years. It's been a very valuable tool!

For our reading group, I'd like to be able to render .gly files to a particular image format from the command line, so we can automate construction of documents. I see that there's a SimpleBitmap demo, and I've gotten that to work, but I'd prefer SVG output, and can I can't get the SVGExportDemo to work at all:

$ mvn package
   [...]
$ java -cp jsesh/target/jsesh-7.5.5.jar:jseshGlyphs/target/jseshGlyphs-7.5.5.jar:cupAndlex/target/cupAndlex-7.5.5.jar:qenherkhopeshefUtils/target/qenherkhopeshefUtils-7.5.5.jar:jseshDemos/target/jseshDemos-7.5.5.jar jsesh.demo.SimpleBitmap
$ file example.png 
example.png: PNG image data, 117 x 473, 8-bit/color RGB, non-interlaced

but

$ java -cp jsesh/target/jsesh-7.5.5.jar:jseshGlyphs/target/jseshGlyphs-7.5.5.jar:cupAndlex/target/cupAndlex-7.5.5.jar:qenherkhopeshefUtils/target/qenherkhopeshefUtils-7.5.5.jar:jseshDemos/target/jseshDemos-7.5.5.jar jsesh.demo.SVGExportDemo
Error: Unable to initialize main class jsesh.demo.SVGExportDemo
Caused by: java.lang.NoClassDefFoundError: org/qenherkhopeshef/graphics/utils/DoubleDimensions

I see other places in the code reference org.qenherkhopeshef.swingUtils.DoubleDimensions instead, so maybe this demo needs updating? There's a similar problem with org.qenherkhopeshef.graphics.svg.SVGGraphics2D that I haven't been able to resolve.

Overall, I'd just like a way to use jsesh to create images from the command line, but I was trying to rework one of the demos toward this end. I have some coding experience, but I've never used java much, so I'd appreciate any suggestions you might have on how to develop this.

Sorry for the late answer (which is not an answer yet). I did not see your message last year ; I will have a better look at the problem. My page about the use of JSesh as a library is perhaps a bit outdated.

BTW, with recent versions of Java, you can use

java -cp 'jsesh/target/*.jar' ... 

instead of using explicitly all the libraries.

The libraries you miss are :

  • jvectclipboard-8.0.0.jar which I externalised from JSesh a while ago (the documentation might be a bit older than that).
  • qenherkhopeshefUtils-7.5.5.jar

See project https://github.com/rosmord/jseshBitmapDemo for an example (more documentation forthcoming).

(almost) closed