SkOTTable_post.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2012 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 SkOTTable_post_DEFINED
  8. #define SkOTTable_post_DEFINED
  9. #include "src/core/SkEndian.h"
  10. #include "src/sfnt/SkOTTableTypes.h"
  11. #pragma pack(push, 1)
  12. struct SkOTTablePostScript {
  13. static const SK_OT_CHAR TAG0 = 'p';
  14. static const SK_OT_CHAR TAG1 = 'o';
  15. static const SK_OT_CHAR TAG2 = 's';
  16. static const SK_OT_CHAR TAG3 = 't';
  17. static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTablePostScript>::value;
  18. struct Format {
  19. enum Value : SK_OT_Fixed {
  20. version1 = SkTEndian_SwapBE32(0x00010000),
  21. version2 = SkTEndian_SwapBE32(0x00020000),
  22. version2_5 = SkTEndian_SwapBE32(0x00025000),
  23. version3 = SkTEndian_SwapBE32(0x00030000),
  24. version4 = SkTEndian_SwapBE32(0x00040000),
  25. };
  26. SK_OT_Fixed value;
  27. } format;
  28. SK_OT_Fixed italicAngle;
  29. SK_OT_FWORD underlinePosition;
  30. SK_OT_FWORD underlineThickness;
  31. SK_OT_ULONG isFixedPitch;
  32. SK_OT_ULONG minMemType42;
  33. SK_OT_ULONG maxMemType42;
  34. SK_OT_ULONG minMemType1;
  35. SK_OT_ULONG maxMemType1;
  36. };
  37. #pragma pack(pop)
  38. #include <stddef.h>
  39. static_assert(offsetof(SkOTTablePostScript, maxMemType1) == 28, "SkOTTablePostScript_maxMemType1_not_at_28");
  40. static_assert(sizeof(SkOTTablePostScript) == 32, "sizeof_SkOTTablePostScript_not_32");
  41. #endif