Skip to content

Commit

Permalink
Fixed font family and size on print
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed May 23, 2017
1 parent 8956ff3 commit a653fe5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions web/client/components/print/Font.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Font = React.createClass({
fonts: React.PropTypes.array,
label: React.PropTypes.string,
onChangeFamily: React.PropTypes.func,
onChangeName: React.PropTypes.func,
onChangeSize: React.PropTypes.func,
onChangeBold: React.PropTypes.func,
onChangeItalic: React.PropTypes.func,
Expand All @@ -28,6 +29,7 @@ const Font = React.createClass({
fonts: ['Verdana', 'Serif', 'SansSerif', 'Arial', 'Courier New', 'Tahoma', 'Times New Roman'],
label: 'Font',
onChangeFamily: () => {},
onChangeName: () => {},
onChangeSize: () => {},
family: '',
size: 8,
Expand All @@ -37,9 +39,10 @@ const Font = React.createClass({
},
onChangeFamily(family) {
this.props.onChangeFamily(family);
this.props.onChangeName(family);
},
onChangeSize(size) {
this.props.onChangeSize(size);
onChangeSize(e) {
this.props.onChangeSize(parseFloat(e.target.value));
},
render() {
return (
Expand Down
1 change: 1 addition & 0 deletions web/client/plugins/print/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const Font = connect((state) => ({
italic: state.print && state.print.spec && state.print.spec.italic
}), {
onChangeFamily: setPrintParameter.bind(null, 'fontFamily'),
onChangeName: setPrintParameter.bind(null, 'fontName'),
onChangeSize: setPrintParameter.bind(null, 'fontSize'),
onChangeBold: setPrintParameter.bind(null, 'bold'),
onChangeItalic: setPrintParameter.bind(null, 'italic')
Expand Down
2 changes: 1 addition & 1 deletion web/client/utils/PrintUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const PrintUtils = {
width: spec.iconSize,
minSymbolSize: spec.iconSize,
fontFamily: spec.fontFamily,
LEGEND_OPTIONS: "forceLabels:" + (spec.forceLabels ? "on" : "") + ";fontAntialiasing:" + spec.antiAliasing + ";dpi:" + spec.legendDpi + ";fontStyle:" + (spec.bold && "bold" || (spec.italic && "italic") || ''),
LEGEND_OPTIONS: "forceLabels:" + (spec.forceLabels ? "on" : "") + ";fontAntialiasing:" + spec.antiAliasing + ";dpi:" + spec.legendDpi + ";fontStyle:" + (spec.bold && "bold" || (spec.italic && "italic") || '') + ";fontName:" + spec.fontFamily + ";fontSize:" + spec.fontSize,
format: "image/png",
...assign({}, layer.params)
}
Expand Down

0 comments on commit a653fe5

Please sign in to comment.