Enhancement: Add 3 fonts: Courier, Helvetica, Times

master
cuixiping 2020-01-07 17:50:49 +08:00
parent 4a5a24f374
commit c924a120dd
2 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,9 @@ const svgElementToPdf = function (element, pdf, options) {
switch ((node.getAttribute('font-family') || '').toLowerCase()) {
case 'serif': pdf.setFont('times'); break;
case 'monospace': pdf.setFont('courier'); break;
case 'times': pdf.setFont('times'); break;
case 'courier': pdf.setFont('courier'); break;
case 'helvetica': pdf.setFont('helvetica'); break;
default:
node.setAttribute('font-family', 'sans-serif');
pdf.setFont('helvetica');

View File

@ -362,6 +362,9 @@
<li style="font-family:cursive">Cursive</li>
<li style="font-family:fantasy">Fantasy</li>
<li style="font-family:monospace">Monospace</li>
<li style="font-family:courier">Courier</li>
<li style="font-family:helvetica">Helvetica</li>
<li style="font-family:times">Times</li>
</ul>
</div>
</div>