aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/skpinfo.cpp')
-rw-r--r--tools/skpinfo.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/skpinfo.cpp b/tools/skpinfo.cpp
index c7fd8c8708..4b65cb8a8c 100644
--- a/tools/skpinfo.cpp
+++ b/tools/skpinfo.cpp
@@ -9,6 +9,7 @@
#include "SkPicture.h"
#include "SkPictureData.h"
#include "SkStream.h"
+#include "SkFontDescriptor.h"
DEFINE_string2(input, i, "", "skp on which to report");
DEFINE_bool2(version, v, true, "version");
@@ -107,13 +108,26 @@ int tool_main(int argc, char** argv) {
SkDebugf("SK_PICT_FACTORY_TAG %d\n", chunkSize);
}
break;
- case SK_PICT_TYPEFACE_TAG:
+ case SK_PICT_TYPEFACE_TAG: {
if (FLAGS_tags && !FLAGS_quiet) {
SkDebugf("SK_PICT_TYPEFACE_TAG %d\n", chunkSize);
- SkDebugf("Exiting early due to format limitations\n");
}
- return kSuccess; // TODO: need to store size in bytes
+
+ const int count = SkToInt(chunkSize);
+ for (int i = 0; i < count; i++) {
+ SkFontDescriptor desc;
+ if (!SkFontDescriptor::Deserialize(&stream, &desc)) {
+ if (!FLAGS_quiet) {
+ SkDebugf("File corruption in SkFontDescriptor\n");
+ }
+ return kInvalidTag;
+ }
+ }
+
+ // clear this since we've consumed all the typefaces
+ chunkSize = 0;
break;
+ }
case SK_PICT_PICTURE_TAG:
if (FLAGS_tags && !FLAGS_quiet) {
SkDebugf("SK_PICT_PICTURE_TAG %d\n", chunkSize);