SkPanose.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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 SkPanose_DEFINED
  8. #define SkPanose_DEFINED
  9. #include "src/sfnt/SkOTTableTypes.h"
  10. #pragma pack(push, 1)
  11. struct SkPanose {
  12. //This value changes the meaning of the following 9 bytes.
  13. enum class FamilyType : SK_OT_BYTE {
  14. Any = 0,
  15. NoFit = 1,
  16. TextAndDisplay = 2,
  17. Script = 3,
  18. Decorative = 4,
  19. Pictoral = 5,
  20. } bFamilyType;
  21. union Data {
  22. struct TextAndDisplay {
  23. enum class SerifStyle : SK_OT_BYTE {
  24. Any = 0,
  25. NoFit = 1,
  26. Cove = 2,
  27. ObtuseCove = 3,
  28. SquareCove = 4,
  29. ObtuseSquareCove = 5,
  30. Square = 6,
  31. Thin = 7,
  32. Bone = 8,
  33. Exaggerated = 9,
  34. Triangle = 10,
  35. NormalSans = 11,
  36. ObtuseSans = 12,
  37. PerpSans = 13,
  38. Flared = 14,
  39. Rounded = 15,
  40. } bSerifStyle;
  41. enum class Weight : SK_OT_BYTE {
  42. Any = 0,
  43. NoFit = 1,
  44. VeryLight = 2,
  45. Light = 3,
  46. Thin = 4,
  47. Book = 5,
  48. Medium = 6,
  49. Demi = 7,
  50. Bold = 8,
  51. Heavy = 9,
  52. Black = 10,
  53. ExtraBlack = 11,
  54. } bWeight;
  55. enum class Proportion : SK_OT_BYTE {
  56. Any = 0,
  57. NoFit = 1,
  58. OldStyle = 2,
  59. Modern = 3,
  60. EvenWidth = 4,
  61. Expanded = 5,
  62. Condensed = 6,
  63. VeryExpanded = 7,
  64. VeryCondensed = 8,
  65. Monospaced = 9,
  66. } bProportion;
  67. enum class Contrast : SK_OT_BYTE {
  68. Any = 0,
  69. NoFit = 1,
  70. None = 2,
  71. VeryLow = 3,
  72. Low = 4,
  73. MediumLow = 5,
  74. Medium = 6,
  75. MediumHigh = 7,
  76. High = 8,
  77. VeryHigh = 9,
  78. } bContrast;
  79. #ifdef SK_WIN_PANOSE
  80. //This is what Windows (and FontForge and Apple TT spec) define.
  81. //The Impact font uses 9.
  82. enum class StrokeVariation : SK_OT_BYTE {
  83. Any = 0,
  84. NoFit = 1,
  85. GradualDiagonal = 2,
  86. GradualTransitional = 3,
  87. GradualVertical = 4,
  88. GradualHorizontal = 5,
  89. RapidVertical = 6,
  90. RapidHorizontal = 7,
  91. InstantVertical = 8,
  92. } bStrokeVariation;
  93. #else
  94. //Stroke variation description in OT OS/2 ver0,ver1 is incorrect.
  95. //This is what HP Panose says.
  96. enum class StrokeVariation : SK_OT_BYTE {
  97. Any = 0,
  98. NoFit = 1,
  99. NoVariation = 2,
  100. Gradual_Diagonal = 3,
  101. Gradual_Transitional = 4,
  102. Gradual_Vertical = 5,
  103. Gradual_Horizontal = 6,
  104. Rapid_Vertical = 7,
  105. Rapid_Horizontal = 8,
  106. Instant_Vertical = 9,
  107. Instant_Horizontal = 10,
  108. } bStrokeVariation;
  109. #endif
  110. enum class ArmStyle : SK_OT_BYTE {
  111. Any = 0,
  112. NoFit = 1,
  113. StraightArms_Horizontal = 2,
  114. StraightArms_Wedge = 3,
  115. StraightArms_Vertical = 4,
  116. StraightArms_SingleSerif = 5,
  117. StraightArms_DoubleSerif = 6,
  118. NonStraightArms_Horizontal = 7,
  119. NonStraightArms_Wedge = 8,
  120. NonStraightArms_Vertical = 9,
  121. NonStraightArms_SingleSerif = 10,
  122. NonStraightArms_DoubleSerif = 11,
  123. } bArmStyle;
  124. enum class Letterform : SK_OT_BYTE {
  125. Any = 0,
  126. NoFit = 1,
  127. Normal_Contact = 2,
  128. Normal_Weighted = 3,
  129. Normal_Boxed = 4,
  130. Normal_Flattened = 5,
  131. Normal_Rounded = 6,
  132. Normal_OffCenter = 7,
  133. Normal_Square = 8,
  134. Oblique_Contact = 9,
  135. Oblique_Weighted = 10,
  136. Oblique_Boxed = 11,
  137. Oblique_Flattened = 12,
  138. Oblique_Rounded = 13,
  139. Oblique_OffCenter = 14,
  140. Oblique_Square = 15,
  141. } bLetterform;
  142. enum class Midline : SK_OT_BYTE {
  143. Any = 0,
  144. NoFit = 1,
  145. Standard_Trimmed = 2,
  146. Standard_Pointed = 3,
  147. Standard_Serifed = 4,
  148. High_Trimmed = 5,
  149. High_Pointed = 6,
  150. High_Serifed = 7,
  151. Constant_Trimmed = 8,
  152. Constant_Pointed = 9,
  153. Constant_Serifed = 10,
  154. Low_Trimmed = 11,
  155. Low_Pointed = 12,
  156. Low_Serifed = 13,
  157. } bMidline;
  158. enum class XHeight : SK_OT_BYTE {
  159. Any = 0,
  160. NoFit = 1,
  161. Constant_Small = 2,
  162. Constant_Standard = 3,
  163. Constant_Large = 4,
  164. Ducking_Small = 5,
  165. Ducking_Standard = 6,
  166. Ducking_Large = 7,
  167. } bXHeight;
  168. } textAndDisplay;
  169. struct Script {
  170. enum class ToolKind : SK_OT_BYTE {
  171. Any = 0,
  172. NoFit = 1,
  173. FlatNib = 2,
  174. PressurePoint = 3,
  175. Engraved = 4,
  176. Ball = 5,
  177. Brush = 6,
  178. Rough = 7,
  179. FeltPen = 8,
  180. WildBrush = 9,
  181. } bToolKind;
  182. enum class Weight : SK_OT_BYTE {
  183. Any = 0,
  184. NoFit = 1,
  185. VeryLight = 2,
  186. Light = 3,
  187. Thin = 4,
  188. Book = 5,
  189. Medium = 6,
  190. Demi = 7,
  191. Bold = 8,
  192. Heavy = 9,
  193. Black = 10,
  194. ExtraBlack = 11,
  195. } bWeight;
  196. enum class Spacing : SK_OT_BYTE {
  197. Any = 0,
  198. NoFit = 1,
  199. ProportionalSpaced = 2,
  200. Monospaced = 3,
  201. } bSpacing;
  202. enum class AspectRatio : SK_OT_BYTE {
  203. Any = 0,
  204. NoFit = 1,
  205. VeryCondensed = 2,
  206. Condensed = 3,
  207. Normal = 4,
  208. Expanded = 5,
  209. VeryExpanded = 6,
  210. } bAspectRatio;
  211. enum class Contrast : SK_OT_BYTE {
  212. Any = 0,
  213. NoFit = 1,
  214. None = 2,
  215. VeryLow = 3,
  216. Low = 4,
  217. MediumLow = 5,
  218. Medium = 6,
  219. MediumHigh = 7,
  220. High = 8,
  221. VeryHigh = 9,
  222. } bContrast;
  223. enum class Topology : SK_OT_BYTE {
  224. Any = 0,
  225. NoFit = 1,
  226. Roman_Disconnected = 2,
  227. Roman_Trailing = 3,
  228. Roman_Connected = 4,
  229. Cursive_Disconnected = 5,
  230. Cursive_Trailing = 6,
  231. Cursive_Connected = 7,
  232. Blackletter_Disconnected = 8,
  233. Blackletter_Trailing = 9,
  234. Blackletter_Connected = 10,
  235. } bTopology;
  236. enum class Form : SK_OT_BYTE {
  237. Any = 0,
  238. NoFit = 1,
  239. Upright_NoWrapping = 2,
  240. Upright_SomeWrapping = 3,
  241. Upright_MoreWrapping = 4,
  242. Upright_ExtremeWrapping = 5,
  243. Oblique_NoWrapping = 6,
  244. Oblique_SomeWrapping = 7,
  245. Oblique_MoreWrapping = 8,
  246. Oblique_ExtremeWrapping = 9,
  247. Exaggerated_NoWrapping = 10,
  248. Exaggerated_SomeWrapping = 11,
  249. Exaggerated_MoreWrapping = 12,
  250. Exaggerated_ExtremeWrapping = 13,
  251. } bForm;
  252. enum class Finials : SK_OT_BYTE {
  253. Any = 0,
  254. NoFit = 1,
  255. None_NoLoops = 2,
  256. None_ClosedLoops = 3,
  257. None_OpenLoops = 4,
  258. Sharp_NoLoops = 5,
  259. Sharp_ClosedLoops = 6,
  260. Sharp_OpenLoops = 7,
  261. Tapered_NoLoops = 8,
  262. Tapered_ClosedLoops = 9,
  263. Tapered_OpenLoops = 10,
  264. Round_NoLoops = 11,
  265. Round_ClosedLoops = 12,
  266. Round_OpenLoops = 13,
  267. } bFinials;
  268. enum class XAscent : SK_OT_BYTE {
  269. Any = 0,
  270. NoFit = 1,
  271. VeryLow = 2,
  272. Low = 3,
  273. Medium = 4,
  274. High = 5,
  275. VeryHigh = 6,
  276. } bXAscent;
  277. } script;
  278. struct Decorative {
  279. enum class Class : SK_OT_BYTE {
  280. Any = 0,
  281. NoFit = 1,
  282. Derivative = 2,
  283. NonStandard_Topology = 3,
  284. NonStandard_Elements = 4,
  285. NonStandard_Aspect = 5,
  286. Initials = 6,
  287. Cartoon = 7,
  288. PictureStems = 8,
  289. Ornamented = 9,
  290. TextAndBackground = 10,
  291. Collage = 11,
  292. Montage = 12,
  293. } bClass;
  294. enum class Weight : SK_OT_BYTE {
  295. Any = 0,
  296. NoFit = 1,
  297. VeryLight = 2,
  298. Light = 3,
  299. Thin = 4,
  300. Book = 5,
  301. Medium = 6,
  302. Demi = 7,
  303. Bold = 8,
  304. Heavy = 9,
  305. Black = 10,
  306. ExtraBlack = 11,
  307. } bWeight;
  308. enum class Aspect : SK_OT_BYTE {
  309. Any = 0,
  310. NoFit = 1,
  311. SuperCondensed = 2,
  312. VeryCondensed = 3,
  313. Condensed = 4,
  314. Normal = 5,
  315. Extended = 6,
  316. VeryExtended = 7,
  317. SuperExtended = 8,
  318. Monospaced = 9,
  319. } bAspect;
  320. enum class Contrast : SK_OT_BYTE {
  321. Any = 0,
  322. NoFit = 1,
  323. None = 2,
  324. VeryLow = 3,
  325. Low = 4,
  326. MediumLow = 5,
  327. Medium = 6,
  328. MediumHigh = 7,
  329. High = 8,
  330. VeryHigh = 9,
  331. HorizontalLow = 10,
  332. HorizontalMedium = 11,
  333. HorizontalHigh = 12,
  334. Broken = 13,
  335. } bContrast;
  336. enum class SerifVariant : SK_OT_BYTE {
  337. Any = 0,
  338. NoFit = 1,
  339. Cove = 2,
  340. ObtuseCove = 3,
  341. SquareCove = 4,
  342. ObtuseSquareCove = 5,
  343. Square = 6,
  344. Thin = 7,
  345. Oval = 8,
  346. Exaggerated = 9,
  347. Triangle = 10,
  348. NormalSans = 11,
  349. ObtuseSans = 12,
  350. PerpendicularSans = 13,
  351. Flared = 14,
  352. Rounded = 15,
  353. Script = 16,
  354. } bSerifVariant;
  355. enum class Treatment : SK_OT_BYTE {
  356. Any = 0,
  357. NoFit = 1,
  358. None_StandardSolidFill = 2,
  359. White_NoFill = 3,
  360. PatternedFill = 4,
  361. ComplexFill = 5,
  362. ShapedFill = 6,
  363. DrawnDistressed = 7,
  364. } bTreatment;
  365. enum class Lining : SK_OT_BYTE {
  366. Any = 0,
  367. NoFit = 1,
  368. None = 2,
  369. Inline = 3,
  370. Outline = 4,
  371. Engraved = 5,
  372. Shadow = 6,
  373. Relief = 7,
  374. Backdrop = 8,
  375. } bLining;
  376. enum class Topology : SK_OT_BYTE {
  377. Any = 0,
  378. NoFit = 1,
  379. Standard = 2,
  380. Square = 3,
  381. MultipleSegment = 4,
  382. DecoWacoMidlines = 5,
  383. UnevenWeighting = 6,
  384. DiverseArms = 7,
  385. DiverseForms = 8,
  386. LombardicForms = 9,
  387. UpperCaseInLowerCase = 10,
  388. ImpliedTopology = 11,
  389. HorseshoeEandA = 12,
  390. Cursive = 13,
  391. Blackletter = 14,
  392. SwashVariance = 15,
  393. } bTopology;
  394. enum class RangeOfCharacters : SK_OT_BYTE {
  395. Any = 0,
  396. NoFit = 1,
  397. ExtendedCollection = 2,
  398. Litterals = 3,
  399. NoLowerCase = 4,
  400. SmallCaps = 5,
  401. } bRangeOfCharacters;
  402. } decorative;
  403. struct Pictoral {
  404. enum class Kind : SK_OT_BYTE {
  405. Any = 0,
  406. NoFit = 1,
  407. Montages = 2,
  408. Pictures = 3,
  409. Shapes = 4,
  410. Scientific = 5,
  411. Music = 6,
  412. Expert = 7,
  413. Patterns = 8,
  414. Boarders = 9,
  415. Icons = 10,
  416. Logos = 11,
  417. IndustrySpecific = 12,
  418. } bKind;
  419. enum class Weight : SK_OT_BYTE {
  420. NoFit = 1,
  421. } bWeight;
  422. enum class Spacing : SK_OT_BYTE {
  423. Any = 0,
  424. NoFit = 1,
  425. ProportionalSpaced = 2,
  426. Monospaced = 3,
  427. } bSpacing;
  428. enum class AspectRatioAndContrast : SK_OT_BYTE {
  429. NoFit = 1,
  430. } bAspectRatioAndContrast;
  431. enum class AspectRatio94 : SK_OT_BYTE {
  432. Any = 0,
  433. NoFit = 1,
  434. NoWidth = 2,
  435. ExceptionallyWide = 3,
  436. SuperWide = 4,
  437. VeryWide = 5,
  438. Wide = 6,
  439. Normal = 7,
  440. Narrow = 8,
  441. VeryNarrow = 9,
  442. } bAspectRatio94;
  443. enum class AspectRatio119 : SK_OT_BYTE {
  444. Any = 0,
  445. NoFit = 1,
  446. NoWidth = 2,
  447. ExceptionallyWide = 3,
  448. SuperWide = 4,
  449. VeryWide = 5,
  450. Wide = 6,
  451. Normal = 7,
  452. Narrow = 8,
  453. VeryNarrow = 9,
  454. } bAspectRatio119;
  455. enum class AspectRatio157 : SK_OT_BYTE {
  456. Any = 0,
  457. NoFit = 1,
  458. NoWidth = 2,
  459. ExceptionallyWide = 3,
  460. SuperWide = 4,
  461. VeryWide = 5,
  462. Wide = 6,
  463. Normal = 7,
  464. Narrow = 8,
  465. VeryNarrow = 9,
  466. } bAspectRatio157;
  467. enum class AspectRatio163 : SK_OT_BYTE {
  468. Any = 0,
  469. NoFit = 1,
  470. NoWidth = 2,
  471. ExceptionallyWide = 3,
  472. SuperWide = 4,
  473. VeryWide = 5,
  474. Wide = 6,
  475. Normal = 7,
  476. Narrow = 8,
  477. VeryNarrow = 9,
  478. } bAspectRatio163;
  479. } pictoral;
  480. } data;
  481. };
  482. #pragma pack(pop)
  483. static_assert(sizeof(SkPanose) == 10, "sizeof_SkPanose_not_10");
  484. #endif