fontconv 0.0.1 → 0.0.3

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 (336) hide show
  1. package/README.md +19 -10
  2. package/esm/{fontconv/cli.js → cli.js} +9 -4
  3. package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.js +1 -0
  4. package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.js +1 -0
  5. package/{script/deps/deno.land/std@0.221.0 → esm/deps/deno.land/std@0.224.0}/path/mod.d.ts +2 -2
  6. package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/mod.js +2 -2
  7. package/{script/deps/deno.land/std@0.221.0 → esm/deps/deno.land/std@0.224.0}/path/parse.d.ts +1 -0
  8. package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.d.ts +1 -0
  9. package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.d.ts +1 -0
  10. package/esm/ligature.d.ts +6 -0
  11. package/esm/ligature.js +72 -0
  12. package/esm/{fontconv/mod.d.ts → mod.d.ts} +3 -0
  13. package/esm/{fontconv/mod.js → mod.js} +113 -29
  14. package/package.json +7 -7
  15. package/script/{fontconv/cli.js → cli.js} +9 -4
  16. package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.js +1 -0
  17. package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.js +1 -0
  18. package/{esm/deps/deno.land/std@0.221.0 → script/deps/deno.land/std@0.224.0}/path/mod.d.ts +2 -2
  19. package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/mod.js +2 -2
  20. package/{esm/deps/deno.land/std@0.221.0 → script/deps/deno.land/std@0.224.0}/path/parse.d.ts +1 -0
  21. package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.d.ts +1 -0
  22. package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.d.ts +1 -0
  23. package/script/ligature.d.ts +6 -0
  24. package/script/ligature.js +77 -0
  25. package/script/{fontconv/mod.d.ts → mod.d.ts} +3 -0
  26. package/script/{fontconv/mod.js → mod.js} +117 -34
  27. package/esm/ttf2svg/mod.d.ts +0 -9
  28. package/esm/ttf2svg/mod.js +0 -167
  29. package/script/ttf2svg/mod.d.ts +0 -9
  30. package/script/ttf2svg/mod.js +0 -204
  31. /package/esm/{fontconv/cli.d.ts → cli.d.ts} +0 -0
  32. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.d.ts +0 -0
  33. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.d.ts +0 -0
  34. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.d.ts +0 -0
  35. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.js +0 -0
  36. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.d.ts +0 -0
  37. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.js +0 -0
  38. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.d.ts +0 -0
  39. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.js +0 -0
  40. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.d.ts +0 -0
  41. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.js +0 -0
  42. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.d.ts +0 -0
  43. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.js +0 -0
  44. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.d.ts +0 -0
  45. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.js +0 -0
  46. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.d.ts +0 -0
  47. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.js +0 -0
  48. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
  49. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.js +0 -0
  50. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.d.ts +0 -0
  51. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.js +0 -0
  52. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.d.ts +0 -0
  53. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.js +0 -0
  54. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.d.ts +0 -0
  55. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.js +0 -0
  56. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.d.ts +0 -0
  57. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.js +0 -0
  58. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.d.ts +0 -0
  59. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.js +0 -0
  60. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.d.ts +0 -0
  61. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.js +0 -0
  62. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.d.ts +0 -0
  63. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.js +0 -0
  64. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.d.ts +0 -0
  65. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.js +0 -0
  66. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.d.ts +0 -0
  67. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.js +0 -0
  68. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.d.ts +0 -0
  69. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.js +0 -0
  70. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.d.ts +0 -0
  71. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.js +0 -0
  72. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.d.ts +0 -0
  73. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.js +0 -0
  74. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.d.ts +0 -0
  75. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.js +0 -0
  76. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.d.ts +0 -0
  77. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.js +0 -0
  78. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.d.ts +0 -0
  79. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.js +0 -0
  80. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.d.ts +0 -0
  81. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.js +0 -0
  82. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.d.ts +0 -0
  83. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.js +0 -0
  84. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.d.ts +0 -0
  85. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.js +0 -0
  86. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.d.ts +0 -0
  87. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.js +0 -0
  88. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.d.ts +0 -0
  89. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.js +0 -0
  90. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.d.ts +0 -0
  91. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.js +0 -0
  92. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/parse.js +0 -0
  93. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.d.ts +0 -0
  94. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.js +0 -0
  95. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.d.ts +0 -0
  96. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.js +0 -0
  97. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.d.ts +0 -0
  98. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.js +0 -0
  99. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.d.ts +0 -0
  100. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.js +0 -0
  101. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.d.ts +0 -0
  102. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.js +0 -0
  103. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.d.ts +0 -0
  104. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.js +0 -0
  105. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.d.ts +0 -0
  106. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.js +0 -0
  107. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.d.ts +0 -0
  108. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.js +0 -0
  109. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.d.ts +0 -0
  110. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.js +0 -0
  111. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.d.ts +0 -0
  112. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.js +0 -0
  113. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.d.ts +0 -0
  114. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.js +0 -0
  115. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.d.ts +0 -0
  116. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.js +0 -0
  117. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.d.ts +0 -0
  118. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.js +0 -0
  119. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.d.ts +0 -0
  120. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.js +0 -0
  121. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.d.ts +0 -0
  122. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.js +0 -0
  123. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.d.ts +0 -0
  124. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.js +0 -0
  125. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.js +0 -0
  126. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.d.ts +0 -0
  127. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.js +0 -0
  128. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.d.ts +0 -0
  129. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.js +0 -0
  130. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.d.ts +0 -0
  131. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.js +0 -0
  132. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.d.ts +0 -0
  133. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.js +0 -0
  134. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.d.ts +0 -0
  135. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.js +0 -0
  136. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.d.ts +0 -0
  137. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.js +0 -0
  138. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.d.ts +0 -0
  139. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.js +0 -0
  140. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.d.ts +0 -0
  141. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.js +0 -0
  142. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.d.ts +0 -0
  143. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.js +0 -0
  144. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.d.ts +0 -0
  145. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.js +0 -0
  146. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.d.ts +0 -0
  147. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.js +0 -0
  148. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.d.ts +0 -0
  149. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.js +0 -0
  150. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.d.ts +0 -0
  151. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.js +0 -0
  152. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.d.ts +0 -0
  153. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.js +0 -0
  154. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.d.ts +0 -0
  155. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.js +0 -0
  156. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.d.ts +0 -0
  157. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.js +0 -0
  158. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.d.ts +0 -0
  159. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.js +0 -0
  160. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.d.ts +0 -0
  161. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.js +0 -0
  162. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.d.ts +0 -0
  163. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.js +0 -0
  164. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.d.ts +0 -0
  165. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.js +0 -0
  166. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.d.ts +0 -0
  167. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.js +0 -0
  168. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.d.ts +0 -0
  169. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.js +0 -0
  170. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.d.ts +0 -0
  171. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.js +0 -0
  172. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.d.ts +0 -0
  173. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.js +0 -0
  174. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.js +0 -0
  175. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.d.ts +0 -0
  176. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.js +0 -0
  177. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.d.ts +0 -0
  178. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.js +0 -0
  179. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.d.ts +0 -0
  180. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.js +0 -0
  181. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.d.ts +0 -0
  182. /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.js +0 -0
  183. /package/esm/{fontconv/test.d.ts → test.d.ts} +0 -0
  184. /package/script/{fontconv/cli.d.ts → cli.d.ts} +0 -0
  185. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.d.ts +0 -0
  186. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.d.ts +0 -0
  187. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.d.ts +0 -0
  188. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.js +0 -0
  189. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.d.ts +0 -0
  190. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.js +0 -0
  191. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.d.ts +0 -0
  192. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.js +0 -0
  193. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.d.ts +0 -0
  194. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.js +0 -0
  195. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.d.ts +0 -0
  196. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.js +0 -0
  197. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.d.ts +0 -0
  198. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.js +0 -0
  199. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.d.ts +0 -0
  200. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.js +0 -0
  201. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
  202. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.js +0 -0
  203. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.d.ts +0 -0
  204. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.js +0 -0
  205. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.d.ts +0 -0
  206. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.js +0 -0
  207. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.d.ts +0 -0
  208. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.js +0 -0
  209. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.d.ts +0 -0
  210. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.js +0 -0
  211. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.d.ts +0 -0
  212. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.js +0 -0
  213. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.d.ts +0 -0
  214. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.js +0 -0
  215. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.d.ts +0 -0
  216. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.js +0 -0
  217. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.d.ts +0 -0
  218. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.js +0 -0
  219. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.d.ts +0 -0
  220. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.js +0 -0
  221. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.d.ts +0 -0
  222. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.js +0 -0
  223. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.d.ts +0 -0
  224. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.js +0 -0
  225. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.d.ts +0 -0
  226. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.js +0 -0
  227. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.d.ts +0 -0
  228. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.js +0 -0
  229. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.d.ts +0 -0
  230. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.js +0 -0
  231. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.d.ts +0 -0
  232. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.js +0 -0
  233. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.d.ts +0 -0
  234. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.js +0 -0
  235. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.d.ts +0 -0
  236. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.js +0 -0
  237. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.d.ts +0 -0
  238. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.js +0 -0
  239. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.d.ts +0 -0
  240. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.js +0 -0
  241. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.d.ts +0 -0
  242. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.js +0 -0
  243. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.d.ts +0 -0
  244. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.js +0 -0
  245. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/parse.js +0 -0
  246. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.d.ts +0 -0
  247. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.js +0 -0
  248. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.d.ts +0 -0
  249. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.js +0 -0
  250. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.d.ts +0 -0
  251. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.js +0 -0
  252. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.d.ts +0 -0
  253. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.js +0 -0
  254. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.d.ts +0 -0
  255. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.js +0 -0
  256. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.d.ts +0 -0
  257. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.js +0 -0
  258. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.d.ts +0 -0
  259. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.js +0 -0
  260. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.d.ts +0 -0
  261. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.js +0 -0
  262. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.d.ts +0 -0
  263. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.js +0 -0
  264. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.d.ts +0 -0
  265. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.js +0 -0
  266. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.d.ts +0 -0
  267. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.js +0 -0
  268. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.d.ts +0 -0
  269. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.js +0 -0
  270. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.d.ts +0 -0
  271. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.js +0 -0
  272. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.d.ts +0 -0
  273. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.js +0 -0
  274. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.d.ts +0 -0
  275. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.js +0 -0
  276. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.d.ts +0 -0
  277. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.js +0 -0
  278. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.js +0 -0
  279. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.d.ts +0 -0
  280. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.js +0 -0
  281. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.d.ts +0 -0
  282. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.js +0 -0
  283. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.d.ts +0 -0
  284. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.js +0 -0
  285. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.d.ts +0 -0
  286. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.js +0 -0
  287. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.d.ts +0 -0
  288. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.js +0 -0
  289. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.d.ts +0 -0
  290. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.js +0 -0
  291. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.d.ts +0 -0
  292. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.js +0 -0
  293. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.d.ts +0 -0
  294. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.js +0 -0
  295. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.d.ts +0 -0
  296. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.js +0 -0
  297. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.d.ts +0 -0
  298. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.js +0 -0
  299. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.d.ts +0 -0
  300. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.js +0 -0
  301. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.d.ts +0 -0
  302. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.js +0 -0
  303. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.d.ts +0 -0
  304. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.js +0 -0
  305. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.d.ts +0 -0
  306. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.js +0 -0
  307. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.d.ts +0 -0
  308. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.js +0 -0
  309. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.d.ts +0 -0
  310. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.js +0 -0
  311. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.d.ts +0 -0
  312. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.js +0 -0
  313. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.d.ts +0 -0
  314. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.js +0 -0
  315. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.d.ts +0 -0
  316. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.js +0 -0
  317. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.d.ts +0 -0
  318. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.js +0 -0
  319. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.d.ts +0 -0
  320. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.js +0 -0
  321. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.d.ts +0 -0
  322. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.js +0 -0
  323. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.d.ts +0 -0
  324. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.js +0 -0
  325. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.d.ts +0 -0
  326. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.js +0 -0
  327. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.js +0 -0
  328. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.d.ts +0 -0
  329. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.js +0 -0
  330. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.d.ts +0 -0
  331. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.js +0 -0
  332. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.d.ts +0 -0
  333. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.js +0 -0
  334. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.d.ts +0 -0
  335. /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.js +0 -0
  336. /package/script/{fontconv/test.d.ts → test.d.ts} +0 -0
