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.
- package/README.md +19 -10
- package/esm/{fontconv/cli.js → cli.js} +9 -4
- package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.js +1 -0
- package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.js +1 -0
- package/{script/deps/deno.land/std@0.221.0 → esm/deps/deno.land/std@0.224.0}/path/mod.d.ts +2 -2
- package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/mod.js +2 -2
- package/{script/deps/deno.land/std@0.221.0 → esm/deps/deno.land/std@0.224.0}/path/parse.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.d.ts +1 -0
- package/esm/ligature.d.ts +6 -0
- package/esm/ligature.js +72 -0
- package/esm/{fontconv/mod.d.ts → mod.d.ts} +3 -0
- package/esm/{fontconv/mod.js → mod.js} +113 -29
- package/package.json +7 -7
- package/script/{fontconv/cli.js → cli.js} +9 -4
- package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.js +1 -0
- package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.js +1 -0
- package/{esm/deps/deno.land/std@0.221.0 → script/deps/deno.land/std@0.224.0}/path/mod.d.ts +2 -2
- package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/mod.js +2 -2
- package/{esm/deps/deno.land/std@0.221.0 → script/deps/deno.land/std@0.224.0}/path/parse.d.ts +1 -0
- package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.d.ts +1 -0
- package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.d.ts +1 -0
- package/script/ligature.d.ts +6 -0
- package/script/ligature.js +77 -0
- package/script/{fontconv/mod.d.ts → mod.d.ts} +3 -0
- package/script/{fontconv/mod.js → mod.js} +117 -34
- package/esm/ttf2svg/mod.d.ts +0 -9
- package/esm/ttf2svg/mod.js +0 -167
- package/script/ttf2svg/mod.d.ts +0 -9
- package/script/ttf2svg/mod.js +0 -204
- /package/esm/{fontconv/cli.d.ts → cli.d.ts} +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.js +0 -0
- /package/esm/{fontconv/test.d.ts → test.d.ts} +0 -0
- /package/script/{fontconv/cli.d.ts → cli.d.ts} +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/assert_path.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/common.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/format.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/normalize_string.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_interface.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_os.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/common.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/format.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/common.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/format.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/posix/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/common.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/format.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/windows/to_namespaced_path.js +0 -0
- /package/script/{fontconv/test.d.ts → test.d.ts} +0 -0
|
@@ -26,16 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.convert = exports.filterGlyphs = exports.getFont = exports.otf2ttf = exports.isWOFF2 = exports.isWOFF = exports.isSVG = exports.isEOT = exports.isTTF = exports.isOTF = void 0;
|
|
30
|
-
const dntShim = __importStar(require("
|
|
29
|
+
exports.convert = exports.filterGlyphs = exports.getNameMap = exports.getFont = exports.otf2ttf = exports.isWOFF2 = exports.isWOFF = exports.isSVG = exports.isEOT = exports.isTTF = exports.isOTF = exports.getLigatureMap = void 0;
|
|
30
|
+
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
31
|
+
const ligature_js_1 = require("./ligature.js");
|
|
32
|
+
Object.defineProperty(exports, "getLigatureMap", { enumerable: true, get: function () { return ligature_js_1.getLigatureMap; } });
|
|
31
33
|
const wawoff2_1 = require("wawoff2");
|
|
32
34
|
const opentype_js_1 = require("opentype.js");
|
|
33
|
-
const
|
|
35
|
+
const ttf2svg_1 = require("@marmooo/ttf2svg");
|
|
34
36
|
const svg2ttf_1 = __importDefault(require("svg2ttf"));
|
|
35
37
|
const ttf2eot_1 = __importDefault(require("ttf2eot"));
|
|
36
38
|
const ttf2woff_1 = __importDefault(require("ttf2woff"));
|
|
37
|
-
// import ttf2woff2 from "npm:ttf2woff2@5.0.0";
|
|
38
|
-
// import * as fonteditor from "npm:fonteditor-core@2.3.3"; // glyph names are lost
|
|
39
39
|
function isOTF(uint8Array) {
|
|
40
40
|
return uint8Array[0] === 0x4F &&
|
|
41
41
|
uint8Array[1] === 0x54 &&
|
|
@@ -81,7 +81,7 @@ exports.isWOFF2 = isWOFF2;
|
|
|
81
81
|
// return new Uint8Array(ttfBuffer);
|
|
82
82
|
// }
|
|
83
83
|
function otf2ttf(otf) {
|
|
84
|
-
const svg = (0,
|
|
84
|
+
const svg = (0, ttf2svg_1.ttf2svgFont)(new Uint8Array(otf));
|
|
85
85
|
return (0, svg2ttf_1.default)(svg).buffer;
|
|
86
86
|
}
|
|
87
87
|
exports.otf2ttf = otf2ttf;
|
|
@@ -91,27 +91,6 @@ exports.otf2ttf = otf2ttf;
|
|
|
91
91
|
// const ttfBuffer = new fonteditor.default.TTFWriter().write(ttfObj);
|
|
92
92
|
// return new Uint8Array(ttfBuffer);
|
|
93
93
|
// }
|
|
94
|
-
function getGlyphString(options) {
|
|
95
|
-
if (options.textFile) {
|
|
96
|
-
const text = dntShim.Deno.readTextFileSync(options.textFile);
|
|
97
|
-
return text.trimEnd().replace(/\n/g, "");
|
|
98
|
-
}
|
|
99
|
-
else if (options.codeFile) {
|
|
100
|
-
const text = dntShim.Deno.readTextFileSync(options.codeFile);
|
|
101
|
-
return text.trimEnd().split("\n")
|
|
102
|
-
.map((line) => String.fromCodePoint(Number(line))).join("");
|
|
103
|
-
}
|
|
104
|
-
else if (options.text) {
|
|
105
|
-
return options.text;
|
|
106
|
-
}
|
|
107
|
-
else if (options.code) {
|
|
108
|
-
return options.code.split(",")
|
|
109
|
-
.map((code) => String.fromCodePoint(Number(code))).join("");
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
94
|
async function getFont(fontContent) {
|
|
116
95
|
if (isSVG(fontContent)) {
|
|
117
96
|
const ttf = (0, svg2ttf_1.default)(fontContent);
|
|
@@ -132,7 +111,7 @@ async function getFont(fontContent) {
|
|
|
132
111
|
}
|
|
133
112
|
exports.getFont = getFont;
|
|
134
113
|
async function convertFormat(font, format) {
|
|
135
|
-
const svg = (0,
|
|
114
|
+
const svg = (0, ttf2svg_1.font2svgFont)(font);
|
|
136
115
|
if (format === ".svg")
|
|
137
116
|
return svg;
|
|
138
117
|
const ttf = (0, svg2ttf_1.default)(svg).buffer;
|
|
@@ -154,11 +133,56 @@ async function convertFormat(font, format) {
|
|
|
154
133
|
throw new Error(`${format} is not a supported format.`);
|
|
155
134
|
}
|
|
156
135
|
}
|
|
136
|
+
function getNameMap(font) {
|
|
137
|
+
const map = {};
|
|
138
|
+
for (const glyph of Object.values(font.glyphs.glyphs)) {
|
|
139
|
+
map[glyph.name] = glyph.index;
|
|
140
|
+
}
|
|
141
|
+
return map;
|
|
142
|
+
}
|
|
143
|
+
exports.getNameMap = getNameMap;
|
|
157
144
|
function filterGlyphs(font, options) {
|
|
158
|
-
|
|
159
|
-
|
|
145
|
+
if (options.textFile) {
|
|
146
|
+
const text = dntShim.Deno.readTextFileSync(options.textFile);
|
|
147
|
+
const glyphString = text.trimEnd().replace(/\n/g, "");
|
|
160
148
|
return font.stringToGlyphs(glyphString);
|
|
161
149
|
}
|
|
150
|
+
else if (options.codeFile) {
|
|
151
|
+
const text = dntShim.Deno.readTextFileSync(options.codeFile);
|
|
152
|
+
const glyphString = text.trimEnd().split("\n")
|
|
153
|
+
.map((line) => String.fromCodePoint(Number(line))).join("");
|
|
154
|
+
return font.stringToGlyphs(glyphString);
|
|
155
|
+
}
|
|
156
|
+
else if (options.nameFile) {
|
|
157
|
+
const nameMap = getNameMap(font);
|
|
158
|
+
const text = dntShim.Deno.readTextFileSync(options.nameFile);
|
|
159
|
+
return text.trimEnd().split("\n")
|
|
160
|
+
.map((line) => font.glyphs.get(nameMap[line]));
|
|
161
|
+
}
|
|
162
|
+
else if (options.ligatureFile) {
|
|
163
|
+
const ligatureMap = (0, ligature_js_1.getLigatureMap)(font, "name");
|
|
164
|
+
const text = dntShim.Deno.readTextFileSync(options.ligatureFile);
|
|
165
|
+
return text.trimEnd().split("\n")
|
|
166
|
+
.map((line) => font.glyphs.get(ligatureMap[line].by));
|
|
167
|
+
}
|
|
168
|
+
else if (options.text) {
|
|
169
|
+
return font.stringToGlyphs(options.text);
|
|
170
|
+
}
|
|
171
|
+
else if (options.code) {
|
|
172
|
+
const glyphString = options.code.split(",")
|
|
173
|
+
.map((code) => String.fromCodePoint(Number(code))).join("");
|
|
174
|
+
return font.stringToGlyphs(glyphString);
|
|
175
|
+
}
|
|
176
|
+
else if (options.name) {
|
|
177
|
+
const nameMap = getNameMap(font);
|
|
178
|
+
return options.name.split(",")
|
|
179
|
+
.map((line) => font.glyphs.get(nameMap[line]));
|
|
180
|
+
}
|
|
181
|
+
else if (options.ligature) {
|
|
182
|
+
const ligatureMap = (0, ligature_js_1.getLigatureMap)(font, "name");
|
|
183
|
+
return options.ligature.split(",")
|
|
184
|
+
.map((line) => font.glyphs.get(ligatureMap[line].by));
|
|
185
|
+
}
|
|
162
186
|
else {
|
|
163
187
|
return Object.values(font.glyphs.glyphs);
|
|
164
188
|
}
|
|
@@ -166,7 +190,15 @@ function filterGlyphs(font, options) {
|
|
|
166
190
|
exports.filterGlyphs = filterGlyphs;
|
|
167
191
|
function createTemporaryFont(font, glyphs) {
|
|
168
192
|
const notdefGlyph = font.glyphs.get(0);
|
|
169
|
-
|
|
193
|
+
notdefGlyph.name = ".notdef";
|
|
194
|
+
// avoid the warning caused by opentype.js below
|
|
195
|
+
// Undefined CHARARRAY encountered and treated as an empty string.
|
|
196
|
+
glyphs.forEach((glyph) => {
|
|
197
|
+
if (!glyph.name) {
|
|
198
|
+
glyph.name = String.fromCharCode(glyph.unicode);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
const tmpFont = new opentype_js_1.Font({
|
|
170
202
|
familyName: font.names.fontFamily.en,
|
|
171
203
|
styleName: font.names.fontSubfamily.en,
|
|
172
204
|
unitsPerEm: font.unitsPerEm,
|
|
@@ -174,13 +206,64 @@ function createTemporaryFont(font, glyphs) {
|
|
|
174
206
|
descender: font.descender,
|
|
175
207
|
glyphs: [notdefGlyph, ...glyphs],
|
|
176
208
|
});
|
|
177
|
-
|
|
178
|
-
return
|
|
209
|
+
tmpFont.names = font.names;
|
|
210
|
+
return tmpFont;
|
|
211
|
+
}
|
|
212
|
+
function createLigaturesFont(font, glyphs) {
|
|
213
|
+
const ligatureMap = (0, ligature_js_1.getLigatureMap)(font, "by");
|
|
214
|
+
const charSet = new Set();
|
|
215
|
+
for (const glyph of glyphs) {
|
|
216
|
+
const ligature = ligatureMap[glyph.index];
|
|
217
|
+
if (ligature) {
|
|
218
|
+
Array.from(ligature.name).forEach((char) => {
|
|
219
|
+
charSet.add(char);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
glyphs.forEach((glyph) => {
|
|
224
|
+
const char = String.fromCharCode(glyph.unicode);
|
|
225
|
+
if (charSet.has(char))
|
|
226
|
+
charSet.delete(char);
|
|
227
|
+
});
|
|
228
|
+
const ligatureGlyphs = [];
|
|
229
|
+
charSet.forEach((char) => {
|
|
230
|
+
const unicode = char.codePointAt(0);
|
|
231
|
+
const glyphIndex = font.encoding.cmap.glyphIndexMap[unicode];
|
|
232
|
+
const glyph = font.glyphs.get(glyphIndex);
|
|
233
|
+
ligatureGlyphs.push(glyph);
|
|
234
|
+
});
|
|
235
|
+
const newGlyphs = [...ligatureGlyphs, ...glyphs];
|
|
236
|
+
const tmpFont = createTemporaryFont(font, newGlyphs);
|
|
237
|
+
const charMap = {};
|
|
238
|
+
newGlyphs.forEach((glyph, index) => {
|
|
239
|
+
const char = String.fromCharCode(glyph.unicode);
|
|
240
|
+
charMap[char] = index + 1;
|
|
241
|
+
});
|
|
242
|
+
glyphs.forEach((glyph, i) => {
|
|
243
|
+
const ligature = ligatureMap[glyph.index];
|
|
244
|
+
if (ligature) {
|
|
245
|
+
const sub = Array.from(ligature.name)
|
|
246
|
+
.map((char) => charMap[char]);
|
|
247
|
+
const by = ligatureGlyphs.length + i + 1;
|
|
248
|
+
tmpFont.substitution.addLigature("liga", { sub, by });
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const otf = tmpFont.toArrayBuffer();
|
|
252
|
+
const newFont = (0, opentype_js_1.parse)(otf);
|
|
253
|
+
return newFont;
|
|
254
|
+
}
|
|
255
|
+
function createFont(font, glyphs, options) {
|
|
256
|
+
if (options.removeLigatures) {
|
|
257
|
+
return createTemporaryFont(font, glyphs);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
return createLigaturesFont(font, glyphs);
|
|
261
|
+
}
|
|
179
262
|
}
|
|
180
263
|
async function convert(fontContent, format, options) {
|
|
181
264
|
const font = await getFont(fontContent);
|
|
182
265
|
const glyphs = filterGlyphs(font, options);
|
|
183
|
-
const tempFont =
|
|
266
|
+
const tempFont = createFont(font, glyphs, options);
|
|
184
267
|
return await convertFormat(tempFont, format);
|
|
185
268
|
}
|
|
186
269
|
exports.convert = convert;
|
package/esm/ttf2svg/mod.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function toSVG(font: any, glyph: any, options?: {}): string | undefined;
|
|
2
|
-
export function toSVGFont(font: any, glyphs: any, options: any): string;
|
|
3
|
-
export function toGlyphTag(font: any, glyphs: any, options: any): any;
|
|
4
|
-
export function filterGlyphs(font: any, options?: {}): any;
|
|
5
|
-
export function font2svg(font: any, options: any): any;
|
|
6
|
-
export function ttf2svg(uint8array: any, options?: {}): any;
|
|
7
|
-
export function ttf2svgFont(uint8array: any, options?: {}): string;
|
|
8
|
-
export function font2svgFont(font: any, options?: {}): string;
|
|
9
|
-
export { parse };
|
package/esm/ttf2svg/mod.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
-
import { parse } from "opentype.js";
|
|
3
|
-
import svgpath from "svgpath";
|
|
4
|
-
export { parse };
|
|
5
|
-
function calcLineSpace(font) {
|
|
6
|
-
const lineGap = font.tables.hhea?.lineGap ?? 0;
|
|
7
|
-
return font.ascender - font.descender + lineGap;
|
|
8
|
-
}
|
|
9
|
-
function svgHeader(font, glyph, options = {}) {
|
|
10
|
-
const widthAttribute = (options.width) ? `width="${options.width}"` : "";
|
|
11
|
-
const heightAttribute = (options.height) ? `height="${options.height}"` : "";
|
|
12
|
-
const glyphWidth = glyph.advanceWidth;
|
|
13
|
-
const glyphHeight = options.glyphHeight ?? calcLineSpace(font);
|
|
14
|
-
const copyright = fontToCopyright(font);
|
|
15
|
-
let svg = `<svg xmlns="http://www.w3.org/2000/svg"
|
|
16
|
-
${widthAttribute} ${heightAttribute} viewBox="0 0 ${glyphWidth} ${glyphHeight}">
|
|
17
|
-
`;
|
|
18
|
-
if (copyright != "") {
|
|
19
|
-
svg += ` <!--
|
|
20
|
-
${copyright}
|
|
21
|
-
-->
|
|
22
|
-
`;
|
|
23
|
-
}
|
|
24
|
-
return svg;
|
|
25
|
-
}
|
|
26
|
-
export function toSVG(font, glyph, options = {}) {
|
|
27
|
-
const translateY = options.translateY ?? font.ascender;
|
|
28
|
-
const d = svgpath(glyph.path.toPathData())
|
|
29
|
-
.scale(1, -1)
|
|
30
|
-
.translate(0, Number(translateY))
|
|
31
|
-
.toString();
|
|
32
|
-
if (d == "")
|
|
33
|
-
return undefined;
|
|
34
|
-
const path = `<path d="${d}"/>`;
|
|
35
|
-
return svgHeader(font, glyph, options) + path + "\n</svg>";
|
|
36
|
-
}
|
|
37
|
-
function getInfo(hash) {
|
|
38
|
-
if (!hash)
|
|
39
|
-
return "";
|
|
40
|
-
const arr = Object.values(hash);
|
|
41
|
-
if (arr.length > 0) {
|
|
42
|
-
return arr[0];
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function fontToCopyright(font) {
|
|
49
|
-
const copyrights = font.names.copyright
|
|
50
|
-
? Object.values(font.names.copyright).join("\n")
|
|
51
|
-
: "";
|
|
52
|
-
const trademarks = font.names.trademark
|
|
53
|
-
? Object.values(font.names.trademark).join("\n")
|
|
54
|
-
: "";
|
|
55
|
-
const licenses = font.names.license
|
|
56
|
-
? Object.values(font.names.license).join("\n")
|
|
57
|
-
: "";
|
|
58
|
-
const licenseURLs = font.names.licenseURL
|
|
59
|
-
? Object.values(font.names.licenseURL).join("\n")
|
|
60
|
-
: "";
|
|
61
|
-
const infos = [copyrights, trademarks, licenses, licenseURLs];
|
|
62
|
-
return infos.filter((info) => info).join("\n");
|
|
63
|
-
}
|
|
64
|
-
function glyphHeader(font) {
|
|
65
|
-
let header = `<svg xmlns="http://www.w3.org/2000/svg">
|
|
66
|
-
`;
|
|
67
|
-
const copyright = fontToCopyright(font);
|
|
68
|
-
if (copyright != "") {
|
|
69
|
-
header += `<!--
|
|
70
|
-
${copyright}
|
|
71
|
-
-->
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
header += `
|
|
75
|
-
<defs>
|
|
76
|
-
<font name="${getInfo(font.names.fullName)}"
|
|
77
|
-
horiz-adv-x="${font.unitsPerEm}" vert-adv-y="${font.unitsPerEm}" >
|
|
78
|
-
<font-face font-family="${getInfo(font.names.fontFamily)}" font-weight="400"
|
|
79
|
-
font-stretch="normal"
|
|
80
|
-
units-per-em="${font.unitsPerEm}"
|
|
81
|
-
ascent="${font.ascender}"
|
|
82
|
-
descent="${font.descender}"/>
|
|
83
|
-
`;
|
|
84
|
-
return header;
|
|
85
|
-
}
|
|
86
|
-
function glyphFooter() {
|
|
87
|
-
return `
|
|
88
|
-
</font>
|
|
89
|
-
</defs>
|
|
90
|
-
</svg>`;
|
|
91
|
-
}
|
|
92
|
-
export function toSVGFont(font, glyphs, options) {
|
|
93
|
-
return glyphHeader(font) + toGlyphTag(font, glyphs, options) +
|
|
94
|
-
glyphFooter();
|
|
95
|
-
}
|
|
96
|
-
export function toGlyphTag(font, glyphs, options) {
|
|
97
|
-
const lineGap = font.tables.hhea?.lineGap ?? 0;
|
|
98
|
-
const height = font.ascender - font.descender + lineGap;
|
|
99
|
-
const existed = glyphs.filter((glyph) => glyph.unicode).map((glyph) => {
|
|
100
|
-
const d = glyph.path.toPathData();
|
|
101
|
-
if (d == "")
|
|
102
|
-
return undefined;
|
|
103
|
-
const glyphName = (glyph.name) ? `glyph-name="${glyph.name}"` : "";
|
|
104
|
-
return `<glyph ${glyphName} unicode="&#${glyph.unicode};"
|
|
105
|
-
horiz-adv-x="${glyph.advanceWidth}" vert-adv-y="${height}"
|
|
106
|
-
d="${d}"/>`;
|
|
107
|
-
}).filter((glyphTag) => glyphTag).join("\n");
|
|
108
|
-
if (options.removeNotdef) {
|
|
109
|
-
return existed;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
const notdefGlyph = font.glyphs.get(0);
|
|
113
|
-
const d = notdefGlyph.path.toPathData();
|
|
114
|
-
const notDef = `<missing-glyph glyph-name=".notdef"
|
|
115
|
-
horiz-adv-x="${notdefGlyph.advanceWidth}" vert-adv-y="${height}"
|
|
116
|
-
d="${d}"/>`;
|
|
117
|
-
return existed + "\n" + notDef;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function getGlyphString(options = {}) {
|
|
121
|
-
if (options.textFile) {
|
|
122
|
-
const text = dntShim.Deno.readTextFileSync(options.textFile);
|
|
123
|
-
return text.trimEnd().replace(/\n/g, "");
|
|
124
|
-
}
|
|
125
|
-
else if (options.codeFile) {
|
|
126
|
-
const text = dntShim.Deno.readTextFileSync(options.codeFile);
|
|
127
|
-
return text.trimEnd().split("\n")
|
|
128
|
-
.map((line) => String.fromCodePoint(Number(line))).join("");
|
|
129
|
-
}
|
|
130
|
-
else if (options.text) {
|
|
131
|
-
return options.text;
|
|
132
|
-
}
|
|
133
|
-
else if (options.code) {
|
|
134
|
-
return options.code.split(",")
|
|
135
|
-
.map((code) => String.fromCodePoint(Number(code))).join("");
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
return undefined;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
export function filterGlyphs(font, options = {}) {
|
|
142
|
-
const glyphString = getGlyphString(options);
|
|
143
|
-
if (glyphString) {
|
|
144
|
-
return font.stringToGlyphs(glyphString);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
return Object.values(font.glyphs.glyphs);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
export function font2svg(font, options) {
|
|
151
|
-
const glyphs = filterGlyphs(font, options);
|
|
152
|
-
return glyphs.map((glyph) => {
|
|
153
|
-
return toSVG(font, glyph, options);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
export function ttf2svg(uint8array, options = {}) {
|
|
157
|
-
const font = parse(uint8array.buffer);
|
|
158
|
-
return font2svg(font, options);
|
|
159
|
-
}
|
|
160
|
-
export function ttf2svgFont(uint8array, options = {}) {
|
|
161
|
-
const font = parse(uint8array.buffer);
|
|
162
|
-
return font2svgFont(font, options);
|
|
163
|
-
}
|
|
164
|
-
export function font2svgFont(font, options = {}) {
|
|
165
|
-
const glyphs = filterGlyphs(font, options);
|
|
166
|
-
return toSVGFont(font, glyphs, options);
|
|
167
|
-
}
|
package/script/ttf2svg/mod.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function toSVG(font: any, glyph: any, options?: {}): string | undefined;
|
|
2
|
-
export function toSVGFont(font: any, glyphs: any, options: any): string;
|
|
3
|
-
export function toGlyphTag(font: any, glyphs: any, options: any): any;
|
|
4
|
-
export function filterGlyphs(font: any, options?: {}): any;
|
|
5
|
-
export function font2svg(font: any, options: any): any;
|
|
6
|
-
export function ttf2svg(uint8array: any, options?: {}): any;
|
|
7
|
-
export function ttf2svgFont(uint8array: any, options?: {}): string;
|
|
8
|
-
export function font2svgFont(font: any, options?: {}): string;
|
|
9
|
-
export { parse };
|
package/script/ttf2svg/mod.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.font2svgFont = exports.ttf2svgFont = exports.ttf2svg = exports.font2svg = exports.filterGlyphs = exports.toGlyphTag = exports.toSVGFont = exports.toSVG = exports.parse = void 0;
|
|
30
|
-
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
31
|
-
const opentype_js_1 = require("opentype.js");
|
|
32
|
-
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return opentype_js_1.parse; } });
|
|
33
|
-
const svgpath_1 = __importDefault(require("svgpath"));
|
|
34
|
-
function calcLineSpace(font) {
|
|
35
|
-
const lineGap = font.tables.hhea?.lineGap ?? 0;
|
|
36
|
-
return font.ascender - font.descender + lineGap;
|
|
37
|
-
}
|
|
38
|
-
function svgHeader(font, glyph, options = {}) {
|
|
39
|
-
const widthAttribute = (options.width) ? `width="${options.width}"` : "";
|
|
40
|
-
const heightAttribute = (options.height) ? `height="${options.height}"` : "";
|
|
41
|
-
const glyphWidth = glyph.advanceWidth;
|
|
42
|
-
const glyphHeight = options.glyphHeight ?? calcLineSpace(font);
|
|
43
|
-
const copyright = fontToCopyright(font);
|
|
44
|
-
let svg = `<svg xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
${widthAttribute} ${heightAttribute} viewBox="0 0 ${glyphWidth} ${glyphHeight}">
|
|
46
|
-
`;
|
|
47
|
-
if (copyright != "") {
|
|
48
|
-
svg += ` <!--
|
|
49
|
-
${copyright}
|
|
50
|
-
-->
|
|
51
|
-
`;
|
|
52
|
-
}
|
|
53
|
-
return svg;
|
|
54
|
-
}
|
|
55
|
-
function toSVG(font, glyph, options = {}) {
|
|
56
|
-
const translateY = options.translateY ?? font.ascender;
|
|
57
|
-
const d = (0, svgpath_1.default)(glyph.path.toPathData())
|
|
58
|
-
.scale(1, -1)
|
|
59
|
-
.translate(0, Number(translateY))
|
|
60
|
-
.toString();
|
|
61
|
-
if (d == "")
|
|
62
|
-
return undefined;
|
|
63
|
-
const path = `<path d="${d}"/>`;
|
|
64
|
-
return svgHeader(font, glyph, options) + path + "\n</svg>";
|
|
65
|
-
}
|
|
66
|
-
exports.toSVG = toSVG;
|
|
67
|
-
function getInfo(hash) {
|
|
68
|
-
if (!hash)
|
|
69
|
-
return "";
|
|
70
|
-
const arr = Object.values(hash);
|
|
71
|
-
if (arr.length > 0) {
|
|
72
|
-
return arr[0];
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return "";
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function fontToCopyright(font) {
|
|
79
|
-
const copyrights = font.names.copyright
|
|
80
|
-
? Object.values(font.names.copyright).join("\n")
|
|
81
|
-
: "";
|
|
82
|
-
const trademarks = font.names.trademark
|
|
83
|
-
? Object.values(font.names.trademark).join("\n")
|
|
84
|
-
: "";
|
|
85
|
-
const licenses = font.names.license
|
|
86
|
-
? Object.values(font.names.license).join("\n")
|
|
87
|
-
: "";
|
|
88
|
-
const licenseURLs = font.names.licenseURL
|
|
89
|
-
? Object.values(font.names.licenseURL).join("\n")
|
|
90
|
-
: "";
|
|
91
|
-
const infos = [copyrights, trademarks, licenses, licenseURLs];
|
|
92
|
-
return infos.filter((info) => info).join("\n");
|
|
93
|
-
}
|
|
94
|
-
function glyphHeader(font) {
|
|
95
|
-
let header = `<svg xmlns="http://www.w3.org/2000/svg">
|
|
96
|
-
`;
|
|
97
|
-
const copyright = fontToCopyright(font);
|
|
98
|
-
if (copyright != "") {
|
|
99
|
-
header += `<!--
|
|
100
|
-
${copyright}
|
|
101
|
-
-->
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
header += `
|
|
105
|
-
<defs>
|
|
106
|
-
<font name="${getInfo(font.names.fullName)}"
|
|
107
|
-
horiz-adv-x="${font.unitsPerEm}" vert-adv-y="${font.unitsPerEm}" >
|
|
108
|
-
<font-face font-family="${getInfo(font.names.fontFamily)}" font-weight="400"
|
|
109
|
-
font-stretch="normal"
|
|
110
|
-
units-per-em="${font.unitsPerEm}"
|
|
111
|
-
ascent="${font.ascender}"
|
|
112
|
-
descent="${font.descender}"/>
|
|
113
|
-
`;
|
|
114
|
-
return header;
|
|
115
|
-
}
|
|
116
|
-
function glyphFooter() {
|
|
117
|
-
return `
|
|
118
|
-
</font>
|
|
119
|
-
</defs>
|
|
120
|
-
</svg>`;
|
|
121
|
-
}
|
|
122
|
-
function toSVGFont(font, glyphs, options) {
|
|
123
|
-
return glyphHeader(font) + toGlyphTag(font, glyphs, options) +
|
|
124
|
-
glyphFooter();
|
|
125
|
-
}
|
|
126
|
-
exports.toSVGFont = toSVGFont;
|
|
127
|
-
function toGlyphTag(font, glyphs, options) {
|
|
128
|
-
const lineGap = font.tables.hhea?.lineGap ?? 0;
|
|
129
|
-
const height = font.ascender - font.descender + lineGap;
|
|
130
|
-
const existed = glyphs.filter((glyph) => glyph.unicode).map((glyph) => {
|
|
131
|
-
const d = glyph.path.toPathData();
|
|
132
|
-
if (d == "")
|
|
133
|
-
return undefined;
|
|
134
|
-
const glyphName = (glyph.name) ? `glyph-name="${glyph.name}"` : "";
|
|
135
|
-
return `<glyph ${glyphName} unicode="&#${glyph.unicode};"
|
|
136
|
-
horiz-adv-x="${glyph.advanceWidth}" vert-adv-y="${height}"
|
|
137
|
-
d="${d}"/>`;
|
|
138
|
-
}).filter((glyphTag) => glyphTag).join("\n");
|
|
139
|
-
if (options.removeNotdef) {
|
|
140
|
-
return existed;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
const notdefGlyph = font.glyphs.get(0);
|
|
144
|
-
const d = notdefGlyph.path.toPathData();
|
|
145
|
-
const notDef = `<missing-glyph glyph-name=".notdef"
|
|
146
|
-
horiz-adv-x="${notdefGlyph.advanceWidth}" vert-adv-y="${height}"
|
|
147
|
-
d="${d}"/>`;
|
|
148
|
-
return existed + "\n" + notDef;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
exports.toGlyphTag = toGlyphTag;
|
|
152
|
-
function getGlyphString(options = {}) {
|
|
153
|
-
if (options.textFile) {
|
|
154
|
-
const text = dntShim.Deno.readTextFileSync(options.textFile);
|
|
155
|
-
return text.trimEnd().replace(/\n/g, "");
|
|
156
|
-
}
|
|
157
|
-
else if (options.codeFile) {
|
|
158
|
-
const text = dntShim.Deno.readTextFileSync(options.codeFile);
|
|
159
|
-
return text.trimEnd().split("\n")
|
|
160
|
-
.map((line) => String.fromCodePoint(Number(line))).join("");
|
|
161
|
-
}
|
|
162
|
-
else if (options.text) {
|
|
163
|
-
return options.text;
|
|
164
|
-
}
|
|
165
|
-
else if (options.code) {
|
|
166
|
-
return options.code.split(",")
|
|
167
|
-
.map((code) => String.fromCodePoint(Number(code))).join("");
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
return undefined;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function filterGlyphs(font, options = {}) {
|
|
174
|
-
const glyphString = getGlyphString(options);
|
|
175
|
-
if (glyphString) {
|
|
176
|
-
return font.stringToGlyphs(glyphString);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
return Object.values(font.glyphs.glyphs);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
exports.filterGlyphs = filterGlyphs;
|
|
183
|
-
function font2svg(font, options) {
|
|
184
|
-
const glyphs = filterGlyphs(font, options);
|
|
185
|
-
return glyphs.map((glyph) => {
|
|
186
|
-
return toSVG(font, glyph, options);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
exports.font2svg = font2svg;
|
|
190
|
-
function ttf2svg(uint8array, options = {}) {
|
|
191
|
-
const font = (0, opentype_js_1.parse)(uint8array.buffer);
|
|
192
|
-
return font2svg(font, options);
|
|
193
|
-
}
|
|
194
|
-
exports.ttf2svg = ttf2svg;
|
|
195
|
-
function ttf2svgFont(uint8array, options = {}) {
|
|
196
|
-
const font = (0, opentype_js_1.parse)(uint8array.buffer);
|
|
197
|
-
return font2svgFont(font, options);
|
|
198
|
-
}
|
|
199
|
-
exports.ttf2svgFont = ttf2svgFont;
|
|
200
|
-
function font2svgFont(font, options = {}) {
|
|
201
|
-
const glyphs = filterGlyphs(font, options);
|
|
202
|
-
return toSVGFont(font, glyphs, options);
|
|
203
|
-
}
|
|
204
|
-
exports.font2svgFont = font2svgFont;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.d.ts
RENAMED
|
File without changes
|
/package/esm/deps/deno.land/{std@0.221.0 → std@0.224.0}/path/_common/strip_trailing_separators.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|