Skip to content

Commit

Permalink
Added new text option strike (Issue #238)
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBrent authored and GitBrent committed Nov 15, 2017
1 parent 9293729 commit f595564
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
**Implemented Enhancements:**
- New chart type: bubble charts [\#208](https://github.com/gitbrent/PptxGenJS/issues/208) ([shrikantbhongade](https://github.com/shrikantbhongade))
- New Chart option: Legend Text Color [\#233](https://github.com/gitbrent/PptxGenJS/issues/233) ([mconlin](https://github.com/mconlin))
- New Text option: `strike` [\#238](https://github.com/gitbrent/PptxGenJS/issues/238) ([adrienco88](https://github.com/adrienco88))



## [v1.9.0](https://github.com/gitbrent/pptxgenjs/tree/v1.9.0) (2017-10-10)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ slide.addText([ {text:'TEXT', options:{OPTIONS}} ]);
| `rectRadius` | number | inches | | rounding radius | rounding radius for `ROUNDED_RECTANGLE` text shapes |
| `rtlMode` | boolean | | `false` | enable Right-to-Left mode | `true` or `false` |
| `shadow` | object | | | text shadow options | see options below. Ex: `shadow:{ type:'outer' }` |
| `strike` | boolean | | `false` | text strikethrough | `true` or `false` |
| `subscript` | boolean | | `false` | subscript text | `true` or `false` |
| `superscript`| boolean | | `false` | superscript text | `true` or `false` |
| `underline` | boolean | | `false` | underline text | `true` or `false` |
Expand Down
1 change: 1 addition & 0 deletions dist/pptxgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3755,6 +3755,7 @@ var PptxGenJS = function(){
startInfo += ( opts.bold ? ' b="1"' : '' );
startInfo += ( opts.font_size ? ' sz="'+ Math.round(opts.font_size) +'00"' : '' ); // NOTE: Use round so sizes like '7.5' wont cause corrupt pres.
startInfo += ( opts.italic ? ' i="1"' : '' );
startInfo += ( opts.strike ? ' strike="sngStrike"' : '' );
startInfo += ( opts.underline || opts.hyperlink ? ' u="sng"' : '' );
startInfo += ( opts.subscript ? ' baseline="-40000"' : (opts.superscript ? ' baseline="30000"' : '') );
// not doc in API yet: startInfo += ( opts.char_spacing ? ' spc="' + (text_info.char_spacing * 100) + '" kern="0"' : '' ); // IMPORTANT: Also disable kerning; otherwise text won't actually expand
Expand Down
4 changes: 2 additions & 2 deletions examples/pptxgenjs-demo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* NAME: pptxgenjs-demo.js
* AUTH: Brent Ely (https://github.com/gitbrent/)
* DATE: Nov 13, 2017
* DATE: Nov 14, 2017
* DESC: Common test/demo slides for all library features
* DEPS: Loaded by `pptxgenjs-demo.js` and `nodejs-demo.js`
*/
Expand Down Expand Up @@ -2156,7 +2156,7 @@ function genSlides_Text(pptx) {
{ text:'1st\nline',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' } },
{ text:'4th line', options:{ font_size:38, font_face:'Arial', color:'FFFF00', align:'c' } },
{ text:'4th line', options:{ font_size:38, font_face:'Arial', color:'FFFF00', align:'c', strike:true } },
{ text:'5th\nline',options:{ font_size:36, font_face:'Courier New', color:'99ABCC', align:'r' } }
],
{ x:0.5, y:0.85, w:6, h:4, margin:0.1, fill:'232323' }
Expand Down

0 comments on commit f595564

Please sign in to comment.