package/README.md CHANGED
@@ -7,7 +7,7 @@ Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).
7
7
  ### Deno
8
8
 
9
9
  ```
10
- deno install -fr --allow-read --allow-write --name fontconv \
10
+ deno install -fr --allow-read --allow-write --name fontconv -g \
11
11
  https://raw.githubusercontent.com/marmooo/fontconv/main/cli.js
12
12
  ```
13
13
 
@@ -36,16 +36,21 @@ Usage: fontconv [options] <input> <output>
36
36
  Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).
37
37
 
38
38
  Arguments:
39
- input Path of input font file
40
- output Path of output font file
39
+ input Path of input font file
40
+ output Path of output font file
41
41
 
42
42
  Options:
43
- -V, --version output the version number
44
- --text <string> characters to compress
45
- --text-file <path> Path of line separated character file to compress
46
- --code <string> comma separated codepoints to compress
47
- --code-file <path> Path of line separated codepoint file to compress
48
- -h, --help display help for command
43
+ -V, --version output the version number
44
+ --text <string> characters to compress
45
+ --text-file <path> Path of line separated character file to compress
46
+ --code <string> comma separated codepoints to compress
47
+ --code-file <path> Path of line separated codepoint file to compress
48
+ --name <string> comma separated glyph names to compress
49
+ --name-file <path> Path of line separated glyph name file to compress
50
+ --ligature <string> comma separated ligatures to compress
51
+ --ligature-file <path> Path of line separated ligature file to compress
52
+ --remove-ligatures remove ligatures associated with the glyphs
53
+ -h, --help display help for command
49
54
  ```
50
55
 
51
56
  ### Examples
@@ -53,10 +58,14 @@ Options:
53
58
  ```
