Skip to content

fully embedding a font breaks text alignment #1383

@smithtim

Description

@smithtim

MWE below. When subsetting is on, justified alignment works and lines up the text on both sides. When subsetting is off, the text is not aligned on the right, only on the left.

require 'prawn'

def make_pdf filename, subset:
  Prawn::Document.generate(filename) {
    font_path = 'path to your font'
    font font_path, subset: subset
    stroke_bounds

    s = 'The quick brown fox jumps over the lazy dog. '
    text s*10, align: :justify
  }
end

make_pdf 'subset_true.pdf', subset: true
make_pdf 'subset_false.pdf', subset: false

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