aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-01 19:36:05 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-01 19:36:05 +0000
commitc3b80ba50a494efdf6505585dc32dbe7422d5555 (patch)
tree132eff76deb3d50b8d802ef6dd646930141dfbd9
parent7e5c6249f18d80553183de050948befaf6e90c6a (diff)
read/write sfnt-data length, to match convetion of other fonthosts.
TODO: move that "convention" into shared code (SkTypeface.cpp or SkFontHost.cpp) and just require each port to support: 1. typeface <--> descriptor 2. typeface_raw_data <--> stream (possibly with algo-style flags) git-svn-id: http://skia.googlecode.com/svn/trunk@4125 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/ports/SkFontHost_mac_coretext.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp
index f49185fb34..118ef50edc 100644
--- a/src/ports/SkFontHost_mac_coretext.cpp
+++ b/src/ports/SkFontHost_mac_coretext.cpp
@@ -1858,11 +1858,20 @@ void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
desc.setPostscriptName(get_str(CTFontCopyPostScriptName(ctFont), &tmpStr));
desc.serialize(stream);
+
+ // by convention, we also write out the actual sfnt data, preceeded by
+ // a packed-length. For now we skip that, so we just write the zero.
+ stream->writePackedUInt(0);
}
SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
SkFontDescriptor desc(stream);
+ // by convention, Serialize will have also written the actual sfnt data.
+ // for now, we just want to skip it.
+ size_t size = stream->readPackedUInt();
+ stream->skip(size);
+
return SkFontHost::CreateTypeface(NULL, desc.getFamilyName(),
desc.getStyle());
}