54
59
  fontconv in.ttf out.woff
55
60
  fontconv in.woff2 out.otf
56
- fontconv --text-file charaters.lst in.ttf out.woff2
57
61
  fontconv --text abcdef in.ttf out.woff2
62
+ fontconv --text-file charaters.lst in.ttf out.woff2
58
63
  fontconv --code 0x61,98 in.ttf out.woff2
59
64
  fontconv --code-file codepoints.lst in.ttf out.woff2
65
+ fontconv --name alarm.box in.otf out.woff
66
+ fontconv --name-file names.lst in.otf out.woff
67
+ fontconv --ligature home,menu --remove-ligatures in.otf out.woff
68
+ fontconv --ligature-file ligatures.lst in.otf out.woff
60
69
  ```
61
70
 
62
71
  `codepoints.lst`
@@ -1,20 +1,25 @@
1
1
  #!/usr/bin/env node
2
- import * as dntShim from "../_dnt.shims.js";
3
- import { extname } from "../deps/deno.land/std@0.221.0/path/mod.js";
2
+ import * as dntShim from "./_dnt.shims.js";
3
+ import { extname } from "./deps/deno.land/std@0.224.0/path/mod.js";
4
4
  import { Command } from "commander";
5
5
  import { convert } from "./mod.js";
6
6
  const program = new Command();
7
7
  program
8
8
  .name("fontconv")
9
9
  .description("Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).")
10
- .version("0.0.1");
10
+ .version("0.0.3");
11
11
  program
12
12
  .argument("<input>", "Path of input font file")
13
13
  .argument("<output>", "Path of output font file")
14
14
  .option("--text <string>", "characters to compress")
15
15
  .option("--text-file <path>", "Path of line separated character file to compress")
16
16
  .option("--code <string>", "comma separated codepoints to compress")
17
- .option("--code-file <path>", "Path of line separated codepoint file to compress");
17
+ .option("--code-file <path>", "Path of line separated codepoint file to compress")
18
+ .option("--name <string>", "comma separated glyph names to compress")
19
+ .option("--name-file <path>", "Path of line separated glyph name file to compress")
20
+ .option("--ligature <string>", "comma separated ligatures to compress")
21
+ .option("--ligature-file <path>", "Path of line separated ligature file to compress")
22
+ .option("--remove-ligatures", "remove ligatures associated with the glyphs");
18
23
  program.parse();
19
24
  const inPath = program.args[0];
20
25
  const outPath = program.args[1];
@@ -1,4 +1,5 @@
1
1
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
2
3
  import { AssertionError } from "./assertion_error.js";
3
4
  /**
4
5
  * Make an assertion, error will be thrown if `expr` does not have truthy value.
@@ -1,4 +1,5 @@
1
1
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
2
3
  /**
3
4
  * Error thrown when an assertion fails.
4
5
  *
@@ -30,9 +30,9 @@
30
30
  */
31
31
  import * as _windows from "./windows/mod.js";
32
32
  import * as _posix from "./posix/mod.js";
33
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
33
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
34
34
  export declare const win32: typeof _windows;
35
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
35
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
36
36
  export declare const posix: typeof _posix;
37
37
  export * from "./basename.js";
38
38
  export * from "./constants.js";
@@ -34,9 +34,9 @@
34
34
  */
35
35
  import * as _windows from "./windows/mod.js";
36
36
  import * as _posix from "./posix/mod.js";
37
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
37
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
38
38
  export const win32 = _windows;
39
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
39
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
40
40
  export const posix = _posix;
41
41
  export * from "./basename.js";
42
42
  export * from "./constants.js";
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "./_interface.js";
2
+ export type { ParsedPath } from "./_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`. Use `format` to reverse the result.
4
5
  *
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "../_interface.js";
2
+ export type { ParsedPath } from "../_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`.
4
5
  * @param path to process
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "../_interface.js";
2
+ export type { ParsedPath } from "../_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`.
4
5
  * @param path to process
