Skip to content

Page break created for each table for some fonts when vertical_padding is small #19

Description

@practicingruby

Reported by Simon Hürlimann:

There's some regression in drawing tables.
When using a small vertical_padding (like 0 or 1), a page break is inserted after each cell. Cell borders are on the previous page than the content, though.

It looks like the commit to prawn-core 63dd5c8 (Don't let descender protrude below bounds bottom. This is a change from pre-text-overhaul functionality.) seems to have introduced this behaviour.

You may reproduce ith git versions
prawn-layout c13d2ce - Really fixing this now prawn-core 63dd5c8 - Don't let descender protrude below bounds bottom. This is a change from pre-text-overhaul functionality.

this wraps page for every cell for default font:
pdf.table([['Test', 'Val'], ['Test', 'Val']], :vertical_padding => 1)

It got somehow better during the development towards 0.7.1. The problem doesn't show anymore with the default font, but can still be triggered by some other fonts and smaller vertical_padding. I've experienced it with some proprietary TTF font called "Cholla Sans" with vertical_padding = 1. It also shows with the free TTF font "DejaVu Sans" and the built in font "Times-Roman" and vertical_padding = 0.

With
prawn-layout 0.7.1 prawn-core 0.7.1

it works for the default font, but still wraps for every cell for "Cholla" font with padding => 1 and "DejaVuSans", "Times-Roman" with padding => 0:
pdf.font('Times-Roman') pdf.table([['Test', 'Val'], ['Test', 'Val']], :vertical_padding => 0)

Minimal reproducing example:

  require 'prawn/core'
  require 'prawn/layout'

  pdf = Prawn::Document.new
  pdf.font('Times-Roman')
  pdf.table([['Test', 'Val'], ['Test', 'Val']], :vertical_padding => 0)
  pdf.render_file('test.pdf')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions