-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Solved] Unsearchable Text wine #2
Comments
I've reproduced that issue in wine, but could only surmise that office converts data to PS before sending it to CUPS, and the text is lost in the pre-conversion. Two things you could try:
|
Hi, thanks for your reply. I did the following: Installed wordviewer under wine and printed the test.docx with the cups-pdf driver: same result, Calibri is not searchable. Printed with Word under wine and printed 'to a file' (aka created a ps file) using the cups-pdf driver. This one can be converted using ghoscript ending up in the same problem. Now I used this file with Acrobat. Acrobat created a pdf file, which has exactly the same problems as the pdf file from ghostscript. So it seems to me that ghostscript is no the problem here (I spent quite some time fiddling around with fonts and ghostscript). So, as you said, the problem seems to be that the text information gets lost somewhere in between Word->Wine->WinePS->CUPS->cups-pdf.ppd. I think I will try to install a different PS Printer and print with this one. If the result persists, it must be the underlying part (wine etc), if not, it must be CUPS/cups-pdf. I will post my results here. PS: So I installed the Adobe generic PS driver under wine and printed 'to a file' using this driver. The output differed just slightly (s. below). Still, the PS file is created by the WinePS driver and the issue persists. So to me it seems that the Wine guys have dig into this issue.
|
So I investigated further this issue and came across a solution. Apparently, the culprit lies within a missing feature rather than a bug. When reading the output of wine while printing, I came across the line: "postscript format 3.0 glyph names are currently unsupported" So I dug into the source code and found the respective distinction in download.c of dlls/wineps.drv/. Here, it is distinguished between the formats type 1, type 2 and type 3. Apparently, the code transforms the truetype font to an intermediate postscript font. For that, it needs to know the name of the glyphs. This is exactly extracted at this position. However:
Bingo! So I understood that the culprit lies within the missing name tables of the font itself. As long as there is no support in wine for these fonts, one hase to transform the fonts including the name tables. I found a solution here: fontforge/designwithfontforge.com#16 And adopted it for my needs:
For every font having no names table, I executed this script (you need fontforge for it):
That's it. |
Wow! Thanks for the solution. I'll keep this issue open, so others can find it if needed. |
Hi, |
I ran into this problem today, too. @marlemion is right in their diagnosis (many thanks!) but the solution didn't quite work for me, so I thought I add my experience for anyone else encountering this issue. First, a smaller issue, is that ttf2afm is very sensitive about the way you supply the argument. If you are in the font folder and do "ttf2afm palatino-linotype-roman.ttf" it will reply "fatal: truetype fonts file `test' not found". You have to provide the full path to the font-file. Secondly, running the script the way @marlemion provided it on a ttf file changed the file type. While before "file palatino-linotype-roman.ttf" returned "TrueType Font data...", after running the script it returned "Spline Font Database". The result was that the font was broken in wine. This is perhaps due to changes to the default behavior of fontforge. I'm not sure how to modify the python script to make it output a ttf (probably instead of font.save one would need font.generate with appropriate flags), but if you just have a few fonts to modify, it's possible to do it manually with fontforge. Just open fontforge, select the ttf file and set "Force glyph names to: Adobe Glyph List". Then go to File->Generate Fonts. Set the output type to "Truetype" and again set "Force glyph names to: Adobe Glyph List". Generate the font and the necessary tables are added. |
Hi, I have a problem reported already to wine and ghostscript, but maybe you have an idea, too:
https://bugs.winehq.org/show_bug.cgi?id=42739
https://sourceforge.net/p/ghostscript/discussion/5452/thread/44e4abf6/
It is a showstopper for creating text searchable pdfs from within wine from random docx/msg documents.
Thanks for any hint!
The text was updated successfully, but these errors were encountered: