@hxa-rn/react-native-gcanvas 6.0.24-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1280) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +207 -0
  4. package/harmony/gcanvas/LICENSE +21 -0
  5. package/harmony/gcanvas/NOTICE +33 -0
  6. package/harmony/gcanvas/OAT.xml +38 -0
  7. package/harmony/gcanvas/build-profile.json5 +16 -0
  8. package/harmony/gcanvas/consumer-rules.txt +0 -0
  9. package/harmony/gcanvas/hvigorfile.ts +2 -0
  10. package/harmony/gcanvas/index.ets +1 -0
  11. package/harmony/gcanvas/oh-package.json5 +14 -0
  12. package/harmony/gcanvas/src/main/cpp/CMakeLists.txt +126 -0
  13. package/harmony/gcanvas/src/main/cpp/GCanvasEngine.cpp +665 -0
  14. package/harmony/gcanvas/src/main/cpp/GCanvasEngine.h +123 -0
  15. package/harmony/gcanvas/src/main/cpp/GCanvasNapi.cpp +485 -0
  16. package/harmony/gcanvas/src/main/cpp/GCanvasXComponent.cpp +166 -0
  17. package/harmony/gcanvas/src/main/cpp/GcanvasPackage.h +24 -0
  18. package/harmony/gcanvas/src/main/cpp/core/CMakeLists.txt +221 -0
  19. package/harmony/gcanvas/src/main/cpp/core/README.md +1 -0
  20. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/gmanager.cpp +69 -0
  21. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/gmanager.h +34 -0
  22. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/jsc/weexjsc.h +14 -0
  23. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/util/auto_ptr.h +110 -0
  24. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/util/i_delete.h +23 -0
  25. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/util/ref_count.h +34 -0
  26. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/view/GcanvasWeexOhos.cpp +28 -0
  27. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/view/GcanvasWeexOhos.h +27 -0
  28. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/view/grenderer.cpp +677 -0
  29. package/harmony/gcanvas/src/main/cpp/core/harmony/3d/view/grenderer.h +127 -0
  30. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/LICENSE.TXT +46 -0
  31. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/README +107 -0
  32. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/ftconfig.h +51 -0
  33. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/ftheader.h +836 -0
  34. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/ftmodule.h +33 -0
  35. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/ftoption.h +1030 -0
  36. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/ftstdlib.h +185 -0
  37. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/integer-types.h +250 -0
  38. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/mac-support.h +49 -0
  39. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/config/public-macros.h +138 -0
  40. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/freetype.h +5289 -0
  41. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftadvanc.h +188 -0
  42. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftbbox.h +101 -0
  43. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftbdf.h +212 -0
  44. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftbitmap.h +329 -0
  45. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftbzip2.h +102 -0
  46. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftcache.h +1087 -0
  47. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftchapters.h +168 -0
  48. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftcid.h +167 -0
  49. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftcolor.h +1667 -0
  50. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftdriver.h +1320 -0
  51. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/fterrdef.h +283 -0
  52. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/fterrors.h +296 -0
  53. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftfntfmt.h +93 -0
  54. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftgasp.h +143 -0
  55. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftglyph.h +750 -0
  56. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftgxval.h +354 -0
  57. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftgzip.h +151 -0
  58. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftimage.h +1289 -0
  59. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftincrem.h +348 -0
  60. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftlcdfil.h +323 -0
  61. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftlist.h +296 -0
  62. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftlogging.h +184 -0
  63. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftlzw.h +100 -0
  64. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftmac.h +289 -0
  65. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftmm.h +834 -0
  66. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftmodapi.h +807 -0
  67. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftmoderr.h +204 -0
  68. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftotval.h +206 -0
  69. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftoutln.h +588 -0
  70. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftparams.h +218 -0
  71. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftpfr.h +179 -0
  72. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftrender.h +244 -0
  73. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftsizes.h +159 -0
  74. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftsnames.h +272 -0
  75. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftstroke.h +773 -0
  76. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftsynth.h +104 -0
  77. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftsystem.h +350 -0
  78. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/fttrigon.h +350 -0
  79. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/fttypes.h +617 -0
  80. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ftwinfnt.h +276 -0
  81. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/autohint.h +234 -0
  82. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/cffotypes.h +107 -0
  83. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/cfftypes.h +416 -0
  84. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/compiler-macros.h +343 -0
  85. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftcalc.h +584 -0
  86. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftdebug.h +442 -0
  87. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftdrv.h +289 -0
  88. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftgloadr.h +147 -0
  89. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/fthash.h +135 -0
  90. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftmemory.h +401 -0
  91. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftmmtypes.h +91 -0
  92. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftobjs.h +1232 -0
  93. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftpsprop.h +47 -0
  94. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftrfork.h +245 -0
  95. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftserv.h +495 -0
  96. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftstream.h +570 -0
  97. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/fttrace.h +173 -0
  98. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/ftvalid.h +160 -0
  99. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/psaux.h +1447 -0
  100. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/pshints.h +699 -0
  101. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svbdf.h +66 -0
  102. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svcfftl.h +90 -0
  103. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svcid.h +69 -0
  104. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svfntfmt.h +55 -0
  105. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svgldict.h +72 -0
  106. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svgxval.h +72 -0
  107. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svkern.h +51 -0
  108. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svmetric.h +131 -0
  109. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svmm.h +214 -0
  110. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svotval.h +55 -0
  111. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svpfr.h +65 -0
  112. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svpostnm.h +65 -0
  113. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svprop.h +66 -0
  114. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svpscmap.h +145 -0
  115. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svpsinfo.h +86 -0
  116. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svsfnt.h +88 -0
  117. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svttcmap.h +90 -0
  118. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svtteng.h +53 -0
  119. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svttglyf.h +56 -0
  120. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/services/svwinfnt.h +50 -0
  121. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/sfnt.h +1099 -0
  122. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/svginterface.h +46 -0
  123. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/t1types.h +307 -0
  124. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/tttypes.h +1747 -0
  125. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/internal/wofftypes.h +312 -0
  126. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/otsvg.h +336 -0
  127. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/t1tables.h +735 -0
  128. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/ttnameid.h +1235 -0
  129. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/tttables.h +856 -0
  130. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/freetype/tttags.h +124 -0
  131. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/include/ft2build.h +42 -0
  132. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afblue.c +779 -0
  133. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afblue.cin +39 -0
  134. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afblue.dat +1121 -0
  135. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afblue.h +429 -0
  136. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afblue.hin +146 -0
  137. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afcjk.c +2383 -0
  138. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afcjk.h +141 -0
  139. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afcover.h +105 -0
  140. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afdummy.c +77 -0
  141. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afdummy.h +40 -0
  142. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/aferrors.h +42 -0
  143. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afglobal.c +513 -0
  144. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afglobal.h +173 -0
  145. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afhints.c +1796 -0
  146. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afhints.h +467 -0
  147. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afindic.c +157 -0
  148. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afindic.h +41 -0
  149. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/aflatin.c +3643 -0
  150. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/aflatin.h +194 -0
  151. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afloader.c +706 -0
  152. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afloader.h +91 -0
  153. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afmodule.c +527 -0
  154. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afmodule.h +55 -0
  155. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afranges.c +1072 -0
  156. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afranges.h +47 -0
  157. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afscript.h +408 -0
  158. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afshaper.c +690 -0
  159. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afshaper.h +71 -0
  160. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afstyles.h +487 -0
  161. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/aftypes.h +511 -0
  162. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afws-decl.h +33 -0
  163. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/afws-iter.h +31 -0
  164. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/autofit.c +35 -0
  165. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/ft-hb.c +115 -0
  166. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/ft-hb.h +48 -0
  167. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/module.mk +23 -0
  168. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/autofit/rules.mk +88 -0
  169. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftadvanc.c +174 -0
  170. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftbase.c +41 -0
  171. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftbase.h +82 -0
  172. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftbbox.c +542 -0
  173. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftbdf.c +90 -0
  174. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftbitmap.c +1144 -0
  175. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftcalc.c +1126 -0
  176. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftcid.c +117 -0
  177. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftcolor.c +156 -0
  178. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftdbgmem.c +971 -0
  179. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftdebug.c +644 -0
  180. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/fterrors.c +45 -0
  181. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftfntfmt.c +54 -0
  182. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftfstype.c +61 -0
  183. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftgasp.c +60 -0
  184. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftgloadr.c +383 -0
  185. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftglyph.c +911 -0
  186. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftgxval.c +141 -0
  187. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/fthash.c +338 -0
  188. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftinit.c +263 -0
  189. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftlcdfil.c +437 -0
  190. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftmac.c +1099 -0
  191. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftmm.c +704 -0
  192. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftobjs.c +5917 -0
  193. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftotval.c +90 -0
  194. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftoutln.c +1120 -0
  195. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftpatent.c +50 -0
  196. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftpfr.c +152 -0
  197. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftpsprop.c +284 -0
  198. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftrfork.c +934 -0
  199. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftsnames.c +185 -0
  200. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftstream.c +872 -0
  201. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftstroke.c +2403 -0
  202. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftsynth.c +180 -0
  203. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftsystem.c +338 -0
  204. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/fttrigon.c +517 -0
  205. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/fttype1.c +126 -0
  206. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftutil.c +442 -0
  207. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftver.rc +61 -0
  208. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/ftwinfnt.c +52 -0
  209. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/md5.c +291 -0
  210. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/md5.h +45 -0
  211. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/base/rules.mk +108 -0
  212. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/README +152 -0
  213. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdf.c +34 -0
  214. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdf.h +253 -0
  215. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdfdrivr.c +1013 -0
  216. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdfdrivr.h +72 -0
  217. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdferror.h +45 -0
  218. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/bdflib.c +2378 -0
  219. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/module.mk +34 -0
  220. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bdf/rules.mk +84 -0
  221. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bzip2/ftbzip2.c +535 -0
  222. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/bzip2/rules.mk +64 -0
  223. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcache.c +31 -0
  224. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcbasic.c +598 -0
  225. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftccache.c +584 -0
  226. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftccache.h +359 -0
  227. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftccback.h +85 -0
  228. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftccmap.c +323 -0
  229. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcerror.h +42 -0
  230. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcglyph.c +204 -0
  231. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcglyph.h +314 -0
  232. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcimage.c +158 -0
  233. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcimage.h +106 -0
  234. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcmanag.c +677 -0
  235. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcmanag.h +175 -0
  236. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcmru.c +341 -0
  237. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcmru.h +242 -0
  238. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcsbits.c +413 -0
  239. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/ftcsbits.h +91 -0
  240. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cache/rules.mk +85 -0
  241. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cff.c +28 -0
  242. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffcmap.c +230 -0
  243. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffcmap.h +67 -0
  244. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffdrivr.c +1263 -0
  245. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffdrivr.h +35 -0
  246. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cfferrs.h +42 -0
  247. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffgload.c +762 -0
  248. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffgload.h +62 -0
  249. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffload.c +2570 -0
  250. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffload.h +124 -0
  251. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffobjs.c +1175 -0
  252. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffobjs.h +84 -0
  253. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffparse.c +1550 -0
  254. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cffparse.h +144 -0
  255. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/cfftoken.h +150 -0
  256. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/module.mk +23 -0
  257. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cff/rules.mk +75 -0
  258. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/ciderrs.h +41 -0
  259. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidgload.c +618 -0
  260. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidgload.h +58 -0
  261. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidload.c +937 -0
  262. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidload.h +52 -0
  263. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidobjs.c +543 -0
  264. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidobjs.h +154 -0
  265. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidparse.c +311 -0
  266. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidparse.h +130 -0
  267. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidriver.c +274 -0
  268. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidriver.h +36 -0
  269. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/cidtoken.h +115 -0
  270. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/module.mk +23 -0
  271. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/rules.mk +73 -0
  272. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/cid/type1cid.c +28 -0
  273. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/dlg/dlgwrap.c +32 -0
  274. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/dlg/rules.mk +70 -0
  275. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/README +532 -0
  276. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvalid.c +46 -0
  277. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvalid.h +107 -0
  278. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvbsln.c +334 -0
  279. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvcommn.c +1747 -0
  280. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvcommn.h +581 -0
  281. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxverror.h +51 -0
  282. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvfeat.c +339 -0
  283. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvfeat.h +173 -0
  284. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvfgen.c +484 -0
  285. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvjust.c +721 -0
  286. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvkern.c +920 -0
  287. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvlcar.c +224 -0
  288. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmod.c +288 -0
  289. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmod.h +46 -0
  290. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort.c +301 -0
  291. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort.h +99 -0
  292. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort0.c +152 -0
  293. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort1.c +260 -0
  294. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort2.c +312 -0
  295. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort4.c +126 -0
  296. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmort5.c +234 -0
  297. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx.c +199 -0
  298. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx.h +73 -0
  299. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx0.c +112 -0
  300. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx1.c +278 -0
  301. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx2.c +331 -0
  302. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx4.c +56 -0
  303. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvmorx5.c +226 -0
  304. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvopbd.c +218 -0
  305. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvprop.c +330 -0
  306. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/gxvtrak.c +288 -0
  307. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/module.mk +23 -0
  308. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gxvalid/rules.mk +98 -0
  309. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/README.freetype +22 -0
  310. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/adler32.c +168 -0
  311. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/crc32.c +1061 -0
  312. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/crc32.h +9446 -0
  313. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/ftgzip.c +805 -0
  314. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/ftzconf.h +551 -0
  315. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/gzguts.h +218 -0
  316. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inffast.c +320 -0
  317. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inffast.h +11 -0
  318. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inffixed.h +94 -0
  319. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inflate.c +1534 -0
  320. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inflate.h +131 -0
  321. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inftrees.c +299 -0
  322. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/inftrees.h +67 -0
  323. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/patches/freetype-zlib.diff +451 -0
  324. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/rules.mk +81 -0
  325. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/zlib.h +1972 -0
  326. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/zutil.c +305 -0
  327. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/gzip/zutil.h +281 -0
  328. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/lzw/ftlzw.c +415 -0
  329. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/lzw/ftzopen.c +429 -0
  330. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/lzw/ftzopen.h +174 -0
  331. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/lzw/rules.mk +72 -0
  332. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/module.mk +23 -0
  333. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvalid.c +31 -0
  334. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvalid.h +77 -0
  335. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvbase.c +345 -0
  336. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvcommn.c +1099 -0
  337. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvcommn.h +468 -0
  338. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otverror.h +42 -0
  339. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvgdef.c +303 -0
  340. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvgpos.c +1051 -0
  341. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvgpos.h +36 -0
  342. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvgsub.c +627 -0
  343. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvjstf.c +259 -0
  344. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvmath.c +453 -0
  345. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvmod.c +281 -0
  346. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/otvmod.h +38 -0
  347. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/otvalid/rules.mk +81 -0
  348. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/README +96 -0
  349. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/module.mk +34 -0
  350. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcf.c +35 -0
  351. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcf.h +251 -0
  352. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfdrivr.c +836 -0
  353. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfdrivr.h +44 -0
  354. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcferror.h +41 -0
  355. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfread.c +1731 -0
  356. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfread.h +44 -0
  357. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfutil.c +119 -0
  358. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/pcfutil.h +55 -0
  359. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pcf/rules.mk +82 -0
  360. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/module.mk +23 -0
  361. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfr.c +29 -0
  362. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrcmap.c +188 -0
  363. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrcmap.h +45 -0
  364. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrdrivr.c +212 -0
  365. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrdrivr.h +36 -0
  366. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrerror.h +41 -0
  367. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrgload.c +849 -0
  368. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrgload.h +49 -0
  369. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrload.c +1062 -0
  370. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrload.h +123 -0
  371. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrobjs.c +603 -0
  372. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrobjs.h +96 -0
  373. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrsbit.c +813 -0
  374. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrsbit.h +37 -0
  375. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/pfrtypes.h +331 -0
  376. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pfr/rules.mk +76 -0
  377. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/afmparse.c +1094 -0
  378. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/afmparse.h +88 -0
  379. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/cffdecode.c +2411 -0
  380. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/cffdecode.h +63 -0
  381. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/module.mk +23 -0
  382. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psarrst.c +240 -0
  383. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psarrst.h +99 -0
  384. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psaux.c +40 -0
  385. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psauxerr.h +42 -0
  386. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psauxmod.c +190 -0
  387. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psauxmod.h +60 -0
  388. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psblues.c +571 -0
  389. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psblues.h +185 -0
  390. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psconv.c +610 -0
  391. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psconv.h +70 -0
  392. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/pserror.c +52 -0
  393. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/pserror.h +120 -0
  394. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psfixed.h +94 -0
  395. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psfont.c +566 -0
  396. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psfont.h +134 -0
  397. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psft.c +895 -0
  398. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psft.h +167 -0
  399. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psglue.h +144 -0
  400. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/pshints.c +1952 -0
  401. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/pshints.h +288 -0
  402. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psintrp.c +3050 -0
  403. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psintrp.h +83 -0
  404. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psobjs.c +2560 -0
  405. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psobjs.h +312 -0
  406. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psread.c +112 -0
  407. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psread.h +68 -0
  408. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psstack.c +329 -0
  409. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/psstack.h +122 -0
  410. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/pstypes.h +77 -0
  411. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/rules.mk +89 -0
  412. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/t1cmap.c +393 -0
  413. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/t1cmap.h +104 -0
  414. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/t1decode.c +2159 -0
  415. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psaux/t1decode.h +73 -0
  416. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/module.mk +23 -0
  417. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshalgo.c +2191 -0
  418. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshalgo.h +233 -0
  419. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshglob.c +795 -0
  420. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshglob.h +196 -0
  421. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshinter.c +27 -0
  422. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshmod.c +125 -0
  423. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshmod.h +38 -0
  424. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshnterr.h +41 -0
  425. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshrec.c +1224 -0
  426. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/pshrec.h +171 -0
  427. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/pshinter/rules.mk +75 -0
  428. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/module.mk +23 -0
  429. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/psmodule.c +621 -0
  430. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/psmodule.h +37 -0
  431. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/psnamerr.h +42 -0
  432. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/psnames.c +24 -0
  433. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/pstables.h +4238 -0
  434. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/psnames/rules.mk +73 -0
  435. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/ftmisc.h +118 -0
  436. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/ftraster.c +2738 -0
  437. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/ftraster.h +47 -0
  438. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/ftrend1.c +209 -0
  439. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/ftrend1.h +37 -0
  440. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/module.mk +23 -0
  441. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/raster.c +25 -0
  442. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/rasterrs.h +42 -0
  443. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/raster/rules.mk +72 -0
  444. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftbsdf.c +1350 -0
  445. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdf.c +3932 -0
  446. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdf.h +97 -0
  447. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdfcommon.c +104 -0
  448. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdfcommon.h +140 -0
  449. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdferrs.h +37 -0
  450. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdfrend.c +603 -0
  451. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/ftsdfrend.h +118 -0
  452. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/module.mk +29 -0
  453. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/rules.mk +78 -0
  454. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sdf/sdf.c +29 -0
  455. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/module.mk +23 -0
  456. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/pngshim.c +474 -0
  457. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/pngshim.h +50 -0
  458. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/rules.mk +87 -0
  459. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfdriver.c +1384 -0
  460. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfdriver.h +35 -0
  461. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sferrors.h +41 -0
  462. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfnt.c +41 -0
  463. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfobjs.c +1552 -0
  464. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfobjs.h +58 -0
  465. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfwoff.c +426 -0
  466. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfwoff.h +43 -0
  467. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfwoff2.c +2380 -0
  468. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/sfwoff2.h +78 -0
  469. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttbdf.c +257 -0
  470. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttbdf.h +49 -0
  471. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcmap.c +3902 -0
  472. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcmap.h +126 -0
  473. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcmapc.h +56 -0
  474. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcolr.c +1923 -0
  475. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcolr.h +83 -0
  476. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcpal.c +310 -0
  477. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttcpal.h +48 -0
  478. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttgpos.c +598 -0
  479. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttgpos.h +53 -0
  480. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttkern.c +317 -0
  481. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttkern.h +51 -0
  482. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttload.c +1496 -0
  483. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttload.h +111 -0
  484. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttmtx.c +338 -0
  485. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttmtx.h +54 -0
  486. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttpost.c +484 -0
  487. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttpost.h +46 -0
  488. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttsbit.c +1685 -0
  489. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttsbit.h +62 -0
  490. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttsvg.c +413 -0
  491. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/ttsvg.h +43 -0
  492. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/woff2tags.c +119 -0
  493. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/sfnt/woff2tags.h +41 -0
  494. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/ftgrays.c +2149 -0
  495. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/ftgrays.h +57 -0
  496. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/ftsmerrs.h +42 -0
  497. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/ftsmooth.c +605 -0
  498. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/ftsmooth.h +37 -0
  499. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/module.mk +23 -0
  500. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/rules.mk +73 -0
  501. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/smooth/smooth.c +25 -0
  502. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/ftsvg.c +355 -0
  503. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/ftsvg.h +35 -0
  504. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/module.mk +23 -0
  505. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/rules.mk +70 -0
  506. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/svg.c +24 -0
  507. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/svg/svgtypes.h +42 -0
  508. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/afblue.pl +551 -0
  509. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/apinames.c +556 -0
  510. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/chktrcmp.py +119 -0
  511. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/cordic.py +32 -0
  512. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/ftrandom/Makefile +45 -0
  513. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/ftrandom/README +69 -0
  514. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/ftrandom/ftrandom.c +720 -0
  515. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/glnames.py +5533 -0
  516. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/make_distribution_archives.py +208 -0
  517. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/no-copyright +66 -0
  518. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/test_afm.c +156 -0
  519. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/test_bbox.c +187 -0
  520. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/test_trig.c +257 -0
  521. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/update-copyright +14 -0
  522. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/update-copyright-year +157 -0
  523. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/tools/vms_shorten_symbol.c +250 -0
  524. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/module.mk +23 -0
  525. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/rules.mk +75 -0
  526. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/truetype.c +29 -0
  527. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttdriver.c +704 -0
  528. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttdriver.h +35 -0
  529. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/tterrors.h +42 -0
  530. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttgload.c +2740 -0
  531. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttgload.h +61 -0
  532. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttgxvar.c +4594 -0
  533. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttgxvar.h +453 -0
  534. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttinterp.c +7751 -0
  535. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttinterp.h +465 -0
  536. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttobjs.c +1543 -0
  537. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttobjs.h +426 -0
  538. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttpload.c +665 -0
  539. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/truetype/ttpload.h +74 -0
  540. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/module.mk +23 -0
  541. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/rules.mk +76 -0
  542. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1afm.c +413 -0
  543. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1afm.h +53 -0
  544. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1driver.c +807 -0
  545. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1driver.h +35 -0
  546. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1errors.h +41 -0
  547. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1gload.c +606 -0
  548. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1gload.h +52 -0
  549. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1load.c +2755 -0
  550. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1load.h +126 -0
  551. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1objs.c +655 -0
  552. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1objs.h +160 -0
  553. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1parse.c +487 -0
  554. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1parse.h +137 -0
  555. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/t1tokens.h +143 -0
  556. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type1/type1.c +29 -0
  557. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/module.mk +23 -0
  558. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/rules.mk +73 -0
  559. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42drivr.c +248 -0
  560. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42drivr.h +36 -0
  561. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42error.h +41 -0
  562. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42objs.c +698 -0
  563. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42objs.h +123 -0
  564. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42parse.c +1351 -0
  565. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42parse.h +91 -0
  566. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/t42types.h +56 -0
  567. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/type42/type42.c +26 -0
  568. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/winfonts/fnterrs.h +42 -0
  569. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/winfonts/module.mk +23 -0
  570. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/winfonts/rules.mk +68 -0
  571. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/winfonts/winfnt.c +1219 -0
  572. package/harmony/gcanvas/src/main/cpp/core/harmony/freetype/src/winfonts/winfnt.h +164 -0
  573. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/.appveyor.yml +69 -0
  574. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/.travis.yml +41 -0
  575. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/ANNOUNCE +55 -0
  576. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/AUTHORS +46 -0
  577. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/CHANGES +6111 -0
  578. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/CMakeLists.txt +1042 -0
  579. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/INSTALL +465 -0
  580. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/LICENSE +134 -0
  581. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/Makefile.am +392 -0
  582. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/Makefile.in +2420 -0
  583. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/README +183 -0
  584. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/TODO +23 -0
  585. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/TRADEMARK +8 -0
  586. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/aclocal.m4 +1196 -0
  587. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/arm/arm_init.c +136 -0
  588. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/arm/filter_neon.S +253 -0
  589. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/arm/filter_neon_intrinsics.c +402 -0
  590. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/arm/palette_neon_intrinsics.c +149 -0
  591. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/autogen.sh +225 -0
  592. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/ci/ci_autotools.sh +95 -0
  593. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/ci/ci_cmake.sh +127 -0
  594. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/ci/ci_legacy.sh +116 -0
  595. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/compile +348 -0
  596. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/config.guess +1476 -0
  597. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/config.h.in +126 -0
  598. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/config.sub +1801 -0
  599. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/configure +16116 -0
  600. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/configure.ac +532 -0
  601. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/README.txt +5 -0
  602. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/arm-neon/README +83 -0
  603. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/arm-neon/android-ndk.c +39 -0
  604. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/arm-neon/linux-auxv.c +120 -0
  605. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/arm-neon/linux.c +161 -0
  606. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/README +49 -0
  607. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/pngcp.dfa +57 -0
  608. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/read.dfa +58 -0
  609. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/s_read.dfa +35 -0
  610. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/s_write.dfa +33 -0
  611. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/simple.dfa +36 -0
  612. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/conftest/write.dfa +45 -0
  613. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/examples/README.txt +24 -0
  614. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/examples/iccfrompng.c +185 -0
  615. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/examples/pngpixel.c +371 -0
  616. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/examples/pngtopng.c +98 -0
  617. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/examples/simpleover.c +648 -0
  618. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/COPYING +340 -0
  619. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/LICENSE +50 -0
  620. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/Makefile.mingw32 +131 -0
  621. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/Makefile.sgi +105 -0
  622. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/Makefile.unx +134 -0
  623. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/Makefile.w32 +114 -0
  624. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/README +186 -0
  625. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/makevms.com +132 -0
  626. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/readpng.c +323 -0
  627. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/readpng.h +88 -0
  628. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/readpng2.c +521 -0
  629. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/readpng2.h +116 -0
  630. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/readppm.c +188 -0
  631. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/rpng-win.c +735 -0
  632. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/rpng-x.c +911 -0
  633. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/rpng2-win.c +1261 -0
  634. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/rpng2-x.c +2143 -0
  635. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/toucan.png +0 -0
  636. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/wpng.c +865 -0
  637. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/writepng.c +401 -0
  638. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/gregbook/writepng.h +133 -0
  639. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/fakepng.c +65 -0
  640. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/gentests.sh +100 -0
  641. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/makepng.c +1948 -0
  642. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/pngimage.c +1722 -0
  643. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/pngstest-errors.h +165 -0
  644. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/pngstest.c +3832 -0
  645. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/pngunknown.c +1305 -0
  646. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/pngvalid.c +12279 -0
  647. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/readpng.c +114 -0
  648. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/tarith.c +1011 -0
  649. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/libtests/timepng.c +607 -0
  650. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/mips-msa/README +83 -0
  651. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/mips-msa/linux.c +67 -0
  652. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/Dockerfile +25 -0
  653. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/README.txt +37 -0
  654. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/build.sh +51 -0
  655. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc +209 -0
  656. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/libpng_read_fuzzer.options +2 -0
  657. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/oss-fuzz/png.dict +39 -0
  658. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/README +5 -0
  659. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/decoder/README +10 -0
  660. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/decoder/pngusr.dfa +40 -0
  661. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/decoder/pngusr.h +23 -0
  662. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/encoder/README +10 -0
  663. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/encoder/pngusr.dfa +39 -0
  664. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/encoder/pngusr.h +23 -0
  665. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/preader/README +15 -0
  666. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/preader/pngusr.dfa +40 -0
  667. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminim/preader/pngusr.h +23 -0
  668. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/CHANGES.txt +13 -0
  669. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/CMakeLists.txt +34 -0
  670. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/LICENSE.txt +22 -0
  671. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/README.txt +120 -0
  672. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/makevms.com +92 -0
  673. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/png2pnm.bat +41 -0
  674. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/png2pnm.c +427 -0
  675. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/png2pnm.sh +42 -0
  676. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/pngminus.bat +4 -0
  677. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/pngminus.sh +5 -0
  678. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/pnm2png.bat +41 -0
  679. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/pnm2png.c +620 -0
  680. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngminus/pnm2png.sh +42 -0
  681. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/README +107 -0
  682. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/bad_interlace_conversions.txt +9 -0
  683. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn0g01.png +0 -0
  684. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn0g02.png +0 -0
  685. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn0g04.png +0 -0
  686. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn0g08.png +0 -0
  687. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn0g16.png +0 -0
  688. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn2c08.png +0 -0
  689. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn2c16.png +0 -0
  690. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn3p01.png +0 -0
  691. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn3p02.png +0 -0
  692. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn3p04.png +0 -0
  693. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn3p08.png +0 -0
  694. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn4a08.png +0 -0
  695. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn4a16.png +0 -0
  696. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn6a08.png +0 -0
  697. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/basn6a16.png +0 -0
  698. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbbn0g01.png +0 -0
  699. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbbn0g02.png +0 -0
  700. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbbn0g04.png +0 -0
  701. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbbn2c16.png +0 -0
  702. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbbn3p08.png +0 -0
  703. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbgn2c16.png +0 -0
  704. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbgn3p08.png +0 -0
  705. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbrn2c08.png +0 -0
  706. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbwn0g16.png +0 -0
  707. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbwn3p08.png +0 -0
  708. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftbyn3p08.png +0 -0
  709. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftp0n0g08.png +0 -0
  710. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftp0n2c08.png +0 -0
  711. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftp0n3p08.png +0 -0
  712. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ftp1n3p08.png +0 -0
  713. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn0g08.png +0 -0
  714. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn0g16.png +0 -0
  715. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn2c08.png +0 -0
  716. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn2c16.png +0 -0
  717. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn3p08.png +0 -0
  718. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn4a08.png +0 -0
  719. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn4a16.png +0 -0
  720. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn6a08.png +0 -0
  721. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/ibasn6a16.png +0 -0
  722. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbbn2c16.png +0 -0
  723. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbbn3p08.png +0 -0
  724. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbgn2c16.png +0 -0
  725. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbgn3p08.png +0 -0
  726. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbrn2c08.png +0 -0
  727. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbwn0g16.png +0 -0
  728. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbwn3p08.png +0 -0
  729. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftbyn3p08.png +0 -0
  730. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftp0n0g08.png +0 -0
  731. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftp0n2c08.png +0 -0
  732. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftp0n3p08.png +0 -0
  733. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/iftp1n3p08.png +0 -0
  734. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/README +2 -0
  735. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn0g01.png +0 -0
  736. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn0g02.png +0 -0
  737. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn0g04.png +0 -0
  738. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn3p01.png +0 -0
  739. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn3p02.png +0 -0
  740. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/ibasn3p04.png +0 -0
  741. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/iftbbn0g01.png +0 -0
  742. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/iftbbn0g02.png +0 -0
  743. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/pngsuite/interlaced/iftbbn0g04.png +0 -0
  744. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/powerpc-vsx/README +81 -0
  745. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/powerpc-vsx/linux.c +57 -0
  746. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/powerpc-vsx/linux_aux.c +34 -0
  747. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/bad_iCCP.png +0 -0
  748. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/badadler.png +0 -0
  749. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/badcrc.png +0 -0
  750. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/empty_ancillary_chunks.png +0 -0
  751. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_IDAT.png +0 -0
  752. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_bKGD_chunk.png +0 -0
  753. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_cHRM_chunk.png +0 -0
  754. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_eXIf_chunk.png +0 -0
  755. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_gAMA_chunk.png +0 -0
  756. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_hIST_chunk.png +0 -0
  757. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_iCCP_chunk.png +0 -0
  758. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_iTXt_chunk.png +0 -0
  759. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png +0 -0
  760. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png +0 -0
  761. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_pCAL_chunk.png +0 -0
  762. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_pHYs_chunk.png +0 -0
  763. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_sCAL_chunk.png +0 -0
  764. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_sPLT_chunk.png +0 -0
  765. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_sRGB_chunk.png +0 -0
  766. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_sTER_chunk.png +0 -0
  767. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_tEXt_chunk.png +0 -0
  768. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_tIME_chunk.png +0 -0
  769. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/crashers/huge_zTXt_chunk.png +0 -0
  770. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-1.8-tRNS.png +0 -0
  771. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-1.8.png +0 -0
  772. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-linear-tRNS.png +0 -0
  773. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-linear.png +0 -0
  774. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-sRGB-tRNS.png +0 -0
  775. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-sRGB.png +0 -0
  776. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1-tRNS.png +0 -0
  777. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-1.png +0 -0
  778. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-1.8-tRNS.png +0 -0
  779. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-1.8.png +0 -0
  780. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-linear-tRNS.png +0 -0
  781. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-linear.png +0 -0
  782. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-sRGB-tRNS.png +0 -0
  783. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-sRGB.png +0 -0
  784. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16-tRNS.png +0 -0
  785. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-16.png +0 -0
  786. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-1.8-tRNS.png +0 -0
  787. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-1.8.png +0 -0
  788. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-linear-tRNS.png +0 -0
  789. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-linear.png +0 -0
  790. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-sRGB-tRNS.png +0 -0
  791. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-sRGB.png +0 -0
  792. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2-tRNS.png +0 -0
  793. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-2.png +0 -0
  794. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-1.8-tRNS.png +0 -0
  795. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-1.8.png +0 -0
  796. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-linear-tRNS.png +0 -0
  797. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-linear.png +0 -0
  798. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-sRGB-tRNS.png +0 -0
  799. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-sRGB.png +0 -0
  800. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4-tRNS.png +0 -0
  801. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-4.png +0 -0
  802. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-1.8-tRNS.png +0 -0
  803. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-1.8.png +0 -0
  804. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-linear-tRNS.png +0 -0
  805. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-linear.png +0 -0
  806. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-sRGB-tRNS.png +0 -0
  807. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-sRGB.png +0 -0
  808. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8-tRNS.png +0 -0
  809. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-8.png +0 -0
  810. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-16-1.8.png +0 -0
  811. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-16-linear.png +0 -0
  812. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-16-sRGB.png +0 -0
  813. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-16.png +0 -0
  814. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-8-1.8.png +0 -0
  815. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-8-linear.png +0 -0
  816. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-8-sRGB.png +0 -0
  817. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/gray-alpha-8.png +0 -0
  818. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/makepngs.sh +94 -0
  819. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-1.8-tRNS.png +0 -0
  820. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-1.8.png +0 -0
  821. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-linear-tRNS.png +0 -0
  822. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-linear.png +0 -0
  823. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-sRGB-tRNS.png +0 -0
  824. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-sRGB.png +0 -0
  825. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1-tRNS.png +0 -0
  826. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-1.png +0 -0
  827. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-1.8-tRNS.png +0 -0
  828. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-1.8.png +0 -0
  829. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-linear-tRNS.png +0 -0
  830. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-linear.png +0 -0
  831. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-sRGB-tRNS.png +0 -0
  832. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-sRGB.png +0 -0
  833. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2-tRNS.png +0 -0
  834. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-2.png +0 -0
  835. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-1.8-tRNS.png +0 -0
  836. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-1.8.png +0 -0
  837. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-linear-tRNS.png +0 -0
  838. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-linear.png +0 -0
  839. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-sRGB-tRNS.png +0 -0
  840. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-sRGB.png +0 -0
  841. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4-tRNS.png +0 -0
  842. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-4.png +0 -0
  843. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-1.8-tRNS.png +0 -0
  844. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-1.8.png +0 -0
  845. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-linear-tRNS.png +0 -0
  846. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-linear.png +0 -0
  847. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-sRGB-tRNS.png +0 -0
  848. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-sRGB.png +0 -0
  849. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8-tRNS.png +0 -0
  850. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/palette-8.png +0 -0
  851. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-1.8-tRNS.png +0 -0
  852. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-1.8.png +0 -0
  853. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-linear-tRNS.png +0 -0
  854. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-linear.png +0 -0
  855. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-sRGB-tRNS.png +0 -0
  856. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-sRGB.png +0 -0
  857. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16-tRNS.png +0 -0
  858. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-16.png +0 -0
  859. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-1.8-tRNS.png +0 -0
  860. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-1.8.png +0 -0
  861. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-linear-tRNS.png +0 -0
  862. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-linear.png +0 -0
  863. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-sRGB-tRNS.png +0 -0
  864. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-sRGB.png +0 -0
  865. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8-tRNS.png +0 -0
  866. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-8.png +0 -0
  867. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-16-1.8.png +0 -0
  868. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-16-linear.png +0 -0
  869. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-16-sRGB.png +0 -0
  870. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-16.png +0 -0
  871. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-8-1.8.png +0 -0
  872. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-8-linear.png +0 -0
  873. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-8-sRGB.png +0 -0
  874. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/testpngs/rgb-alpha-8.png +0 -0
  875. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/README.txt +27 -0
  876. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/checksum-icc.c +102 -0
  877. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/chkfmt +144 -0
  878. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/cvtcolor.c +188 -0
  879. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/genpng.c +881 -0
  880. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/intgamma.sh +110 -0
  881. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/makesRGB.c +430 -0
  882. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/png-fix-itxt.c +164 -0
  883. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/pngcp.c +2453 -0
  884. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/pngfix.c +4049 -0
  885. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/reindent +25 -0
  886. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/tools/sRGB.h +48 -0
  887. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/PngFile.c +454 -0
  888. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/PngFile.h +30 -0
  889. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/README.txt +61 -0
  890. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.c +978 -0
  891. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.dsp +147 -0
  892. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.dsw +29 -0
  893. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.ico +0 -0
  894. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.png +0 -0
  895. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/VisualPng.rc +152 -0
  896. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/cexcept.h +248 -0
  897. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/contrib/visupng/resource.h +23 -0
  898. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/depcomp +791 -0
  899. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/example.c +1041 -0
  900. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/install-sh +518 -0
  901. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/intel/filter_sse2_intrinsics.c +391 -0
  902. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/intel/intel_init.c +52 -0
  903. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/libpng-config.in +127 -0
  904. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/libpng-manual.txt +5409 -0
  905. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/libpng.3 +6052 -0
  906. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/libpng.pc.in +12 -0
  907. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/libpngpf.3 +24 -0
  908. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/ltmain.sh +11147 -0
  909. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/mips/filter_msa_intrinsics.c +808 -0
  910. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/mips/mips_init.c +130 -0
  911. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/missing +215 -0
  912. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/png.5 +84 -0
  913. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/png.c +4607 -0
  914. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/png.h +3247 -0
  915. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngbar.jpg +0 -0
  916. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngbar.png +0 -0
  917. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngconf.h +623 -0
  918. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngdebug.h +153 -0
  919. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngerror.c +963 -0
  920. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngget.c +1249 -0
  921. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pnginfo.h +267 -0
  922. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pnglibconf.h +219 -0
  923. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngmem.c +284 -0
  924. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngnow.png +0 -0
  925. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngpread.c +1096 -0
  926. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngpriv.h +2152 -0
  927. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngread.c +4225 -0
  928. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngrio.c +120 -0
  929. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngrtran.c +5044 -0
  930. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngrutil.c +4678 -0
  931. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngset.c +1802 -0
  932. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngstruct.h +489 -0
  933. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngtest.c +2158 -0
  934. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngtest.png +0 -0
  935. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngtrans.c +864 -0
  936. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngusr.dfa +14 -0
  937. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngwio.c +168 -0
  938. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngwrite.c +2390 -0
  939. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngwtran.c +575 -0
  940. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/pngwutil.c +2781 -0
  941. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/powerpc/filter_vsx_intrinsics.c +768 -0
  942. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/powerpc/powerpc_init.c +126 -0
  943. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/libpng.tgt +383 -0
  944. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/libpng.wpj +112 -0
  945. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/pngconfig.mak +160 -0
  946. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/pngstest.tgt +219 -0
  947. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/pngtest.tgt +179 -0
  948. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/owatcom/pngvalid.tgt +210 -0
  949. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/PRJ0041.mak +21 -0
  950. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/README.txt +58 -0
  951. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/README_zlib.txt +44 -0
  952. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/libpng.sln +60 -0
  953. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/libpng.vcproj +419 -0
  954. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/pngtest.vcproj +267 -0
  955. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/visualc71/zlib.vcproj +391 -0
  956. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/README.txt +87 -0
  957. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/libpng/libpng.vcxproj +234 -0
  958. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/pnglibconf/pnglibconf.vcxproj +61 -0
  959. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/vstudio.sln +109 -0
  960. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/zlib/zlib.vcxproj +175 -0
  961. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/projects/vstudio/zlib.props +57 -0
  962. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/README.txt +83 -0
  963. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/SCOPTIONS.ppc +7 -0
  964. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/checksym.awk +173 -0
  965. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/descrip.mms +47 -0
  966. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/dfn.awk +203 -0
  967. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/genchk.cmake.in +37 -0
  968. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/genout.cmake.in +105 -0
  969. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/gensrc.cmake.in +138 -0
  970. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/intprefix.c +22 -0
  971. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/libpng-config-body.in +96 -0
  972. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/libpng-config-head.in +24 -0
  973. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/libpng.pc.in +10 -0
  974. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/libtool.m4 +8369 -0
  975. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/ltoptions.m4 +437 -0
  976. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/ltsugar.m4 +124 -0
  977. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/ltversion.m4 +23 -0
  978. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/lt~obsolete.m4 +99 -0
  979. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/macro.lst +3 -0
  980. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.32sunu +241 -0
  981. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.64sunu +241 -0
  982. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.acorn +57 -0
  983. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.aix +116 -0
  984. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.amiga +58 -0
  985. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.atari +71 -0
  986. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.bc32 +158 -0
  987. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.beos +222 -0
  988. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.cegcc +116 -0
  989. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.clang +87 -0
  990. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.darwin +222 -0
  991. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.dec +210 -0
  992. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.dj2 +72 -0
  993. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.freebsd +66 -0
  994. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.gcc +87 -0
  995. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.hp64 +228 -0
  996. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.hpgcc +225 -0
  997. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.hpux +226 -0
  998. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.ibmc +90 -0
  999. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.intel +118 -0
  1000. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.linux +240 -0
  1001. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.linux-opt +258 -0
  1002. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.mips +100 -0
  1003. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.msys +199 -0
  1004. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.netbsd +55 -0
  1005. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.openbsd +86 -0
  1006. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.sco +223 -0
  1007. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.sggcc +233 -0
  1008. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.sgi +234 -0
  1009. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.so9 +244 -0
  1010. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.solaris +240 -0
  1011. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.std +133 -0
  1012. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.sunos +112 -0
  1013. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makefile.vcwin32 +112 -0
  1014. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/makevms.com +142 -0
  1015. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/options.awk +898 -0
  1016. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/pnglibconf.dfa +920 -0
  1017. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/pnglibconf.h.prebuilt +219 -0
  1018. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/pnglibconf.mak +55 -0
  1019. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/pngwin.rc +112 -0
  1020. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/prefix.c +24 -0
  1021. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/smakefile.ppc +34 -0
  1022. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/sym.c +15 -0
  1023. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/symbols.c +58 -0
  1024. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/symbols.def +255 -0
  1025. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/test.cmake.in +31 -0
  1026. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/scripts/vers.c +19 -0
  1027. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/test-driver +148 -0
  1028. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngimage-full +2 -0
  1029. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngimage-quick +2 -0
  1030. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-1.8 +2 -0
  1031. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-1.8-alpha +2 -0
  1032. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-linear +2 -0
  1033. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-linear-alpha +2 -0
  1034. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-none +2 -0
  1035. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-none-alpha +2 -0
  1036. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-sRGB +2 -0
  1037. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngstest-sRGB-alpha +2 -0
  1038. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngtest-all +16 -0
  1039. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-IDAT +2 -0
  1040. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-discard +2 -0
  1041. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-if-safe +2 -0
  1042. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-sAPI +2 -0
  1043. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-sTER +2 -0
  1044. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-save +2 -0
  1045. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngunknown-vpAg +2 -0
  1046. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-16-to-8 +2 -0
  1047. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-alpha-mode +2 -0
  1048. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-background +2 -0
  1049. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-expand16-alpha-mode +2 -0
  1050. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-expand16-background +2 -0
  1051. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-expand16-transform +2 -0
  1052. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-sbit +2 -0
  1053. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-threshold +2 -0
  1054. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-gamma-transform +2 -0
  1055. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-progressive-interlace-standard +2 -0
  1056. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-progressive-size +2 -0
  1057. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-progressive-standard +2 -0
  1058. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-standard +2 -0
  1059. package/harmony/gcanvas/src/main/cpp/core/harmony/libpng/tests/pngvalid-transform +2 -0
  1060. package/harmony/gcanvas/src/main/cpp/core/harmony/manager/GCanvasManagerOhos.cpp +50 -0
  1061. package/harmony/gcanvas/src/main/cpp/core/harmony/memory/AutoPtr.h +99 -0
  1062. package/harmony/gcanvas/src/main/cpp/core/harmony/memory/IDelete.h +25 -0
  1063. package/harmony/gcanvas/src/main/cpp/core/harmony/memory/RefCount.h +55 -0
  1064. package/harmony/gcanvas/src/main/cpp/core/harmony/png/IPngCoder.h +38 -0
  1065. package/harmony/gcanvas/src/main/cpp/core/harmony/png/LodePngCoder.cpp +101 -0
  1066. package/harmony/gcanvas/src/main/cpp/core/harmony/png/LodePngCoder.h +40 -0
  1067. package/harmony/gcanvas/src/main/cpp/core/harmony/png/PngLoader.cpp +114 -0
  1068. package/harmony/gcanvas/src/main/cpp/core/harmony/png/PngLoader.h +53 -0
  1069. package/harmony/gcanvas/src/main/cpp/core/harmony/png/thirdparty/lodepng.c +6292 -0
  1070. package/harmony/gcanvas/src/main/cpp/core/harmony/png/thirdparty/lodepng.h +1890 -0
  1071. package/harmony/gcanvas/src/main/cpp/core/src/GCanvas.cpp +89 -0
  1072. package/harmony/gcanvas/src/main/cpp/core/src/GCanvas.hpp +45 -0
  1073. package/harmony/gcanvas/src/main/cpp/core/src/GCanvasManager.cpp +158 -0
  1074. package/harmony/gcanvas/src/main/cpp/core/src/GCanvasManager.h +56 -0
  1075. package/harmony/gcanvas/src/main/cpp/core/src/GCanvasWeex.cpp +1925 -0
  1076. package/harmony/gcanvas/src/main/cpp/core/src/GCanvasWeex.hpp +335 -0
  1077. package/harmony/gcanvas/src/main/cpp/core/src/RNCGCanvasBridge.h +225 -0
  1078. package/harmony/gcanvas/src/main/cpp/core/src/export.h +29 -0
  1079. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GCanvas2dContext.cpp +2366 -0
  1080. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GCanvas2dContext.h +449 -0
  1081. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GCanvasState.cpp +189 -0
  1082. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GCanvasState.h +83 -0
  1083. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GContext2dType.h +68 -0
  1084. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GConvert.cpp +476 -0
  1085. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GConvert.h +25 -0
  1086. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFillStyle.h +191 -0
  1087. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFontManager.h +110 -0
  1088. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFontStyle.cpp +149 -0
  1089. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFontStyle.h +94 -0
  1090. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFrameBufferObject.cpp +226 -0
  1091. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GFrameBufferObject.h +116 -0
  1092. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GGL.h +45 -0
  1093. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GGlyphCache.cpp +106 -0
  1094. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GGlyphCache.h +159 -0
  1095. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GPath.cpp +1213 -0
  1096. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GPath.h +115 -0
  1097. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GPoint.h +117 -0
  1098. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GShader.cpp +346 -0
  1099. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GShader.h +360 -0
  1100. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GShaderManager.cpp +140 -0
  1101. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GShaderManager.h +38 -0
  1102. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GStrSeparator.cpp +84 -0
  1103. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GStrSeparator.h +31 -0
  1104. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTextDefine.h +34 -0
  1105. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTexture.cpp +327 -0
  1106. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTexture.h +133 -0
  1107. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTransform.h +163 -0
  1108. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTreemap.cpp +61 -0
  1109. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GTreemap.h +88 -0
  1110. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GWebglContext.cpp +3259 -0
  1111. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/GWebglContext.h +13 -0
  1112. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/default.glsl +39 -0
  1113. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/grad.glsl +101 -0
  1114. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/pattern.glsl +45 -0
  1115. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/radiation.glsl +110 -0
  1116. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/shadow.glsl +39 -0
  1117. package/harmony/gcanvas/src/main/cpp/core/src/gcanvas/shaders/texture.glsl +34 -0
  1118. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GCanvas2DContextAndroid.cpp +386 -0
  1119. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GCanvas2DContextAndroid.h +113 -0
  1120. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GCanvas2DContextImpl.cpp +67 -0
  1121. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GCanvasAndroid.cpp +41 -0
  1122. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GCanvasAndroid.h +36 -0
  1123. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFont.cpp +806 -0
  1124. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFont.h +164 -0
  1125. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontCache.cpp +467 -0
  1126. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontCache.h +93 -0
  1127. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontFamily.cpp +187 -0
  1128. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontFamily.h +68 -0
  1129. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontManager.cpp +205 -0
  1130. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontManagerAndroid.cpp +328 -0
  1131. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontManagerAndroid.h +63 -0
  1132. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFontManagerImpl.cpp +22 -0
  1133. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GFrameBufferObjectImpl.cpp +180 -0
  1134. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GPreCompiledShaders.cpp +175 -0
  1135. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GPreCompiledShaders.h +75 -0
  1136. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GSystemFontInformation.cpp +231 -0
  1137. package/harmony/gcanvas/src/main/cpp/core/src/platform/Android/GSystemFontInformation.h +69 -0
  1138. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/FontTool.hpp +892 -0
  1139. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/GFont.cpp +742 -0
  1140. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/GFontCache.cpp +296 -0
  1141. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/GFontFamily.cpp +162 -0
  1142. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/GFontManager.cpp +230 -0
  1143. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/GSystemFontInformation.cpp +232 -0
  1144. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/PortableMap.hpp +621 -0
  1145. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/argh.h +434 -0
  1146. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/fonttool.cpp +109 -0
  1147. package/harmony/gcanvas/src/main/cpp/core/src/platform/Linux/utils.hpp +229 -0
  1148. package/harmony/gcanvas/src/main/cpp/core/src/platform/iOS/GCVFont.h +126 -0
  1149. package/harmony/gcanvas/src/main/cpp/core/src/platform/iOS/GCVFont.mm +573 -0
  1150. package/harmony/gcanvas/src/main/cpp/core/src/platform/iOS/GFontManager.mm +185 -0
  1151. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GCanvas2DContextHarmony.cpp +391 -0
  1152. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GCanvas2DContextHarmony.h +114 -0
  1153. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GCanvas2DContextOHOS.cpp +49 -0
  1154. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GCanvasHarmony.cpp +42 -0
  1155. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GCanvasHarmony.h +37 -0
  1156. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFont.cpp +806 -0
  1157. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFont.h +164 -0
  1158. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontCache.cpp +466 -0
  1159. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontCache.h +94 -0
  1160. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontFamily.cpp +188 -0
  1161. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontFamily.h +69 -0
  1162. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontManagerHarmony.cpp +329 -0
  1163. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontManagerHarmony.h +64 -0
  1164. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFontManagerImpl.cpp +23 -0
  1165. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GFrameBufferObjectImpl.cpp +221 -0
  1166. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GPreCompiledShaders.cpp +176 -0
  1167. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GPreCompiledShaders.h +76 -0
  1168. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GSystemFontInformation.cpp +232 -0
  1169. package/harmony/gcanvas/src/main/cpp/core/src/platform/ohos/GSystemFontInformation.h +70 -0
  1170. package/harmony/gcanvas/src/main/cpp/core/src/support/CharacterSet.cpp +126 -0
  1171. package/harmony/gcanvas/src/main/cpp/core/src/support/CharacterSet.h +30 -0
  1172. package/harmony/gcanvas/src/main/cpp/core/src/support/ConcurrenceQueue.h +128 -0
  1173. package/harmony/gcanvas/src/main/cpp/core/src/support/DynArray.h +157 -0
  1174. package/harmony/gcanvas/src/main/cpp/core/src/support/Encode.cpp +116 -0
  1175. package/harmony/gcanvas/src/main/cpp/core/src/support/Encode.h +20 -0
  1176. package/harmony/gcanvas/src/main/cpp/core/src/support/FileUtils.cpp +153 -0
  1177. package/harmony/gcanvas/src/main/cpp/core/src/support/FileUtils.h +56 -0
  1178. package/harmony/gcanvas/src/main/cpp/core/src/support/GLUtil.cpp +174 -0
  1179. package/harmony/gcanvas/src/main/cpp/core/src/support/GLUtil.h +25 -0
  1180. package/harmony/gcanvas/src/main/cpp/core/src/support/Lesser.h +27 -0
  1181. package/harmony/gcanvas/src/main/cpp/core/src/support/Log.cpp +158 -0
  1182. package/harmony/gcanvas/src/main/cpp/core/src/support/Log.h +100 -0
  1183. package/harmony/gcanvas/src/main/cpp/core/src/support/Util.cpp +118 -0
  1184. package/harmony/gcanvas/src/main/cpp/core/src/support/Util.h +38 -0
  1185. package/harmony/gcanvas/src/main/cpp/core/src/support/Value.cpp +180 -0
  1186. package/harmony/gcanvas/src/main/cpp/core/src/support/Value.h +76 -0
  1187. package/harmony/gcanvas/src/main/cpp/generated/RNOH/generated/BaseGcanvasPackage.h +79 -0
  1188. package/harmony/gcanvas/src/main/cpp/generated/RNOH/generated/components/GCanvasViewJSIBinder.h +37 -0
  1189. package/harmony/gcanvas/src/main/cpp/generated/RNOH/generated/turbo_modules/GCanvasModule.cpp +35 -0
  1190. package/harmony/gcanvas/src/main/cpp/generated/RNOH/generated/turbo_modules/GCanvasModule.h +16 -0
  1191. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/ComponentDescriptors.h +24 -0
  1192. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/EventEmitters.cpp +33 -0
  1193. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/EventEmitters.h +31 -0
  1194. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/Props.cpp +28 -0
  1195. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/Props.h +30 -0
  1196. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/ShadowNodes.cpp +17 -0
  1197. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/ShadowNodes.h +32 -0
  1198. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/States.cpp +16 -0
  1199. package/harmony/gcanvas/src/main/cpp/generated/react/renderer/components/gcanvas/States.h +29 -0
  1200. package/harmony/gcanvas/src/main/ets/GCanvasModuleTurboModule.ts +448 -0
  1201. package/harmony/gcanvas/src/main/ets/GCanvasNativeEngine.ts +206 -0
  1202. package/harmony/gcanvas/src/main/ets/GcanvasTurboModulesFactory.ets +42 -0
  1203. package/harmony/gcanvas/src/main/ets/components/GCanvasView.ets +109 -0
  1204. package/harmony/gcanvas/src/main/ets/generated/components/GCanvasView.ts +126 -0
  1205. package/harmony/gcanvas/src/main/ets/generated/components/ts.ts +5 -0
  1206. package/harmony/gcanvas/src/main/ets/generated/index.ets +5 -0
  1207. package/harmony/gcanvas/src/main/ets/generated/ts.ts +6 -0
  1208. package/harmony/gcanvas/src/main/ets/generated/turboModules/GCanvasModule.ts +52 -0
  1209. package/harmony/gcanvas/src/main/ets/generated/turboModules/ts.ts +5 -0
  1210. package/harmony/gcanvas/src/main/module.json5 +21 -0
  1211. package/harmony/gcanvas/src/main/resources/base/element/string.json +12 -0
  1212. package/harmony/gcanvas/src/main/resources/en_US/element/string.json +8 -0
  1213. package/harmony/gcanvas/src/main/resources/zh_CN/element/string.json +12 -0
  1214. package/harmony/gcanvas.har +0 -0
  1215. package/package.json +69 -0
  1216. package/packages/gcanvas/.babelrc +5 -0
  1217. package/packages/gcanvas/.eslintrc.js +133 -0
  1218. package/packages/gcanvas/package.json +19 -0
  1219. package/packages/gcanvas/rollup.config.js +14 -0
  1220. package/packages/gcanvas/src/bridge/react-native.js +286 -0
  1221. package/packages/gcanvas/src/bridge/weex.js +210 -0
  1222. package/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +17 -0
  1223. package/packages/gcanvas/src/context/2d/FillStylePattern.js +8 -0
  1224. package/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +17 -0
  1225. package/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +49 -0
  1226. package/packages/gcanvas/src/context/2d/RenderingContext.js +787 -0
  1227. package/packages/gcanvas/src/context/webgl/ActiveInfo.js +11 -0
  1228. package/packages/gcanvas/src/context/webgl/Buffer.js +21 -0
  1229. package/packages/gcanvas/src/context/webgl/Framebuffer.js +21 -0
  1230. package/packages/gcanvas/src/context/webgl/GLenum.js +300 -0
  1231. package/packages/gcanvas/src/context/webgl/GLmethod.js +142 -0
  1232. package/packages/gcanvas/src/context/webgl/GLtype.js +22 -0
  1233. package/packages/gcanvas/src/context/webgl/Program.js +21 -0
  1234. package/packages/gcanvas/src/context/webgl/Renderbuffer.js +21 -0
  1235. package/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -0
  1236. package/packages/gcanvas/src/context/webgl/Shader.js +22 -0
  1237. package/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +11 -0
  1238. package/packages/gcanvas/src/context/webgl/Texture.js +22 -0
  1239. package/packages/gcanvas/src/context/webgl/UniformLocation.js +22 -0
  1240. package/packages/gcanvas/src/context/webgl/classUtils.js +3 -0
  1241. package/packages/gcanvas/src/env/canvas.js +210 -0
  1242. package/packages/gcanvas/src/env/image.js +76 -0
  1243. package/packages/gcanvas/src/env/off-screen-canvas.js +74 -0
  1244. package/packages/gcanvas/src/index.js +65 -0
  1245. package/src/components/CanvasView.js +20 -0
  1246. package/src/components/GCanvasComponent.js +408 -0
  1247. package/src/index.js +69 -0
  1248. package/src/packages/gcanvas/.babelrc +5 -0
  1249. package/src/packages/gcanvas/.eslintrc.js +133 -0
  1250. package/src/packages/gcanvas/package.json +19 -0
  1251. package/src/packages/gcanvas/rollup.config.js +14 -0
  1252. package/src/packages/gcanvas/src/bridge/react-native.js +288 -0
  1253. package/src/packages/gcanvas/src/bridge/weex.js +210 -0
  1254. package/src/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +17 -0
  1255. package/src/packages/gcanvas/src/context/2d/FillStylePattern.js +8 -0
  1256. package/src/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +17 -0
  1257. package/src/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +49 -0
  1258. package/src/packages/gcanvas/src/context/2d/RenderingContext.js +801 -0
  1259. package/src/packages/gcanvas/src/context/webgl/ActiveInfo.js +11 -0
  1260. package/src/packages/gcanvas/src/context/webgl/Buffer.js +21 -0
  1261. package/src/packages/gcanvas/src/context/webgl/Framebuffer.js +21 -0
  1262. package/src/packages/gcanvas/src/context/webgl/GLenum.js +300 -0
  1263. package/src/packages/gcanvas/src/context/webgl/GLmethod.js +142 -0
  1264. package/src/packages/gcanvas/src/context/webgl/GLtype.js +22 -0
  1265. package/src/packages/gcanvas/src/context/webgl/Program.js +21 -0
  1266. package/src/packages/gcanvas/src/context/webgl/Renderbuffer.js +21 -0
  1267. package/src/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -0
  1268. package/src/packages/gcanvas/src/context/webgl/Shader.js +22 -0
  1269. package/src/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +11 -0
  1270. package/src/packages/gcanvas/src/context/webgl/Texture.js +22 -0
  1271. package/src/packages/gcanvas/src/context/webgl/UniformLocation.js +22 -0
  1272. package/src/packages/gcanvas/src/context/webgl/classUtils.js +3 -0
  1273. package/src/packages/gcanvas/src/env/canvas.js +210 -0
  1274. package/src/packages/gcanvas/src/env/image.js +76 -0
  1275. package/src/packages/gcanvas/src/env/off-screen-canvas.js +74 -0
  1276. package/src/packages/gcanvas/src/index.js +65 -0
  1277. package/src/specs/v1/.gitkeep +1 -0
  1278. package/src/specs/v1/GCanvasViewNativeComponent.ts +47 -0
  1279. package/src/specs/v1/NativeGCanvasModule.ts +140 -0
  1280. package/src/specs/v2/.gitkeep +1 -0
