-
Notifications
You must be signed in to change notification settings - Fork 176
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
Text not selectable with current Linux binaries #3
Comments
Thanks for the report. Indeed, selectable text is supposed to work and even if you don't need it, that still impacts file size significantly. Could you please precise on what OS / architecture you've built PhantomJS submodule? Indeed, it is a known issue on Mac 64-bit though it's supposed to be fixed by astefanutti/phantomjs@d32178f. Another lead would be to build the version before the Qt
That may help identify the root cause of the issue / regression. |
Ubuntu x86_64
Not sure what's going on here. I see f4ab03 in your phantomjs fork on github and the submodule seems correctly configured:
|
I haven't been able to generate and test binaries for Ubuntu yet unfortunately. There may have some missing dependencies as documented in: I see at least the following dependencies relating to font management / rendering:
|
I have no problem building phantomjs. I have a problem because I can't checkout commit f4ab03d from your phantomjs fork. This is because you rebased your patches on top of phantomjs and pushed the changes in the same branch thus overwriting the previous history. Once a commit id is not referred to by some ref like a branch or a tag by git it will get garbage collected and will no longer be reachable. To avoid this in the future you might want to tag the commits that you will refer to with your decktape submodule. I forked your forked, cherry-picked your patches on top of c4df640 and tagged it as decktape-fbe46421. I'm rebuilding phantomjs right now and we'll see if it fixes the issue. |
Finally built previous phantomjs and I still experience the issue. I can select monospace text but not text that has the fancy reveal.js default web font (which is used everywhere). I think that someone will have to make a patch similar to yours for the Linux platform in ariya/phantomjs#10373. This is beyond my competencies but I would be willing to test any fixes. |
OK, thanks for the test. I've squashed the two commits to get rid of the garbage collected one as I haven't noticed any regression introduced by the rebase as far as DeckTape is concerned. It looks like this is a specific Linux issue for embedding / rendering Web fonts. I'll try to dig into it further ASAP. |
I also had the problem that some fonts rendered as graphics instead of as text with a self-compiled phantomjs, on Ubuntu 15.04. |
This doesn't seem to be a problem with deck.js, so perhaps it has something to do with web fonts only. |
Upon further exploration, it appears that PhantomJS is converting the web font glyphs into paths. That's why the text cannot be selected. You can find this out by converting one of the PDF pages to SVG using Inkscape. This reveals that what is in the PDF are actually paths and not embedded font glyphs. Otherwise, Inkscape would try to map the glyphs to text objects.
So this appears to be a PhantomJS (and perhaps WebKit) issue. |
The workaround to this problem seems to be to install the TTF or OTF font on your system (and perhaps disable the web fonts import). Then, the custom font can be selected. |
It's rather odd that it makes a difference that the font was loaded via the web, but that seems to be what the results are telling me. |
Reported as a regression in ariya/phantomjs#13997. |
If the font is on your system, and the |
From upstream:
|
...we know that this is limited to text that uses web fonts that aren't on the local system. |
As a workaround, you can grab the webfont TTF files and put them into |
I've provided the minimal test case below to the upstream ariya/phantomjs#13997 issue:
When executing So at least the PhantomJS dev team now has a clear reproducer. The good news is that it's a regression apparently (I haven't verified that yet). So that may ease the resolution. If not, I'll try to jump into it ASAP as this is a major limitation for Linux users. |
I have not seen progress on this issue either here or on the referenced phantomjs issue. What is the current status of this issue? |
@patrickdepinguin no progress unfortunately yet since the above elements. Though that's a major issue so I'll jump into it ASAP to move forward on this. I encourage you to weight in ariya/phantomjs#13997 as well as PhantomJS devs tend to prioritize based on user feedback. |
@astefanutti Thanks. |
I've isolated a minimal Qt application that demonstrates this is a regression from Qt 4.8 to Qt 5.x. I've created QTBUG-52417 and I'll try to dig into Qt to eventually have a fix. |
Is there any update on this? Thanks for looking into this!! |
@willemmulder, next-step is to apply the work-around proposed in ariya/phantomjs#13997 (comment) and look into a definitive solution to QTBUG-52417. |
But that fix is for Qt code, right? Would PhantomJS be able to 'package' (excuse the wording) that fix so that a new Phantom release fixes the Qt problem, even when Qt itself is not yet fixed? (in other words: does Phantom reference Qt, or does it actually contain Qt?) |
@willemmulder, yes PhantomJS uses its own version of Qt, for instance, that would be merging the fix in https://github.com/Vitallium/qtbase. |
@astefanutti Ah that would be perfect! I don't know anything about this myself, but would be really grateful once this is in...! |
An update on this is available at ariya/phantomjs#13997 (comment). So there is a working solution. I'm still investing a bit to iterate over the proper solution and I'll update the binaries / Docker image ASAP. |
I think I'll go with the fix that I have as it works for all the test examples that I have. |
I've just released version The Docker image has been updated with this statically linked binary. I'm so glad it's fixed! Thanks for your patience! |
Great; thank you so much! If I wanted to get the standalone PhantomJS binary, where could I go get it? |
@willemmulder it's all in the |
@willemmulder BTW, I was thinking a plugin for Presenteer.js may be worth 😉! |
Hey @astefanutti yeah that would be great! I'm not sure how Decktape works? Note that there is no Presenteer.js 'wrapper' to actually create presentations. Presenteer.js is (currently) focussed at developers, not end-users. Is that something that would need fixing first or can Decktape work with any Presenteer.js webpage, as long as the Presenteer.js API is clear? |
@willemmulder DeckTape would just need to rely on the Presenteer.js API. DeckTape basically needs a |
Okay, so how do we go from here? :-) Is there an instruction-page that I could follow? Or is there something else you need? |
@willemmulder it's just a matter of creating a |
I checked out master, built my own phantomjs in the submodule and PDF rendered some slides. The resulting PDF although very nice doesn't have selectable text.
For me this is still way better than the print-pdf option which has many problems so I don't really mind but since your README mentions selectable text I thought I should let you know.
The text was updated successfully, but these errors were encountered: