add SkSfntUtils to parse some known truetype tables
add comments and cleanup to count_tables in SkFontHost_tables.cpp
fix transparency bug in gifs
use (alpha+1) for blending in srcover mode, to ensure opaque results
git-svn-id: http://skia.googlecode.com/svn/trunk@155 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp
index adbd962..ebd2b33 100644
--- a/bench/TextBench.cpp
+++ b/bench/TextBench.cpp
@@ -3,6 +3,7 @@
#include "SkFontHost.h"
#include "SkPaint.h"
#include "SkRandom.h"
+#include "SkSfntUtils.h"
#include "SkString.h"
#include "SkTemplates.h"
@@ -22,6 +23,22 @@
uint8_t(tag>>24), uint8_t(tag>>16), uint8_t(tag>>8), uint8_t(tag),
size, bytes, data[0], data[1], data[2], data[3]);
}
+
+ SkSfntTable_head head;
+ if (SkSfntUtils::ReadTable_head(fontID, &head)) {
+ SkDebugf("--- head: version=%x magic=%x upem=%d style=%x\n", head.fVersion,
+ head.fMagicNumber, head.fUnitsPerEm, head.fMacStyle);
+ } else {
+ SkDebugf("------- head wasn't read\n");
+ }
+
+ SkSfntTable_maxp maxp;
+ if (SkSfntUtils::ReadTable_maxp(fontID, &maxp)) {
+ SkDebugf("--- maxp: version=%x glyphs=%d points=%d ctrs=%d\n", maxp.fVersion,
+ maxp.fNumGlyphs, maxp.fMaxPoints, maxp.fMaxContours);
+ } else {
+ SkDebugf("------- maxp wasn't read\n");
+ }
}
static void test_tables() {