New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable point and click #48
Comments
If we do this, we'll have to fork PDF.js for now. See mozilla/pdf.js#6072 and http://logs.glob.uno/?c=mozilla%23pdfjs#c34556. |
I just spent a night trying to figure out how PDF.js works, and I feel that it could be made to work, but SVG would be a LOT easier to implement. First, there are multiple ways of using PDF.js:
1 is the most orthodox way, but it is basically a skeleton only and everything else like zooming, paging must be implemented by hand. Kind of complicated considering the pretty viewer took 7700 LoC. 2 seems to be the best looking option, but I am not yet familiar with cross-document messaging for We'll also need to add some relevant buttons like downloading MIDI to the viewer page, remove our existing controls as people don't really like multiple toolbars, and maybe use our own theme instead of the Mozilla-esque black background (the latter will come later of course). Forking and modifying the giant code code base will also be fun. On the CodeMirror side, we can use I'll be moving short-distance AND traveling long-distance for the next few days/weeks so I can't guarantee how much (or even if) I can get done on this, but feel free to start if you'd like to. I have pushed some very rudimentary WIP to the pdf branch of this repo, including a hardcoded copy of PDF.js. That should get you started if you have time for this :) |
Something to also be aware of - though perhaps rare, I have noticed that the built-in web browser PDF viewer in Firefox (pdf.js?) many times does not render a lilypond score very well. Some missing elements, or things seeming a little off. In one case I was freaking out when it appeared that staccato articulations were missing. When opening in a real viewer (okular, evince, etc) scores are as expected. |
Interestingly, SVG output has links too! By the way, I'm finding that LilyPond can be quite a bit slower when using SVG as a backend instead of PostScript. http://www.mutopiaproject.org/ftp/BachJS/BWV230/bach_BWV_230_Lobet_den_Herrn_alle_Heiden/bach_BWV_230_Lobet_den_Herrn_alle_Heiden.ly takes 11–12 seconds to make a PDF, and 16–17 seconds to do SVG. |
@scottlinux The Firefox PDF viewer is PDF.js, so that's good to know of those issues. Do you have some small (1-page) example PDFs that don't render properly in Firefox? We should send them to the PDF.js people and let them know of issues. |
I can make a small preview. This score I believe had that issue (missing articulations viewed in Firefox): |
Use https://mozilla.github.io/pdf.js/web/viewer.html to test. (I don't notice anything missing right off the bat.) |
Ok looks good! Perhaps all is well now. |
@trevordixon said:
LOL, that's what I remembered, but seems like overlooked it yesterday while confirming my thoughts, thus trolling myself into looking at PDF.js :)
On my non-SSD machine, the difference is 44.954s vs 13.489s in favor of PS → PNG. This is a quite significant performance hit I'd say. I guess PDF might be worthy after all :) |
Nice job! |
:) |
http://www.lilypond.org/doc/v2.18/Documentation/usage/configuring-the-system-for-point-and-click
If we use PDF.js to preview, we might be able to make this point and click feature work.
The text was updated successfully, but these errors were encountered: