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