ADDED MIT.txt
Index: MIT.txt
==================================================================
--- /dev/null
+++ MIT.txt
@@ -0,0 +1,19 @@
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
Index: README.md
==================================================================
--- README.md
+++ README.md
@@ -3,33 +3,28 @@
li{margin-left:.5cm;max-width:20cm}
li p{margin-left:0}
## abc2svg
-**abc2svg** is a set of Javascript files for handling the
- [ABC music notation](http://abcnotation.com/). This includes
+**abc2svg** is a set of ECMAscript files that handle the
+[ABC music notation](http://abcnotation.com/). This includes
editing, displaying, printing, playing the music files and
converting them to other formats such as ABC and MEI notations.
The **abc2svg** core is based on the
-[abcm2ps](https://github.com/leesavide/abcm2ps) C code
+[abcm2ps](https://github.com/lewdlime/abcm2ps) C code
which requires compilation on every operating system.
The **abc2svg** scripts can run in any system with no compilation on
-any platform that contains an internet browser. This includes Windows,
+any platform that contains an internet browser. This includes MS-Windows,
Apple, and Unix-like systems (Linux, BSD...) as well as portable devices
such as cell phones and iPads.
A description of the ABC parameters that relate to both abcm2ps
and abc2svg can be found [here][1].
[1]: http://moinejf.free.fr/abcm2ps-doc/index.html "abc2svg documentation"
-Note: The ABC music notation is now discussed in the mailing list
-[abcusers at groups.io](https://groups.io/g/abcusers).
-Some work in progress about the ABC draft may be found in these
-[temporary pages](http://moinejf.free.fr/abcstd/).
-
### 1. Web browser usage
#### 1.1 Rendering ABC files from a local or remote source
After accessing ABC files with a web browser either from a local or web
@@ -56,11 +51,11 @@
complexity of the abc code, it should be replaced by a music
representation or a list of the contents of the ABC file. Here
are two bookmarklets that you can try.
This
-first abc2svg bookmarklet
renders all the music it finds in the page currently displayed.
Once the music is displayed, clicking inside a tune starts playing it
from the beginning.
Clicking on a particular note or rest starts playing from that point.
@@ -69,14 +64,14 @@
(If the 'Print' button does not appear on your browser menu,
try right clicking on the web page.)
Alternatively, if your source contains many tunes, you can
use this
-second bookmarklet.
-The browser will list the titles of the tunes. Click on one of the titles
-to view the music representation.
+The browser will list the titles of the tunes.
+Clicking on a title displays the tune.
Playing and printing work in the same manner as above.
The generated pages contain a yellow menu in the top right corner which permits
you to return to the tune list or to modify the music. With this last option,
you can adjust the page size before printing, correct the ABC syntax or
do some transposition.
@@ -134,11 +129,11 @@
ABC sequences in the <body>.
[This example][4] demonstrates how to do it.
(Note that, in the example, the paths are relative - see why below.)
-[4]: http://moinejf.free.fr/abcm2ps-doc/tabac.xhtml "J'ai du bon tabac"
+[4]: http://moinejf.free.fr/abcm2ps-doc/tabac.html "J'ai du bon tabac"
As it is apparent, HTML and ABC can be mixed in the same html file.
Both are rendered in the order you defined them.
You may also have noticed this CSS about SVG elements:
@@ -151,11 +146,11 @@
Global ABC parameters may be added as `parameter=value` in the query string
of the URL of the page. The [following example][16] calls the same
"J'ai du bon tabac" with `pagescale=1.2` (giving `%%pagescale 1.2`).
-[16]: http://moinejf.free.fr/abcm2ps-doc/tabac.xhtml?pagescale=1.2 "J'ai du bon tabac"
+[16]: http://moinejf.free.fr/abcm2ps-doc/tabac.html?pagescale=1.2 "J'ai du bon tabac"
In the above examples, all the ABC music is generated (displayed
and ready to be played) by means of the script **abcweb-1.js**.
If there is a large collection of tunes, it may be preferable to
link to the other script, **abcweb1-1.js**, which permits you
@@ -166,11 +161,11 @@
A menu on the top right corner of the screen
permits to get the tune list again. Here is [a real example][6].
[6]: http://moinejf.free.fr/abc/boyvin-2-2.html "J. Boyvin organ tunes"
-As you may note in the menu, the edition of the ABC content is proposed.
+As you may notice in the menu, the edition of the ABC content is proposed.
This permits, for example, to transpose the tunes.
This edition is done inside the browser, so, your changes will be lost
after leaving the page.
When accessing such pages, an external selection of the tunes
@@ -180,15 +175,10 @@
For instance, here is the ['Duo' de J. Boyvin][8].
[7]: https://en.wikibooks.org/wiki/Regular_Expressions "Regular expressions"
[8]: http://moinejf.free.fr/abc/boyvin-2-2.html#T:Duo "Duo"
-In the first example ("J'ai du bon tabac"), you saw that care
-should be taken with regard to the special XML characters
-'<', '>' and '&' by enclosing
-the ABC sequences inside XML comments.
-
With any of the above scripts the music may be printed using
the 'Print' button of the browser. You should add a style as:
` @media print{body{margin:0;padding:0;border:0}.nop{display:none}}`
to remove the margins, the error messages and the menus from the
@@ -205,22 +195,22 @@
- [Guido Gonzato's page](http://abcplus.sourceforge.net/#abc2svg)
Guido maintains a ZIP archive of the abc2vg scripts after
each release of a new version (many thanks, Guido!).
You can just download and unzip this archive. **abc2svg** should
run immediately in your machine without connecting to my site.
- In the same page, you can also find some binaries for the fastest
- javascript interpreter (QuickJS - see below).
+ In the same page, you can also find some binaries of QuickJS,
+ a fast javascript interpreter (see below).
- tarball
From the timeline in the [chisel repository][13], you can get a tarball
any version of the abc2svg source and install it in your system.
The abc2svg scripts must then be built from the raw source files
described in the section 'Build' below.
The disadvantage of this approach is that if you want
to use an other or newer version you need to download a new tarball.
-[13]: https://chiselapp.com/user/moinejf/repository/abc2svg/timeline)
+[13]: https://chiselapp.com/user/moinejf/repository/abc2svg/timeline
- fossil clone
If you can get the fossil program (one binary) for your system,
you may clone the chisel repository by
` fossil clone https://chiselapp.com/user/moinejf/repository/abc2svg abc2svg.fossil`
@@ -228,11 +218,11 @@
and get the abc2svg source files containing the last changes
between the official versions. Updating your files is done by
` fossil pull`
` fossil update`
Building the scripts is done in the same way as with a tarball.
- The repository is presently over 23Mb.
+ The repository is presently over 34Mb.
For those unfamiliar with [fossil][14], it is an integrated
software management system similar to [git](https://git-scm.com/).
Chisel acts like a repository similar to [github](https://github.com/).
@@ -274,15 +264,12 @@
The interfaces to the various scripts are different. Below you will
find various scripts that I had to built.
- `abcqjs` with `qjs` [QuickJS by Fabrice Bellard and Charlie Gordon][10]
-- `abcjs24` with `js24` (Mozilla JavaScript shell - Spidermonkey)
-- `abcjs52` with `js52` (Mozilla JavaScript shell - Spidermonkey)
-- `abcjs60` with `js60` (Mozilla JavaScript shell - Spidermonkey)
-- `abcjsc` with `jsc-1` (webkitgtk2)
-- `abcv8` with `d8` (Google libv8)
+- `abcmjs` with `js78`, `js68`, `js60`, `js52` or `js24` (Mozilla JavaScript shell)
+- `abcjsc` with `jsc` (webkit2gtk)
- `abcnode` with `node` (nodeJS without module)
- `abc2svg` with `node` (nodeJS with modules)
[10]: https://bellard.org/quickjs/
@@ -294,10 +281,15 @@
- `script.js` is an optional backend script.
It defaults to `tohtml.js` (HTML+SVG)
- `options` are the ABC options.
For compatibility, the last options are moved before the last ABC file.
+
+These scripts try to read a file `default.abc` at startup time.
+This file and also the files included by `%%abc-include` are searched
+in the current directory or in the colon separated list of directories
+contained in the environment variable `ABCPATH`.
#### 2.2 Backend scripts
By default, the shell scripts generate (HTML+SVG) files.
This output may be modified by backend scripts. These ones must appear
@@ -316,17 +308,20 @@
word processors (abiword, libreoffice...). The word processor allows
you to convert the file to many other formats from a command line.
The abc2svg music font (`abc2svf.woff` or `abc2svg.ttf`) must be installed
in the local system for displaying and/or converting the .abw file.
Example:
- ` abcv8 toabw.js my_file.abc > my_file.abw`
+ ` abcmjs toabw.js my_file.abc > my_file.abw`
- `tomei.js`
This script outputs the music as a [MEI](https://music-encoding.org/) file.
Note, only one tune may be translated from ABC to MEI (multi-tunes ABC
generates bad MEI).
+- `tonotes.js`
+ This script outputs a list of the MIDI events.
+
- `toodt.js`
This script creates an Open Document (ODT+SVG) which can be read by most
word processors (abiword, libreoffice...).
It runs only with the shell script `abc2svg` and asks for the npm module
`jszip` to be installed.
@@ -436,12 +431,11 @@
- Playing uses the HTML5 audio and/or the midi APIs.
For audio, by default, abc2svg uses a sound font (format SF2)
which is split into one file
per instrument. This sound font is stored in the subdirectory `Scc1t2/`.
- Each instrument file is a base64 encoded javascript array.
-
+ Each instrument file is a base64 encoded javascript array.
Other sound fonts may be used. Some of them are stored in the subdirectory
`sf2/` (`AWE_ROM_gm` and `2MBGMGS`). Two formats are supported: raw SF2 and
SF2 wrapped into javascript (the raw SF2 files can be loaded
only when they are in the same HTTP domain).
The shell script `sf.sh` (in `sf2/`) may be used to create the javacript files
@@ -457,18 +451,19 @@
Here are the scripts which are used in a web context:
- `abcweb-1.js`
This script replaces the ABC or MEI sequences found in the (X)HTML file
- by SVG images of the music. The ABC sequences may start on `X:` or `%abc-`
- at start of line, and stop on any XML tag also at start of line
- (see below for MEI).
- They may also appear after a (X)HTML element of the class "abc"
- (lower case letters) or inside a <script> with a type
- ["text/vnd.abc"](https://www.iana.org/assignments/media-types/text/vnd.abc)
- (the script element is removed from the page).
- When a ABC sequence is not included in a <script> and when it contains
+ by SVG images of the music.
+ The ABC sequences are searched:
+ - first inside <script> elements with a type
+ ["text/vnd.abc"](https://www.iana.org/assignments/media-types/text/vnd.abc)
+ (the script tag is removed from the page),
+ - or inside (X)HTML elements with a class `abc` (lower case letters),
+ - otherwise on `X:` or `%abc-` at start of line up to a XML tag at start of line.
+
+ When a ABC sequence is not included in a <script> and when it contains
the characters '<', '>' or '&',
it must be enclosed in a XML comment or in a CDATA
(%<![CDATA[ .. %]]> - the comment or CDATA must be in a ABC comment).
See the
[%%beginml documentation](http://moinejf.free.fr/abcm2ps-doc/beginml.xhtml)
@@ -477,37 +472,41 @@
the script `snd-1.js` (see below).
[15]: http://moinejf.free.fr/abcm2ps-doc/inline.html "abc2svg - inline music"
- `abcweb1-1.js`
- This script replaces all the page body by music as SVG images.
- As with abcweb-1.js, the music sequences start on `X:` or `%abc`
- at start of line, stop on any ML tag, a XML comment must be used
- when there are special XML characters, and playing is possible.
- When there are many tunes in the file, the script displays a list
+ The page body is analyzed as a ABC file and its content is
+ replaced by music as SVG images.
+ If the page contains reserved XML characters ('<', '>' and '&'),
+ the ABC code must be enclosed in a
+ ` `
+ sequence.
+
+ When there are many tunes in the file, the script displays a list
of the tunes. The list step may be bypassed when the URL of the file
contains a regular expression in the 'hash' value ('#' followed by
a string at the end of the URL).
This string does a
- [%%select](http://moinejf.free.fr/abcm2ps-doc/select.xhtml).
- When one or many tunes are displayed, a menu in the top/right corner
+ [%%select](http://moinejf.free.fr/abcm2ps-doc/select.xhtml).
+
+ When one or many tunes are displayed, a menu in the top/right corner
offers to go back to the tune list or to modify the ABC source.
- `snd-1.js`
- This script may be used with `abcweb{,1}-1.js` to play the rendered
- ABC music.
+ This script may be used with `abcweb-1.js` or `abcweb1-1.js`
+ to play the rendered ABC music.
- `abcdoc-1.js`
This script is mainly used for ABC documentation.
It lets the ABC source sequences in the page before the SVG images.
See the source of
- [abcm2ps/abc2svg features](http://moinejf.free.fr/abcm2ps-doc/features.xhtml)
+ [abcm2ps/abc2svg features](http://moinejf.free.fr/abcm2ps-doc/features.html)
for an example.
### 5. MEI support
-As an experimental feature, an extented core `mei2svg-1.js` may be generated.
+As an experimental feature, an extended core `mei2svg-1.js` may be generated.
This one may handle both the ABC and
[MEI](https://music-encoding.org/ "Music Encoding Initiative")
notations.
In browser mode, the script `abcweb-1.js` loads either `abc2svg-1.js` or
Index: abc2svg
==================================================================
--- abc2svg
+++ abc2svg
@@ -21,11 +21,15 @@
process.exit(1)
}
abc2svg.readFile = function(fname) {
var fs = require("fs")
- return fs.readFileSync(fname).toString()
+ try {
+ return fs.readFileSync(fname).toString()
+ } catch(e) {
+ }
+ return null
}
abc2svg.get_mtime = function(fn) {
var fs = require("fs")
@@ -49,11 +53,16 @@
// load the command line
m = require("abc2svg/cmdline");
global.user = m.user;
global.abc_cmd = m.abc_cmd
+// set the ABC path
+var path = process.env.ABCPATH
+if (path)
+ abc2svg.path = path.split(':')
+
// main
var args = process.argv
args.shift();
args.shift()
-abc_cmd("nodeJS", args, "Node.js")
+abc_cmd("abc2svg", args, "nodeJS")
Index: abc2svg.ttf
==================================================================
--- abc2svg.ttf
+++ abc2svg.ttf
cannot compute difference between binary files
Index: abcjsc
==================================================================
--- abcjsc
+++ abcjsc
@@ -1,10 +1,18 @@
#!/bin/sh
# abc2svg with jsc (webkit2gtk)
-progdir=`dirname $0`
+# search where are the abc2svg scripts
+c=$0
+if [ `dirname $c` = . ]; then
+ c=`which $c`
+fi
+if [ -L $c ]; then
+ c=`realpath $c`
+fi
+c=`dirname $c`
-exec jsc -e "var progdir='${progdir}/'
+exec jsc -e "var progdir='${c}/'
// function to do utf-8 work...
// uncommenting this function asks for also uncommenting its call in cmdline.js
//function utf_convert(fin) {
// var b1, b2, b3,
@@ -48,11 +56,15 @@
},
quit: function() {
quit(1)
},
readFile: function(fname) {
- return read(fname)
+ try {
+ return read(fname)
+ } catch(e) {
+ }
+ return null
},
loadjs: function(fn, relay, onerror) {
try {
load(progdir + fn)
if (relay)
@@ -68,13 +80,21 @@
load(progdir + 'abc2svg-1.js')
load(progdir + 'cmdline.js')
function main(args) {
+ var i = '${ABCPATH}'
+
+ console = {
+ log: printErr
+ }
+
+ if (i)
+ abc2svg.path = i.split(':')
abc_cmd('abcjsc', args, 'jsc (webkit2gtk)')
}
if (typeof arguments == 'undefined')
var arguments = ''
main(arguments)
" -- "$@"
ADDED abcmjs
Index: abcmjs
==================================================================
--- /dev/null
+++ abcmjs
@@ -0,0 +1,66 @@
+:;# abc2svg with a Mozilla JavaScript interpreter
+
+for c in js78 js68 js60 js52 js24 end; do
+ if [ $c = 'end' ]; then
+ echo "$0: could not find a javascript interpreter - abort"
+ exit 1
+ fi
+ if command -v $c >/dev/null 2>&1; then
+ break
+ fi
+done
+
+# search where are the abc2svg scripts
+p=$0
+if [ `dirname $p` = . ]; then
+ p=`which $p`
+fi
+if [ -L $p ]; then
+ p=`realpath $p`
+fi
+p=`dirname $p`
+
+exec $c -e "// interpreter specific functions
+var abc2svg = {
+ print: print,
+ printErr: printErr,
+ quit: function() {
+ quit(1)
+ },
+ readFile: function(fn) {
+ try {
+ return read(fn)
+ } catch(e) {
+ }
+ return null
+ },
+ loadjs: function(fn, relay, onerror) {
+ try {
+ load(fn[0] == '/' ? fn : (path + fn))
+ if (relay)
+ relay()
+ } catch(e) {
+ if (onerror)
+ onerror()
+ else
+ printErr('Cannot read file ' + fn)
+ }
+ } // loadjs()
+} // abc2svg
+
+ var args = scriptArgs,
+ path = '${ABCPATH}'
+
+ if (path)
+ abc2svg.path = path.split(':')
+
+ path = '${p}/' // path to the abc2svg scripts
+
+ console.log = printErr
+
+load(path + 'abc2svg-1.js')
+load(path + 'cmdline.js')
+
+// main
+abc_cmd('abcmjs', args, '${c}')
+" -- "$@"
Index: abcnode
==================================================================
--- abcnode
+++ abcnode
@@ -1,9 +1,18 @@
:;# abc2svg with raw nodeJS
-progdir=`dirname $0`
+
+# search where are the abc2svg scripts
+p=$0
+if [ `dirname $p` = . ]; then
+ p=`which $p`
+fi
+if [ -L $p ]; then
+ p=`realpath $p`
+fi
+p=`dirname $p`
-cat ${progdir}/abc2svg-1.js ${progdir}/cmdline.js > /tmp/toto.js
+cat ${p}/abc2svg-1.js ${p}/cmdline.js > /tmp/toto.js
case $1 in
*.js)
cat $1 >> /tmp/toto.js
if grep 'abc2svg.abc_init =' "$1" > /dev/null; then
x="no"
@@ -10,15 +19,15 @@
fi
shift
;;
esac
if [ "x$x" != 'xno' ]; then
- cat ${progdir}/tohtml.js >> /tmp/toto.js
+ cat ${p}/tohtml.js >> /tmp/toto.js
fi
cat <> /tmp/toto.js
- var progdir='${progdir}/'
+ var path='${p}/'
// interpreter specific functions
abc2svg.print = function(str) {
process.stdout.write(str + '\n')
}
@@ -29,11 +38,15 @@
process.exit(1)
}
abc2svg.readFile = function(fname) {
var fs = require("fs");
- return fs.readFileSync(fname).toString()
+ try {
+ return fs.readFileSync(fname).toString()
+ } catch(e) {
+ }
+ return null
}
abc2svg.get_mtime= function(fn) {
var fs = require("fs")
@@ -41,11 +54,11 @@
}
abc2svg.loadjs = function(fn, relay, onerror) {
try {
var geval = eval;
- geval(abc2svg.readFile(progdir + fn))
+ geval(abc2svg.readFile(path + fn))
if (relay)
relay()
} catch(e) {
if (onerror)
onerror()
@@ -57,13 +70,17 @@
// (this file is wrapped)
global.Abc = Abc
global.abc2svg = abc2svg
// main
- var args = process.argv
+ var args = process.argv,
+ i = '${ABCPATH}'
+ if (i)
+ abc2svg.path = i.split(':')
+
args.shift()
args.shift()
global.user = user; // (for modules/page.js)
- abc_cmd("abcnode", process.argv, "nodeJS")
+ abc_cmd("abcnode", args, "nodeJS")
EOF
node /tmp/toto.js "$@"
Index: abcqjs
==================================================================
--- abcqjs
+++ abcqjs
@@ -1,63 +1,64 @@
:;# shell script to convert ABC or MEI music notation to other format
# using abc2svg and quickjs (https://bellard.org/quickjs/)
+
+# search where are the abc2svg scripts
+p=$0
+if [ `dirname $p` = . ]; then
+ p=`which $p`
+fi
+if [ -L $p ]; then
+ p=`realpath $p`
+fi
+p=`dirname $p`
exec qjs --std -e '
var i,
args = scriptArgs,
core = "abc2svg-1.js",
- path = args.shift(). // the 1st argument is the script name
- match(/.*\//)
+ path = args.shift() + "/" // the 1st argument is the script path
// interpreter specific functions
function load(fn) {
return std.loadScript(fn)
}
var abc2svg = {
- print: function(str) {
- print(str)
- },
+ print: print,
printErr: function(str) {
std.err.printf("%s\n", str)
},
quit: function() {
std.exit(1)
},
- readFile: function(fname) {
- var f, b
-
- f = std.open(fname, "r")
- if (!f)
- return ""
-
- b = f.readAsString()
- f.close()
- return b
- }, // readfile()
+ readFile: std.loadFile,
get_mtime: function(fn) {
return new Date(os.stat(fn)[0].mtime)
},
loadjs: function(fn, relay, onerror) {
try {
load(fn[0] == "/" ? fn : (path + fn))
+ if (relay)
+ relay()
} catch(e) {
if (onerror)
onerror()
else
abc2svg.printErr("Cannot read file " + fn +
"\n " + e.name + ": " + e.message)
return
}
- if (relay)
- relay()
} // loadjs()
} // abc2svg
// --- main ---
- path = path ? path[0] : ""
+ console.log = abc2svg.printErr
+
+ i = std.getenv("ABCPATH")
+ if (i)
+ abc2svg.path = i.split(":")
i = args.length
while (--i >= 0) {
if (/\.mei$/.test(args[i])) {
core = "mei2svg-1.js"
@@ -67,10 +68,10 @@
load(path + core)
load(path + "cmdline.js")
abc_cmd("abcqjs", args, "QuickJS")
-' $0 "$@"
+' $p "$@"
The previous solution with the shebang line as
#!/usr/bin/env -S qjs --std
did not work with non-GNU versions of env
Index: abctopdf
==================================================================
--- abctopdf
+++ abctopdf
@@ -1,22 +1,20 @@
:;# abctopdf
# convert ABC to PDF using abc2svg and one of
# - a chrome/chromium compatible web browser
-# (if not found, set its name in the environment variable 'BROWSER')
+# (if not found, you can set its name in the environment variable 'BROWSER')
# - weasyprint (https://weasyprint.org/)
-# - rsvg-convert (https://wiki.gnome.org/Projects/LibRsvg)
#
-# Note: when weasyprint or rsvg-convert are used,
+# Note: when weasyprint is used,
# this script forces A4 as the paper size.
# For an other size, change
-# 'size: A4' and '--pageheight 29.7cm' with weasyprint
-# '%%pageheight 29.7cm' with rsvg-convert
+# 'size: A4' and '--pageheight 29.7cm'
#
-# Copyright (C) 2019-2020 Jean-François Moine - License GPL3+
+# Copyright (C) 2019-2021 Jean-François Moine - License GPL3+
# set a browser
-if [ x$BROWSER = x ]; then
+if [ "x$BROWSER" = "x" ]; then
BROWSER=chromium
fi
if [ $# -eq 0 ]; then
cat << EOF
@@ -86,40 +84,31 @@
fi
shift
done
# check if some chromium-based browser is available
-for c in $BROWSER chromium-browser vivaldi opera brave-browser epic google-chrome; do
- if command -v $c >/dev/null 2>&1; then
+for c in "$BROWSER" chromium-browser vivaldi opera brave-browser epic google-chrome; do
+ if command -v "$c" >/dev/null 2>&1; then
echo "and $c"
command $abcscr "$@" > /tmp/o.html
- $c --headless --disable-gpu --print-to-pdf=$out /tmp/o.html
+ "$c" --headless --disable-gpu\
+ --print-to-pdf=$out --print-to-pdf-no-header /tmp/o.html
rm /tmp/o.html
exit 0
fi
done
# try weasyprint
if command -v weasyprint >/dev/null 2>&1; then
echo "and weasyprint"
- rm -f /tmp/abc*.svg
+ rm -f /tmp/abc*.svg /tmp/abc.html
# generate a (HTML+SVG) file
# then, extract the SVG images (pages) to /tmp/ and build a file.html
- cat > /tmp/abc.html <
-
-
-
-EOF
-n=0
+ touch /tmp/abc.html
+ n=0
command $abcscr --pageheight 29.7cm --fullsvg 1 --musicfont abc2svg "$@" | while read v; do
case "$v" in
"