@@ -0,0 +1,4594 @@
1
+ /****************************************************************************
2
+ *
3
+ * ttgxvar.c
4
+ *
5
+ * TrueType GX Font Variation loader
6
+ *
7
+ * Copyright (C) 2004-2024 by
8
+ * David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
9
+ *
10
+ * This file is part of the FreeType project, and may only be used,
11
+ * modified, and distributed under the terms of the FreeType project
12
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
13
+ * this file you indicate that you have read the license and
14
+ * understand and accept it fully.
15
+ *
16
+ */
17
+
18
+
19
+ /**************************************************************************
20
+ *
21
+ * Apple documents the `fvar', `gvar', `cvar', and `avar' tables at
22
+ *
23
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html
24
+ *
25
+ * The documentation for `gvar' is not intelligible; `cvar' refers you
26
+ * to `gvar' and is thus also incomprehensible.
27
+ *
28
+ * The documentation for `avar' appears correct, but Apple has no fonts
29
+ * with an `avar' table, so it is hard to test.
30
+ *
31
+ * Many thanks to John Jenkins (at Apple) in figuring this out.
32
+ *
33
+ *
34
+ * Apple's `kern' table has some references to tuple indices, but as
35
+ * there is no indication where these indices are defined, nor how to
36
+ * interpolate the kerning values (different tuples have different
37
+ * classes) this issue is ignored.
38
+ *
39
+ */
40
+
41
+
42
+ #include <ft2build.h>
43
+ #include <freetype/internal/ftdebug.h>
44
+ #include FT_CONFIG_CONFIG_H
45
+ #include <freetype/internal/ftcalc.h>
46
+ #include <freetype/internal/ftstream.h>
47
+ #include <freetype/internal/sfnt.h>
48
+ #include <freetype/internal/services/svmetric.h>
49
+ #include <freetype/tttags.h>
50
+ #include <freetype/ttnameid.h>
51
+ #include <freetype/ftmm.h>
52
+ #include <freetype/ftlist.h>
53
+
54
+ #include "ttpload.h"
55
+ #include "ttgxvar.h"
56
+
57
+ #include "tterrors.h"
58
+
59
+
60
+ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
61
+
62
+
63
+ #define FT_Stream_FTell( stream ) \
64
+ (FT_ULong)( (stream)->cursor - (stream)->base )
65
+ #define FT_Stream_SeekSet( stream, off ) \
66
+ (stream)->cursor = \
67
+ ( (off) < (FT_ULong)( (stream)->limit - (stream)->base ) ) \
68
+ ? (stream)->base + (off) \
69
+ : (stream)->limit
70
+
71
+
72
+ /* some macros we need */
73
+ #define FT_fdot14ToFixed( x ) \
74
+ ( (FT_Fixed)( (FT_ULong)(x) << 2 ) )
75
+ #define FT_intToFixed( i ) \
76
+ ( (FT_Fixed)( (FT_ULong)(i) << 16 ) )
77
+ #define FT_fdot6ToFixed( i ) \
78
+ ( (FT_Fixed)( (FT_ULong)(i) << 10 ) )
79
+ #define FT_fixedToInt( x ) \
80
+ ( (FT_Short)( ( (x) + 0x8000U ) >> 16 ) )
81
+ #define FT_fixedToFdot6( x ) \
82
+ ( (FT_Pos)( ( (x) + 0x200 ) >> 10 ) )
83
+
84
+
85
+ /**************************************************************************
86
+ *
87
+ * The macro FT_COMPONENT is used in trace mode. It is an implicit
88
+ * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
89
+ * messages during execution.
90
+ */
91
+ #undef FT_COMPONENT
92
+ #define FT_COMPONENT ttgxvar
93
+
94
+
95
+ /*************************************************************************/
96
+ /*************************************************************************/
97
+ /***** *****/
98
+ /***** Internal Routines *****/
99
+ /***** *****/
100
+ /*************************************************************************/
101
+ /*************************************************************************/
102
+
103
+
104
+ /**************************************************************************
105
+ *
106
+ * The macro ALL_POINTS is used in `ft_var_readpackedpoints'. It
107
+ * indicates that there is a delta for every point without needing to
108
+ * enumerate all of them.
109
+ */
110
+
111
+ /* ensure that value `0' has the same width as a pointer */
112
+ #define ALL_POINTS (FT_UShort*)~(FT_PtrDist)0
113
+
114
+
115
+ #define GX_PT_POINTS_ARE_WORDS 0x80U
116
+ #define GX_PT_POINT_RUN_COUNT_MASK 0x7FU
117
+
118
+
119
+ /**************************************************************************
120
+ *
121
+ * @Function:
122
+ * ft_var_readpackedpoints
123
+ *
124
+ * @Description:
125
+ * Read a set of points to which the following deltas will apply.
126
+ * Points are packed with a run length encoding.
127
+ *
128
+ * @Input:
129
+ * stream ::
130
+ * The data stream.
131
+ *
132
+ * @Output:
133
+ * point_cnt ::
134
+ * The number of points read. A zero value means that
135
+ * all points in the glyph will be affected, without
136
+ * enumerating them individually.
137
+ *
138
+ * @Return:
139
+ * An array of FT_UShort containing the affected points or the
140
+ * special value ALL_POINTS.
141
+ */
142
+ static FT_UShort*
143
+ ft_var_readpackedpoints( FT_Stream stream,
144
+ FT_UInt *point_cnt )
145
+ {
146
+ FT_UShort *points = NULL;
147
+ FT_UInt n;
148
+ FT_UInt runcnt, cnt;
149
+ FT_UInt i, j;
150
+ FT_UShort first;
151
+ FT_Byte* p;
152
+ FT_Memory memory = stream->memory;
153
+ FT_Error error;
154
+
155
+
156
+ *point_cnt = 0;
157
+
158
+ n = FT_GET_BYTE();
159
+ if ( n == 0 )
160
+ return ALL_POINTS;
161
+
162
+ if ( n & GX_PT_POINTS_ARE_WORDS )
163
+ {
164
+ n &= GX_PT_POINT_RUN_COUNT_MASK;
165
+ n <<= 8;
166
+ n |= FT_GET_BYTE();
167
+ }
168
+
169
+ if ( FT_QNEW_ARRAY( points, n ) )
170
+ return NULL;
171
+
172
+ p = stream->cursor;
173
+ first = 0;
174
+ i = 0;
175
+ while ( i < n )
176
+ {
177
+ if ( p >= stream->limit )
178
+ goto Fail;
179
+
180
+ runcnt = FT_NEXT_BYTE( p );
181
+ cnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
182
+
183
+ /* first point not included in run count */
184
+ cnt++;
185
+ if ( cnt > n - i )
186
+ cnt = n - i;
187
+
188
+ if ( runcnt & GX_PT_POINTS_ARE_WORDS )
189
+ {
190
+ if ( 2 * cnt > (FT_UInt)( stream->limit - p ) )
191
+ goto Fail;
192
+
193
+ for ( j = 0; j < cnt; j++ )
194
+ {
195
+ first += FT_NEXT_USHORT( p );
196
+ points[i++] = first;
197
+ }
198
+ }
199
+ else
200
+ {
201
+ if ( cnt > (FT_UInt)( stream->limit - p ) )
202
+ goto Fail;
203
+
204
+ for ( j = 0; j < cnt; j++ )
205
+ {
206
+ first += FT_NEXT_BYTE( p );
207
+ points[i++] = first;
208
+ }
209
+ }
210
+ }
211
+
212
+ stream->cursor = p;
213
+
214
+ *point_cnt = n;
215
+
216
+ return points;
217
+
218
+ Fail:
219
+ FT_TRACE1(( "ft_var_readpackedpoints: invalid table\n" ));
220
+
221
+ FT_FREE( points );
222
+ return NULL;
223
+ }
224
+
225
+
226
+ #define GX_DT_DELTAS_ARE_ZERO 0x80U
227
+ #define GX_DT_DELTAS_ARE_WORDS 0x40U
228
+ #define GX_DT_DELTA_RUN_COUNT_MASK 0x3FU
229
+
230
+
231
+ /**************************************************************************
232
+ *
233
+ * @Function:
234
+ * ft_var_readpackeddeltas
235
+ *
236
+ * @Description:
237
+ * Read a set of deltas. These are packed slightly differently than
238
+ * points. In particular there is no overall count.
239
+ *
240
+ * @Input:
241
+ * stream ::
242
+ * The data stream.
243
+ *
244
+ * delta_cnt ::
245
+ * The number of deltas to be read.
246
+ *
247
+ * @Return:
248
+ * An array of FT_Fixed containing the deltas for the affected
249
+ * points. (This only gets the deltas for one dimension. It will
250
+ * generally be called twice, once for x, once for y. When used in
251
+ * cvt table, it will only be called once.)
252
+ *
253
+ * We use FT_Fixed to avoid accumulation errors while summing up all
254
+ * deltas (the rounding to integer values happens as the very last
255
+ * step).
256
+ */
257
+ static FT_Fixed*
258
+ ft_var_readpackeddeltas( FT_Stream stream,
259
+ FT_UInt delta_cnt )
260
+ {
261
+ FT_Fixed *deltas = NULL;
262
+ FT_UInt runcnt, cnt;
263
+ FT_UInt i, j;
264
+ FT_Byte* p;
265
+ FT_Memory memory = stream->memory;
266
+ FT_Error error;
267
+
268
+
269
+ if ( FT_QNEW_ARRAY( deltas, delta_cnt ) )
270
+ return NULL;
271
+
272
+ p = stream->cursor;
273
+ i = 0;
274
+ while ( i < delta_cnt )
275
+ {
276
+ if ( p >= stream->limit )
277
+ goto Fail;
278
+
279
+ runcnt = FT_NEXT_BYTE( p );
280
+ cnt = runcnt & GX_DT_DELTA_RUN_COUNT_MASK;
281
+
282
+ /* first point not included in run count */
283
+ cnt++;
284
+ if ( cnt > delta_cnt - i )
285
+ cnt = delta_cnt - i;
286
+
287
+ if ( runcnt & GX_DT_DELTAS_ARE_ZERO )
288
+ {
289
+ for ( j = 0; j < cnt; j++ )
290
+ deltas[i++] = 0;
291
+ }
292
+ else if ( runcnt & GX_DT_DELTAS_ARE_WORDS )
293
+ {
294
+ if ( 2 * cnt > (FT_UInt)( stream->limit - p ) )
295
+ goto Fail;
296
+
297
+ for ( j = 0; j < cnt; j++ )
298
+ deltas[i++] = FT_intToFixed( FT_NEXT_SHORT( p ) );
299
+ }
300
+ else
301
+ {
302
+ if ( cnt > (FT_UInt)( stream->limit - p ) )
303
+ goto Fail;
304
+
305
+ for ( j = 0; j < cnt; j++ )
306
+ deltas[i++] = FT_intToFixed( FT_NEXT_CHAR( p ) );
307
+ }
308
+ }
309
+
310
+ stream->cursor = p;
311
+
312
+ return deltas;
313
+
314
+ Fail:
315
+ FT_TRACE1(( "ft_var_readpackeddeltas: invalid table\n" ));
316
+
317
+ FT_FREE( deltas );
318
+ return NULL;
319
+ }
320
+
321
+
322
+ /**************************************************************************
323
+ *
324
+ * @Function:
325
+ * ft_var_load_avar
326
+ *
327
+ * @Description:
328
+ * Parse the `avar' table if present. It need not be, so we return
329
+ * nothing.
330
+ *
331
+ * @InOut:
332
+ * face ::
333
+ * The font face.
334
+ */
335
+ static void
336
+ ft_var_load_avar( TT_Face face )
337
+ {
338
+ FT_Error error;
339
+ FT_Stream stream = FT_FACE_STREAM( face );
340
+ FT_Memory memory = stream->memory;
341
+ FT_Int i, j;
342
+
343
+ GX_Blend blend = face->blend;
344
+ GX_AVarSegment segment;
345
+ GX_AVarTable table;
346
+
347
+ FT_Long version;
348
+ FT_Long axisCount;
349
+ FT_ULong table_len;
350
+
351
+ #ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
352
+ FT_ULong table_offset;
353
+ FT_ULong store_offset;
354
+ FT_ULong axisMap_offset;
355
+ #endif
356
+
357
+
358
+ FT_TRACE2(( "AVAR " ));
359
+
360
+ blend->avar_loaded = TRUE;
361
+ error = face->goto_table( face, TTAG_avar, stream, &table_len );
362
+ if ( error )
363
+ {
364
+ FT_TRACE2(( "is missing\n" ));
365
+ return;
366
+ }
367
+
368
+ #ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
369
+ table_offset = FT_STREAM_POS();
370
+ #endif
371
+
372
+ if ( FT_FRAME_ENTER( table_len ) )
373
+ return;
374
+
375
+ version = FT_GET_LONG();
376
+ axisCount = FT_GET_LONG();
377
+
378
+ if ( version != 0x00010000L
379
+ #ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
380
+ && version != 0x00020000L
381
+ #endif
382
+ )
383
+ {
384
+ FT_TRACE2(( "bad table version\n" ));
385
+ goto Exit;
386
+ }
387
+
388
+ FT_TRACE2(( "loaded\n" ));
389
+
390
+ if ( axisCount != (FT_Long)blend->mmvar->num_axis )
391
+ {
392
+ FT_TRACE2(( "ft_var_load_avar:"
393
+ " number of axes in `avar' and `fvar'\n" ));
394
+ FT_TRACE2(( " table are different\n" ));
395
+ goto Exit;
396
+ }
397
+
398
+ if ( FT_NEW( blend->avar_table ) )
399
+ goto Exit;
400
+ table = blend->avar_table;
401
+
402
+ if ( FT_QNEW_ARRAY( table->avar_segment, axisCount ) )
403
+ goto Exit;
404
+
405
+ segment = &table->avar_segment[0];
406
+ for ( i = 0; i < axisCount; i++, segment++ )
407
+ {
408
+ FT_TRACE5(( " axis %d:\n", i ));
409
+
410
+ segment->pairCount = FT_GET_USHORT();
411
+ if ( (FT_ULong)segment->pairCount * 4 > table_len ||
412
+ FT_QNEW_ARRAY( segment->correspondence, segment->pairCount ) )
413
+ {
414
+ /* Failure. Free everything we have done so far. We must do */
415
+ /* it right now since loading the `avar' table is optional. */
416
+
417
+ for ( j = i - 1; j >= 0; j-- )
418
+ FT_FREE( table->avar_segment[j].correspondence );
419
+
420
+ FT_FREE( table->avar_segment );
421
+ goto Exit;
422
+ }
423
+
424
+ for ( j = 0; j < segment->pairCount; j++ )
425
+ {
426
+ segment->correspondence[j].fromCoord =
427
+ FT_fdot14ToFixed( FT_GET_SHORT() );
428
+ segment->correspondence[j].toCoord =
429
+ FT_fdot14ToFixed( FT_GET_SHORT() );
430
+
431
+ FT_TRACE5(( " mapping %.5f to %.5f\n",
432
+ (double)segment->correspondence[j].fromCoord / 65536,
433
+ (double)segment->correspondence[j].toCoord / 65536 ));
434
+ }
435
+
436
+ FT_TRACE5(( "\n" ));
437
+ }
438
+
439
+ #ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
440
+ if ( version < 0x00020000L )
441
+ goto Exit;
442
+
443
+ axisMap_offset = FT_GET_ULONG();
444
+ store_offset = FT_GET_ULONG();
445
+
446
+ if ( store_offset )
447
+ {
448
+ error = tt_var_load_item_variation_store(
449
+ FT_FACE( face ),
450
+ table_offset + store_offset,
451
+ &table->itemStore );
452
+ if ( error )
453
+ goto Exit;
454
+ }
455
+
456
+ if ( axisMap_offset )
457
+ {
458
+ error = tt_var_load_delta_set_index_mapping(
459
+ FT_FACE( face ),
460
+ table_offset + axisMap_offset,
461
+ &table->axisMap,
462
+ &table->itemStore,
463
+ table_len );
464
+ if ( error )
465
+ goto Exit;
466
+ }
467
+ #endif
468
+
469
+
470
+ Exit:
471
+ FT_FRAME_EXIT();
472
+ }
473
+
474
+
475
+ FT_LOCAL_DEF( FT_Error )
476
+ tt_var_load_item_variation_store( FT_Face face, /* TT_Face */
477
+ FT_ULong offset,
478
+ GX_ItemVarStore itemStore )
479
+ {
480
+ TT_Face ttface = (TT_Face)face;
481
+ FT_Stream stream = FT_FACE_STREAM( face );
482
+ FT_Memory memory = stream->memory;
483
+
484
+ FT_Error error;
485
+ FT_UShort format;
486
+ FT_ULong region_offset;
487
+
488
+ FT_UInt data_count;
489
+ FT_UShort axis_count;
490
+ FT_UInt region_count;
491
+
492
+ FT_UInt i, j;
493
+ FT_Bool long_words;
494
+
495
+ GX_Blend blend = ttface->blend;
496
+ FT_ULong* dataOffsetArray = NULL;
497
+
498
+
499
+ if ( FT_STREAM_SEEK( offset ) ||
500
+ FT_READ_USHORT( format ) )
501
+ goto Exit;
502
+
503
+ if ( format != 1 )
504
+ {
505
+ FT_TRACE2(( "tt_var_load_item_variation_store: bad store format %d\n",
506
+ format ));
507
+ error = FT_THROW( Invalid_Table );
508
+ goto Exit;
509
+ }
510
+
511
+ /* read top level fields */
512
+ if ( FT_READ_ULONG( region_offset ) ||
513
+ FT_READ_USHORT( data_count ) )
514
+ goto Exit;
515
+
516
+ /* we need at least one entry in `itemStore->varData' */
517
+ if ( !data_count )
518
+ {
519
+ FT_TRACE2(( "tt_var_load_item_variation_store: missing varData\n" ));
520
+ error = FT_THROW( Invalid_Table );
521
+ goto Exit;
522
+ }
523
+
524
+ /* make temporary copy of item variation data offsets; */
525
+ /* we will parse region list first, then come back */
526
+ if ( FT_QNEW_ARRAY( dataOffsetArray, data_count ) )
527
+ goto Exit;
528
+
529
+ for ( i = 0; i < data_count; i++ )
530
+ {
531
+ if ( FT_READ_ULONG( dataOffsetArray[i] ) )
532
+ goto Exit;
533
+ }
534
+
535
+ /* parse array of region records (region list) */
536
+ if ( FT_STREAM_SEEK( offset + region_offset ) )
537
+ goto Exit;
538
+
539
+ if ( FT_READ_USHORT( axis_count ) ||
540
+ FT_READ_USHORT( region_count ) )
541
+ goto Exit;
542
+
543
+ if ( axis_count != (FT_Long)blend->mmvar->num_axis )
544
+ {
545
+ FT_TRACE2(( "tt_var_load_item_variation_store:"
546
+ " number of axes in item variation store\n" ));
547
+ FT_TRACE2(( " "
548
+ " and `fvar' table are different\n" ));
549
+ error = FT_THROW( Invalid_Table );
550
+ goto Exit;
551
+ }
552
+ itemStore->axisCount = axis_count;
553
+
554
+ /* new constraint in OpenType 1.8.4 */
555
+ if ( region_count >= 32768U )
556
+ {
557
+ FT_TRACE2(( "tt_var_load_item_variation_store:"
558
+ " too many variation region tables\n" ));
559
+ error = FT_THROW( Invalid_Table );
560
+ goto Exit;
561
+ }
562
+
563
+ if ( FT_NEW_ARRAY( itemStore->varRegionList, region_count ) )
564
+ goto Exit;
565
+ itemStore->regionCount = region_count;
566
+
567
+ for ( i = 0; i < itemStore->regionCount; i++ )
568
+ {
569
+ GX_AxisCoords axisCoords;
570
+
571
+
572
+ if ( FT_NEW_ARRAY( itemStore->varRegionList[i].axisList, axis_count ) )
573
+ goto Exit;
574
+
575
+ axisCoords = itemStore->varRegionList[i].axisList;
576
+
577
+ for ( j = 0; j < itemStore->axisCount; j++ )
578
+ {
579
+ FT_Int start, peak, end;
580
+
581
+
582
+ if ( FT_READ_SHORT( start ) ||
583
+ FT_READ_SHORT( peak ) ||
584
+ FT_READ_SHORT( end ) )
585
+ goto Exit;
586
+
587
+ /* immediately tag invalid ranges with special peak = 0 */
588
+ if ( ( start < 0 && end > 0 ) || start > peak || peak > end )
589
+ peak = 0;
590
+
591
+ axisCoords[j].startCoord = FT_fdot14ToFixed( start );
592
+ axisCoords[j].peakCoord = FT_fdot14ToFixed( peak );
593
+ axisCoords[j].endCoord = FT_fdot14ToFixed( end );
594
+ }
595
+ }
596
+
597
+ /* end of region list parse */
598
+
599
+ /* use dataOffsetArray now to parse varData items */
600
+ if ( FT_NEW_ARRAY( itemStore->varData, data_count ) )
601
+ goto Exit;
602
+ itemStore->dataCount = data_count;
603
+
604
+ for ( i = 0; i < data_count; i++ )
605
+ {
606
+ GX_ItemVarData varData = &itemStore->varData[i];
607
+
608
+ FT_UInt item_count;
609
+ FT_UShort word_delta_count;
610
+ FT_UInt region_idx_count;
611
+ FT_UInt per_region_size;
612
+
613
+
614
+ if ( FT_STREAM_SEEK( offset + dataOffsetArray[i] ) )
615
+ goto Exit;
616
+
617
+ if ( FT_READ_USHORT( item_count ) ||
618
+ FT_READ_USHORT( word_delta_count ) ||
619
+ FT_READ_USHORT( region_idx_count ) )
620
+ goto Exit;
621
+
622
+ long_words = !!( word_delta_count & 0x8000 );
623
+ word_delta_count &= 0x7FFF;
624
+
625
+ /* check some data consistency */
626
+ if ( word_delta_count > region_idx_count )
627
+ {
628
+ FT_TRACE2(( "bad short count %d or region count %d\n",
629
+ word_delta_count,
630
+ region_idx_count ));
631
+ error = FT_THROW( Invalid_Table );
632
+ goto Exit;
633
+ }
634
+
635
+ if ( region_idx_count > itemStore->regionCount )
636
+ {
637
+ FT_TRACE2(( "inconsistent regionCount %d in varData[%d]\n",
638
+ region_idx_count,
639
+ i ));
640
+ error = FT_THROW( Invalid_Table );
641
+ goto Exit;
642
+ }
643
+
644
+ /* parse region indices */
645
+ if ( FT_NEW_ARRAY( varData->regionIndices, region_idx_count ) )
646
+ goto Exit;
647
+ varData->regionIdxCount = region_idx_count;
648
+ varData->wordDeltaCount = word_delta_count;
649
+ varData->longWords = long_words;
650
+
651
+ for ( j = 0; j < varData->regionIdxCount; j++ )
652
+ {
653
+ if ( FT_READ_USHORT( varData->regionIndices[j] ) )
654
+ goto Exit;
655
+
656
+ if ( varData->regionIndices[j] >= itemStore->regionCount )
657
+ {
658
+ FT_TRACE2(( "bad region index %d\n",
659
+ varData->regionIndices[j] ));
660
+ error = FT_THROW( Invalid_Table );
661
+ goto Exit;
662
+ }
663
+ }
664
+
665
+ per_region_size = word_delta_count + region_idx_count;
666
+ if ( long_words )
667
+ per_region_size *= 2;
668
+
669
+ if ( FT_NEW_ARRAY( varData->deltaSet, per_region_size * item_count ) )
670
+ goto Exit;
671
+ if ( FT_Stream_Read( stream,
672
+ varData->deltaSet,
673
+ per_region_size * item_count ) )
674
+ {
675
+ FT_TRACE2(( "deltaSet read failed." ));
676
+ error = FT_THROW( Invalid_Table );
677
+ goto Exit;
678
+ }
679
+
680
+ varData->itemCount = item_count;
681
+ }
682
+
683
+ Exit:
684
+ FT_FREE( dataOffsetArray );
685
+
686
+ return error;
687
+ }
688
+
689
+
690
+ FT_LOCAL_DEF( FT_Error )
691
+ tt_var_load_delta_set_index_mapping( FT_Face face, /* TT_Face */
692
+ FT_ULong offset,
693
+ GX_DeltaSetIdxMap map,
694
+ GX_ItemVarStore itemStore,
695
+ FT_ULong table_len )
696
+ {
697
+ FT_Stream stream = FT_FACE_STREAM( face );
698
+ FT_Memory memory = stream->memory;
699
+
700
+ FT_Error error;
701
+
702
+ FT_Byte format;
703
+ FT_Byte entryFormat;
704
+ FT_UInt entrySize;
705
+ FT_UInt innerBitCount;
706
+ FT_UInt innerIndexMask;
707
+ FT_ULong i;
708
+ FT_UInt j;
709
+
710
+
711
+ if ( FT_STREAM_SEEK( offset ) ||
712
+ FT_READ_BYTE( format ) ||
713
+ FT_READ_BYTE( entryFormat ) )
714
+ goto Exit;
715
+
716
+ if ( format == 0 )
717
+ {
718
+ if ( FT_READ_USHORT( map->mapCount ) )
719
+ goto Exit;
720
+ }
721
+ else if ( format == 1 ) /* new in OpenType 1.9 */
722
+ {
723
+ if ( FT_READ_ULONG( map->mapCount ) )
724
+ goto Exit;
725
+ }
726
+ else
727
+ {
728
+ FT_TRACE2(( "bad map format %d\n", format ));
729
+ error = FT_THROW( Invalid_Table );
730
+ goto Exit;
731
+ }
732
+
733
+ if ( entryFormat & 0xC0 )
734
+ {
735
+ FT_TRACE2(( "bad entry format %d\n", format ));
736
+ error = FT_THROW( Invalid_Table );
737
+ goto Exit;
738
+ }
739
+
740
+ /* bytes per entry: 1, 2, 3, or 4 */
741
+ entrySize = ( ( entryFormat & 0x30 ) >> 4 ) + 1;
742
+ innerBitCount = ( entryFormat & 0x0F ) + 1;
743
+ innerIndexMask = ( 1 << innerBitCount ) - 1;
744
+
745
+ /* rough sanity check */
746
+ if ( map->mapCount * entrySize > table_len )
747
+ {
748
+ FT_TRACE1(( "tt_var_load_delta_set_index_mapping:"
749
+ " invalid number of delta-set index mappings\n" ));
750
+ error = FT_THROW( Invalid_Table );
751
+ goto Exit;
752
+ }
753
+
754
+ if ( FT_NEW_ARRAY( map->innerIndex, map->mapCount ) )
755
+ goto Exit;
756
+
757
+ if ( FT_NEW_ARRAY( map->outerIndex, map->mapCount ) )
758
+ goto Exit;
759
+
760
+ for ( i = 0; i < map->mapCount; i++ )
761
+ {
762
+ FT_UInt mapData = 0;
763
+ FT_UInt outerIndex, innerIndex;
764
+
765
+
766
+ /* read map data one unsigned byte at a time, big endian */
767
+ for ( j = 0; j < entrySize; j++ )
768
+ {
769
+ FT_Byte data;
770
+
771
+
772
+ if ( FT_READ_BYTE( data ) )
773
+ goto Exit;
774
+
775
+ mapData = ( mapData << 8 ) | data;
776
+ }
777
+
778
+ /* new in OpenType 1.8.4 */
779
+ if ( mapData == 0xFFFFFFFFUL )
780
+ {
781
+ /* no variation data for this item */
782
+ map->outerIndex[i] = 0xFFFFU;
783
+ map->innerIndex[i] = 0xFFFFU;
784
+
785
+ continue;
786
+ }
787
+
788
+ outerIndex = mapData >> innerBitCount;
789
+
790
+ if ( outerIndex >= itemStore->dataCount )
791
+ {
792
+ FT_TRACE2(( "outerIndex[%ld] == %d out of range\n",
793
+ i,
794
+ outerIndex ));
795
+ error = FT_THROW( Invalid_Table );
796
+ goto Exit;
797
+ }
798
+
799
+ map->outerIndex[i] = outerIndex;
800
+
801
+ innerIndex = mapData & innerIndexMask;
802
+
803
+ if ( innerIndex >= itemStore->varData[outerIndex].itemCount )
804
+ {
805
+ FT_TRACE2(( "innerIndex[%ld] == %d out of range\n",
806
+ i,
807
+ innerIndex ));
808
+ error = FT_THROW( Invalid_Table );
809
+ goto Exit;
810
+ }
811
+
812
+ map->innerIndex[i] = innerIndex;
813
+ }
814
+
815
+ Exit:
816
+ return error;
817
+ }
818
+
819
+
820
+ /**************************************************************************
821
+ *
822
+ * @Function:
823
+ * ft_var_load_hvvar
824
+ *
825
+ * @Description:
826
+ * If `vertical' is zero, parse the `HVAR' table and set
827
+ * `blend->hvar_loaded' to TRUE. On success, `blend->hvar_checked'
828
+ * is set to TRUE.
829
+ *
830
+ * If `vertical' is not zero, parse the `VVAR' table and set
831
+ * `blend->vvar_loaded' to TRUE. On success, `blend->vvar_checked'
832
+ * is set to TRUE.
833
+ *
834
+ * Some memory may remain allocated on error; it is always freed in
835
+ * `tt_done_blend', however.
836
+ *
837
+ * @InOut:
838
+ * face ::
839
+ * The font face.
840
+ *
841
+ * @Return:
842
+ * FreeType error code. 0 means success.
843
+ */
844
+ static FT_Error
845
+ ft_var_load_hvvar( TT_Face face,
846
+ FT_Bool vertical )
847
+ {
848
+ FT_Stream stream = FT_FACE_STREAM( face );
849
+ FT_Memory memory = stream->memory;
850
+
851
+ GX_Blend blend = face->blend;
852
+
853
+ GX_HVVarTable table;
854
+
855
+ FT_Error error;
856
+ FT_UShort majorVersion;
857
+ FT_ULong table_len;
858
+ FT_ULong table_offset;
859
+ FT_ULong store_offset;
860
+ FT_ULong widthMap_offset;
861
+
862
+
863
+ if ( vertical )
864
+ {
865
+ blend->vvar_loaded = TRUE;
866
+
867
+ FT_TRACE2(( "VVAR " ));
868
+
869
+ error = face->goto_table( face, TTAG_VVAR, stream, &table_len );
870
+ }
871
+ else
872
+ {
873
+ blend->hvar_loaded = TRUE;
874
+
875
+ FT_TRACE2(( "HVAR " ));
876
+
877
+ error = face->goto_table( face, TTAG_HVAR, stream, &table_len );
878
+ }
879
+
880
+ if ( error )
881
+ {
882
+ FT_TRACE2(( "is missing\n" ));
883
+ goto Exit;
884
+ }
885
+
886
+ table_offset = FT_STREAM_POS();
887
+
888
+ /* skip minor version */
889
+ if ( FT_READ_USHORT( majorVersion ) ||
890
+ FT_STREAM_SKIP( 2 ) )
891
+ goto Exit;
892
+
893
+ if ( majorVersion != 1 )
894
+ {
895
+ FT_TRACE2(( "bad table version %d\n", majorVersion ));
896
+ error = FT_THROW( Invalid_Table );
897
+ goto Exit;
898
+ }
899
+
900
+ if ( FT_READ_ULONG( store_offset ) ||
901
+ FT_READ_ULONG( widthMap_offset ) )
902
+ goto Exit;
903
+
904
+ if ( vertical )
905
+ {
906
+ if ( FT_NEW( blend->vvar_table ) )
907
+ goto Exit;
908
+ table = blend->vvar_table;
909
+ }
910
+ else
911
+ {
912
+ if ( FT_NEW( blend->hvar_table ) )
913
+ goto Exit;
914
+ table = blend->hvar_table;
915
+ }
916
+
917
+ error = tt_var_load_item_variation_store(
918
+ FT_FACE( face ),
919
+ table_offset + store_offset,
920
+ &table->itemStore );
921
+ if ( error )
922
+ goto Exit;
923
+
924
+ if ( widthMap_offset )
925
+ {
926
+ error = tt_var_load_delta_set_index_mapping(
927
+ FT_FACE( face ),
928
+ table_offset + widthMap_offset,
929
+ &table->widthMap,
930
+ &table->itemStore,
931
+ table_len );
932
+ if ( error )
933
+ goto Exit;
934
+ }
935
+
936
+ FT_TRACE2(( "loaded\n" ));
937
+ error = FT_Err_Ok;
938
+
939
+ Exit:
940
+ if ( !error )
941
+ {
942
+ if ( vertical )
943
+ {
944
+ blend->vvar_checked = TRUE;
945
+
946
+ /* FreeType doesn't provide functions to quickly retrieve */
947
+ /* TSB, BSB, or VORG values; we thus don't have to implement */
948
+ /* support for those three item variation stores. */
949
+
950
+ face->variation_support |= TT_FACE_FLAG_VAR_VADVANCE;
951
+ }
952
+ else
953
+ {
954
+ blend->hvar_checked = TRUE;
955
+
956
+ /* FreeType doesn't provide functions to quickly retrieve */
957
+ /* LSB or RSB values; we thus don't have to implement */
958
+ /* support for those two item variation stores. */
959
+
960
+ face->variation_support |= TT_FACE_FLAG_VAR_HADVANCE;
961
+ }
962
+ }
963
+
964
+ return error;
965
+ }
966
+
967
+
968
+ FT_LOCAL_DEF( FT_ItemVarDelta )
969
+ tt_var_get_item_delta( FT_Face face, /* TT_Face */
970
+ GX_ItemVarStore itemStore,
971
+ FT_UInt outerIndex,
972
+ FT_UInt innerIndex )
973
+ {
974
+ TT_Face ttface = (TT_Face)face;
975
+ FT_Stream stream = FT_FACE_STREAM( face );
976
+ FT_Memory memory = stream->memory;
977
+ FT_Error error = FT_Err_Ok;
978
+
979
+ GX_ItemVarData varData;
980
+ FT_ItemVarDelta* deltaSet = NULL;
981
+ FT_ItemVarDelta deltaSetStack[16];
982
+
983
+ FT_Fixed* scalars = NULL;
984
+ FT_Fixed scalarsStack[16];
985
+
986
+ FT_UInt master, j;
987
+ FT_ItemVarDelta returnValue = 0;
988
+ FT_UInt per_region_size;
989
+ FT_Byte* bytes;
990
+
991
+
992
+ if ( !ttface->blend || !ttface->blend->normalizedcoords )
993
+ return 0;
994
+
995
+ /* OpenType 1.8.4+: No variation data for this item */
996
+ /* as indices have special value 0xFFFF. */
997
+ if ( outerIndex == 0xFFFF && innerIndex == 0xFFFF )
998
+ return 0;
999
+
1000
+ /* See pseudo code from `Font Variations Overview' */
1001
+ /* in the OpenType specification. */
1002
+
1003
+ if ( outerIndex >= itemStore->dataCount )
1004
+ return 0; /* Out of range. */
1005
+
1006
+ varData = &itemStore->varData[outerIndex];
1007
+
1008
+ if ( innerIndex >= varData->itemCount )
1009
+ return 0; /* Out of range. */
1010
+
1011
+ if ( varData->regionIdxCount == 0 )
1012
+ return 0; /* Avoid "applying zero offset to null pointer". */
1013
+
1014
+ if ( varData->regionIdxCount < 16 )
1015
+ {
1016
+ deltaSet = deltaSetStack;
1017
+ scalars = scalarsStack;
1018
+ }
1019
+ else
1020
+ {
1021
+ if ( FT_QNEW_ARRAY( deltaSet, varData->regionIdxCount ) )
1022
+ goto Exit;
1023
+ if ( FT_QNEW_ARRAY( scalars, varData->regionIdxCount ) )
1024
+ goto Exit;
1025
+ }
1026
+
1027
+ /* Parse delta set. */
1028
+ /* */
1029
+ /* Deltas are (word_delta_count + region_idx_count) bytes each */
1030
+ /* if `longWords` isn't set, and twice as much otherwise. */
1031
+ per_region_size = varData->wordDeltaCount + varData->regionIdxCount;
1032
+ if ( varData->longWords )
1033
+ per_region_size *= 2;
1034
+
1035
+ bytes = varData->deltaSet + per_region_size * innerIndex;
1036
+
1037
+ if ( varData->longWords )
1038
+ {
1039
+ for ( master = 0; master < varData->wordDeltaCount; master++ )
1040
+ deltaSet[master] = FT_NEXT_LONG( bytes );
1041
+ for ( ; master < varData->regionIdxCount; master++ )
1042
+ deltaSet[master] = FT_NEXT_SHORT( bytes );
1043
+ }
1044
+ else
1045
+ {
1046
+ for ( master = 0; master < varData->wordDeltaCount; master++ )
1047
+ deltaSet[master] = FT_NEXT_SHORT( bytes );
1048
+ for ( ; master < varData->regionIdxCount; master++ )
1049
+ deltaSet[master] = FT_NEXT_CHAR( bytes );
1050
+ }
1051
+
1052
+ /* outer loop steps through master designs to be blended */
1053
+ for ( master = 0; master < varData->regionIdxCount; master++ )
1054
+ {
1055
+ FT_Fixed scalar = 0x10000L;
1056
+ FT_UInt regionIndex = varData->regionIndices[master];
1057
+
1058
+ GX_AxisCoords axis = itemStore->varRegionList[regionIndex].axisList;
1059
+
1060
+
1061
+ /* inner loop steps through axes in this region */
1062
+ for ( j = 0; j < itemStore->axisCount; j++, axis++ )
1063
+ {
1064
+ FT_Fixed ncv = ttface->blend->normalizedcoords[j];
1065
+
1066
+
1067
+ /* compute the scalar contribution of this axis */
1068
+ /* with peak of 0 used for invalid axes */
1069
+ if ( axis->peakCoord == ncv ||
1070
+ axis->peakCoord == 0 )
1071
+ continue;
1072
+
1073
+ /* ignore this region if coords are out of range */
1074
+ else if ( ncv <= axis->startCoord ||
1075
+ ncv >= axis->endCoord )
1076
+ {
1077
+ scalar = 0;
1078
+ break;
1079
+ }
1080
+
1081
+ /* cumulative product of all the axis scalars */
1082
+ else if ( ncv < axis->peakCoord )
1083
+ scalar = FT_MulDiv( scalar,
1084
+ ncv - axis->startCoord,
1085
+ axis->peakCoord - axis->startCoord );
1086
+ else /* ncv > axis->peakCoord */
1087
+ scalar = FT_MulDiv( scalar,
1088
+ axis->endCoord - ncv,
1089
+ axis->endCoord - axis->peakCoord );
1090
+
1091
+ } /* per-axis loop */
1092
+
1093
+ scalars[master] = scalar;
1094
+
1095
+ } /* per-region loop */
1096
+
1097
+
1098
+ /* Compute the scaled delta for this region.
1099
+ *
1100
+ * From: https://docs.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#item-variation-store-header-and-item-variation-data-subtables:
1101
+ *
1102
+ * `Fixed` is a 32-bit (16.16) type and, in the general case, requires
1103
+ * 32-bit deltas. As described above, the `DeltaSet` record can
1104
+ * accommodate deltas that are, logically, either 16-bit or 32-bit.
1105
+ * When scaled deltas are applied to `Fixed` values, the `Fixed` value
1106
+ * is treated like a 32-bit integer.
1107
+ *
1108
+ * `FT_MulAddFix` internally uses 64-bit precision; it thus can handle
1109
+ * deltas ranging from small 8-bit to large 32-bit values that are
1110
+ * applied to 16.16 `FT_Fixed` / OpenType `Fixed` values.
1111
+ */
1112
+ returnValue = FT_MulAddFix( scalars, deltaSet, varData->regionIdxCount );
1113
+
1114
+ Exit:
1115
+ if ( scalars != scalarsStack )
1116
+ FT_FREE( scalars );
1117
+ if ( deltaSet != deltaSetStack )
1118
+ FT_FREE( deltaSet );
1119
+
1120
+ return returnValue;
1121
+ }
1122
+
1123
+
1124
+ /**************************************************************************
1125
+ *
1126
+ * @Function:
1127
+ * tt_hvadvance_adjust
1128
+ *
1129
+ * @Description:
1130
+ * Apply `HVAR' advance width or `VVAR' advance height adjustment of
1131
+ * a given glyph.
1132
+ *
1133
+ * @Input:
1134
+ * gindex ::
1135
+ * The glyph index.
1136
+ *
1137
+ * vertical ::
1138
+ * If set, handle `VVAR' table.
1139
+ *
1140
+ * @InOut:
1141
+ * face ::
1142
+ * The font face.
1143
+ *
1144
+ * adelta ::
1145
+ * Points to width or height value that gets modified.
1146
+ */
1147
+ static FT_Error
1148
+ tt_hvadvance_adjust( TT_Face face,
1149
+ FT_UInt gindex,
1150
+ FT_Int *avalue,
1151
+ FT_Bool vertical )
1152
+ {
1153
+ FT_Error error = FT_Err_Ok;
1154
+ FT_UInt innerIndex, outerIndex;
1155
+ FT_Int delta;
1156
+
1157
+ GX_HVVarTable table;
1158
+
1159
+
1160
+ if ( !face->doblend || !face->blend )
1161
+ goto Exit;
1162
+
1163
+ if ( vertical )
1164
+ {
1165
+ if ( !face->blend->vvar_loaded )
1166
+ {
1167
+ /* initialize vvar table */
1168
+ face->blend->vvar_error = ft_var_load_hvvar( face, 1 );
1169
+ }
1170
+
1171
+ if ( !face->blend->vvar_checked )
1172
+ {
1173
+ error = face->blend->vvar_error;
1174
+ goto Exit;
1175
+ }
1176
+
1177
+ table = face->blend->vvar_table;
1178
+ }
1179
+ else
1180
+ {
1181
+ if ( !face->blend->hvar_loaded )
1182
+ {
1183
+ /* initialize hvar table */
1184
+ face->blend->hvar_error = ft_var_load_hvvar( face, 0 );
1185
+ }
1186
+
1187
+ if ( !face->blend->hvar_checked )
1188
+ {
1189
+ error = face->blend->hvar_error;
1190
+ goto Exit;
1191
+ }
1192
+
1193
+ table = face->blend->hvar_table;
1194
+ }
1195
+
1196
+ /* advance width or height adjustments are always present in an */
1197
+ /* `HVAR' or `VVAR' table; no need to test for this capability */
1198
+
1199
+ if ( table->widthMap.innerIndex )
1200
+ {
1201
+ FT_UInt idx = gindex;
1202
+
1203
+
1204
+ if ( idx >= table->widthMap.mapCount )
1205
+ idx = table->widthMap.mapCount - 1;
1206
+
1207
+ /* trust that HVAR parser has checked indices */
1208
+ outerIndex = table->widthMap.outerIndex[idx];
1209
+ innerIndex = table->widthMap.innerIndex[idx];
1210
+ }
1211
+ else
1212
+ {
1213
+ /* no widthMap data */
1214
+ outerIndex = 0;
1215
+ innerIndex = gindex;
1216
+ }
1217
+
1218
+ delta = tt_var_get_item_delta( FT_FACE( face ),
1219
+ &table->itemStore,
1220
+ outerIndex,
1221
+ innerIndex );
1222
+
1223
+ if ( delta )
1224
+ {
1225
+ FT_TRACE5(( "%s value %d adjusted by %d unit%s (%s)\n",
1226
+ vertical ? "vertical height" : "horizontal width",
1227
+ *avalue,
1228
+ delta,
1229
+ delta == 1 ? "" : "s",
1230
+ vertical ? "VVAR" : "HVAR" ));
1231
+
1232
+ *avalue = ADD_INT( *avalue, delta );
1233
+ }
1234
+
1235
+ Exit:
1236
+ return error;
1237
+ }
1238
+
1239
+
1240
+ FT_LOCAL_DEF( FT_Error )
1241
+ tt_hadvance_adjust( FT_Face face, /* TT_Face */
1242
+ FT_UInt gindex,
1243
+ FT_Int *avalue )
1244
+ {
1245
+ return tt_hvadvance_adjust( (TT_Face)face, gindex, avalue, 0 );
1246
+ }
1247
+
1248
+
1249
+ FT_LOCAL_DEF( FT_Error )
1250
+ tt_vadvance_adjust( FT_Face face, /* TT_Face */
1251
+ FT_UInt gindex,
1252
+ FT_Int *avalue )
1253
+ {
1254
+ return tt_hvadvance_adjust( (TT_Face)face, gindex, avalue, 1 );
1255
+ }
1256
+
1257
+
1258
+ #define GX_VALUE_SIZE 8
1259
+
1260
+ /* all values are FT_Short or FT_UShort entities; */
1261
+ /* we treat them consistently as FT_Short */
1262
+ #define GX_VALUE_CASE( tag, dflt ) \
1263
+ case MVAR_TAG_ ## tag : \
1264
+ p = (FT_Short*)&face->dflt; \
1265
+ break
1266
+
1267
+ #define GX_GASP_CASE( idx ) \
1268
+ case MVAR_TAG_GASP_ ## idx : \
1269
+ if ( idx < face->gasp.numRanges - 1 ) \
1270
+ p = (FT_Short*)&face->gasp.gaspRanges[idx].maxPPEM; \
1271
+ else \
1272
+ p = NULL; \
1273
+ break
1274
+
1275
+
1276
+ static FT_Short*
1277
+ ft_var_get_value_pointer( TT_Face face,
1278
+ FT_ULong mvar_tag )
1279
+ {
1280
+ FT_Short* p;
1281
+
1282
+
1283
+ switch ( mvar_tag )
1284
+ {
1285
+ GX_GASP_CASE( 0 );
1286
+ GX_GASP_CASE( 1 );
1287
+ GX_GASP_CASE( 2 );
1288
+ GX_GASP_CASE( 3 );
1289
+ GX_GASP_CASE( 4 );
1290
+ GX_GASP_CASE( 5 );
1291
+ GX_GASP_CASE( 6 );
1292
+ GX_GASP_CASE( 7 );
1293
+ GX_GASP_CASE( 8 );
1294
+ GX_GASP_CASE( 9 );
1295
+
1296
+ GX_VALUE_CASE( CPHT, os2.sCapHeight );
1297
+ GX_VALUE_CASE( HASC, os2.sTypoAscender );
1298
+ GX_VALUE_CASE( HCLA, os2.usWinAscent );
1299
+ GX_VALUE_CASE( HCLD, os2.usWinDescent );
1300
+ GX_VALUE_CASE( HCOF, horizontal.caret_Offset );
1301
+ GX_VALUE_CASE( HCRN, horizontal.caret_Slope_Run );
1302
+ GX_VALUE_CASE( HCRS, horizontal.caret_Slope_Rise );
1303
+ GX_VALUE_CASE( HDSC, os2.sTypoDescender );
1304
+ GX_VALUE_CASE( HLGP, os2.sTypoLineGap );
1305
+ GX_VALUE_CASE( SBXO, os2.ySubscriptXOffset);
1306
+ GX_VALUE_CASE( SBXS, os2.ySubscriptXSize );
1307
+ GX_VALUE_CASE( SBYO, os2.ySubscriptYOffset );
1308
+ GX_VALUE_CASE( SBYS, os2.ySubscriptYSize );
1309
+ GX_VALUE_CASE( SPXO, os2.ySuperscriptXOffset );
1310
+ GX_VALUE_CASE( SPXS, os2.ySuperscriptXSize );
1311
+ GX_VALUE_CASE( SPYO, os2.ySuperscriptYOffset );
1312
+ GX_VALUE_CASE( SPYS, os2.ySuperscriptYSize );
1313
+ GX_VALUE_CASE( STRO, os2.yStrikeoutPosition );
1314
+ GX_VALUE_CASE( STRS, os2.yStrikeoutSize );
1315
+ GX_VALUE_CASE( UNDO, postscript.underlinePosition );
1316
+ GX_VALUE_CASE( UNDS, postscript.underlineThickness );
1317
+ GX_VALUE_CASE( VASC, vertical.Ascender );
1318
+ GX_VALUE_CASE( VCOF, vertical.caret_Offset );
1319
+ GX_VALUE_CASE( VCRN, vertical.caret_Slope_Run );
1320
+ GX_VALUE_CASE( VCRS, vertical.caret_Slope_Rise );
1321
+ GX_VALUE_CASE( VDSC, vertical.Descender );
1322
+ GX_VALUE_CASE( VLGP, vertical.Line_Gap );
1323
+ GX_VALUE_CASE( XHGT, os2.sxHeight );
1324
+
1325
+ default:
1326
+ /* ignore unknown tag */
1327
+ p = NULL;
1328
+ }
1329
+
1330
+ return p;
1331
+ }
1332
+
1333
+
1334
+ /**************************************************************************
1335
+ *
1336
+ * @Function:
1337
+ * ft_var_load_mvar
1338
+ *
1339
+ * @Description:
1340
+ * Parse the `MVAR' table.
1341
+ *
1342
+ * Some memory may remain allocated on error; it is always freed in
1343
+ * `tt_done_blend', however.
1344
+ *
1345
+ * @InOut:
1346
+ * face ::
1347
+ * The font face.
1348
+ */
1349
+ static void
1350
+ ft_var_load_mvar( TT_Face face )
1351
+ {
1352
+ FT_Stream stream = FT_FACE_STREAM( face );
1353
+ FT_Memory memory = stream->memory;
1354
+
1355
+ GX_Blend blend = face->blend;
1356
+ GX_ItemVarStore itemStore;
1357
+ GX_Value value, limit;
1358
+
1359
+ FT_Error error;
1360
+ FT_UShort majorVersion;
1361
+ FT_ULong table_len;
1362
+ FT_ULong table_offset;
1363
+ FT_UShort store_offset;
1364
+ FT_ULong records_offset;
1365
+
1366
+
1367
+ FT_TRACE2(( "MVAR " ));
1368
+
1369
+ error = face->goto_table( face, TTAG_MVAR, stream, &table_len );
1370
+ if ( error )
1371
+ {
1372
+ FT_TRACE2(( "is missing\n" ));
1373
+ return;
1374
+ }
1375
+
1376
+ table_offset = FT_STREAM_POS();
1377
+
1378
+ /* skip minor version */
1379
+ if ( FT_READ_USHORT( majorVersion ) ||
1380
+ FT_STREAM_SKIP( 2 ) )
1381
+ return;
1382
+
1383
+ if ( majorVersion != 1 )
1384
+ {
1385
+ FT_TRACE2(( "bad table version %d\n", majorVersion ));
1386
+ return;
1387
+ }
1388
+
1389
+ if ( FT_NEW( blend->mvar_table ) )
1390
+ return;
1391
+
1392
+ /* skip reserved entry and value record size */
1393
+ if ( FT_STREAM_SKIP( 4 ) ||
1394
+ FT_READ_USHORT( blend->mvar_table->valueCount ) ||
1395
+ FT_READ_USHORT( store_offset ) )
1396
+ return;
1397
+
1398
+ records_offset = FT_STREAM_POS();
1399
+
1400
+ error = tt_var_load_item_variation_store(
1401
+ FT_FACE( face ),
1402
+ table_offset + store_offset,
1403
+ &blend->mvar_table->itemStore );
1404
+ if ( error )
1405
+ return;
1406
+
1407
+ if ( FT_NEW_ARRAY( blend->mvar_table->values,
1408
+ blend->mvar_table->valueCount ) )
1409
+ return;
1410
+
1411
+ if ( FT_STREAM_SEEK( records_offset ) ||
1412
+ FT_FRAME_ENTER( blend->mvar_table->valueCount * GX_VALUE_SIZE ) )
1413
+ return;
1414
+
1415
+ value = blend->mvar_table->values;
1416
+ limit = FT_OFFSET( value, blend->mvar_table->valueCount );
1417
+ itemStore = &blend->mvar_table->itemStore;
1418
+
1419
+ for ( ; value < limit; value++ )
1420
+ {
1421
+ value->tag = FT_GET_ULONG();
1422
+ value->outerIndex = FT_GET_USHORT();
1423
+ value->innerIndex = FT_GET_USHORT();
1424
+
1425
+ /* new in OpenType 1.8.4 */
1426
+ if ( value->outerIndex == 0xFFFFU && value->innerIndex == 0xFFFFU )
1427
+ {
1428
+ /* no variation data for this item */
1429
+ continue;
1430
+ }
1431
+
1432
+ if ( value->outerIndex >= itemStore->dataCount ||
1433
+ value->innerIndex >= itemStore->varData[value->outerIndex]
1434
+ .itemCount )
1435
+ {
1436
+ error = FT_THROW( Invalid_Table );
1437
+ break;
1438
+ }
1439
+ }
1440
+
1441
+ FT_FRAME_EXIT();
1442
+
1443
+ if ( error )
1444
+ return;
1445
+
1446
+ FT_TRACE2(( "loaded\n" ));
1447
+
1448
+ value = blend->mvar_table->values;
1449
+ limit = FT_OFFSET( value, blend->mvar_table->valueCount );
1450
+
1451
+ /* save original values of the data MVAR is going to modify */
1452
+ for ( ; value < limit; value++ )
1453
+ {
1454
+ FT_Short* p = ft_var_get_value_pointer( face, value->tag );
1455
+
1456
+
1457
+ if ( p )
1458
+ value->unmodified = *p;
1459
+ #ifdef FT_DEBUG_LEVEL_TRACE
1460
+ else
1461
+ FT_TRACE1(( "ft_var_load_mvar: Ignoring unknown tag `%c%c%c%c'\n",
1462
+ (FT_Char)( value->tag >> 24 ),
1463
+ (FT_Char)( value->tag >> 16 ),
1464
+ (FT_Char)( value->tag >> 8 ),
1465
+ (FT_Char)( value->tag ) ));
1466
+ #endif
1467
+ }
1468
+
1469
+ face->variation_support |= TT_FACE_FLAG_VAR_MVAR;
1470
+ }
1471
+
1472
+
1473
+ static FT_Error
1474
+ ft_size_reset_iterator( FT_ListNode node,
1475
+ void* user )
1476
+ {
1477
+ FT_Size size = (FT_Size)node->data;
1478
+ FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)user;
1479
+
1480
+
1481
+ var->size_reset( size );
1482
+
1483
+ return FT_Err_Ok;
1484
+ }
1485
+
1486
+
1487
+ /**************************************************************************
1488
+ *
1489
+ * @Function:
1490
+ * tt_apply_mvar
1491
+ *
1492
+ * @Description:
1493
+ * Apply `MVAR' table adjustments.
1494
+ *
1495
+ * @InOut:
1496
+ * face ::
1497
+ * The font face.
1498
+ */
1499
+ FT_LOCAL_DEF( void )
1500
+ tt_apply_mvar( FT_Face face ) /* TT_Face */
1501
+ {
1502
+ TT_Face ttface = (TT_Face)face;
1503
+
1504
+ GX_Blend blend = ttface->blend;
1505
+ GX_Value value, limit;
1506
+
1507
+ FT_Short mvar_hasc_delta = 0;
1508
+ FT_Short mvar_hdsc_delta = 0;
1509
+ FT_Short mvar_hlgp_delta = 0;
1510
+
1511
+
1512
+ if ( !( ttface->variation_support & TT_FACE_FLAG_VAR_MVAR ) )
1513
+ return;
1514
+
1515
+ value = blend->mvar_table->values;
1516
+ limit = FT_OFFSET( value, blend->mvar_table->valueCount );
1517
+
1518
+ for ( ; value < limit; value++ )
1519
+ {
1520
+ FT_Short* p = ft_var_get_value_pointer( ttface, value->tag );
1521
+ FT_Int delta;
1522
+
1523
+
1524
+ delta = tt_var_get_item_delta( face,
1525
+ &blend->mvar_table->itemStore,
1526
+ value->outerIndex,
1527
+ value->innerIndex );
1528
+
1529
+ if ( p && delta )
1530
+ {
1531
+ FT_TRACE5(( "value %c%c%c%c (%d unit%s) adjusted by %d unit%s (MVAR)\n",
1532
+ (FT_Char)( value->tag >> 24 ),
1533
+ (FT_Char)( value->tag >> 16 ),
1534
+ (FT_Char)( value->tag >> 8 ),
1535
+ (FT_Char)( value->tag ),
1536
+ value->unmodified,
1537
+ value->unmodified == 1 ? "" : "s",
1538
+ delta,
1539
+ delta == 1 ? "" : "s" ));
1540
+
1541
+ /* since we handle both signed and unsigned values as FT_Short, */
1542
+ /* ensure proper overflow arithmetic */
1543
+ *p = (FT_Short)( value->unmodified + (FT_Short)delta );
1544
+
1545
+ /* Treat hasc, hdsc and hlgp specially, see below. */
1546
+ if ( value->tag == MVAR_TAG_HASC )
1547
+ mvar_hasc_delta = (FT_Short)delta;
1548
+ else if ( value->tag == MVAR_TAG_HDSC )
1549
+ mvar_hdsc_delta = (FT_Short)delta;
1550
+ else if ( value->tag == MVAR_TAG_HLGP )
1551
+ mvar_hlgp_delta = (FT_Short)delta;
1552
+ }
1553
+ }
1554
+
1555
+ /* adjust all derived values */
1556
+ {
1557
+ FT_Service_MetricsVariations var =
1558
+ (FT_Service_MetricsVariations)ttface->face_var;
1559
+
1560
+ /*
1561
+ * Apply the deltas of hasc, hdsc and hlgp to the FT_Face's ascender,
1562
+ * descender and height attributes, no matter how they were originally
1563
+ * computed.
1564
+ *
1565
+ * (Code that ignores those and accesses the font's metrics values
1566
+ * directly is already served by the delta application code above.)
1567
+ *
1568
+ * The MVAR table supports variations for both typo and win metrics.
1569
+ * According to Behdad Esfahbod, the thinking of the working group was
1570
+ * that no one uses win metrics anymore for setting line metrics (the
1571
+ * specification even calls these metrics "horizontal clipping
1572
+ * ascent/descent", probably for their role on the Windows platform in
1573
+ * computing clipping boxes), and new fonts should use typo metrics, so
1574
+ * typo deltas should be applied to whatever sfnt_load_face decided the
1575
+ * line metrics should be.
1576
+ *
1577
+ * Before, the following led to different line metrics between default
1578
+ * outline and instances, visible when e.g. the default outlines were
1579
+ * used as the regular face and instances for everything else:
1580
+ *
1581
+ * 1. sfnt_load_face applied the hhea metrics by default.
1582
+ * 2. This code later applied the typo metrics by default, regardless of
1583
+ * whether they were actually changed or the font had the OS/2 table's
1584
+ * fsSelection's bit 7 (USE_TYPO_METRICS) set.
1585
+ */
1586
+ FT_Short current_line_gap = face->height - face->ascender +
1587
+ face->descender;
1588
+
1589
+
1590
+ face->ascender = face->ascender + mvar_hasc_delta;
1591
+ face->descender = face->descender + mvar_hdsc_delta;
1592
+ face->height = face->ascender - face->descender +
1593
+ current_line_gap + mvar_hlgp_delta;
1594
+
1595
+ face->underline_position = ttface->postscript.underlinePosition -
1596
+ ttface->postscript.underlineThickness / 2;
1597
+ face->underline_thickness = ttface->postscript.underlineThickness;
1598
+
1599
+ /* iterate over all FT_Size objects and call `var->size_reset' */
1600
+ /* to propagate the metrics changes */
1601
+ if ( var && var->size_reset )
1602
+ FT_List_Iterate( &face->sizes_list,
1603
+ ft_size_reset_iterator,
1604
+ (void*)var );
1605
+ }
1606
+ }
1607
+
1608
+
1609
+ typedef struct GX_GVar_Head_
1610
+ {
1611
+ FT_Long version;
1612
+ FT_UShort axisCount;
1613
+ FT_UShort globalCoordCount;
1614
+ FT_ULong offsetToCoord;
1615
+ FT_UShort glyphCount;
1616
+ FT_UShort flags;
1617
+ FT_ULong offsetToData;
1618
+
1619
+ } GX_GVar_Head;
1620
+
1621
+
1622
+ /**************************************************************************
1623
+ *
1624
+ * @Function:
1625
+ * ft_var_load_gvar
1626
+ *
1627
+ * @Description:
1628
+ * Parse the `gvar' table if present. If `fvar' is there, `gvar' had
1629
+ * better be there too.
1630
+ *
1631
+ * @InOut:
1632
+ * face ::
1633
+ * The font face.
1634
+ *
1635
+ * @Return:
1636
+ * FreeType error code. 0 means success.
1637
+ */
1638
+ static FT_Error
1639
+ ft_var_load_gvar( TT_Face face )
1640
+ {
1641
+ FT_Stream stream = FT_FACE_STREAM( face );
1642
+ FT_Memory memory = stream->memory;
1643
+ GX_Blend blend = face->blend;
1644
+ FT_Error error;
1645
+ FT_UInt i, j;
1646
+ FT_ULong table_len;
1647
+ FT_ULong gvar_start;
1648
+ FT_ULong offsetToData;
1649
+ FT_ULong offsets_len;
1650
+ GX_GVar_Head gvar_head;
1651
+
1652
+ static const FT_Frame_Field gvar_fields[] =
1653
+ {
1654
+
1655
+ #undef FT_STRUCTURE
1656
+ #define FT_STRUCTURE GX_GVar_Head
1657
+
1658
+ FT_FRAME_START( 20 ),
1659
+ FT_FRAME_LONG ( version ),
1660
+ FT_FRAME_USHORT( axisCount ),
1661
+ FT_FRAME_USHORT( globalCoordCount ),
1662
+ FT_FRAME_ULONG ( offsetToCoord ),
1663
+ FT_FRAME_USHORT( glyphCount ),
1664
+ FT_FRAME_USHORT( flags ),
1665
+ FT_FRAME_ULONG ( offsetToData ),
1666
+ FT_FRAME_END
1667
+ };
1668
+
1669
+
1670
+ FT_TRACE2(( "GVAR " ));
1671
+
1672
+ if ( FT_SET_ERROR( face->goto_table( face,
1673
+ TTAG_gvar,
1674
+ stream,
1675
+ &table_len ) ) )
1676
+ {
1677
+ FT_TRACE2(( "is missing\n" ));
1678
+ goto Exit;
1679
+ }
1680
+
1681
+ gvar_start = FT_STREAM_POS( );
1682
+ if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) )
1683
+ goto Exit;
1684
+
1685
+ if ( gvar_head.version != 0x00010000L )
1686
+ {
1687
+ FT_TRACE1(( "bad table version\n" ));
1688
+ error = FT_THROW( Invalid_Table );
1689
+ goto Exit;
1690
+ }
1691
+
1692
+ if ( gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
1693
+ {
1694
+ FT_TRACE1(( "ft_var_load_gvar:"
1695
+ " number of axes in `gvar' and `cvar'\n" ));
1696
+ FT_TRACE1(( " table are different\n" ));
1697
+ error = FT_THROW( Invalid_Table );
1698
+ goto Exit;
1699
+ }
1700
+
1701
+ /* rough sanity check, ignoring offsets */
1702
+ if ( (FT_ULong)gvar_head.globalCoordCount * gvar_head.axisCount >
1703
+ table_len / 2 )
1704
+ {
1705
+ FT_TRACE1(( "ft_var_load_gvar:"
1706
+ " invalid number of global coordinates\n" ));
1707
+ error = FT_THROW( Invalid_Table );
1708
+ goto Exit;
1709
+ }
1710
+
1711
+ /* offsets can be either 2 or 4 bytes */
1712
+ /* (one more offset than glyphs, to mark size of last) */
1713
+ offsets_len = ( gvar_head.glyphCount + 1 ) *
1714
+ ( ( gvar_head.flags & 1 ) ? 4L : 2L );
1715
+
1716
+ /* rough sanity check */
1717
+ if (offsets_len > table_len )
1718
+ {
1719
+ FT_TRACE1(( "ft_var_load_gvar: invalid number of glyphs\n" ));
1720
+ error = FT_THROW( Invalid_Table );
1721
+ goto Exit;
1722
+ }
1723
+
1724
+ FT_TRACE2(( "loaded\n" ));
1725
+
1726
+ blend->gvar_size = table_len;
1727
+ offsetToData = gvar_start + gvar_head.offsetToData;
1728
+
1729
+ FT_TRACE5(( "gvar: there %s %d shared coordinate%s:\n",
1730
+ gvar_head.globalCoordCount == 1 ? "is" : "are",
1731
+ gvar_head.globalCoordCount,
1732
+ gvar_head.globalCoordCount == 1 ? "" : "s" ));
1733
+
1734
+ if ( FT_FRAME_ENTER( offsets_len ) )
1735
+ goto Exit;
1736
+
1737
+ /* offsets (one more offset than glyphs, to mark size of last) */
1738
+ if ( FT_QNEW_ARRAY( blend->glyphoffsets, gvar_head.glyphCount + 1 ) )
1739
+ goto Fail2;
1740
+
1741
+ if ( gvar_head.flags & 1 )
1742
+ {
1743
+ FT_ULong limit = gvar_start + table_len;
1744
+ FT_ULong max_offset = 0;
1745
+
1746
+
1747
+ for ( i = 0; i <= gvar_head.glyphCount; i++ )
1748
+ {
1749
+ blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG();
1750
+
1751
+ if ( max_offset <= blend->glyphoffsets[i] )
1752
+ max_offset = blend->glyphoffsets[i];
1753
+ else
1754
+ {
1755
+ FT_TRACE2(( "ft_var_load_gvar:"
1756
+ " glyph variation data offset %d not monotonic\n",
1757
+ i ));
1758
+ blend->glyphoffsets[i] = max_offset;
1759
+ }
1760
+
1761
+ /* use `<', not `<=' */
1762
+ if ( limit < blend->glyphoffsets[i] )
1763
+ {
1764
+ FT_TRACE2(( "ft_var_load_gvar:"
1765
+ " glyph variation data offset %d out of range\n",
1766
+ i ));
1767
+ blend->glyphoffsets[i] = limit;
1768
+ }
1769
+ }
1770
+ }
1771
+ else
1772
+ {
1773
+ FT_ULong limit = gvar_start + table_len;
1774
+ FT_ULong max_offset = 0;
1775
+
1776
+
1777
+ for ( i = 0; i <= gvar_head.glyphCount; i++ )
1778
+ {
1779
+ blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;
1780
+
1781
+ if ( max_offset <= blend->glyphoffsets[i] )
1782
+ max_offset = blend->glyphoffsets[i];
1783
+ else
1784
+ {
1785
+ FT_TRACE2(( "ft_var_load_gvar:"
1786
+ " glyph variation data offset %d not monotonic\n",
1787
+ i ));
1788
+ blend->glyphoffsets[i] = max_offset;
1789
+ }
1790
+
1791
+ /* use `<', not `<=' */
1792
+ if ( limit < blend->glyphoffsets[i] )
1793
+ {
1794
+ FT_TRACE2(( "ft_var_load_gvar:"
1795
+ " glyph variation data offset %d out of range\n",
1796
+ i ));
1797
+ blend->glyphoffsets[i] = limit;
1798
+ }
1799
+ }
1800
+ }
1801
+
1802
+ blend->gv_glyphcnt = gvar_head.glyphCount;
1803
+
1804
+ FT_FRAME_EXIT();
1805
+
1806
+ if ( gvar_head.globalCoordCount != 0 )
1807
+ {
1808
+ if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) ||
1809
+ FT_FRAME_ENTER( gvar_head.globalCoordCount *
1810
+ gvar_head.axisCount * 2L ) )
1811
+ {
1812
+ FT_TRACE2(( "ft_var_load_gvar:"
1813
+ " glyph variation shared tuples missing\n" ));
1814
+ goto Fail;
1815
+ }
1816
+
1817
+ if ( FT_QNEW_ARRAY( blend->tuplecoords,
1818
+ gvar_head.axisCount * gvar_head.globalCoordCount ) )
1819
+ goto Fail2;
1820
+
1821
+ for ( i = 0; i < gvar_head.globalCoordCount; i++ )
1822
+ {
1823
+ FT_TRACE5(( " [ " ));
1824
+ for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ )
1825
+ {
1826
+ blend->tuplecoords[i * gvar_head.axisCount + j] =
1827
+ FT_fdot14ToFixed( FT_GET_SHORT() );
1828
+ FT_TRACE5(( "%.5f ",
1829
+ (double)blend->tuplecoords[i * gvar_head.axisCount + j] / 65536 ));
1830
+ }
1831
+ FT_TRACE5(( "]\n" ));
1832
+ }
1833
+
1834
+ blend->tuplecount = gvar_head.globalCoordCount;
1835
+
1836
+ FT_TRACE5(( "\n" ));
1837
+
1838
+ FT_FRAME_EXIT();
1839
+ }
1840
+
1841
+ Exit:
1842
+ return error;
1843
+
1844
+ Fail2:
1845
+ FT_FRAME_EXIT();
1846
+
1847
+ Fail:
1848
+ FT_FREE( blend->glyphoffsets );
1849
+ blend->gv_glyphcnt = 0;
1850
+ goto Exit;
1851
+ }
1852
+
1853
+
1854
+ /**************************************************************************
1855
+ *
1856
+ * @Function:
1857
+ * ft_var_apply_tuple
1858
+ *
1859
+ * @Description:
1860
+ * Figure out whether a given tuple (design) applies to the current
1861
+ * blend, and if so, what is the scaling factor.
1862
+ *
1863
+ * @Input:
1864
+ * blend ::
1865
+ * The current blend of the font.
1866
+ *
1867
+ * tupleIndex ::
1868
+ * A flag saying whether this is an intermediate
1869
+ * tuple or not.
1870
+ *
1871
+ * tuple_coords ::
1872
+ * The coordinates of the tuple in normalized axis
1873
+ * units.
1874
+ *
1875
+ * im_start_coords ::
1876
+ * The initial coordinates where this tuple starts
1877
+ * to apply (for intermediate coordinates).
1878
+ *
1879
+ * im_end_coords ::
1880
+ * The final coordinates after which this tuple no
1881
+ * longer applies (for intermediate coordinates).
1882
+ *
1883
+ * @Return:
1884
+ * An FT_Fixed value containing the scaling factor.
1885
+ */
1886
+ static FT_Fixed
1887
+ ft_var_apply_tuple( GX_Blend blend,
1888
+ FT_UShort tupleIndex,
1889
+ FT_Fixed* tuple_coords,
1890
+ FT_Fixed* im_start_coords,
1891
+ FT_Fixed* im_end_coords )
1892
+ {
1893
+ FT_UInt i;
1894
+ FT_Fixed apply = 0x10000L;
1895
+
1896
+
1897
+ for ( i = 0; i < blend->num_axis; i++ )
1898
+ {
1899
+ FT_Fixed ncv = blend->normalizedcoords[i];
1900
+
1901
+
1902
+ FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 ));
1903
+
1904
+ /* It's not clear why (for intermediate tuples) we don't need */
1905
+ /* to check against start/end -- the documentation says we don't. */
1906
+ /* Similarly, it's unclear why we don't need to scale along the */
1907
+ /* axis. */
1908
+
1909
+ if ( tuple_coords[i] == ncv )
1910
+ {
1911
+ FT_TRACE6(( " tuple coordinate %.5f fits perfectly\n",
1912
+ (double)tuple_coords[i] / 65536 ));
1913
+ /* `apply' does not change */
1914
+ continue;
1915
+ }
1916
+
1917
+ if ( tuple_coords[i] == 0 )
1918
+ {
1919
+ FT_TRACE6(( " tuple coordinate is zero, ignore\n" ));
1920
+ continue;
1921
+ }
1922
+
1923
+ if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
1924
+ {
1925
+ /* not an intermediate tuple */
1926
+
1927
+ if ( ( tuple_coords[i] > ncv && ncv > 0 ) ||
1928
+ ( tuple_coords[i] < ncv && ncv < 0 ) )
1929
+ {
1930
+ FT_TRACE6(( " tuple coordinate %.5f fits\n",
1931
+ (double)tuple_coords[i] / 65536 ));
1932
+ apply = FT_MulDiv( apply, ncv, tuple_coords[i] );
1933
+ }
1934
+ else
1935
+ {
1936
+ FT_TRACE6(( " tuple coordinate %.5f is exceeded, stop\n",
1937
+ (double)tuple_coords[i] / 65536 ));
1938
+ apply = 0;
1939
+ break;
1940
+ }
1941
+ }
1942
+ else
1943
+ {
1944
+ /* intermediate tuple */
1945
+
1946
+ if ( ncv <= im_start_coords[i] ||
1947
+ ncv >= im_end_coords[i] )
1948
+ {
1949
+ FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ is exceeded,"
1950
+ " stop\n",
1951
+ (double)im_start_coords[i] / 65536,
1952
+ (double)im_end_coords[i] / 65536 ));
1953
+ apply = 0;
1954
+ break;
1955
+ }
1956
+
1957
+ FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ fits\n",
1958
+ (double)im_start_coords[i] / 65536,
1959
+ (double)im_end_coords[i] / 65536 ));
1960
+ if ( ncv < tuple_coords[i] )
1961
+ apply = FT_MulDiv( apply,
1962
+ ncv - im_start_coords[i],
1963
+ tuple_coords[i] - im_start_coords[i] );
1964
+ else /* ncv > tuple_coords[i] */
1965
+ apply = FT_MulDiv( apply,
1966
+ im_end_coords[i] - ncv,
1967
+ im_end_coords[i] - tuple_coords[i] );
1968
+ }
1969
+ }
1970
+
1971
+ FT_TRACE6(( " apply factor is %.5f\n", (double)apply / 65536 ));
1972
+
1973
+ return apply;
1974
+ }
1975
+
1976
+
1977
+ /* convert from design coordinates to normalized coordinates */
1978
+
1979
+ static void
1980
+ ft_var_to_normalized( TT_Face face,
1981
+ FT_UInt num_coords,
1982
+ FT_Fixed* coords,
1983
+ FT_Fixed* normalized )
1984
+ {
1985
+ FT_Error error = FT_Err_Ok;
1986
+ FT_Memory memory = face->root.memory;
1987
+ FT_UInt i, j;
1988
+
1989
+ GX_Blend blend;
1990
+ FT_MM_Var* mmvar;
1991
+ FT_Var_Axis* a;
1992
+ GX_AVarSegment av;
1993
+
1994
+ FT_Fixed* new_normalized = NULL;
1995
+ FT_Fixed* old_normalized;
1996
+
1997
+
1998
+ blend = face->blend;
1999
+ mmvar = blend->mmvar;
2000
+
2001
+ if ( num_coords > mmvar->num_axis )
2002
+ {
2003
+ FT_TRACE2(( "ft_var_to_normalized:"
2004
+ " only using first %d of %d coordinates\n",
2005
+ mmvar->num_axis, num_coords ));
2006
+ num_coords = mmvar->num_axis;
2007
+ }
2008
+
2009
+ /* Axis normalization is a two-stage process. First we normalize */
2010
+ /* based on the [min,def,max] values for the axis to be [-1,0,1]. */
2011
+ /* Then, if there's an `avar' table, we renormalize this range. */
2012
+
2013
+ a = mmvar->axis;
2014
+ for ( i = 0; i < num_coords; i++, a++ )
2015
+ {
2016
+ FT_Fixed coord = coords[i];
2017
+
2018
+
2019
+ FT_TRACE5(( " %d: %.5f\n", i, (double)coord / 65536 ));
2020
+ if ( coord > a->maximum || coord < a->minimum )
2021
+ {
2022
+ FT_TRACE1(( "ft_var_to_normalized: design coordinate %.5f\n",
2023
+ (double)coord / 65536 ));
2024
+ FT_TRACE1(( " is out of range [%.5f;%.5f];"
2025
+ " clamping\n",
2026
+ (double)a->minimum / 65536,
2027
+ (double)a->maximum / 65536 ));
2028
+ }
2029
+
2030
+ if ( coord > a->def )
2031
+ normalized[i] = coord >= a->maximum ? 0x10000L :
2032
+ FT_DivFix( SUB_LONG( coord, a->def ),
2033
+ SUB_LONG( a->maximum, a->def ) );
2034
+ else if ( coord < a->def )
2035
+ normalized[i] = coord <= a->minimum ? -0x10000L :
2036
+ FT_DivFix( SUB_LONG( coord, a->def ),
2037
+ SUB_LONG( a->def, a->minimum ) );
2038
+ else
2039
+ normalized[i] = 0;
2040
+ }
2041
+
2042
+ FT_TRACE5(( "\n" ));
2043
+
2044
+ for ( ; i < mmvar->num_axis; i++ )
2045
+ normalized[i] = 0;
2046
+
2047
+ if ( blend->avar_table )
2048
+ {
2049
+ GX_AVarTable table = blend->avar_table;
2050
+
2051
+
2052
+ FT_TRACE5(( "normalized design coordinates"
2053
+ " before applying `avar' data:\n" ));
2054
+
2055
+ if ( table->avar_segment )
2056
+ {
2057
+ av = table->avar_segment;
2058
+
2059
+ for ( i = 0; i < mmvar->num_axis; i++, av++ )
2060
+ {
2061
+ for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
2062
+ {
2063
+ if ( normalized[i] < av->correspondence[j].fromCoord )
2064
+ {
2065
+ FT_TRACE5(( " %.5f\n", (double)normalized[i] / 65536 ));
2066
+
2067
+ normalized[i] =
2068
+ FT_MulDiv( normalized[i] - av->correspondence[j - 1].fromCoord,
2069
+ av->correspondence[j].toCoord -
2070
+ av->correspondence[j - 1].toCoord,
2071
+ av->correspondence[j].fromCoord -
2072
+ av->correspondence[j - 1].fromCoord ) +
2073
+ av->correspondence[j - 1].toCoord;
2074
+ break;
2075
+ }
2076
+ }
2077
+ }
2078
+ }
2079
+
2080
+ if ( table->itemStore.varData )
2081
+ {
2082
+ if ( FT_QNEW_ARRAY( new_normalized, mmvar->num_axis ) )
2083
+ return;
2084
+
2085
+ /* Install our half-normalized coordinates for the next */
2086
+ /* Item Variation Store to work with. */
2087
+ old_normalized = face->blend->normalizedcoords;
2088
+ face->blend->normalizedcoords = normalized;
2089
+
2090
+ for ( i = 0; i < mmvar->num_axis; i++ )
2091
+ {
2092
+ FT_Fixed v = normalized[i];
2093
+ FT_UInt innerIndex = i;
2094
+ FT_UInt outerIndex = 0;
2095
+ FT_Int delta;
2096
+
2097
+
2098
+ if ( table->axisMap.innerIndex )
2099
+ {
2100
+ FT_UInt idx = i;
2101
+
2102
+
2103
+ if ( idx >= table->axisMap.mapCount )
2104
+ idx = table->axisMap.mapCount - 1;
2105
+
2106
+ outerIndex = table->axisMap.outerIndex[idx];
2107
+ innerIndex = table->axisMap.innerIndex[idx];
2108
+ }
2109
+
2110
+ delta = tt_var_get_item_delta( FT_FACE( face ),
2111
+ &table->itemStore,
2112
+ outerIndex,
2113
+ innerIndex );
2114
+
2115
+ /* Convert delta in F2DOT14 to 16.16 before adding. */
2116
+ v += MUL_INT( delta, 4 );
2117
+
2118
+ /* Clamp value to range [-1, 1]. */
2119
+ v = v >= 0x10000L ? 0x10000 : v;
2120
+ v = v <= -0x10000L ? -0x10000 : v;
2121
+
2122
+ new_normalized[i] = v;
2123
+ }
2124
+
2125
+ for ( i = 0; i < mmvar->num_axis; i++ )
2126
+ {
2127
+ normalized[i] = new_normalized[i];
2128
+ }
2129
+
2130
+ face->blend->normalizedcoords = old_normalized;
2131
+
2132
+ FT_FREE( new_normalized );
2133
+ }
2134
+ }
2135
+ }
2136
+
2137
+
2138
+ /* convert from normalized coordinates to design coordinates */
2139
+
2140
+ static void
2141
+ ft_var_to_design( TT_Face face,
2142
+ FT_UInt num_coords,
2143
+ FT_Fixed* coords,
2144
+ FT_Fixed* design )
2145
+ {
2146
+ GX_Blend blend;
2147
+ FT_MM_Var* mmvar;
2148
+ FT_Var_Axis* a;
2149
+
2150
+ FT_UInt i, j, nc;
2151
+
2152
+
2153
+ blend = face->blend;
2154
+
2155
+ nc = num_coords;
2156
+ if ( num_coords > blend->num_axis )
2157
+ {
2158
+ FT_TRACE2(( "ft_var_to_design:"
2159
+ " only using first %d of %d coordinates\n",
2160
+ blend->num_axis, num_coords ));
2161
+ nc = blend->num_axis;
2162
+ }
2163
+
2164
+ for ( i = 0; i < nc; i++ )
2165
+ design[i] = coords[i];
2166
+
2167
+ for ( ; i < num_coords; i++ )
2168
+ design[i] = 0;
2169
+
2170
+ if ( blend->avar_table && blend->avar_table->avar_segment )
2171
+ {
2172
+ GX_AVarSegment av = blend->avar_table->avar_segment;
2173
+
2174
+
2175
+ FT_TRACE5(( "design coordinates"
2176
+ " after removing `avar' distortion:\n" ));
2177
+
2178
+ for ( i = 0; i < nc; i++, av++ )
2179
+ {
2180
+ for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
2181
+ {
2182
+ if ( design[i] < av->correspondence[j].toCoord )
2183
+ {
2184
+ design[i] =
2185
+ FT_MulDiv( design[i] - av->correspondence[j - 1].toCoord,
2186
+ av->correspondence[j].fromCoord -
2187
+ av->correspondence[j - 1].fromCoord,
2188
+ av->correspondence[j].toCoord -
2189
+ av->correspondence[j - 1].toCoord ) +
2190
+ av->correspondence[j - 1].fromCoord;
2191
+
2192
+ FT_TRACE5(( " %.5f\n", (double)design[i] / 65536 ));
2193
+ break;
2194
+ }
2195
+ }
2196
+ }
2197
+ }
2198
+
2199
+ mmvar = blend->mmvar;
2200
+ a = mmvar->axis;
2201
+
2202
+ for ( i = 0; i < nc; i++, a++ )
2203
+ {
2204
+ if ( design[i] < 0 )
2205
+ design[i] = a->def + FT_MulFix( design[i],
2206
+ a->def - a->minimum );
2207
+ else if ( design[i] > 0 )
2208
+ design[i] = a->def + FT_MulFix( design[i],
2209
+ a->maximum - a->def );
2210
+ else
2211
+ design[i] = a->def;
2212
+ }
2213
+ }
2214
+
2215
+
2216
+ /*************************************************************************/
2217
+ /*************************************************************************/
2218
+ /***** *****/
2219
+ /***** MULTIPLE MASTERS SERVICE FUNCTIONS *****/
2220
+ /***** *****/
2221
+ /*************************************************************************/
2222
+ /*************************************************************************/
2223
+
2224
+
2225
+ typedef struct GX_FVar_Head_
2226
+ {
2227
+ FT_Long version;
2228
+ FT_UShort offsetToData;
2229
+ FT_UShort axisCount;
2230
+ FT_UShort axisSize;
2231
+ FT_UShort instanceCount;
2232
+ FT_UShort instanceSize;
2233
+
2234
+ } GX_FVar_Head;
2235
+
2236
+
2237
+ typedef struct fvar_axis_
2238
+ {
2239
+ FT_ULong axisTag;
2240
+ FT_Fixed minValue;
2241
+ FT_Fixed defaultValue;
2242
+ FT_Fixed maxValue;
2243
+ FT_UShort flags;
2244
+ FT_UShort nameID;
2245
+
2246
+ } GX_FVar_Axis;
2247
+
2248
+
2249
+ /**************************************************************************
2250
+ *
2251
+ * @Function:
2252
+ * TT_Get_MM_Var
2253
+ *
2254
+ * @Description:
2255
+ * Check that the font's `fvar' table is valid, parse it, and return
2256
+ * those data. It also loads (and parses) the `MVAR' table, if
2257
+ * possible.
2258
+ *
2259
+ * @InOut:
2260
+ * face ::
2261
+ * The font face.
2262
+ * TT_Get_MM_Var initializes the blend structure.
2263
+ *
2264
+ * @Output:
2265
+ * master ::
2266
+ * The `fvar' data (must be freed by caller). Can be NULL,
2267
+ * which makes this function simply load MM support.
2268
+ *
2269
+ * @Return:
2270
+ * FreeType error code. 0 means success.
2271
+ */
2272
+ FT_LOCAL_DEF( FT_Error )
2273
+ TT_Get_MM_Var( FT_Face face, /* TT_Face */
2274
+ FT_MM_Var* *master )
2275
+ {
2276
+ TT_Face ttface = (TT_Face)face;
2277
+ FT_Stream stream = FT_FACE_STREAM( face );
2278
+ FT_Memory memory = FT_FACE_MEMORY( face );
2279
+ FT_ULong table_len;
2280
+ FT_Error error = FT_Err_Ok;
2281
+ FT_ULong fvar_start = 0;
2282
+ FT_UInt i, j;
2283
+ FT_MM_Var* mmvar = NULL;
2284
+ FT_Fixed* next_coords;
2285
+ FT_Fixed* nsc;
2286
+ FT_String* next_name;
2287
+ FT_Var_Axis* a;
2288
+ FT_Fixed* c;
2289
+ FT_Var_Named_Style* ns;
2290
+ GX_FVar_Head fvar_head = { 0, 0, 0, 0, 0, 0 };
2291
+ FT_Bool usePsName = 0;
2292
+ FT_UInt num_instances;
2293
+ FT_UInt num_axes;
2294
+ FT_UShort* axis_flags;
2295
+
2296
+ FT_Offset mmvar_size;
2297
+ FT_Offset axis_flags_size;
2298
+ FT_Offset axis_size;
2299
+ FT_Offset namedstyle_size;
2300
+ FT_Offset next_coords_size;
2301
+ FT_Offset next_name_size;
2302
+
2303
+ FT_Bool need_init;
2304
+
2305
+ static const FT_Frame_Field fvar_fields[] =
2306
+ {
2307
+
2308
+ #undef FT_STRUCTURE
2309
+ #define FT_STRUCTURE GX_FVar_Head
2310
+
2311
+ FT_FRAME_START( 16 ),
2312
+ FT_FRAME_LONG ( version ),
2313
+ FT_FRAME_USHORT ( offsetToData ),
2314
+ FT_FRAME_SKIP_SHORT,
2315
+ FT_FRAME_USHORT ( axisCount ),
2316
+ FT_FRAME_USHORT ( axisSize ),
2317
+ FT_FRAME_USHORT ( instanceCount ),
2318
+ FT_FRAME_USHORT ( instanceSize ),
2319
+ FT_FRAME_END
2320
+ };
2321
+
2322
+ static const FT_Frame_Field fvaraxis_fields[] =
2323
+ {
2324
+
2325
+ #undef FT_STRUCTURE
2326
+ #define FT_STRUCTURE GX_FVar_Axis
2327
+
2328
+ FT_FRAME_START( 20 ),
2329
+ FT_FRAME_ULONG ( axisTag ),
2330
+ FT_FRAME_LONG ( minValue ),
2331
+ FT_FRAME_LONG ( defaultValue ),
2332
+ FT_FRAME_LONG ( maxValue ),
2333
+ FT_FRAME_USHORT( flags ),
2334
+ FT_FRAME_USHORT( nameID ),
2335
+ FT_FRAME_END
2336
+ };
2337
+
2338
+ /* `num_instances` holds the number of all named instances including */
2339
+ /* the default instance, which might be missing in the table of named */
2340
+ /* instances (in 'fvar'). This value is validated in `sfobjs.c` and */
2341
+ /* may be reset to 0 if consistency checks fail. */
2342
+ num_instances = (FT_UInt)face->style_flags >> 16;
2343
+
2344
+ /* read the font data and set up the internal representation */
2345
+ /* if not already done */
2346
+
2347
+ need_init = !ttface->blend;
2348
+
2349
+ if ( need_init )
2350
+ {
2351
+ FT_TRACE2(( "FVAR " ));
2352
+
2353
+ if ( FT_SET_ERROR( ttface->goto_table( ttface, TTAG_fvar,
2354
+ stream, &table_len ) ) )
2355
+ {
2356
+ FT_TRACE1(( "is missing\n" ));
2357
+ goto Exit;
2358
+ }
2359
+
2360
+ fvar_start = FT_STREAM_POS( );
2361
+
2362
+ /* the validity of the `fvar' header data was already checked */
2363
+ /* in function `sfnt_init_face' */
2364
+ if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) )
2365
+ goto Exit;
2366
+
2367
+ /* If `num_instances` is larger, synthetization of the default */
2368
+ /* instance is required. If `num_instances` is smaller, */
2369
+ /* however, the value has been reset to 0 in `sfnt_init_face` */
2370
+ /* (in `sfobjs.c`); in this case we have underallocated `mmvar` */
2371
+ /* structs. */
2372
+ if ( num_instances < fvar_head.instanceCount )
2373
+ {
2374
+ error = FT_THROW( Invalid_Table );
2375
+ goto Exit;
2376
+ }
2377
+
2378
+ usePsName = FT_BOOL( fvar_head.instanceSize ==
2379
+ 6 + 4 * fvar_head.axisCount );
2380
+
2381
+ FT_TRACE2(( "loaded\n" ));
2382
+
2383
+ FT_TRACE5(( "%d variation ax%s\n",
2384
+ fvar_head.axisCount,
2385
+ fvar_head.axisCount == 1 ? "is" : "es" ));
2386
+
2387
+ if ( FT_NEW( ttface->blend ) )
2388
+ goto Exit;
2389
+
2390
+ num_axes = fvar_head.axisCount;
2391
+ ttface->blend->num_axis = num_axes;
2392
+ }
2393
+ else
2394
+ num_axes = ttface->blend->num_axis;
2395
+
2396
+ /* prepare storage area for MM data; this cannot overflow */
2397
+ /* 32-bit arithmetic because of the size limits used in the */
2398
+ /* `fvar' table validity check in `sfnt_init_face' */
2399
+
2400
+ /* the various `*_size' variables, which we also use as */
2401
+ /* offsets into the `mmvar' array, must be multiples of the */
2402
+ /* pointer size (except the last one); without such an */
2403
+ /* alignment there might be runtime errors due to */
2404
+ /* misaligned addresses */
2405
+ #undef ALIGN_SIZE
2406
+ #define ALIGN_SIZE( n ) \
2407
+ ( ( (n) + sizeof (void*) - 1 ) & ~( sizeof (void*) - 1 ) )
2408
+
2409
+ mmvar_size = ALIGN_SIZE( sizeof ( FT_MM_Var ) );
2410
+ axis_flags_size = ALIGN_SIZE( num_axes *
2411
+ sizeof ( FT_UShort ) );
2412
+ axis_size = ALIGN_SIZE( num_axes *
2413
+ sizeof ( FT_Var_Axis ) );
2414
+ namedstyle_size = ALIGN_SIZE( num_instances *
2415
+ sizeof ( FT_Var_Named_Style ) );
2416
+ next_coords_size = ALIGN_SIZE( num_instances *
2417
+ num_axes *
2418
+ sizeof ( FT_Fixed ) );
2419
+ next_name_size = num_axes * 5;
2420
+
2421
+ if ( need_init )
2422
+ {
2423
+ ttface->blend->mmvar_len = mmvar_size +
2424
+ axis_flags_size +
2425
+ axis_size +
2426
+ namedstyle_size +
2427
+ next_coords_size +
2428
+ next_name_size;
2429
+
2430
+ if ( FT_ALLOC( mmvar, ttface->blend->mmvar_len ) )
2431
+ goto Exit;
2432
+ ttface->blend->mmvar = mmvar;
2433
+
2434
+ /* set up pointers and offsets into the `mmvar' array; */
2435
+ /* the data gets filled in later on */
2436
+
2437
+ mmvar->num_axis =
2438
+ num_axes;
2439
+ mmvar->num_designs =
2440
+ ~0U; /* meaningless in this context; each glyph */
2441
+ /* may have a different number of designs */
2442
+ /* (or tuples, as called by Apple) */
2443
+ mmvar->num_namedstyles =
2444
+ num_instances;
2445
+
2446
+ /* alas, no public field in `FT_Var_Axis' for axis flags */
2447
+ axis_flags =
2448
+ (FT_UShort*)( (char*)mmvar + mmvar_size );
2449
+ mmvar->axis =
2450
+ (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size );
2451
+ mmvar->namedstyle =
2452
+ (FT_Var_Named_Style*)( (char*)mmvar->axis + axis_size );
2453
+
2454
+ next_coords = (FT_Fixed*)( (char*)mmvar->namedstyle +
2455
+ namedstyle_size );
2456
+ for ( i = 0; i < num_instances; i++ )
2457
+ {
2458
+ mmvar->namedstyle[i].coords = next_coords;
2459
+ next_coords += num_axes;
2460
+ }
2461
+
2462
+ next_name = (FT_String*)( (char*)mmvar->namedstyle +
2463
+ namedstyle_size + next_coords_size );
2464
+ for ( i = 0; i < num_axes; i++ )
2465
+ {
2466
+ mmvar->axis[i].name = next_name;
2467
+ next_name += 5;
2468
+ }
2469
+
2470
+ /* now fill in the data */
2471
+
2472
+ if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) )
2473
+ goto Exit;
2474
+
2475
+ a = mmvar->axis;
2476
+ for ( i = 0; i < num_axes; i++ )
2477
+ {
2478
+ GX_FVar_Axis axis_rec;
2479
+
2480
+ #ifdef FT_DEBUG_LEVEL_TRACE
2481
+ int invalid = 0;
2482
+ #endif
2483
+
2484
+
2485
+ if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
2486
+ goto Exit;
2487
+ a->tag = axis_rec.axisTag;
2488
+ a->minimum = axis_rec.minValue;
2489
+ a->def = axis_rec.defaultValue;
2490
+ a->maximum = axis_rec.maxValue;
2491
+ a->strid = axis_rec.nameID;
2492
+
2493
+ a->name[0] = (FT_String)( a->tag >> 24 );
2494
+ a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF );
2495
+ a->name[2] = (FT_String)( ( a->tag >> 8 ) & 0xFF );
2496
+ a->name[3] = (FT_String)( ( a->tag ) & 0xFF );
2497
+ a->name[4] = '\0';
2498
+
2499
+ *axis_flags = axis_rec.flags;
2500
+
2501
+ if ( a->minimum > a->def ||
2502
+ a->def > a->maximum )
2503
+ {
2504
+ a->minimum = a->def;
2505
+ a->maximum = a->def;
2506
+
2507
+ #ifdef FT_DEBUG_LEVEL_TRACE
2508
+ invalid = 1;
2509
+ #endif
2510
+ }
2511
+
2512
+ #ifdef FT_DEBUG_LEVEL_TRACE
2513
+ if ( i == 0 )
2514
+ FT_TRACE5(( " idx tag "
2515
+ /* " XXX `XXXX'" */
2516
+ " minimum default maximum flags\n" ));
2517
+ /* " XXXX.XXXXX XXXX.XXXXX XXXX.XXXXX 0xXXXX" */
2518
+
2519
+ FT_TRACE5(( " %3d `%s'"
2520
+ " %10.5f %10.5f %10.5f 0x%04X%s\n",
2521
+ i,
2522
+ a->name,
2523
+ (double)a->minimum / 65536,
2524
+ (double)a->def / 65536,
2525
+ (double)a->maximum / 65536,
2526
+ *axis_flags,
2527
+ invalid ? " (invalid, disabled)" : "" ));
2528
+ #endif
2529
+
2530
+ a++;
2531
+ axis_flags++;
2532
+ }
2533
+
2534
+ FT_TRACE5(( "\n" ));
2535
+
2536
+ /* named instance coordinates are stored as design coordinates; */
2537
+ /* we have to convert them to normalized coordinates also */
2538
+ if ( FT_NEW_ARRAY( ttface->blend->normalized_stylecoords,
2539
+ num_axes * num_instances ) )
2540
+ goto Exit;
2541
+
2542
+ if ( fvar_head.instanceCount && !ttface->blend->avar_loaded )
2543
+ {
2544
+ FT_ULong offset = FT_STREAM_POS();
2545
+
2546
+
2547
+ ft_var_load_avar( ttface );
2548
+
2549
+ if ( FT_STREAM_SEEK( offset ) )
2550
+ goto Exit;
2551
+ }
2552
+
2553
+ FT_TRACE5(( "%d named instance%s\n",
2554
+ fvar_head.instanceCount,
2555
+ fvar_head.instanceCount == 1 ? "" : "s" ));
2556
+
2557
+ ns = mmvar->namedstyle;
2558
+ nsc = ttface->blend->normalized_stylecoords;
2559
+ for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
2560
+ {
2561
+ /* PostScript names add 2 bytes to the instance record size */
2562
+ if ( FT_FRAME_ENTER( ( usePsName ? 6L : 4L ) +
2563
+ 4L * num_axes ) )
2564
+ goto Exit;
2565
+
2566
+ ns->strid = FT_GET_USHORT();
2567
+ (void) /* flags = */ FT_GET_USHORT();
2568
+
2569
+ c = ns->coords;
2570
+ for ( j = 0; j < num_axes; j++, c++ )
2571
+ *c = FT_GET_LONG();
2572
+
2573
+ /* valid psid values are 6, [256;32767], and 0xFFFF */
2574
+ if ( usePsName )
2575
+ ns->psid = FT_GET_USHORT();
2576
+ else
2577
+ ns->psid = 0xFFFF;
2578
+
2579
+ #ifdef FT_DEBUG_LEVEL_TRACE
2580
+ {
2581
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
2582
+
2583
+ FT_String* strname = NULL;
2584
+ FT_String* psname = NULL;
2585
+
2586
+ FT_ULong pos;
2587
+
2588
+
2589
+ pos = FT_STREAM_POS();
2590
+
2591
+ if ( ns->strid != 0xFFFF )
2592
+ {
2593
+ (void)sfnt->get_name( ttface,
2594
+ (FT_UShort)ns->strid,
2595
+ &strname );
2596
+ if ( strname && !ft_strcmp( strname, ".notdef" ) )
2597
+ strname = NULL;
2598
+ }
2599
+
2600
+ if ( ns->psid != 0xFFFF )
2601
+ {
2602
+ (void)sfnt->get_name( ttface,
2603
+ (FT_UShort)ns->psid,
2604
+ &psname );
2605
+ if ( psname && !ft_strcmp( psname, ".notdef" ) )
2606
+ psname = NULL;
2607
+ }
2608
+
2609
+ (void)FT_STREAM_SEEK( pos );
2610
+
2611
+ FT_TRACE5(( " named instance %d (%s%s%s, %s%s%s)\n",
2612
+ i,
2613
+ strname ? "name: `" : "",
2614
+ strname ? strname : "unnamed",
2615
+ strname ? "'" : "",
2616
+ psname ? "PS name: `" : "",
2617
+ psname ? psname : "no PS name",
2618
+ psname ? "'" : "" ));
2619
+
2620
+ FT_FREE( strname );
2621
+ FT_FREE( psname );
2622
+ }
2623
+ #endif /* FT_DEBUG_LEVEL_TRACE */
2624
+
2625
+ ft_var_to_normalized( ttface, num_axes, ns->coords, nsc );
2626
+ nsc += num_axes;
2627
+
2628
+ FT_FRAME_EXIT();
2629
+ }
2630
+
2631
+ if ( num_instances != fvar_head.instanceCount )
2632
+ {
2633
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
2634
+
2635
+ FT_Int found, dummy1, dummy2;
2636
+ FT_UInt strid = ~0U;
2637
+
2638
+
2639
+ /* The default instance is missing in array the */
2640
+ /* of named instances; try to synthesize an entry. */
2641
+ /* If this fails, `default_named_instance` remains */
2642
+ /* at value zero, which doesn't do any harm. */
2643
+ found = sfnt->get_name_id( ttface,
2644
+ TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY,
2645
+ &dummy1,
2646
+ &dummy2 );
2647
+ if ( found )
2648
+ strid = TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY;
2649
+ else
2650
+ {
2651
+ found = sfnt->get_name_id( ttface,
2652
+ TT_NAME_ID_FONT_SUBFAMILY,
2653
+ &dummy1,
2654
+ &dummy2 );
2655
+ if ( found )
2656
+ strid = TT_NAME_ID_FONT_SUBFAMILY;
2657
+ }
2658
+
2659
+ if ( found )
2660
+ {
2661
+ found = sfnt->get_name_id( ttface,
2662
+ TT_NAME_ID_PS_NAME,
2663
+ &dummy1,
2664
+ &dummy2 );
2665
+ if ( found )
2666
+ {
2667
+ FT_TRACE5(( "TT_Get_MM_Var:"
2668
+ " Adding default instance to named instances\n" ));
2669
+
2670
+ /* named instance indices start with value 1 */
2671
+ ttface->var_default_named_instance = num_instances;
2672
+
2673
+ ns = &mmvar->namedstyle[fvar_head.instanceCount];
2674
+
2675
+ ns->strid = strid;
2676
+ ns->psid = TT_NAME_ID_PS_NAME;
2677
+
2678
+ a = mmvar->axis;
2679
+ c = ns->coords;
2680
+ for ( j = 0; j < num_axes; j++, a++, c++ )
2681
+ *c = a->def;
2682
+ }
2683
+ }
2684
+ }
2685
+
2686
+ ft_var_load_mvar( ttface );
2687
+ }
2688
+
2689
+ /* fill the output array if requested */
2690
+
2691
+ if ( master )
2692
+ {
2693
+ FT_UInt n;
2694
+
2695
+
2696
+ if ( FT_DUP( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ) )
2697
+ goto Exit;
2698
+
2699
+ axis_flags =
2700
+ (FT_UShort*)( (char*)mmvar + mmvar_size );
2701
+ mmvar->axis =
2702
+ (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size );
2703
+ mmvar->namedstyle =
2704
+ (FT_Var_Named_Style*)( (char*)mmvar->axis+ axis_size );
2705
+
2706
+ next_coords = (FT_Fixed*)( (char*)mmvar->namedstyle +
2707
+ namedstyle_size );
2708
+ for ( n = 0; n < mmvar->num_namedstyles; n++ )
2709
+ {
2710
+ mmvar->namedstyle[n].coords = next_coords;
2711
+ next_coords += num_axes;
2712
+ }
2713
+
2714
+ a = mmvar->axis;
2715
+ next_name = (FT_String*)( (char*)mmvar->namedstyle +
2716
+ namedstyle_size + next_coords_size );
2717
+ for ( n = 0; n < num_axes; n++ )
2718
+ {
2719
+ a->name = next_name;
2720
+
2721
+ /* standard PostScript names for some standard apple tags */
2722
+ if ( a->tag == TTAG_wght )
2723
+ a->name = (char*)"Weight";
2724
+ else if ( a->tag == TTAG_wdth )
2725
+ a->name = (char*)"Width";
2726
+ else if ( a->tag == TTAG_opsz )
2727
+ a->name = (char*)"OpticalSize";
2728
+ else if ( a->tag == TTAG_slnt )
2729
+ a->name = (char*)"Slant";
2730
+ else if ( a->tag == TTAG_ital )
2731
+ a->name = (char*)"Italic";
2732
+
2733
+ next_name += 5;
2734
+ a++;
2735
+ }
2736
+
2737
+ *master = mmvar;
2738
+ }
2739
+
2740
+ Exit:
2741
+ return error;
2742
+ }
2743
+
2744
+
2745
+ static FT_Error
2746
+ tt_set_mm_blend( TT_Face face,
2747
+ FT_UInt num_coords,
2748
+ FT_Fixed* coords,
2749
+ FT_Bool set_design_coords )
2750
+ {
2751
+ FT_Error error = FT_Err_Ok;
2752
+ GX_Blend blend;
2753
+ FT_MM_Var* mmvar;
2754
+ FT_UInt i;
2755
+
2756
+ FT_Bool all_design_coords = FALSE;
2757
+
2758
+ FT_Memory memory = face->root.memory;
2759
+
2760
+ enum
2761
+ {
2762
+ mcvt_retain,
2763
+ mcvt_modify,
2764
+ mcvt_load
2765
+
2766
+ } manageCvt;
2767
+
2768
+
2769
+ face->doblend = FALSE;
2770
+
2771
+ if ( !face->blend )
2772
+ {
2773
+ if ( FT_SET_ERROR( TT_Get_MM_Var( FT_FACE( face ), NULL ) ) )
2774
+ goto Exit;
2775
+ }
2776
+
2777
+ blend = face->blend;
2778
+ mmvar = blend->mmvar;
2779
+
2780
+ if ( num_coords > mmvar->num_axis )
2781
+ {
2782
+ FT_TRACE2(( "TT_Set_MM_Blend:"
2783
+ " only using first %d of %d coordinates\n",
2784
+ mmvar->num_axis, num_coords ));
2785
+ num_coords = mmvar->num_axis;
2786
+ }
2787
+
2788
+ FT_TRACE5(( "TT_Set_MM_Blend:\n" ));
2789
+ FT_TRACE5(( " normalized design coordinates:\n" ));
2790
+
2791
+ for ( i = 0; i < num_coords; i++ )
2792
+ {
2793
+ FT_TRACE5(( " %.5f\n", (double)coords[i] / 65536 ));
2794
+ if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
2795
+ {
2796
+ FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.5f\n",
2797
+ (double)coords[i] / 65536 ));
2798
+ FT_TRACE1(( " is out of range [-1;1]\n" ));
2799
+ error = FT_THROW( Invalid_Argument );
2800
+ goto Exit;
2801
+ }
2802
+ }
2803
+
2804
+ FT_TRACE5(( "\n" ));
2805
+
2806
+ if ( !face->is_cff2 && !blend->glyphoffsets )
2807
+ {
2808
+ /* While a missing 'gvar' table is acceptable, for example for */
2809
+ /* fonts that only vary metrics information or 'COLR' v1 */
2810
+ /* `PaintVar*` tables, an incorrect SFNT table offset or size */
2811
+ /* for 'gvar', or an inconsistent 'gvar' table is not. */
2812
+ error = ft_var_load_gvar( face );
2813
+ if ( error != FT_Err_Table_Missing && error != FT_Err_Ok )
2814
+ goto Exit;
2815
+ error = FT_Err_Ok;
2816
+ }
2817
+
2818
+ if ( !blend->coords )
2819
+ {
2820
+ if ( FT_NEW_ARRAY( blend->coords, mmvar->num_axis ) )
2821
+ goto Exit;
2822
+
2823
+ /* the first time we have to compute all design coordinates */
2824
+ all_design_coords = TRUE;
2825
+ }
2826
+
2827
+ if ( !blend->normalizedcoords )
2828
+ {
2829
+ if ( FT_NEW_ARRAY( blend->normalizedcoords, mmvar->num_axis ) )
2830
+ goto Exit;
2831
+
2832
+ manageCvt = mcvt_modify;
2833
+
2834
+ /* If we have not set the blend coordinates before this, then the */
2835
+ /* cvt table will still be what we read from the `cvt ' table and */
2836
+ /* we don't need to reload it. We may need to change it though... */
2837
+ }
2838
+ else
2839
+ {
2840
+ FT_Bool have_diff = 0;
2841
+ FT_UInt j;
2842
+ FT_Fixed* c;
2843
+ FT_Fixed* n;
2844
+
2845
+
2846
+ manageCvt = mcvt_retain;
2847
+
2848
+ for ( i = 0; i < num_coords; i++ )
2849
+ {
2850
+ if ( blend->normalizedcoords[i] != coords[i] )
2851
+ {
2852
+ manageCvt = mcvt_load;
2853
+ have_diff = 1;
2854
+ break;
2855
+ }
2856
+ }
2857
+
2858
+ if ( !have_diff )
2859
+ {
2860
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
2861
+ {
2862
+ FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16;
2863
+
2864
+
2865
+ c = blend->normalizedcoords + i;
2866
+ n = blend->normalized_stylecoords +
2867
+ ( instance_index - 1 ) * mmvar->num_axis +
2868
+ i;
2869
+
2870
+ for ( j = i; j < mmvar->num_axis; j++, n++, c++ )
2871
+ if ( *c != *n )
2872
+ have_diff = 1;
2873
+ }
2874
+ else
2875
+ {
2876
+ c = blend->normalizedcoords + i;
2877
+ for ( j = i; j < mmvar->num_axis; j++, c++ )
2878
+ if ( *c != 0 )
2879
+ have_diff = 1;
2880
+ }
2881
+ }
2882
+
2883
+ /* return value -1 indicates `no change' */
2884
+ if ( !have_diff )
2885
+ {
2886
+ face->doblend = TRUE;
2887
+
2888
+ return -1;
2889
+ }
2890
+
2891
+ for ( ; i < mmvar->num_axis; i++ )
2892
+ {
2893
+ if ( blend->normalizedcoords[i] != 0 )
2894
+ {
2895
+ manageCvt = mcvt_load;
2896
+ break;
2897
+ }
2898
+ }
2899
+
2900
+ /* If we don't change the blend coords then we don't need to do */
2901
+ /* anything to the cvt table. It will be correct. Otherwise we */
2902
+ /* no longer have the original cvt (it was modified when we set */
2903
+ /* the blend last time), so we must reload and then modify it. */
2904
+ }
2905
+
2906
+ blend->num_axis = mmvar->num_axis;
2907
+ if ( coords )
2908
+ FT_MEM_COPY( blend->normalizedcoords,
2909
+ coords,
2910
+ num_coords * sizeof ( FT_Fixed ) );
2911
+
2912
+ if ( set_design_coords )
2913
+ ft_var_to_design( face,
2914
+ all_design_coords ? blend->num_axis : num_coords,
2915
+ blend->normalizedcoords,
2916
+ blend->coords );
2917
+
2918
+ face->doblend = TRUE;
2919
+
2920
+ if ( face->cvt )
2921
+ {
2922
+ switch ( manageCvt )
2923
+ {
2924
+ case mcvt_load:
2925
+ /* The cvt table has been loaded already; every time we change the */
2926
+ /* blend we may need to reload and remodify the cvt table. */
2927
+ FT_FREE( face->cvt );
2928
+
2929
+ error = tt_face_load_cvt( face, face->root.stream );
2930
+ break;
2931
+
2932
+ case mcvt_modify:
2933
+ /* The original cvt table is in memory. All we need to do is */
2934
+ /* apply the `cvar' table (if any). */
2935
+ error = tt_face_vary_cvt( face, face->root.stream );
2936
+ break;
2937
+
2938
+ case mcvt_retain:
2939
+ /* The cvt table is correct for this set of coordinates. */
2940
+ break;
2941
+ }
2942
+ }
2943
+
2944
+ Exit:
2945
+ return error;
2946
+ }
2947
+
2948
+
2949
+ /**************************************************************************
2950
+ *
2951
+ * @Function:
2952
+ * TT_Set_MM_Blend
2953
+ *
2954
+ * @Description:
2955
+ * Set the blend (normalized) coordinates for this instance of the
2956
+ * font. Check that the `gvar' table is reasonable and does some
2957
+ * initial preparation.
2958
+ *
2959
+ * @InOut:
2960
+ * face ::
2961
+ * The font.
2962
+ * Initialize the blend structure with `gvar' data.
2963
+ *
2964
+ * @Input:
2965
+ * num_coords ::
2966
+ * The number of available coordinates. If it is
2967
+ * larger than the number of axes, ignore the excess
2968
+ * values. If it is smaller than the number of axes,
2969
+ * use the default value (0) for the remaining axes.
2970
+ *
2971
+ * coords ::
2972
+ * An array of `num_coords', each between [-1,1].
2973
+ *
2974
+ * @Return:
2975
+ * FreeType error code. 0 means success, -1 means success and unchanged
2976
+ * axis values.
2977
+ */
2978
+ FT_LOCAL_DEF( FT_Error )
2979
+ TT_Set_MM_Blend( FT_Face face, /* TT_Face */
2980
+ FT_UInt num_coords,
2981
+ FT_Fixed* coords )
2982
+ {
2983
+ return tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 );
2984
+ }
2985
+
2986
+
2987
+ /**************************************************************************
2988
+ *
2989
+ * @Function:
2990
+ * TT_Get_MM_Blend
2991
+ *
2992
+ * @Description:
2993
+ * Get the blend (normalized) coordinates for this instance of the
2994
+ * font.
2995
+ *
2996
+ * @InOut:
2997
+ * face ::
2998
+ * The font.
2999
+ * Initialize the blend structure with `gvar' data.
3000
+ *
3001
+ * @Input:
3002
+ * num_coords ::
3003
+ * The number of available coordinates. If it is
3004
+ * larger than the number of axes, set the excess
3005
+ * values to 0.
3006
+ *
3007
+ * coords ::
3008
+ * An array of `num_coords', each between [-1,1].
3009
+ *
3010
+ * @Return:
3011
+ * FreeType error code. 0 means success, -1 means success and unchanged
3012
+ * axis values.
3013
+ */
3014
+ FT_LOCAL_DEF( FT_Error )
3015
+ TT_Get_MM_Blend( FT_Face face, /* TT_Face */
3016
+ FT_UInt num_coords,
3017
+ FT_Fixed* coords )
3018
+ {
3019
+ TT_Face ttface = (TT_Face)face;
3020
+
3021
+ FT_Error error = FT_Err_Ok;
3022
+ GX_Blend blend;
3023
+ FT_UInt i, nc;
3024
+
3025
+
3026
+ if ( !ttface->blend )
3027
+ {
3028
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
3029
+ return error;
3030
+ }
3031
+
3032
+ blend = ttface->blend;
3033
+
3034
+ if ( !blend->coords )
3035
+ {
3036
+ /* select default instance coordinates */
3037
+ /* if no instance is selected yet */
3038
+ if ( FT_SET_ERROR( tt_set_mm_blend( ttface, 0, NULL, 1 ) ) )
3039
+ return error;
3040
+ }
3041
+
3042
+ nc = num_coords;
3043
+ if ( num_coords > blend->num_axis )
3044
+ {
3045
+ FT_TRACE2(( "TT_Get_MM_Blend:"
3046
+ " only using first %d of %d coordinates\n",
3047
+ blend->num_axis, num_coords ));
3048
+ nc = blend->num_axis;
3049
+ }
3050
+
3051
+ if ( ttface->doblend )
3052
+ {
3053
+ for ( i = 0; i < nc; i++ )
3054
+ coords[i] = blend->normalizedcoords[i];
3055
+ }
3056
+ else
3057
+ {
3058
+ for ( i = 0; i < nc; i++ )
3059
+ coords[i] = 0;
3060
+ }
3061
+
3062
+ for ( ; i < num_coords; i++ )
3063
+ coords[i] = 0;
3064
+
3065
+ return FT_Err_Ok;
3066
+ }
3067
+
3068
+
3069
+ /**************************************************************************
3070
+ *
3071
+ * @Function:
3072
+ * TT_Set_Var_Design
3073
+ *
3074
+ * @Description:
3075
+ * Set the coordinates for the instance, measured in the user
3076
+ * coordinate system. Parse the `avar' table (if present) to convert
3077
+ * from user to normalized coordinates.
3078
+ *
3079
+ * @InOut:
3080
+ * face ::
3081
+ * The font face.
3082
+ * Initialize the blend struct with `gvar' data.
3083
+ *
3084
+ * @Input:
3085
+ * num_coords ::
3086
+ * The number of available coordinates. If it is
3087
+ * larger than the number of axes, ignore the excess
3088
+ * values. If it is smaller than the number of axes,
3089
+ * use the default values for the remaining axes.
3090
+ *
3091
+ * coords ::
3092
+ * A coordinate array with `num_coords' elements.
3093
+ *
3094
+ * @Return:
3095
+ * FreeType error code. 0 means success.
3096
+ */
3097
+ FT_LOCAL_DEF( FT_Error )
3098
+ TT_Set_Var_Design( FT_Face face, /* TT_Face */
3099
+ FT_UInt num_coords,
3100
+ FT_Fixed* coords )
3101
+ {
3102
+ TT_Face ttface = (TT_Face)face;
3103
+ FT_Error error = FT_Err_Ok;
3104
+ GX_Blend blend;
3105
+ FT_MM_Var* mmvar;
3106
+ FT_UInt i;
3107
+ FT_Memory memory = FT_FACE_MEMORY( face );
3108
+
3109
+ FT_Fixed* c;
3110
+ FT_Fixed* n;
3111
+ FT_Fixed* normalized = NULL;
3112
+
3113
+ FT_Bool have_diff = 0;
3114
+
3115
+
3116
+ if ( !ttface->blend )
3117
+ {
3118
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
3119
+ goto Exit;
3120
+ }
3121
+
3122
+ blend = ttface->blend;
3123
+ mmvar = blend->mmvar;
3124
+
3125
+ if ( num_coords > mmvar->num_axis )
3126
+ {
3127
+ FT_TRACE2(( "TT_Set_Var_Design:"
3128
+ " only using first %d of %d coordinates\n",
3129
+ mmvar->num_axis, num_coords ));
3130
+ num_coords = mmvar->num_axis;
3131
+ }
3132
+
3133
+ if ( !blend->coords )
3134
+ {
3135
+ if ( FT_NEW_ARRAY( blend->coords, mmvar->num_axis ) )
3136
+ goto Exit;
3137
+ }
3138
+
3139
+ c = blend->coords;
3140
+ n = coords;
3141
+ for ( i = 0; i < num_coords; i++, n++, c++ )
3142
+ {
3143
+ if ( *c != *n )
3144
+ {
3145
+ *c = *n;
3146
+ have_diff = 1;
3147
+ }
3148
+ }
3149
+
3150
+ if ( FT_IS_NAMED_INSTANCE( face ) )
3151
+ {
3152
+ FT_UInt instance_index;
3153
+ FT_Var_Named_Style* named_style;
3154
+
3155
+
3156
+ instance_index = (FT_UInt)face->face_index >> 16;
3157
+ named_style = mmvar->namedstyle + instance_index - 1;
3158
+
3159
+ n = named_style->coords + num_coords;
3160
+ for ( ; i < mmvar->num_axis; i++, n++, c++ )
3161
+ {
3162
+ if ( *c != *n )
3163
+ {
3164
+ *c = *n;
3165
+ have_diff = 1;
3166
+ }
3167
+ }
3168
+ }
3169
+ else
3170
+ {
3171
+ FT_Var_Axis* a;
3172
+
3173
+
3174
+ a = mmvar->axis + num_coords;
3175
+ for ( ; i < mmvar->num_axis; i++, a++, c++ )
3176
+ {
3177
+ if ( *c != a->def )
3178
+ {
3179
+ *c = a->def;
3180
+ have_diff = 1;
3181
+ }
3182
+ }
3183
+ }
3184
+
3185
+ /* return value -1 indicates `no change'; */
3186
+ /* we can exit early if `normalizedcoords' is already computed */
3187
+ if ( blend->normalizedcoords && !have_diff )
3188
+ return -1;
3189
+
3190
+ if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )
3191
+ goto Exit;
3192
+
3193
+ if ( !ttface->blend->avar_loaded )
3194
+ ft_var_load_avar( ttface );
3195
+
3196
+ FT_TRACE5(( "TT_Set_Var_Design:\n" ));
3197
+ FT_TRACE5(( " normalized design coordinates:\n" ));
3198
+ ft_var_to_normalized( ttface, num_coords, blend->coords, normalized );
3199
+
3200
+ error = tt_set_mm_blend( ttface, mmvar->num_axis, normalized, 0 );
3201
+ if ( error )
3202
+ goto Exit;
3203
+
3204
+ Exit:
3205
+ FT_FREE( normalized );
3206
+ return error;
3207
+ }
3208
+
3209
+
3210
+ /**************************************************************************
3211
+ *
3212
+ * @Function:
3213
+ * TT_Get_Var_Design
3214
+ *
3215
+ * @Description:
3216
+ * Get the design coordinates of the currently selected interpolated
3217
+ * font.
3218
+ *
3219
+ * @Input:
3220
+ * face ::
3221
+ * A handle to the source face.
3222
+ *
3223
+ * num_coords ::
3224
+ * The number of design coordinates to retrieve. If it
3225
+ * is larger than the number of axes, set the excess
3226
+ * values to~0.
3227
+ *
3228
+ * @Output:
3229
+ * coords ::
3230
+ * The design coordinates array.
3231
+ *
3232
+ * @Return:
3233
+ * FreeType error code. 0~means success.
3234
+ */
3235
+ FT_LOCAL_DEF( FT_Error )
3236
+ TT_Get_Var_Design( FT_Face face, /* TT_Face */
3237
+ FT_UInt num_coords,
3238
+ FT_Fixed* coords )
3239
+ {
3240
+ TT_Face ttface = (TT_Face)face;
3241
+ FT_Error error = FT_Err_Ok;
3242
+ GX_Blend blend;
3243
+ FT_UInt i, nc;
3244
+
3245
+
3246
+ if ( !ttface->blend )
3247
+ {
3248
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
3249
+ return error;
3250
+ }
3251
+
3252
+ blend = ttface->blend;
3253
+
3254
+ if ( !blend->coords )
3255
+ {
3256
+ /* select default instance coordinates */
3257
+ /* if no instance is selected yet */
3258
+ if ( FT_SET_ERROR( tt_set_mm_blend( ttface, 0, NULL, 1 ) ) )
3259
+ return error;
3260
+ }
3261
+
3262
+ nc = num_coords;
3263
+ if ( num_coords > blend->num_axis )
3264
+ {
3265
+ FT_TRACE2(( "TT_Get_Var_Design:"
3266
+ " only using first %d of %d coordinates\n",
3267
+ blend->num_axis, num_coords ));
3268
+ nc = blend->num_axis;
3269
+ }
3270
+
3271
+ if ( ttface->doblend )
3272
+ {
3273
+ for ( i = 0; i < nc; i++ )
3274
+ coords[i] = blend->coords[i];
3275
+ }
3276
+ else
3277
+ {
3278
+ for ( i = 0; i < nc; i++ )
3279
+ coords[i] = 0;
3280
+ }
3281
+
3282
+ for ( ; i < num_coords; i++ )
3283
+ coords[i] = 0;
3284
+
3285
+ return FT_Err_Ok;
3286
+ }
3287
+
3288
+
3289
+ /**************************************************************************
3290
+ *
3291
+ * @Function:
3292
+ * TT_Set_Named_Instance
3293
+ *
3294
+ * @Description:
3295
+ * Set the given named instance, also resetting any further
3296
+ * variation.
3297
+ *
3298
+ * @Input:
3299
+ * face ::
3300
+ * A handle to the source face.
3301
+ *
3302
+ * instance_index ::
3303
+ * The instance index, starting with value 1.
3304
+ * Value 0 indicates to not use an instance.
3305
+ *
3306
+ * @Return:
3307
+ * FreeType error code. 0~means success, -1 means success and unchanged
3308
+ * axis values.
3309
+ */
3310
+ FT_LOCAL_DEF( FT_Error )
3311
+ TT_Set_Named_Instance( FT_Face face, /* TT_Face */
3312
+ FT_UInt instance_index )
3313
+ {
3314
+ TT_Face ttface = (TT_Face)face;
3315
+ FT_Error error;
3316
+ GX_Blend blend;
3317
+ FT_MM_Var* mmvar;
3318
+
3319
+ FT_Memory memory = FT_FACE_MEMORY( face );
3320
+
3321
+ FT_UInt num_instances;
3322
+
3323
+
3324
+ if ( !ttface->blend )
3325
+ {
3326
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
3327
+ goto Exit;
3328
+ }
3329
+
3330
+ blend = ttface->blend;
3331
+ mmvar = blend->mmvar;
3332
+
3333
+ num_instances = (FT_UInt)face->style_flags >> 16;
3334
+
3335
+ /* `instance_index' starts with value 1, thus `>' */
3336
+ if ( instance_index > num_instances )
3337
+ {
3338
+ error = FT_ERR( Invalid_Argument );
3339
+ goto Exit;
3340
+ }
3341
+
3342
+ if ( instance_index > 0 )
3343
+ {
3344
+ SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
3345
+
3346
+ FT_Var_Named_Style* named_style;
3347
+ FT_String* style_name;
3348
+
3349
+
3350
+ named_style = mmvar->namedstyle + instance_index - 1;
3351
+
3352
+ error = sfnt->get_name( ttface,
3353
+ (FT_UShort)named_style->strid,
3354
+ &style_name );
3355
+ if ( error )
3356
+ goto Exit;
3357
+
3358
+ /* set (or replace) style name */
3359
+ FT_FREE( face->style_name );
3360
+ face->style_name = style_name;
3361
+
3362
+ /* finally, select the named instance */
3363
+ error = TT_Set_Var_Design( face,
3364
+ mmvar->num_axis,
3365
+ named_style->coords );
3366
+ }
3367
+ else
3368
+ {
3369
+ /* restore non-VF style name */
3370
+ FT_FREE( face->style_name );
3371
+ if ( FT_STRDUP( face->style_name, ttface->non_var_style_name ) )
3372
+ goto Exit;
3373
+ error = TT_Set_Var_Design( face, 0, NULL );
3374
+ }
3375
+
3376
+ Exit:
3377
+ return error;
3378
+ }
3379
+
3380
+
3381
+ /**************************************************************************
3382
+ *
3383
+ * @Function:
3384
+ * TT_Get_Default_Named_Instance
3385
+ *
3386
+ * @Description:
3387
+ * Get the default named instance.
3388
+ *
3389
+ * @Input:
3390
+ * face ::
3391
+ * A handle to the source face.
3392
+ *
3393
+ * @Output:
3394
+ * instance_index ::
3395
+ * The default named instance index.
3396
+ *
3397
+ * @Return:
3398
+ * FreeType error code. 0~means success.
3399
+ */
3400
+ FT_LOCAL_DEF( FT_Error )
3401
+ TT_Get_Default_Named_Instance( FT_Face face,
3402
+ FT_UInt *instance_index )
3403
+ {
3404
+ TT_Face ttface = (TT_Face)face;
3405
+ FT_Error error = FT_Err_Ok;
3406
+
3407
+
3408
+ if ( !ttface->blend )
3409
+ {
3410
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
3411
+ goto Exit;
3412
+ }
3413
+
3414
+ *instance_index = ttface->var_default_named_instance;
3415
+
3416
+ Exit:
3417
+ return error;
3418
+ }
3419
+
3420
+
3421
+ /* This function triggers (lazy) recomputation of the `postscript_name` */
3422
+ /* field in `TT_Face`. */
3423
+
3424
+ FT_LOCAL_DEF( void )
3425
+ tt_construct_ps_name( FT_Face face )
3426
+ {
3427
+ TT_Face ttface = (TT_Face)face;
3428
+ FT_Memory memory = FT_FACE_MEMORY( face );
3429
+
3430
+
3431
+ FT_FREE( ttface->postscript_name );
3432
+ }
3433
+
3434
+
3435
+ /*************************************************************************/
3436
+ /*************************************************************************/
3437
+ /***** *****/
3438
+ /***** GX VAR PARSING ROUTINES *****/
3439
+ /***** *****/
3440
+ /*************************************************************************/
3441
+ /*************************************************************************/
3442
+
3443
+
3444
+ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
3445
+
3446
+ static FT_Error
3447
+ tt_cvt_ready_iterator( FT_ListNode node,
3448
+ void* user )
3449
+ {
3450
+ TT_Size size = (TT_Size)node->data;
3451
+
3452
+ FT_UNUSED( user );
3453
+
3454
+
3455
+ size->cvt_ready = -1;
3456
+
3457
+ return FT_Err_Ok;
3458
+ }
3459
+
3460
+ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
3461
+
3462
+
3463
+
3464
+ /**************************************************************************
3465
+ *
3466
+ * @Function:
3467
+ * tt_face_vary_cvt
3468
+ *
3469
+ * @Description:
3470
+ * Modify the loaded cvt table according to the `cvar' table and the
3471
+ * font's blend.
3472
+ *
3473
+ * @InOut:
3474
+ * face ::
3475
+ * A handle to the target face object.
3476
+ *
3477
+ * @Input:
3478
+ * stream ::
3479
+ * A handle to the input stream.
3480
+ *
3481
+ * @Return:
3482
+ * FreeType error code. 0 means success.
3483
+ *
3484
+ * Most errors are ignored. It is perfectly valid not to have a
3485
+ * `cvar' table even if there is a `gvar' and `fvar' table.
3486
+ */
3487
+ FT_LOCAL_DEF( FT_Error )
3488
+ tt_face_vary_cvt( TT_Face face,
3489
+ FT_Stream stream )
3490
+ {
3491
+ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
3492
+
3493
+ FT_Error error;
3494
+ FT_Memory memory = stream->memory;
3495
+
3496
+ FT_Face root = &face->root;
3497
+
3498
+ FT_ULong table_start;
3499
+ FT_ULong table_len;
3500
+
3501
+ FT_UInt tupleCount;
3502
+ FT_ULong offsetToData;
3503
+
3504
+ FT_ULong here;
3505
+ FT_UInt i, j;
3506
+
3507
+ FT_Fixed* peak_coords = NULL;
3508
+ FT_Fixed* tuple_coords;
3509
+ FT_Fixed* im_start_coords;
3510
+ FT_Fixed* im_end_coords;
3511
+
3512
+ GX_Blend blend = face->blend;
3513
+
3514
+ FT_UInt point_count;
3515
+ FT_UInt spoint_count = 0;
3516
+
3517
+ FT_UShort* sharedpoints = NULL;
3518
+ FT_UShort* localpoints = NULL;
3519
+ FT_UShort* points;
3520
+
3521
+ FT_Fixed* deltas = NULL;
3522
+ FT_Fixed* cvt_deltas = NULL;
3523
+
3524
+
3525
+ FT_TRACE2(( "CVAR " ));
3526
+
3527
+ if ( !blend )
3528
+ {
3529
+ FT_TRACE2(( "\n" ));
3530
+ FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" ));
3531
+
3532
+ return FT_Err_Ok;
3533
+ }
3534
+
3535
+ if ( !face->cvt )
3536
+ {
3537
+ FT_TRACE2(( "\n" ));
3538
+ FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" ));
3539
+
3540
+ return FT_Err_Ok;
3541
+ }
3542
+
3543
+ error = face->goto_table( face, TTAG_cvar, stream, &table_len );
3544
+ if ( error )
3545
+ {
3546
+ FT_TRACE2(( "is missing\n" ));
3547
+
3548
+ return FT_Err_Ok;
3549
+ }
3550
+
3551
+ if ( FT_FRAME_ENTER( table_len ) )
3552
+ return FT_Err_Ok;
3553
+
3554
+ table_start = FT_Stream_FTell( stream );
3555
+ if ( FT_GET_LONG() != 0x00010000L )
3556
+ {
3557
+ FT_TRACE2(( "bad table version\n" ));
3558
+
3559
+ error = FT_Err_Ok;
3560
+ goto FExit;
3561
+ }
3562
+
3563
+ FT_TRACE2(( "loaded\n" ));
3564
+
3565
+ tupleCount = FT_GET_USHORT();
3566
+ offsetToData = FT_GET_USHORT();
3567
+
3568
+ /* rough sanity test */
3569
+ if ( offsetToData + ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 >
3570
+ table_len )
3571
+ {
3572
+ FT_TRACE2(( "tt_face_vary_cvt:"
3573
+ " invalid CVT variation array header\n" ));
3574
+
3575
+ error = FT_THROW( Invalid_Table );
3576
+ goto FExit;
3577
+ }
3578
+
3579
+ offsetToData += table_start;
3580
+
3581
+ if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS )
3582
+ {
3583
+ here = FT_Stream_FTell( stream );
3584
+
3585
+ FT_Stream_SeekSet( stream, offsetToData );
3586
+
3587
+ sharedpoints = ft_var_readpackedpoints( stream, &spoint_count );
3588
+
3589
+ offsetToData = FT_Stream_FTell( stream );
3590
+
3591
+ FT_Stream_SeekSet( stream, here );
3592
+ }
3593
+
3594
+ FT_TRACE5(( "cvar: there %s %d tuple%s:\n",
3595
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
3596
+ tupleCount & GX_TC_TUPLE_COUNT_MASK,
3597
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
3598
+
3599
+ if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) ||
3600
+ FT_NEW_ARRAY( cvt_deltas, face->cvt_size ) )
3601
+ goto Exit;
3602
+
3603
+ im_start_coords = peak_coords + blend->num_axis;
3604
+ im_end_coords = im_start_coords + blend->num_axis;
3605
+
3606
+ for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
3607
+ {
3608
+ FT_UInt tupleDataSize;
3609
+ FT_UInt tupleIndex;
3610
+ FT_Fixed apply;
3611
+
3612
+
3613
+ FT_TRACE6(( " tuple %d:\n", i ));
3614
+
3615
+ tupleDataSize = FT_GET_USHORT();
3616
+ tupleIndex = FT_GET_USHORT();
3617
+
3618
+ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
3619
+ {
3620
+ for ( j = 0; j < blend->num_axis; j++ )
3621
+ peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
3622
+ tuple_coords = peak_coords;
3623
+ }
3624
+ else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount )
3625
+ tuple_coords = blend->tuplecoords +
3626
+ ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis;
3627
+ else
3628
+ {
3629
+ FT_TRACE2(( "tt_face_vary_cvt:"
3630
+ " invalid tuple index\n" ));
3631
+
3632
+ error = FT_THROW( Invalid_Table );
3633
+ goto Exit;
3634
+ }
3635
+
3636
+ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
3637
+ {
3638
+ for ( j = 0; j < blend->num_axis; j++ )
3639
+ im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
3640
+ for ( j = 0; j < blend->num_axis; j++ )
3641
+ im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
3642
+ }
3643
+
3644
+ apply = ft_var_apply_tuple( blend,
3645
+ (FT_UShort)tupleIndex,
3646
+ tuple_coords,
3647
+ im_start_coords,
3648
+ im_end_coords );
3649
+
3650
+ if ( apply == 0 ) /* tuple isn't active for our blend */
3651
+ {
3652
+ offsetToData += tupleDataSize;
3653
+ continue;
3654
+ }
3655
+
3656
+ here = FT_Stream_FTell( stream );
3657
+
3658
+ FT_Stream_SeekSet( stream, offsetToData );
3659
+
3660
+ if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS )
3661
+ {
3662
+ localpoints = ft_var_readpackedpoints( stream, &point_count );
3663
+ points = localpoints;
3664
+ }
3665
+ else
3666
+ {
3667
+ localpoints = NULL;
3668
+ points = sharedpoints;
3669
+ point_count = spoint_count;
3670
+ }
3671
+
3672
+ deltas = ft_var_readpackeddeltas( stream,
3673
+ point_count == 0 ? face->cvt_size
3674
+ : point_count );
3675
+
3676
+ if ( !points || !deltas )
3677
+ ; /* failure, ignore it */
3678
+
3679
+ else if ( localpoints == ALL_POINTS )
3680
+ {
3681
+ #ifdef FT_DEBUG_LEVEL_TRACE
3682
+ int count = 0;
3683
+ #endif
3684
+
3685
+
3686
+ FT_TRACE7(( " CVT deltas:\n" ));
3687
+
3688
+ /* this means that there are deltas for every entry in cvt */
3689
+ for ( j = 0; j < face->cvt_size; j++ )
3690
+ {
3691
+ FT_Fixed old_cvt_delta;
3692
+
3693
+
3694
+ old_cvt_delta = cvt_deltas[j];
3695
+ cvt_deltas[j] = old_cvt_delta + FT_MulFix( deltas[j], apply );
3696
+
3697
+ #ifdef FT_DEBUG_LEVEL_TRACE
3698
+ if ( old_cvt_delta != cvt_deltas[j] )
3699
+ {
3700
+ FT_TRACE7(( " %d: %f -> %f\n",
3701
+ j,
3702
+ (double)( FT_fdot6ToFixed( face->cvt[j] ) +
3703
+ old_cvt_delta ) / 65536,
3704
+ (double)( FT_fdot6ToFixed( face->cvt[j] ) +
3705
+ cvt_deltas[j] ) / 65536 ));
3706
+ count++;
3707
+ }
3708
+ #endif
3709
+ }
3710
+
3711
+ #ifdef FT_DEBUG_LEVEL_TRACE
3712
+ if ( !count )
3713
+ FT_TRACE7(( " none\n" ));
3714
+ #endif
3715
+ }
3716
+
3717
+ else
3718
+ {
3719
+ #ifdef FT_DEBUG_LEVEL_TRACE
3720
+ int count = 0;
3721
+ #endif
3722
+
3723
+
3724
+ FT_TRACE7(( " CVT deltas:\n" ));
3725
+
3726
+ for ( j = 0; j < point_count; j++ )
3727
+ {
3728
+ int pindex;
3729
+ FT_Fixed old_cvt_delta;
3730
+
3731
+
3732
+ pindex = points[j];
3733
+ if ( (FT_ULong)pindex >= face->cvt_size )
3734
+ continue;
3735
+
3736
+ old_cvt_delta = cvt_deltas[pindex];
3737
+ cvt_deltas[pindex] = old_cvt_delta + FT_MulFix( deltas[j], apply );
3738
+
3739
+ #ifdef FT_DEBUG_LEVEL_TRACE
3740
+ if ( old_cvt_delta != cvt_deltas[pindex] )
3741
+ {
3742
+ FT_TRACE7(( " %d: %f -> %f\n",
3743
+ pindex,
3744
+ (double)( FT_fdot6ToFixed( face->cvt[pindex] ) +
3745
+ old_cvt_delta ) / 65536,
3746
+ (double)( FT_fdot6ToFixed( face->cvt[pindex] ) +
3747
+ cvt_deltas[pindex] ) / 65536 ));
3748
+ count++;
3749
+ }
3750
+ #endif
3751
+ }
3752
+
3753
+ #ifdef FT_DEBUG_LEVEL_TRACE
3754
+ if ( !count )
3755
+ FT_TRACE7(( " none\n" ));
3756
+ #endif
3757
+ }
3758
+
3759
+ if ( localpoints != ALL_POINTS )
3760
+ FT_FREE( localpoints );
3761
+ FT_FREE( deltas );
3762
+
3763
+ offsetToData += tupleDataSize;
3764
+
3765
+ FT_Stream_SeekSet( stream, here );
3766
+ }
3767
+
3768
+ FT_TRACE5(( "\n" ));
3769
+
3770
+ for ( i = 0; i < face->cvt_size; i++ )
3771
+ face->cvt[i] += FT_fixedToFdot6( cvt_deltas[i] );
3772
+
3773
+ /* Iterate over all `FT_Size` objects and set `cvt_ready` to -1 */
3774
+ /* to trigger rescaling of all CVT values. */
3775
+ FT_List_Iterate( &root->sizes_list,
3776
+ tt_cvt_ready_iterator,
3777
+ NULL );
3778
+
3779
+ Exit:
3780
+ if ( sharedpoints != ALL_POINTS )
3781
+ FT_FREE( sharedpoints );
3782
+ FT_FREE( cvt_deltas );
3783
+ FT_FREE( peak_coords );
3784
+
3785
+ FExit:
3786
+ FT_FRAME_EXIT();
3787
+
3788
+ return error;
3789
+
3790
+ #else /* !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
3791
+
3792
+ FT_UNUSED( face );
3793
+ FT_UNUSED( stream );
3794
+
3795
+ return FT_Err_Ok;
3796
+
3797
+ #endif /* !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
3798
+
3799
+ }
3800
+
3801
+
3802
+ /* Shift the original coordinates of all points between indices `p1' */
3803
+ /* and `p2', using the same difference as given by index `ref'. */
3804
+
3805
+ /* modeled after `af_iup_shift' */
3806
+
3807
+ static void
3808
+ tt_delta_shift( int p1,
3809
+ int p2,
3810
+ int ref,
3811
+ FT_Vector* in_points,
3812
+ FT_Vector* out_points )
3813
+ {
3814
+ int p;
3815
+ FT_Vector delta;
3816
+
3817
+
3818
+ delta.x = out_points[ref].x - in_points[ref].x;
3819
+ delta.y = out_points[ref].y - in_points[ref].y;
3820
+
3821
+ if ( delta.x == 0 && delta.y == 0 )
3822
+ return;
3823
+
3824
+ for ( p = p1; p < ref; p++ )
3825
+ {
3826
+ out_points[p].x += delta.x;
3827
+ out_points[p].y += delta.y;
3828
+ }
3829
+
3830
+ for ( p = ref + 1; p <= p2; p++ )
3831
+ {
3832
+ out_points[p].x += delta.x;
3833
+ out_points[p].y += delta.y;
3834
+ }
3835
+ }
3836
+
3837
+
3838
+ /* Interpolate the original coordinates of all points with indices */
3839
+ /* between `p1' and `p2', using `ref1' and `ref2' as the reference */
3840
+ /* point indices. */
3841
+
3842
+ /* modeled after `af_iup_interp', `_iup_worker_interpolate', and */
3843
+ /* `Ins_IUP' with spec differences in handling ill-defined cases. */
3844
+ static void
3845
+ tt_delta_interpolate( int p1,
3846
+ int p2,
3847
+ int ref1,
3848
+ int ref2,
3849
+ FT_Vector* in_points,
3850
+ FT_Vector* out_points )
3851
+ {
3852
+ int p, i;
3853
+
3854
+ FT_Pos out, in1, in2, out1, out2, d1, d2;
3855
+
3856
+
3857
+ if ( p1 > p2 )
3858
+ return;
3859
+
3860
+ /* handle both horizontal and vertical coordinates */
3861
+ for ( i = 0; i <= 1; i++ )
3862
+ {
3863
+ /* shift array pointers so that we can access `foo.y' as `foo.x' */
3864
+ in_points = (FT_Vector*)( (FT_Pos*)in_points + i );
3865
+ out_points = (FT_Vector*)( (FT_Pos*)out_points + i );
3866
+
3867
+ if ( in_points[ref1].x > in_points[ref2].x )
3868
+ {
3869
+ p = ref1;
3870
+ ref1 = ref2;
3871
+ ref2 = p;
3872
+ }
3873
+
3874
+ in1 = in_points[ref1].x;
3875
+ in2 = in_points[ref2].x;
3876
+ out1 = out_points[ref1].x;
3877
+ out2 = out_points[ref2].x;
3878
+ d1 = out1 - in1;
3879
+ d2 = out2 - in2;
3880
+
3881
+ /* If the reference points have the same coordinate but different */
3882
+ /* delta, inferred delta is zero. Otherwise interpolate. */
3883
+ if ( in1 != in2 || out1 == out2 )
3884
+ {
3885
+ FT_Fixed scale = in1 != in2 ? FT_DivFix( out2 - out1, in2 - in1 )
3886
+ : 0;
3887
+
3888
+
3889
+ for ( p = p1; p <= p2; p++ )
3890
+ {
3891
+ out = in_points[p].x;
3892
+
3893
+ if ( out <= in1 )
3894
+ out += d1;
3895
+ else if ( out >= in2 )
3896
+ out += d2;
3897
+ else
3898
+ out = out1 + FT_MulFix( out - in1, scale );
3899
+
3900
+ out_points[p].x = out;
3901
+ }
3902
+ }
3903
+ }
3904
+ }
3905
+
3906
+
3907
+ /* Interpolate points without delta values, similar to */
3908
+ /* the `IUP' hinting instruction. */
3909
+
3910
+ /* modeled after `Ins_IUP */
3911
+
3912
+ static void
3913
+ tt_interpolate_deltas( FT_Outline* outline,
3914
+ FT_Vector* out_points,
3915
+ FT_Vector* in_points,
3916
+ FT_Bool* has_delta )
3917
+ {
3918
+ FT_Int first_point;
3919
+ FT_Int end_point;
3920
+
3921
+ FT_Int first_delta;
3922
+ FT_Int cur_delta;
3923
+
3924
+ FT_Int point;
3925
+ FT_Short contour;
3926
+
3927
+
3928
+ /* ignore empty outlines */
3929
+ if ( !outline->n_contours )
3930
+ return;
3931
+
3932
+ contour = 0;
3933
+ point = 0;
3934
+
3935
+ do
3936
+ {
3937
+ end_point = outline->contours[contour];
3938
+ first_point = point;
3939
+
3940
+ /* search first point that has a delta */
3941
+ while ( point <= end_point && !has_delta[point] )
3942
+ point++;
3943
+
3944
+ if ( point <= end_point )
3945
+ {
3946
+ first_delta = point;
3947
+ cur_delta = point;
3948
+
3949
+ point++;
3950
+
3951
+ while ( point <= end_point )
3952
+ {
3953
+ /* search next point that has a delta */
3954
+ /* and interpolate intermediate points */
3955
+ if ( has_delta[point] )
3956
+ {
3957
+ tt_delta_interpolate( cur_delta + 1,
3958
+ point - 1,
3959
+ cur_delta,
3960
+ point,
3961
+ in_points,
3962
+ out_points );
3963
+ cur_delta = point;
3964
+ }
3965
+
3966
+ point++;
3967
+ }
3968
+
3969
+ /* shift contour if we only have a single delta */
3970
+ if ( cur_delta == first_delta )
3971
+ tt_delta_shift( first_point,
3972
+ end_point,
3973
+ cur_delta,
3974
+ in_points,
3975
+ out_points );
3976
+ else
3977
+ {
3978
+ /* otherwise handle remaining points */
3979
+ /* at the end and beginning of the contour */
3980
+ tt_delta_interpolate( cur_delta + 1,
3981
+ end_point,
3982
+ cur_delta,
3983
+ first_delta,
3984
+ in_points,
3985
+ out_points );
3986
+
3987
+ if ( first_delta > 0 )
3988
+ tt_delta_interpolate( first_point,
3989
+ first_delta - 1,
3990
+ cur_delta,
3991
+ first_delta,
3992
+ in_points,
3993
+ out_points );
3994
+ }
3995
+ }
3996
+ contour++;
3997
+
3998
+ } while ( contour < outline->n_contours );
3999
+ }
4000
+
4001
+
4002
+ /**************************************************************************
4003
+ *
4004
+ * @Function:
4005
+ * TT_Vary_Apply_Glyph_Deltas
4006
+ *
4007
+ * @Description:
4008
+ * Apply the appropriate deltas to the current glyph.
4009
+ *
4010
+ * @InOut:
4011
+ * loader ::
4012
+ * A handle to the loader object.
4013
+ *
4014
+ * outline ::
4015
+ * The outline to change, with appended phantom points.
4016
+ *
4017
+ * @Output:
4018
+ * unrounded ::
4019
+ * An array with `n_points' elements that is filled with unrounded
4020
+ * point coordinates (in 26.6 format).
4021
+ *
4022
+ * @Return:
4023
+ * FreeType error code. 0 means success.
4024
+ */
4025
+ FT_LOCAL_DEF( FT_Error )
4026
+ TT_Vary_Apply_Glyph_Deltas( TT_Loader loader,
4027
+ FT_Outline* outline,
4028
+ FT_Vector* unrounded )
4029
+ {
4030
+ FT_Error error;
4031
+ TT_Face face = loader->face;
4032
+ FT_Stream stream = face->root.stream;
4033
+ FT_Memory memory = stream->memory;
4034
+ FT_UInt glyph_index = loader->glyph_index;
4035
+ FT_UInt n_points = (FT_UInt)outline->n_points + 4;
4036
+
4037
+ FT_Vector* points_org = NULL; /* coordinates in 16.16 format */
4038
+ FT_Vector* points_out = NULL; /* coordinates in 16.16 format */
4039
+ FT_Bool* has_delta = NULL;
4040
+
4041
+ FT_ULong glyph_start;
4042
+
4043
+ FT_UInt tupleCount;
4044
+ FT_ULong offsetToData;
4045
+ FT_ULong dataSize;
4046
+
4047
+ FT_ULong here;
4048
+ FT_UInt i, j;
4049
+
4050
+ FT_Fixed* peak_coords = NULL;
4051
+ FT_Fixed* tuple_coords;
4052
+ FT_Fixed* im_start_coords;
4053
+ FT_Fixed* im_end_coords;
4054
+
4055
+ GX_Blend blend = face->blend;
4056
+
4057
+ FT_UInt point_count;
4058
+ FT_UInt spoint_count = 0;
4059
+
4060
+ FT_UShort* sharedpoints = NULL;
4061
+ FT_UShort* localpoints = NULL;
4062
+ FT_UShort* points;
4063
+
4064
+ FT_Fixed* deltas_x = NULL;
4065
+ FT_Fixed* deltas_y = NULL;
4066
+ FT_Fixed* point_deltas_x = NULL;
4067
+ FT_Fixed* point_deltas_y = NULL;
4068
+
4069
+
4070
+ if ( !face->doblend || !blend )
4071
+ return FT_THROW( Invalid_Argument );
4072
+
4073
+ for ( i = 0; i < n_points; i++ )
4074
+ {
4075
+ unrounded[i].x = INT_TO_F26DOT6( outline->points[i].x );
4076
+ unrounded[i].y = INT_TO_F26DOT6( outline->points[i].y );
4077
+ }
4078
+
4079
+ if ( glyph_index >= blend->gv_glyphcnt ||
4080
+ blend->glyphoffsets[glyph_index] ==
4081
+ blend->glyphoffsets[glyph_index + 1] )
4082
+ {
4083
+ FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
4084
+ " no variation data for glyph %d\n", glyph_index ));
4085
+ return FT_Err_Ok;
4086
+ }
4087
+
4088
+ dataSize = blend->glyphoffsets[glyph_index + 1] -
4089
+ blend->glyphoffsets[glyph_index];
4090
+
4091
+ if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) ||
4092
+ FT_FRAME_ENTER( dataSize ) )
4093
+ return error;
4094
+
4095
+ glyph_start = FT_Stream_FTell( stream );
4096
+
4097
+ /* each set of glyph variation data is formatted similarly to `cvar' */
4098
+
4099
+ tupleCount = FT_GET_USHORT();
4100
+ offsetToData = FT_GET_USHORT();
4101
+
4102
+ /* rough sanity test */
4103
+ if ( offsetToData > dataSize ||
4104
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 > dataSize )
4105
+ {
4106
+ FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
4107
+ " invalid glyph variation array header\n" ));
4108
+
4109
+ error = FT_THROW( Invalid_Table );
4110
+ goto FExit;
4111
+ }
4112
+
4113
+ offsetToData += glyph_start;
4114
+
4115
+ if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS )
4116
+ {
4117
+ here = FT_Stream_FTell( stream );
4118
+
4119
+ FT_Stream_SeekSet( stream, offsetToData );
4120
+
4121
+ sharedpoints = ft_var_readpackedpoints( stream, &spoint_count );
4122
+
4123
+ offsetToData = FT_Stream_FTell( stream );
4124
+
4125
+ FT_Stream_SeekSet( stream, here );
4126
+ }
4127
+
4128
+ FT_TRACE5(( "gvar: there %s %d tuple%s:\n",
4129
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
4130
+ tupleCount & GX_TC_TUPLE_COUNT_MASK,
4131
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
4132
+
4133
+ if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) ||
4134
+ FT_NEW_ARRAY( point_deltas_x, 2 * n_points ) ||
4135
+ FT_QNEW_ARRAY( points_org, n_points ) ||
4136
+ FT_QNEW_ARRAY( points_out, n_points ) ||
4137
+ FT_QNEW_ARRAY( has_delta, n_points ) )
4138
+ goto Exit;
4139
+
4140
+ im_start_coords = peak_coords + blend->num_axis;
4141
+ im_end_coords = im_start_coords + blend->num_axis;
4142
+ point_deltas_y = point_deltas_x + n_points;
4143
+
4144
+ for ( j = 0; j < n_points; j++ )
4145
+ {
4146
+ points_org[j].x = FT_intToFixed( outline->points[j].x );
4147
+ points_org[j].y = FT_intToFixed( outline->points[j].y );
4148
+ }
4149
+
4150
+ for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
4151
+ {
4152
+ FT_UInt tupleDataSize;
4153
+ FT_UInt tupleIndex;
4154
+ FT_Fixed apply;
4155
+
4156
+
4157
+ FT_TRACE6(( " tuple %d:\n", i ));
4158
+
4159
+ tupleDataSize = FT_GET_USHORT();
4160
+ tupleIndex = FT_GET_USHORT();
4161
+
4162
+ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
4163
+ {
4164
+ for ( j = 0; j < blend->num_axis; j++ )
4165
+ peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
4166
+ tuple_coords = peak_coords;
4167
+ }
4168
+ else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount )
4169
+ tuple_coords = blend->tuplecoords +
4170
+ ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis;
4171
+ else
4172
+ {
4173
+ FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
4174
+ " invalid tuple index\n" ));
4175
+
4176
+ error = FT_THROW( Invalid_Table );
4177
+ goto Exit;
4178
+ }
4179
+
4180
+ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
4181
+ {
4182
+ for ( j = 0; j < blend->num_axis; j++ )
4183
+ im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
4184
+ for ( j = 0; j < blend->num_axis; j++ )
4185
+ im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
4186
+ }
4187
+
4188
+ apply = ft_var_apply_tuple( blend,
4189
+ (FT_UShort)tupleIndex,
4190
+ tuple_coords,
4191
+ im_start_coords,
4192
+ im_end_coords );
4193
+
4194
+ if ( apply == 0 ) /* tuple isn't active for our blend */
4195
+ {
4196
+ offsetToData += tupleDataSize;
4197
+ continue;
4198
+ }
4199
+
4200
+ here = FT_Stream_FTell( stream );
4201
+
4202
+ FT_Stream_SeekSet( stream, offsetToData );
4203
+
4204
+ if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS )
4205
+ {
4206
+ localpoints = ft_var_readpackedpoints( stream, &point_count );
4207
+ points = localpoints;
4208
+ }
4209
+ else
4210
+ {
4211
+ points = sharedpoints;
4212
+ point_count = spoint_count;
4213
+ }
4214
+
4215
+ deltas_x = ft_var_readpackeddeltas( stream,
4216
+ point_count == 0 ? n_points
4217
+ : point_count );
4218
+ deltas_y = ft_var_readpackeddeltas( stream,
4219
+ point_count == 0 ? n_points
4220
+ : point_count );
4221
+
4222
+ if ( !points || !deltas_y || !deltas_x )
4223
+ ; /* failure, ignore it */
4224
+
4225
+ else if ( points == ALL_POINTS )
4226
+ {
4227
+ #ifdef FT_DEBUG_LEVEL_TRACE
4228
+ int count = 0;
4229
+ #endif
4230
+
4231
+
4232
+ FT_TRACE7(( " point deltas:\n" ));
4233
+
4234
+ /* this means that there are deltas for every point in the glyph */
4235
+ for ( j = 0; j < n_points; j++ )
4236
+ {
4237
+ FT_Fixed old_point_delta_x = point_deltas_x[j];
4238
+ FT_Fixed old_point_delta_y = point_deltas_y[j];
4239
+
4240
+ FT_Fixed point_delta_x = FT_MulFix( deltas_x[j], apply );
4241
+ FT_Fixed point_delta_y = FT_MulFix( deltas_y[j], apply );
4242
+
4243
+
4244
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
4245
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
4246
+
4247
+ #ifdef FT_DEBUG_LEVEL_TRACE
4248
+ if ( point_delta_x || point_delta_y )
4249
+ {
4250
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
4251
+ j,
4252
+ (double)( FT_intToFixed( outline->points[j].x ) +
4253
+ old_point_delta_x ) / 65536,
4254
+ (double)( FT_intToFixed( outline->points[j].y ) +
4255
+ old_point_delta_y ) / 65536,
4256
+ (double)( FT_intToFixed( outline->points[j].x ) +
4257
+ point_deltas_x[j] ) / 65536,
4258
+ (double)( FT_intToFixed( outline->points[j].y ) +
4259
+ point_deltas_y[j] ) / 65536 ));
4260
+ count++;
4261
+ }
4262
+ #endif
4263
+ }
4264
+
4265
+ #ifdef FT_DEBUG_LEVEL_TRACE
4266
+ if ( !count )
4267
+ FT_TRACE7(( " none\n" ));
4268
+ #endif
4269
+ }
4270
+
4271
+ else
4272
+ {
4273
+ #ifdef FT_DEBUG_LEVEL_TRACE
4274
+ int count = 0;
4275
+ #endif
4276
+
4277
+
4278
+ /* we have to interpolate the missing deltas similar to the */
4279
+ /* IUP bytecode instruction */
4280
+ for ( j = 0; j < n_points; j++ )
4281
+ {
4282
+ has_delta[j] = FALSE;
4283
+ points_out[j] = points_org[j];
4284
+ }
4285
+
4286
+ for ( j = 0; j < point_count; j++ )
4287
+ {
4288
+ FT_UShort idx = points[j];
4289
+
4290
+
4291
+ if ( idx >= n_points )
4292
+ continue;
4293
+
4294
+ has_delta[idx] = TRUE;
4295
+
4296
+ points_out[idx].x += FT_MulFix( deltas_x[j], apply );
4297
+ points_out[idx].y += FT_MulFix( deltas_y[j], apply );
4298
+ }
4299
+
4300
+ /* no need to handle phantom points here, */
4301
+ /* since solitary points can't be interpolated */
4302
+ tt_interpolate_deltas( outline,
4303
+ points_out,
4304
+ points_org,
4305
+ has_delta );
4306
+
4307
+ FT_TRACE7(( " point deltas:\n" ));
4308
+
4309
+ for ( j = 0; j < n_points; j++ )
4310
+ {
4311
+ FT_Fixed old_point_delta_x = point_deltas_x[j];
4312
+ FT_Fixed old_point_delta_y = point_deltas_y[j];
4313
+
4314
+ FT_Pos point_delta_x = points_out[j].x - points_org[j].x;
4315
+ FT_Pos point_delta_y = points_out[j].y - points_org[j].y;
4316
+
4317
+
4318
+ point_deltas_x[j] = old_point_delta_x + point_delta_x;
4319
+ point_deltas_y[j] = old_point_delta_y + point_delta_y;
4320
+
4321
+ #ifdef FT_DEBUG_LEVEL_TRACE
4322
+ if ( point_delta_x || point_delta_y )
4323
+ {
4324
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
4325
+ j,
4326
+ (double)( FT_intToFixed( outline->points[j].x ) +
4327
+ old_point_delta_x ) / 65536,
4328
+ (double)( FT_intToFixed( outline->points[j].y ) +
4329
+ old_point_delta_y ) / 65536,
4330
+ (double)( FT_intToFixed( outline->points[j].x ) +
4331
+ point_deltas_x[j] ) / 65536,
4332
+ (double)( FT_intToFixed( outline->points[j].y ) +
4333
+ point_deltas_y[j] ) / 65536 ));
4334
+ count++;
4335
+ }
4336
+ #endif
4337
+ }
4338
+
4339
+ #ifdef FT_DEBUG_LEVEL_TRACE
4340
+ if ( !count )
4341
+ FT_TRACE7(( " none\n" ));
4342
+ #endif
4343
+ }
4344
+
4345
+ if ( localpoints != ALL_POINTS )
4346
+ FT_FREE( localpoints );
4347
+ FT_FREE( deltas_x );
4348
+ FT_FREE( deltas_y );
4349
+
4350
+ offsetToData += tupleDataSize;
4351
+
4352
+ FT_Stream_SeekSet( stream, here );
4353
+ }
4354
+
4355
+ FT_TRACE5(( "\n" ));
4356
+
4357
+ /* To avoid double adjustment of advance width or height, */
4358
+ /* do not move phantom points if there is HVAR or VVAR */
4359
+ /* support, respectively. */
4360
+ if ( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE )
4361
+ {
4362
+ point_deltas_x[n_points - 4] = 0;
4363
+ point_deltas_y[n_points - 4] = 0;
4364
+ point_deltas_x[n_points - 3] = 0;
4365
+ point_deltas_y[n_points - 3] = 0;
4366
+ }
4367
+ if ( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE )
4368
+ {
4369
+ point_deltas_x[n_points - 2] = 0;
4370
+ point_deltas_y[n_points - 2] = 0;
4371
+ point_deltas_x[n_points - 1] = 0;
4372
+ point_deltas_y[n_points - 1] = 0;
4373
+ }
4374
+
4375
+ for ( i = 0; i < n_points; i++ )
4376
+ {
4377
+ unrounded[i].x += FT_fixedToFdot6( point_deltas_x[i] );
4378
+ unrounded[i].y += FT_fixedToFdot6( point_deltas_y[i] );
4379
+
4380
+ outline->points[i].x += FT_fixedToInt( point_deltas_x[i] );
4381
+ outline->points[i].y += FT_fixedToInt( point_deltas_y[i] );
4382
+ }
4383
+
4384
+ /* To avoid double adjustment of advance width or height, */
4385
+ /* adjust phantom points only if there is no HVAR or VVAR */
4386
+ /* support, respectively. */
4387
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
4388
+ {
4389
+ loader->pp1 = outline->points[n_points - 4];
4390
+ loader->pp2 = outline->points[n_points - 3];
4391
+ loader->linear = FT_PIX_ROUND( unrounded[n_points - 3].x -
4392
+ unrounded[n_points - 4].x ) / 64;
4393
+ }
4394
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
4395
+ {
4396
+ loader->pp3 = outline->points[n_points - 2];
4397
+ loader->pp4 = outline->points[n_points - 1];
4398
+ loader->vadvance = FT_PIX_ROUND( unrounded[n_points - 1].y -
4399
+ unrounded[n_points - 2].y ) / 64;
4400
+ }
4401
+
4402
+ Exit:
4403
+ if ( sharedpoints != ALL_POINTS )
4404
+ FT_FREE( sharedpoints );
4405
+ FT_FREE( points_org );
4406
+ FT_FREE( points_out );
4407
+ FT_FREE( has_delta );
4408
+ FT_FREE( peak_coords );
4409
+ FT_FREE( point_deltas_x );
4410
+
4411
+ FExit:
4412
+ FT_FRAME_EXIT();
4413
+
4414
+ return error;
4415
+ }
4416
+
4417
+
4418
+ /**************************************************************************
4419
+ *
4420
+ * @Function:
4421
+ * tt_get_var_blend
4422
+ *
4423
+ * @Description:
4424
+ * An extended internal version of `TT_Get_MM_Blend' that returns
4425
+ * pointers instead of copying data, without any initialization of
4426
+ * the MM machinery in case it isn't loaded yet.
4427
+ */
4428
+ FT_LOCAL_DEF( FT_Error )
4429
+ tt_get_var_blend( FT_Face face, /* TT_Face */
4430
+ FT_UInt *num_coords,
4431
+ FT_Fixed* *coords,
4432
+ FT_Fixed* *normalizedcoords,
4433
+ FT_MM_Var* *mm_var )
4434
+ {
4435
+ TT_Face ttface = (TT_Face)face;
4436
+
4437
+
4438
+ if ( ttface->blend )
4439
+ {
4440
+ if ( num_coords )
4441
+ *num_coords = ttface->blend->num_axis;
4442
+ if ( coords )
4443
+ *coords = ttface->blend->coords;
4444
+ if ( normalizedcoords )
4445
+ *normalizedcoords = ttface->blend->normalizedcoords;
4446
+ if ( mm_var )
4447
+ *mm_var = ttface->blend->mmvar;
4448
+ }
4449
+ else
4450
+ {
4451
+ if ( num_coords )
4452
+ *num_coords = 0;
4453
+ if ( coords )
4454
+ *coords = NULL;
4455
+ if ( mm_var )
4456
+ *mm_var = NULL;
4457
+ }
4458
+
4459
+ return FT_Err_Ok;
4460
+ }
4461
+
4462
+
4463
+ FT_LOCAL_DEF( void )
4464
+ tt_var_done_item_variation_store( FT_Face face,
4465
+ GX_ItemVarStore itemStore )
4466
+ {
4467
+ FT_Memory memory = FT_FACE_MEMORY( face );
4468
+ FT_UInt i;
4469
+
4470
+
4471
+ if ( itemStore->varData )
4472
+ {
4473
+ for ( i = 0; i < itemStore->dataCount; i++ )
4474
+ {
4475
+ FT_FREE( itemStore->varData[i].regionIndices );
4476
+ FT_FREE( itemStore->varData[i].deltaSet );
4477
+ }
4478
+
4479
+ FT_FREE( itemStore->varData );
4480
+ }
4481
+
4482
+ if ( itemStore->varRegionList )
4483
+ {
4484
+ for ( i = 0; i < itemStore->regionCount; i++ )
4485
+ FT_FREE( itemStore->varRegionList[i].axisList );
4486
+
4487
+ FT_FREE( itemStore->varRegionList );
4488
+ }
4489
+ }
4490
+
4491
+
4492
+ FT_LOCAL_DEF( void )
4493
+ tt_var_done_delta_set_index_map( FT_Face face,
4494
+ GX_DeltaSetIdxMap deltaSetIdxMap )
4495
+ {
4496
+ FT_Memory memory = FT_FACE_MEMORY( face );
4497
+
4498
+
4499
+ FT_FREE( deltaSetIdxMap->innerIndex );
4500
+ FT_FREE( deltaSetIdxMap->outerIndex );
4501
+ }
4502
+
4503
+
4504
+ /**************************************************************************
4505
+ *
4506
+ * @Function:
4507
+ * tt_done_blend
4508
+ *
4509
+ * @Description:
4510
+ * Free the blend internal data structure.
4511
+ */
4512
+ FT_LOCAL_DEF( void )
4513
+ tt_done_blend( FT_Face face )
4514
+ {
4515
+ TT_Face ttface = (TT_Face)face;
4516
+ FT_Memory memory = FT_FACE_MEMORY( face );
4517
+ GX_Blend blend = ttface->blend;
4518
+
4519
+
4520
+ if ( blend )
4521
+ {
4522
+ FT_UInt i, num_axes;
4523
+
4524
+
4525
+ /* blend->num_axis might not be set up yet */
4526
+ num_axes = blend->mmvar->num_axis;
4527
+
4528
+ FT_FREE( blend->coords );
4529
+ FT_FREE( blend->normalizedcoords );
4530
+ FT_FREE( blend->normalized_stylecoords );
4531
+ FT_FREE( blend->mmvar );
4532
+
4533
+ if ( blend->avar_table )
4534
+ {
4535
+ if ( blend->avar_table->avar_segment )
4536
+ {
4537
+ for ( i = 0; i < num_axes; i++ )
4538
+ FT_FREE( blend->avar_table->avar_segment[i].correspondence );
4539
+ FT_FREE( blend->avar_table->avar_segment );
4540
+ }
4541
+
4542
+ tt_var_done_item_variation_store( face,
4543
+ &blend->avar_table->itemStore );
4544
+
4545
+ tt_var_done_delta_set_index_map( face,
4546
+ &blend->avar_table->axisMap );
4547
+
4548
+ FT_FREE( blend->avar_table );
4549
+ }
4550
+
4551
+ if ( blend->hvar_table )
4552
+ {
4553
+ tt_var_done_item_variation_store( face,
4554
+ &blend->hvar_table->itemStore );
4555
+
4556
+ tt_var_done_delta_set_index_map( face,
4557
+ &blend->hvar_table->widthMap );
4558
+ FT_FREE( blend->hvar_table );
4559
+ }
4560
+
4561
+ if ( blend->vvar_table )
4562
+ {
4563
+ tt_var_done_item_variation_store( face,
4564
+ &blend->vvar_table->itemStore );
4565
+
4566
+ tt_var_done_delta_set_index_map( face,
4567
+ &blend->vvar_table->widthMap );
4568
+ FT_FREE( blend->vvar_table );
4569
+ }
4570
+
4571
+ if ( blend->mvar_table )
4572
+ {
4573
+ tt_var_done_item_variation_store( face,
4574
+ &blend->mvar_table->itemStore );
4575
+
4576
+ FT_FREE( blend->mvar_table->values );
4577
+ FT_FREE( blend->mvar_table );
4578
+ }
4579
+
4580
+ FT_FREE( blend->tuplecoords );
4581
+ FT_FREE( blend->glyphoffsets );
4582
+ FT_FREE( blend );
4583
+ }
4584
+ }
4585
+
4586
+ #else /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */
4587
+
4588
+ /* ANSI C doesn't like empty source files */
4589
+ typedef int tt_gxvar_dummy_;
4590
+
4591
+ #endif /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */
4592
+
4593
+
4594
+ /* END */