Skip to content
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 postscript export to write text objects in addition to text as paths (shapes) #1537

Closed
durack1 opened this issue Sep 10, 2015 · 12 comments
Closed
Assignees
Milestone

Comments

@durack1
Copy link
Member

@durack1 durack1 commented Sep 10, 2015

As discussed in #1527 the current postscript export function writes text objects as shapes, rather than encoded as text objects.

It would be preferable to expose the ability to export text as text/string objects, which will provide better control when importing postscript output files into vector graphics editing software (such as Adobe Illustrator).

Further discussions are included in #1527 - in particular here

@dlonie can describe what needs to be exposed - a potential upside is that file sizes may be reduced (#517)

@allisonvacanti
Copy link
Contributor

@allisonvacanti allisonvacanti commented Sep 10, 2015

Just to comment on a point made in #1527, the "text object" mode should not be the default. Leave "text as paths" as the default. The original VTK vector export implementation in VCS exported text objects and it caused problems.

In particular, some vector formats do not support alignment/rotation of text, and embedding the objects results in portability issues as fonts vary greatly across viewers and platforms. To keep things consistent, we decided to export as paths, since that avoids all of these issues.

As for filesize, every large ps/pdf I've been sent to inspect shows the vast majority of the file to be comprised of high-resolution polygonal data from the plot, while text took up a negligible amount of space. The only way around that is to rasterize the plot into the image or downsample the data prior to exporting.

@doutriaux1
Copy link
Contributor

@doutriaux1 doutriaux1 commented Sep 10, 2015

@dlonie I was thinking of simply add it to the psotscript function, so it would be on by default for postscript only. I will test with @durack1 as is and if it creates too many issue will put it back as OFF by default. Does that sound good?

@durack1
Copy link
Member Author

@durack1 durack1 commented Sep 10, 2015

@doutriaux1 I think @dlonie was recommending leaving the default as is, but exposing the write text as text object functionality using an additional keyword argument.. That way all the work to get ps files looking good across multiple systems doesn't go to waste.. And only when you want to dig deeper for text object control would a user use it..

@allisonvacanti
Copy link
Contributor

@allisonvacanti allisonvacanti commented Sep 11, 2015

What @durack1 said :-)

@durack1
Copy link
Member Author

@durack1 durack1 commented Feb 4, 2016

@danlipsa @doutriaux1 @aashish24 this would seem to be a very simple addition to the export postscript function - I'd be happy to kick the tyres on this once a branch is in place to test.

@aashish24
Copy link
Contributor

@aashish24 aashish24 commented Feb 4, 2016

@dlonie if we switch to opengl2 backend, would that be giving us text objects or still shapes?

@allisonvacanti
Copy link
Contributor

@allisonvacanti allisonvacanti commented Feb 4, 2016

Either -- See vtkGL2PSExporter::SetTextAsPath(bool). If true, all text will be exported as paths. If false, 2D non-math text will be embedded as a text object (3D or mathtext strings will still be paths, though).

This is the case for both VTK OpenGL backends.

@durack1
Copy link
Member Author

@durack1 durack1 commented Feb 4, 2016

@doutriaux1 @aashish24 could this be moved to a 2.6 milestone - I certainly do think such new functionality, that would appear to be a couple of lines of code tweaks would be a great new feature to highlight for 2.6..?

@aashish24
Copy link
Contributor

@aashish24 aashish24 commented Feb 4, 2016

@durack1 sure it sounds like a easy fix unless anyone else objects to it, I am in favor of putting in 2.6.

@aashish24 aashish24 added this to the 2.6 milestone Feb 4, 2016
@aashish24 aashish24 removed this from the 3.0 milestone Feb 4, 2016
@aashish24 aashish24 self-assigned this Feb 4, 2016
@aashish24
Copy link
Contributor

@aashish24 aashish24 commented May 26, 2016

So I verified that for both pdf and postscript we are exporting text as paths. Also checked the code that the flag is present. Both PDF and Postscript text

line: 1098 (master as of today).

gl.TextAsPathOn()

The docs are attached
foo.pdf

I am closing this bug if I am mistaken please feel free to ping me on it.

@aashish24 aashish24 closed this May 26, 2016
@aashish24 aashish24 reopened this May 26, 2016
@aashish24
Copy link
Contributor

@aashish24 aashish24 commented May 26, 2016

Oops.. I just realized that @durack1 wants the text object. Okay, I will add an option to vcs and set the default to text object.

@durack1
Copy link
Member Author

@durack1 durack1 commented May 26, 2016

@aashish24 yes, I was about to ping you on that! I thought the issue title made things clear.

Rather than just change the default without testing, can we test out the options to see how the outputs look first? I'd be happy to provide feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants