[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] Now online: gropdf / grops previewer
From: |
John Gardner |
Subject: |
[groff] Now online: gropdf / grops previewer |
Date: |
Mon, 23 Apr 2018 09:04:25 +1000 |
Well, here it is:
https://rawgit.com/Alhadis/Roff.js/web-demo/index.html
Some modifications were needed for web-delivery, and performance still
isn't optimal, but it works. You'll need a relatively recent browser to use
it (anything released within the last year should do).
Few things to note before you try it:
- *This is a post-processor.* Make sure you use groff's -Z switch (or
troff directly) if you're testing it with your own documents. You'll
need to pipe it to your system's clipboard and paste it into the *Edit
Source* dialogue.
Normally, Atom handles this procedure transparently by piping the
editor's contents through Groff in a separate process. Webpages don't have
access to system binaries (thankfully), so this is the best I can do.
- *Heirloom Troff output isn't perfect.* This is a known issue I intend
to fix in a future release. At the moment, the renderer is heavily reliant
on the āwā and ānā output commands to identify where a word ends. Groff
uses these sequences consistently, but Heirloom doesn't. They're also
omitted from certain eqn(1) constructs which also need fixing.
- *Some fonts may look different.* Browsers handle font-rendering, which
means the base 35 PDF fonts won't be visible in the renderer unless they've
also been installed in your system's usual fonts directory.
I have this taken care of by bundling
<https://github.com/Alhadis/URW-Core35-Fonts> with the editor-package
all 35 URW's core fonts. For the sake of your bandwidth, I've opted *not* to
embed ~3 MBs of fonts into the page: if basic fonts seem to be missing, you
can probably fix it by installing the fonts from upstream
<http://git.ghostscript.com/?p=urw-core35-fonts.git;a=tree;h=refs/heads/master;hb=refs/heads/master>
.
- *There's an issue with zooming.* This is what I'm stuck on, and when
Branden offered help with matrix calculations, I decided the best way of
explaining was with a working demo.
If you zoom in using the *100%* menu, you'll notice you can't scroll
left or upwards. That's because the page contents extend past the top-left
corner of the browser window, and we all know you can't scroll past the
window's origin corner.
Other than that, enjoy!
- John
- [groff] Now online: gropdf / grops previewer,
John Gardner <=