@@ -0,0 +1,6 @@
1
+ export function parseLigatures(font: any): Generator<{
2
+ name: string;
3
+ sub: any[];
4
+ by: any;
5
+ }, void, unknown>;
6
+ export function getLigatureMap(font: any, key: any): {};
@@ -0,0 +1,72 @@
1
+ function* parseCoverageFormat1(subtable, reverseGlyphIndexMap) {
2
+ if (!subtable.ligatureSets)
3
+ return;
4
+ for (let i = 0; i < subtable.ligatureSets.length; i++) {
5
+ for (const ligature of subtable.ligatureSets[i]) {
6
+ const initialIndex = subtable.coverage.glyphs[i];
7
+ const coverage1 = reverseGlyphIndexMap[initialIndex];
8
+ const components = ligature.components.map((component) => {
9
+ const codePoint = reverseGlyphIndexMap[component];
10
+ return String.fromCharCode(codePoint);
11
+ });
12
+ const sub = [initialIndex, ...ligature.components];
13
+ const name = String.fromCharCode(coverage1) + components.join("");
14
+ yield { name, sub, by: ligature.ligGlyph };
15
+ }
16
+ }
17
+ }
18
+ function* parseCoverageFormat2(subtable, reverseGlyphIndexMap) {
19
+ if (!subtable.ligatureSets)
20
+ return;
21
+ const coverage2 = [];
22
+ subtable.coverage.ranges.forEach((coverage) => {
23
+ for (let c = coverage.start; c <= coverage.end; c++) {
24
+ coverage2.push(c);
25
+ }
26
+ });
27
+ for (let i = 0; i < subtable.ligatureSets.length; i++) {
28
+ for (const ligature of subtable.ligatureSets[i]) {
29
+ const components = ligature.components.map((component) => {
30
+ const codePoint = reverseGlyphIndexMap[component];
31
+ return String.fromCharCode(codePoint);
32
+ });
33
+ const coverage = reverseGlyphIndexMap[coverage2[i]];
34
+ const name = String.fromCharCode(coverage) + components.join("");
35
+ const sub = [coverage2[i], ...ligature.components];
36
+ yield { name, sub, by: ligature.ligGlyph };
37
+ }
38
+ }
39
+ }
40
+ // https://github.com/opentypejs/opentype.js/issues/384
41
+ // https://jsfiddle.net/nvbajtmo/
42
+ export function* parseLigatures(font) {
43
+ const gsub = font.tables.gsub;
44
+ if (!gsub)
45
+ return;
46
+ const glyphIndexMap = font.tables.cmap.glyphIndexMap;
47
+ const reverseGlyphIndexMap = {};
48
+ Object.keys(glyphIndexMap).forEach((codePoint) => {
49
+ const value = glyphIndexMap[codePoint];
50
+ reverseGlyphIndexMap[value] = codePoint;
51
+ });
52
+ for (const lookup of gsub.lookups) {
53
+ for (const subtable of lookup.subtables) {
54
+ const coverage = subtable.coverage;
55
+ if (!coverage)
56
+ continue;
57
+ if (coverage.format === 1) {
58
+ yield* parseCoverageFormat1(subtable, reverseGlyphIndexMap);
59
+ }
60
+ else {
61
+ yield* parseCoverageFormat2(subtable, reverseGlyphIndexMap);
62
+ }
63
+ }
64
+ }
65
+ }
66
+ export function getLigatureMap(font, key) {
67
+ const map = {};
68
+ for (const ligature of parseLigatures(font)) {
69
+ map[ligature[key]] = ligature;
70
+ }
71
+ return map;
72
+ }
@@ -6,5 +6,8 @@ export function isWOFF(uint8Array: any): boolean;
6
6
  export function isWOFF2(uint8Array: any): boolean;
7
7
  export function otf2ttf(otf: any): any;
8
8
  export function getFont(fontContent: any): Promise<any>;
9
+ export function getNameMap(font: any): {};
9
10
  export function filterGlyphs(font: any, options: any): any;
10
11
  export function convert(fontContent: any, format: any, options: any): Promise<any>;
12
+ export { getLigatureMap };
13
+ import { getLigatureMap } from "./ligature.js";
@@ -1,12 +1,14 @@
1
- import * as dntShim from "../_dnt.shims.js";
1
+ import * as dntShim from "./_dnt.shims.js";
2
+ import { getLigatureMap } from "./ligature.js";
2
3
  import { compress, decompress } from "wawoff2";
3
4
  import { Font, parse } from "opentype.js";
4
- import { font2svgFont, ttf2svgFont } from "../ttf2svg/mod.js";
5
+ import { font2svgFont, ttf2svgFont } from "@marmooo/ttf2svg";
5
6
  import svg2ttf from "svg2ttf";
6
7
  import ttf2eot from "ttf2eot";
7
8
  import ttf2woff from "ttf2woff";
8
9
  // import ttf2woff2 from "npm:ttf2woff2@5.0.0";
9
10
  // import * as fonteditor from "npm:fonteditor-core@2.3.3"; // glyph names are lost
11
+ export { getLigatureMap };
10
12
  export function isOTF(uint8Array) {
11
13
  return uint8Array[0] === 0x4F &&
12
14
  uint8Array[1] === 0x54 &&
@@ -55,27 +57,6 @@ export function otf2ttf(otf) {
55
57
  // const ttfBuffer = new fonteditor.default.TTFWriter().write(ttfObj);
56
58
  // return new Uint8Array(ttfBuffer);
57
59
  // }
58
- function getGlyphString(options) {
59
- if (options.textFile) {
60
- const text = dntShim.Deno.readTextFileSync(options.textFile);
61
- return text.trimEnd().replace(/\n/g, "");
62
- }
63
- else if (options.codeFile) {
64
- const text = dntShim.Deno.readTextFileSync(options.codeFile);
65
- return text.trimEnd().split("\n")
66
- .map((line) => String.fromCodePoint(Number(line))).join("");
67
- }
68
- else if (options.text) {
69
- return options.text;
70
- }
71
- else if (options.code) {
72
- return options.code.split(",")
73
- .map((code) => String.fromCodePoint(Number(code))).join("");
74
- }
75
- else {
76
- return undefined;
77
- }
78
- }
79
60
  export async function getFont(fontContent) {
80
61
  if (isSVG(fontContent)) {
81
62
  const ttf = svg2ttf(fontContent);
@@ -117,18 +98,70 @@ async function convertFormat(font, format) {
117
98
  throw new Error(`${format} is not a supported format.`);
118
99
  }
119
100
  }
101
+ export function getNameMap(font) {
102
+ const map = {};
103
+ for (const glyph of Object.values(font.glyphs.glyphs)) {
104
+ map[glyph.name] = glyph.index;
105
+ }
106
+ return map;
107
+ }
120
108
  export function filterGlyphs(font, options) {
121
- const glyphString = getGlyphString(options);
122
- if (glyphString) {
109
+ if (options.textFile) {
110
+ const text = dntShim.Deno.readTextFileSync(options.textFile);
111
+ const glyphString = text.trimEnd().replace(/\n/g, "");
123
112
  return font.stringToGlyphs(glyphString);
124
113
  }
114
+ else if (options.codeFile) {
115
+ const text = dntShim.Deno.readTextFileSync(options.codeFile);
116
+ const glyphString = text.trimEnd().split("\n")
117
+ .map((line) => String.fromCodePoint(Number(line))).join("");
118
+ return font.stringToGlyphs(glyphString);
119
+ }
120
+ else if (options.nameFile) {
121
+ const nameMap = getNameMap(font);
122
+ const text = dntShim.Deno.readTextFileSync(options.nameFile);
123
+ return text.trimEnd().split("\n")
124
+ .map((line) => font.glyphs.get(nameMap[line]));
125
+ }
126
+ else if (options.ligatureFile) {
127
+ const ligatureMap = getLigatureMap(font, "name");
128
+ const text = dntShim.Deno.readTextFileSync(options.ligatureFile);
129
+ return text.trimEnd().split("\n")
130
+ .map((line) => font.glyphs.get(ligatureMap[line].by));
131
+ }
132
+ else if (options.text) {
133
+ return font.stringToGlyphs(options.text);
134
+ }
135
+ else if (options.code) {
136
+ const glyphString = options.code.split(",")
137
+ .map((code) => String.fromCodePoint(Number(code))).join("");
138
+ return font.stringToGlyphs(glyphString);
139
+ }
140
+ else if (options.name) {
141
+ const nameMap = getNameMap(font);
142
+ return options.name.split(",")
143
+ .map((line) => font.glyphs.get(nameMap[line]));
144
+ }
145
+ else if (options.ligature) {
146
+ const ligatureMap = getLigatureMap(font, "name");
147
+ return options.ligature.split(",")
148
+ .map((line) => font.glyphs.get(ligatureMap[line].by));
149
+ }
125
150
  else {
126
151
  return Object.values(font.glyphs.glyphs);
127
152
  }
128
153
  }
129
154
  function createTemporaryFont(font, glyphs) {
130
155
  const notdefGlyph = font.glyphs.get(0);
131
- const tempFont = new Font({
156
+ notdefGlyph.name = ".notdef";
157
+ // avoid the warning caused by opentype.js below
158
+ // Undefined CHARARRAY encountered and treated as an empty string.
159
+ glyphs.forEach((glyph) => {
160
+ if (!glyph.name) {
161
+ glyph.name = String.fromCharCode(glyph.unicode);
162
+ }
163
+ });
164
+ const tmpFont = new Font({
132
165
  familyName: font.names.fontFamily.en,
133
166
  styleName: font.names.fontSubfamily.en,
134
167
  unitsPerEm: font.unitsPerEm,
@@ -136,12 +169,63 @@ function createTemporaryFont(font, glyphs) {
136
169
  descender: font.descender,
137
170
  glyphs: [notdefGlyph, ...glyphs],
138
171
  });
139
- tempFont.names = font.names;
140
- return tempFont;
172
+ tmpFont.names = font.names;
173
+ return tmpFont;
174
+ }
175
+ function createLigaturesFont(font, glyphs) {
176
+ const ligatureMap = getLigatureMap(font, "by");
177
+ const charSet = new Set();
178
+ for (const glyph of glyphs) {
179
+ const ligature = ligatureMap[glyph.index];
180
+ if (ligature) {
181
+ Array.from(ligature.name).forEach((char) => {
182
+ charSet.add(char);
183
+ });
184
+ }
185
+ }
186
+ glyphs.forEach((glyph) => {
187
+ const char = String.fromCharCode(glyph.unicode);
188
+ if (charSet.has(char))
189
+ charSet.delete(char);
190
+ });
191
+ const ligatureGlyphs = [];
192
+ charSet.forEach((char) => {
193
+ const unicode = char.codePointAt(0);
194
+ const glyphIndex = font.encoding.cmap.glyphIndexMap[unicode];
195
+ const glyph = font.glyphs.get(glyphIndex);
196
+ ligatureGlyphs.push(glyph);
197
+ });
198
+ const newGlyphs = [...ligatureGlyphs, ...glyphs];
199
+ const tmpFont = createTemporaryFont(font, newGlyphs);
200
+ const charMap = {};
201
+ newGlyphs.forEach((glyph, index) => {
202
+ const char = String.fromCharCode(glyph.unicode);
203
+ charMap[char] = index + 1;
204
+ });
205
+ glyphs.forEach((glyph, i) => {
206
+ const ligature = ligatureMap[glyph.index];
207
+ if (ligature) {
208
+ const sub = Array.from(ligature.name)
209
+ .map((char) => charMap[char]);
210
+ const by = ligatureGlyphs.length + i + 1;
211
+ tmpFont.substitution.addLigature("liga", { sub, by });
212
+ }
213
+ });
214
+ const otf = tmpFont.toArrayBuffer();
215
+ const newFont = parse(otf);
216
+ return newFont;
217
+ }
218
+ function createFont(font, glyphs, options) {
219
+ if (options.removeLigatures) {
220
+ return createTemporaryFont(font, glyphs);
221
+ }
222
+ else {
223
+ return createLigaturesFont(font, glyphs);
224
+ }
141
225
  }
142
226
  export async function convert(fontContent, format, options) {
143
227
  const font = await getFont(fontContent);
144
228
  const glyphs = filterGlyphs(font, options);
145
- const tempFont = createTemporaryFont(font, glyphs);
229
+ const tempFont = createFont(font, glyphs, options);
146
230
  return await convertFormat(tempFont, format);
147
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontconv",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,25 +10,25 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/marmooo/fontconv/issues"
12
12
  },
13
- "main": "./script/fontconv/mod.js",
14
- "module": "./esm/fontconv/mod.js",
13
+ "main": "./script/mod.js",
14
+ "module": "./esm/mod.js",
15
15
  "exports": {
16
16
  ".": {
17
- "import": "./esm/fontconv/mod.js",
18
- "require": "./script/fontconv/mod.js"
17
+ "import": "./esm/mod.js",
18
+ "require": "./script/mod.js"
19
19
  }
20
20
  },
21
21
  "scripts": {
22
22
  "test": "node test_runner.js"
23
23
  },
24
24
  "bin": {
25
- "fontconv": "./esm/fontconv/cli.js"
25
+ "fontconv": "./esm/cli.js"
26
26
  },
27
27
  "dependencies": {
28
+ "@marmooo/ttf2svg": "0.2.1",
28
29
  "commander": "12.0.0",
29
30
  "opentype.js": "1.3.4",
30
31
  "svg2ttf": "6.0.3",
31
- "svgpath": "2.6.0",
32
32
  "ttf2eot": "3.1.0",
33
33
  "ttf2woff": "3.0.0",
34
34
  "wawoff2": "2.0.1",
@@ -24,22 +24,27 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  return result;
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- const dntShim = __importStar(require("../_dnt.shims.js"));
28
- const mod_js_1 = require("../deps/deno.land/std@0.221.0/path/mod.js");
27
+ const dntShim = __importStar(require("./_dnt.shims.js"));
28
+ const mod_js_1 = require("./deps/deno.land/std@0.224.0/path/mod.js");
29
29
  const commander_1 = require("commander");
30
30
  const mod_js_2 = require("./mod.js");
31
31
  const program = new commander_1.Command();
32
32
  program
33
33
  .name("fontconv")
34
34
  .description("Convert and compress fonts (.ttf, .otf, .eot, .svg, .woff, .woff2).")
35
- .version("0.0.1");
35
+ .version("0.0.3");
36
36
  program
37
37
  .argument("<input>", "Path of input font file")
38
38
  .argument("<output>", "Path of output font file")
39
39
  .option("--text <string>", "characters to compress")
40
40
  .option("--text-file <path>", "Path of line separated character file to compress")
41
41
  .option("--code <string>", "comma separated codepoints to compress")
42
- .option("--code-file <path>", "Path of line separated codepoint file to compress");
42
+ .option("--code-file <path>", "Path of line separated codepoint file to compress")
43
+ .option("--name <string>", "comma separated glyph names to compress")
44
+ .option("--name-file <path>", "Path of line separated glyph name file to compress")
45
+ .option("--ligature <string>", "comma separated ligatures to compress")
46
+ .option("--ligature-file <path>", "Path of line separated ligature file to compress")
47
+ .option("--remove-ligatures", "remove ligatures associated with the glyphs");
43
48
  program.parse();
44
49
  const inPath = program.args[0];
45
50
  const outPath = program.args[1];
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assert = void 0;
4
4
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
5
+ // This module is browser compatible.
5
6
  const assertion_error_js_1 = require("./assertion_error.js");
6
7
  /**
7
8
  * Make an assertion, error will be thrown if `expr` does not have truthy value.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
+ // This module is browser compatible.
3
4
  Object.defineProperty(exports, "__esModule", { value: true });
4
5
  exports.AssertionError = void 0;
5
6
  /**
@@ -30,9 +30,9 @@
30
30
  */
31
31
  import * as _windows from "./windows/mod.js";
32
32
  import * as _posix from "./posix/mod.js";
33
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
33
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
34
34
  export declare const win32: typeof _windows;
35
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
35
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
36
36
  export declare const posix: typeof _posix;
37
37
  export * from "./basename.js";
38
38
  export * from "./constants.js";
@@ -63,9 +63,9 @@ exports.posix = exports.win32 = void 0;
63
63
  */
64
64
  const _windows = __importStar(require("./windows/mod.js"));
65
65
  const _posix = __importStar(require("./posix/mod.js"));
66
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
66
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/windows/mod.ts} instead. */
67
67
  exports.win32 = _windows;
68
- /** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
68
+ /** @deprecated This will be removed in 1.0.0. Import from {@link https://deno.land/std/path/posix/mod.ts} instead. */
69
69
  exports.posix = _posix;
70
70
  __exportStar(require("./basename.js"), exports);
71
71
  __exportStar(require("./constants.js"), exports);
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "./_interface.js";
2
+ export type { ParsedPath } from "./_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`. Use `format` to reverse the result.
4
5
  *
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "../_interface.js";
2
+ export type { ParsedPath } from "../_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`.
4
5
  * @param path to process
@@ -1,4 +1,5 @@
1
1
  import type { ParsedPath } from "../_interface.js";
2
+ export type { ParsedPath } from "../_interface.js";
2
3
  /**
3
4
  * Return a `ParsedPath` object of the `path`.
4
5
  * @param path to process
@@ -0,0 +1,6 @@
1
+ export function parseLigatures(font: any): Generator<{
2
+ name: string;
3
+ sub: any[];
4
+ by: any;
5
+ }, void, unknown>;
6
+ export function getLigatureMap(font: any, key: any): {};
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLigatureMap = exports.parseLigatures = void 0;
4
+ function* parseCoverageFormat1(subtable, reverseGlyphIndexMap) {
5
+ if (!subtable.ligatureSets)
6
+ return;
7
+ for (let i = 0; i < subtable.ligatureSets.length; i++) {
8
+ for (const ligature of subtable.ligatureSets[i]) {
9
+ const initialIndex = subtable.coverage.glyphs[i];
10
+ const coverage1 = reverseGlyphIndexMap[initialIndex];
11
+ const components = ligature.components.map((component) => {
12
+ const codePoint = reverseGlyphIndexMap[component];
13
+ return String.fromCharCode(codePoint);
14
+ });
15
+ const sub = [initialIndex, ...ligature.components];
16
+ const name = String.fromCharCode(coverage1) + components.join("");
17
+ yield { name, sub, by: ligature.ligGlyph };
18
+ }
19
+ }
20
+ }
21
+ function* parseCoverageFormat2(subtable, reverseGlyphIndexMap) {
22
+ if (!subtable.ligatureSets)
23
+ return;
24
+ const coverage2 = [];
25
+ subtable.coverage.ranges.forEach((coverage) => {
26
+ for (let c = coverage.start; c <= coverage.end; c++) {
27
+ coverage2.push(c);
28
+ }
29
+ });
30
+ for (let i = 0; i < subtable.ligatureSets.length; i++) {
31
+ for (const ligature of subtable.ligatureSets[i]) {
32
+ const components = ligature.components.map((component) => {
33
+ const codePoint = reverseGlyphIndexMap[component];
34
+ return String.fromCharCode(codePoint);
35
+ });
36
+ const coverage = reverseGlyphIndexMap[coverage2[i]];
37
+ const name = String.fromCharCode(coverage) + components.join("");
38
+ const sub = [coverage2[i], ...ligature.components];
39
+ yield { name, sub, by: ligature.ligGlyph };
40
+ }
41
+ }
42
+ }
43
+ // https://github.com/opentypejs/opentype.js/issues/384
44
+ // https://jsfiddle.net/nvbajtmo/
45
+ function* parseLigatures(font) {
46
+ const gsub = font.tables.gsub;
47
+ if (!gsub)
48
+ return;
49
+ const glyphIndexMap = font.tables.cmap.glyphIndexMap;
50
+ const reverseGlyphIndexMap = {};
51
+ Object.keys(glyphIndexMap).forEach((codePoint) => {
52
+ const value = glyphIndexMap[codePoint];
53
+ reverseGlyphIndexMap[value] = codePoint;
54
+ });
55
+ for (const lookup of gsub.lookups) {
56
+ for (const subtable of lookup.subtables) {
57
+ const coverage = subtable.coverage;
58
+ if (!coverage)
59
+ continue;
60
+ if (coverage.format === 1) {
61
+ yield* parseCoverageFormat1(subtable, reverseGlyphIndexMap);
62
+ }
63
+ else {
64
+ yield* parseCoverageFormat2(subtable, reverseGlyphIndexMap);
65
+ }
66
+ }
67
+ }
68
+ }
69
+ exports.parseLigatures = parseLigatures;
70
+ function getLigatureMap(font, key) {
71
+ const map = {};
72
+ for (const ligature of parseLigatures(font)) {
73
+ map[ligature[key]] = ligature;
74
+ }
75
+ return map;
76
+ }
77
+ exports.getLigatureMap = getLigatureMap;
@@ -6,5 +6,8 @@ export function isWOFF(uint8Array: any): boolean;
6
6
  export function isWOFF2(uint8Array: any): boolean;
7
7
  export function otf2ttf(otf: any): any;
8
8
  export function getFont(fontContent: any): Promise<any>;
9
+ export function getNameMap(font: any): {};
9
10
  export function filterGlyphs(font: any, options: any): any;
10
11
  export function convert(fontContent: any, format: any, options: any): Promise<any>;
12
+ export { getLigatureMap };
13
+ import { getLigatureMap } from "./ligature.js";