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

Correctly embed fonts in generated pdf #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

albertored
Copy link

With this change the eps generated as a middle step to have pdf files as output are generated with the -teps:text flag on plantuml. See https://plantuml.com/eps for reference.

In this way text is not rendered as outlines in eps file but it keeps the font indication allowing epstopdf to correctly embed font in the final pdf

Copy link
Collaborator

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

def render_plantuml(self, node, fileformat):
def render_plantuml(self, node, fileformat, plantuml_type=None):
if not plantuml_type:
plantuml_type = fileformat
Copy link
Collaborator

@yuja yuja Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding separate fileformat, plantuml_type parameters, maybe eps:text can be mapped to <filename>.text.eps (i.e. 'text.eps': ['-teps:text'])?

Suppose -teps and -teps:text generate different contents, the output filenames should be unique.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, but it might break batch rendering where the output file names are controlled by plantuml.

If -teps:text doesn't break existing users, maybe it's okay to always use -teps:text.

Copy link
Author

@albertored albertored Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an option available on config? Like plantuml_latex_output_format = "eps:text"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If -teps:text doesn't break existing users, maybe it's okay to always use -teps:text.

Depends on the definition of "breaking". For sure it can lead to a different output

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that seems good if we need to support both eps formats.

If eps:text is strictly better in latex rendering, I think it's good to use it by default. eps format wouldn't be used for the other purposes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In alternative I can add a new option, something like plantuml_latex_pdf_embed_fonts = True (default to False as today) that if given uses -teps:text instead of -teps

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference over adding option vs changing the default. If we add an option, it will be something like plantuml_eps_embed_fonts so that all <hash>.eps files of the same name are rendered with the same configuration.

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

Successfully merging this pull request may close these issues.

2 participants