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

Feature Request: Text Outline #298

Closed
stevenljacobsen opened this issue Mar 9, 2018 · 5 comments
Closed

Feature Request: Text Outline #298

stevenljacobsen opened this issue Mar 9, 2018 · 5 comments
Assignees
Milestone

Comments

@stevenljacobsen
Copy link

Text outline would be very helpful. Our group uses backgrounds that have dramatic contrast. An outline helps define the character when it lands upon a background of the same color. I'm using Shadow right now but since it is only one sided it isn't as good as it could be. A simple solid line with width and color options would be great!

@gitbrent gitbrent self-assigned this Mar 20, 2018
@gitbrent gitbrent added this to the 2.1.0 milestone Mar 20, 2018
gitbrent pushed a commit that referenced this issue Mar 20, 2018
gitbrent pushed a commit that referenced this issue Mar 20, 2018
@gitbrent
Copy link
Owner

Hi @stevenljacobsen,

Text Outline turned out to be pretty trivial to add - thanks for the suggestion.

outline has two options: size (pt) and color.

slide.addText(
    "Text Outline",
    {
        x:7.5, y:6.5, w:'40%', h:0.6,
        fontSize:32, color:'0088cc', outline:{size:1.5, color:'00DD00'}
    }
);

screen shot 2018-03-19 at 20 55 21

gitbrent pushed a commit that referenced this issue Mar 20, 2018
@stevenljacobsen
Copy link
Author

Awesome! I'll download and test it out!

@stevenljacobsen
Copy link
Author

I pulled down the new code and added the outline options and that works. But I'm having an issue with the font size now.

In this code the font defaults to 12p in the generated PPTX filet:
var optLyrics = {color: lyricscolor, marginPt: 0, border: [0, 0, 0, 0], align: 'center', valign: 'middle', font_size: lyricssize,
font_face: lyricsfont, bold: lyricsbold};
slide.addTable([[{text: songPPTdata[z]['title'], opts: optLyrics}]], {x: 0.01, y: 0.01, cx: slidewidth, cy: slideheight});

And in this code it defaults to 18pt:
slide.addText(slidetext, {x: 0.01, y: 0.01, cx: slidewidth, cy: slideheight, color: lyricscolor,
align: 'center', valign: 'middle', font_size: lyricssize, font_face: lyricsfont, bold: lyricsbold,
italics: lyricsitalic, outline: {size: .5, color: '000000'}
});
I logged the variables to console and they show the correct values but don't seem to

@gitbrent
Copy link
Owner

Many option names changed in 2.0 and wont work...

Use: fontSize, fontFace and use w for cw and h for cy

@stevenljacobsen
Copy link
Author

Got it! Much better! Thanks!

ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants