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

Formatting rules do not apply to string with '\n' #34

Closed
itskun opened this issue Feb 7, 2017 · 1 comment
Closed

Formatting rules do not apply to string with '\n' #34

itskun opened this issue Feb 7, 2017 · 1 comment
Assignees
Milestone

Comments

@itskun
Copy link

itskun commented Feb 7, 2017

Formatting rules are ignored after the symbol '\n', e.g:
slide4.addText('first paragraph\nsecond paragraph\nthird paragraph', { x: 0.0, y: '50%', valign: 'middle', align: 'center', color: '000000', font_face: 'Times New Roman', font_size: 16, isTextBox:true});
It looks like:
image

@gitbrent gitbrent self-assigned this Feb 7, 2017
@gitbrent gitbrent added this to the v1.2.0 milestone Feb 7, 2017
gitbrent pushed a commit that referenced this issue Feb 9, 2017
@gitbrent
Copy link
Owner

Hi @itskun,

Thanks for reporting this issue!

There was actually an underlying issue here with text run formatting within paragraphs that needed fixing.

Lastly, I've updated the README and examples/pptxgenjs-demo.html page with an code showing how to format down to the word/line level, so you could align/format each of your 3 lines above differently.

slide.addText(
 [
  { text:'1st line', options:{ font_size:24, font_face:'Courier New', color:'99ABCC', align:'r', breakLine:true } },
  { text:'2nd line', options:{ font_size:36, font_face:'Arial',       color:'FFFF00', align:'c', breakLine:true } },
  { text:'3rd line', options:{ font_size:48, font_face:'Verdana',     color:'0088CC', align:'l' } }
 ],
  { x:0.5, y:1.1, w:6, h:3, margin:0.1, fill:'232323' }
);

issue34fix

issue34exfix

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