Expand description
Port of fontTools.diff: comparing two fonts table by table, as a unified
diff of their TTX dumps, or as a summary of which tables are present and
binary identical.
| fontoxide-diff | fontTools |
|---|---|
summarize, get_binary_exclude_tables, main, run, pipe_output | fontTools.diff (__init__, __main__) |
color | fontTools.diff.color |
diff | fontTools.diff.diff |
utils | fontTools.diff.utils |
difflib | Python’s difflib (SequenceMatcher, unified_diff) |
The diff tool, the pager and the modification times use the operating system; the TTX dumps are made in memory (and saved to a temporary directory only for an external diff tool).
Re-exports§
pub use diff::DiffOptions;pub use diff::run_external_diff;pub use diff::u_diff;
Modules§
- color
- Port of
fontTools.diff.color: coloring the lines of a unified diff with ANSI escape codes. - diff
- Port of
fontTools.diff.diff: the unified diff of the TTX dumps of two fonts, with the built-in diff (u_diff) or an external diff tool (run_external_diff). - difflib
- The part of Python’s
difflib(CPython 3.13) thatfontTools.diffuses:SequenceMatcherwithout a junk function, with its “popular elements” heuristic (autojunk), andunified_diff. - utils
- Port of
fontTools.diff.utils, and of the parts of Python’sshutilthatfontTools.diffuses.
Enums§
- Diff
Error - The errors of
fontTools.diff.
Constants§
- COMMAND
- The command line of
fonttools diff.
Functions§
- get_
binary_ exclude_ tables get_binary_exclude_tables: the tables (filtered as insummarize) that are in both fonts and binary identical.- main
main: compares two fonts (seerun), writing the diff to standard output (through a pager if it is a terminal) and the errors to standard error. Returns the exit code: 0 if the fonts are the same, 1 if they differ, 2 on errors.- pipe_
output pipe_output: writes the output to standard output, through a pager ($PAGER, orless -R) if standard output is a terminal.- run
run(argv): compares two fonts, writing the diff (or the summary, or the help) tooutand the errors toerr. Returns the exit code: 0 if the fonts are the same, 1 if they differ, 2 on errors.- summarize
summarize: which tables are only in one of the fonts, and which of those in both are binary identical. Returns whether the fonts are identical, and the report.
Type Aliases§
- Result
- The result type of this crate.