Skip to content

Issue using colon character ":" with fontkit and Noto Sans CJK font #472

@mmejia27

Description

@mmejia27

Coming over from fontkit (foliojs/fontkit#23), since we determined that the issue most likely lies in pdfkit.

Using the colon character causes many of the characters to not be displayed in the resulting PDF. As soon as the colon is removed, the characters are displayed without an issue.

Below is a snippet that reproduces the issue. I used a local module to reference the fontkit branch of pdfkit.

var PDFDocument = require('../pdfkit');
var fs = require('fs');

var pdfFile = 'test.pdf';
var fontFile = 'NotoSansCJKsc-Regular.otf';
var doc = new PDFDocument({  bufferPages: true });
var pdfStream = fs.createWriteStream(pdfFile);
doc.pipe(pdfStream);

doc.fontSize(12)
   .font(fontFile)
   .text("This is a test: The quick brown fox jumps over the lazy dog.");

doc.end();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions