Commit f07a3ace by ramdayalmunda

handled italics on PDF

parent c1280274
...@@ -26,9 +26,8 @@ ...@@ -26,9 +26,8 @@
position: absolute; position: absolute;
z-index: 100; z-index: 100;
background-color: #f5f5f5; background-color: #f5f5f5;
padding: 5px;
border-radius: 5px; border-radius: 5px;
height: 300px; max-height: 300px;
overflow: auto; overflow: auto;
top: 100%; top: 100%;
} }
......
...@@ -426,7 +426,9 @@ var ADocEditor = function (customConfig) { ...@@ -426,7 +426,9 @@ var ADocEditor = function (customConfig) {
} }
ctx.save() ctx.save()
ctx.fillStyle = `${style.fontColor}` ctx.fillStyle = `${style.fontColor}`
ctx.font = `${style.bold ? 'bold ' : ''}${style.italic ? 'italic ' : ''} ${style.fontSize * config.pageSetup.fontMultiplier}px ${style.fontFamily}` // 10 * Math.PI/180 = 0.174
ctx.setTransform(1, 0.174, 0, 1, 0, 0)
ctx.font = `${style.bold ? 'bold ' : ''} ${style.fontSize * config.pageSetup.fontMultiplier}px ${style.fontFamily}`
ctx.fillText(`${lines[l].listIndex + 1}.`, numberX, y) ctx.fillText(`${lines[l].listIndex + 1}.`, numberX, y)
ctx.restore() ctx.restore()
} }
...@@ -822,6 +824,7 @@ var ADocEditor = function (customConfig) { ...@@ -822,6 +824,7 @@ var ADocEditor = function (customConfig) {
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier, size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
font: embededFonts[style.fontFamily], font: embededFonts[style.fontFamily],
color: rgb( ...getRgbArrayFromHex( style.fontColor ) ), color: rgb( ...getRgbArrayFromHex( style.fontColor ) ),
ySkew: { type: 'radians', angle: style.italic?0.174:0 },
}) })
setData.formatedText[c].x = x setData.formatedText[c].x = x
setData.formatedText[c].y = y setData.formatedText[c].y = y
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment