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

Fix placeholder text formatting issues #1247

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mikemeerschaert
Copy link
Contributor

This PR fixes several bugs related to placeholders on master slides that can be observed in this minimal demo repo

Valign and Margin in master slides

When creating a placeholder on a master slide, the valign and margin options are disregarded on the layout slide (in ppt, go to View > Slide Master and examine the items added to the layout slide, even if you specify valign and/or margin, the items on the layout slide will still have the default values.

This issue is somewhat related to #640. The fix for that issue fixed the generated slides that use the master and placeholders from within the library, but unfortunately, it didn't fix the issue on the master slides themselves.

This causes issues when you generate a pptx and then you want to add more slides to that file manually in PowerPoint using the generated master slides.

Bullets in master slides

This one is very specific and probably doesn't come up much, but it came up for me, and since I was already in the library fixing the above issue, I decided to also developed a fix for this one.

When you supply type: "bullet" and a custom characterCode to bulleted text in a placeholder, the placeholder still uses the default bullet code 2022. The easy workaround is to just not supply a type and it will default to bullet, but it is very confusing when you run into it.

e.g.

presentation.defineSlideMaster({
  title: "Bullet point demo",
  background: { color: "FFFFFF" },
  objects: [
    {
      placeholder: {
        options: {
          name: "Bullets",
          type: "body",
          bullet: {
            type: "bullet",
            characterCode: "25CF",
          },
          x: 0.5,
          y: 0.1,
          w: 9,
          h: 1,
          fontSize: 12,
          fontFace: "Arial",
        },
        text: "bullet 1\nbullet 2\nbullet 3",
      },
    },
  ],
})

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.

1 participant