Skip to content

Underline y-position wrong for baseline "alphabetic" #994

Open
@GeorgeP39

Description

@GeorgeP39

Underline y-position wrong for baseline "alphabetic"

When setting the baseline to "alphabetic", underlines are drawn too far from the text

Code sample

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

doc
  .font('Times-Roman', 13)
  .text(lorem, {
    width: 412,
    align: 'justify',
    indent: 30,
    columns: 2,
    height: 300,
    underline:true,
    baseline: "alphabetic"
  });

// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});

underlineOffset

Your environment

  • pdfkit version: 0.10.0
  • Node version: N/A
  • Browser version (if applicable): N/A
  • Operating System: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions