Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created January 17, 2009 23:43
Show Gist options
  • Select an option

  • Save practicingruby/48491 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/48491 to your computer and use it in GitHub Desktop.
# === Text Positioning Details:
#
# When using the :at parameter, Prawn will position your text by its
# baseline, and flow along a single line.
#
# When using automatic text flow, Prawn currently does a bunch of nasty
# hacks to get things to position nicely in bounding boxes, table cells,
# etc.
#
# For AFM fonts, the first line of text is positioned font.height below
# the baseline.
#
# For TTF fonts, the first line is possitioned font.ascender below the
# baseline.
#
# The issue here is that there are complex issues with determining the
# size of the glyphs above and below the baseline in TTF that we haven't
# figured out yet, and that AFM and TTF appear to handle things very
# differently.
#
# The moral of the story is that if you want reliable font positioning
# for your advanced needs, use :at, otherwise, just let Prawn do its
# positioning magic for you, or investigate and help us get rid of this
# ugly issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment