SkTTCFHeader.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2013 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkTTCFHeader_DEFINED
  8. #define SkTTCFHeader_DEFINED
  9. #include "src/sfnt/SkOTTableTypes.h"
  10. #include "src/sfnt/SkSFNTHeader.h"
  11. #pragma pack(push, 1)
  12. struct SkTTCFHeader {
  13. SK_SFNT_ULONG ttcTag;
  14. static const SK_OT_CHAR TAG0 = 't';
  15. static const SK_OT_CHAR TAG1 = 't';
  16. static const SK_OT_CHAR TAG2 = 'c';
  17. static const SK_OT_CHAR TAG3 = 'f';
  18. static const SK_OT_ULONG TAG = SkOTTableTAG<SkTTCFHeader>::value;
  19. SK_OT_Fixed version;
  20. static const SK_OT_Fixed version_1 = SkTEndian_SwapBE32(1 << 16);
  21. static const SK_OT_Fixed version_2 = SkTEndian_SwapBE32(2 << 16);
  22. SK_OT_ULONG numOffsets;
  23. //SK_OT_ULONG offset[numOffsets]
  24. struct Version2Ext {
  25. SK_OT_ULONG dsigType;
  26. struct dsigType_None {
  27. static const SK_OT_CHAR TAG0 = 0;
  28. static const SK_OT_CHAR TAG1 = 0;
  29. static const SK_OT_CHAR TAG2 = 0;
  30. static const SK_OT_CHAR TAG3 = 0;
  31. static const SK_OT_ULONG TAG = SkOTTableTAG<dsigType_None>::value;
  32. };
  33. struct dsigType_Format1 {
  34. static const SK_OT_CHAR TAG0 = 'D';
  35. static const SK_OT_CHAR TAG1 = 'S';
  36. static const SK_OT_CHAR TAG2 = 'I';
  37. static const SK_OT_CHAR TAG3 = 'G';
  38. static const SK_OT_ULONG TAG = SkOTTableTAG<dsigType_Format1>::value;
  39. };
  40. SK_OT_ULONG dsigLength; //Length of DSIG table (in bytes).
  41. SK_OT_ULONG dsigOffset; //Offset of DSIG table from the beginning of file (in bytes).
  42. };// version2ext (if version == version_2)
  43. };
  44. #pragma pack(pop)
  45. static_assert(sizeof(SkTTCFHeader) == 12, "sizeof_SkTTCFHeader_not_12");
  46. #endif