diff -r 77bd78b748cd javafx-font/src/com/sun/t2k/T2KFontFile.java --- a/javafx-font/src/com/sun/t2k/T2KFontFile.java Fri Jan 18 14:52:07 2013 -0500 +++ b/javafx-font/src/com/sun/t2k/T2KFontFile.java Fri Jan 18 15:05:22 2013 -0800 @@ -690,6 +690,34 @@ throw new Exception("Font name not found."); } + + System.out.println("font name="+fullName + " " + upem + " "); + hhea = readTable(hheaTag);//need to read again cause the inner buffer gets reused + if (hhea != null) { + System.out.println("hhea ascent=" + (hhea.getShort(4))); + System.out.println("hhea descent=" + hhea.getShort(6)); + System.out.println("hhea linegap=" + hhea.getShort(8)); + } + Buffer os_2 = readTable(os_2Tag); + if (os_2 != null && os_2.capacity() >= 88) { + System.out.println("os_2 TypoAscender=" + (os_2.getShort(68))); + System.out.println("os_2 TypoDescender=" + (os_2.getShort(70))); + System.out.println("os_2 TypoLineGap=" + os_2.getShort(72)); + System.out.println("os_2 WinAscent=" + os_2.getShort(74)); + System.out.println("os_2 WinDescent=" + os_2.getShort(76)); + System.out.println("os_2 xHeight=" + os_2.getShort(86)); + System.out.println("os_2 CapHeight=" + os_2.getShort(88)); + +// ascent = -(float)os_2.getShort(68); +// descent = -(float)os_2.getShort(70); +// linegap = (float)os_2.getShort(72); + float deltaA = (float)hhea.getShort(4) - (float)os_2.getShort(68); //positives + float deltaD = (float)hhea.getShort(6) - (float)os_2.getShort(70); //negatives + float delta = (deltaA + deltaD) / 2; + System.out.println("adding delta of " + delta); + descent += delta; + } + /* update the font resource only if the file was decoded * and initialized successfully. */