Permalink
Browse files

Fix for OS/2 blocks with 0 for ascent/descent/line_gap.

  • Loading branch information...
CodeMonkeySteve authored and bradediger committed Dec 16, 2010
1 parent b48c1e4 commit 1d488ac32e588089bee6a4b90c24dff09a04845c
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/ttfunk.rb
View
@@ -22,15 +22,15 @@ def initialize(contents)
def ascent
- @ascent ||= os2.exists? && os2.ascent || horizontal_header.ascent
+ @ascent ||= (os2.exists? && os2.ascent && os2.ascent.nonzero?) || horizontal_header.ascent
end
def descent
- @descent ||= os2.exists? && os2.descent || horizontal_header.descent
+ @descent ||= (os2.exists? && os2.descent && os2.descent.nonzero?) || horizontal_header.descent
end
def line_gap
- @line_gap ||= os2.exists? && os2.line_gap || horizontal_header.line_gap
+ @line_gap ||= (os2.exists? && os2.line_gap && os2.line_gap.nonzero?) || horizontal_header.line_gap
end
def bbox

0 comments on commit 1d488ac

Please sign in to comment.