Skip to main content

Crate fontoxide_diff

Crate fontoxide_diff 

Source
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-difffontTools
summarize, get_binary_exclude_tables, main, run, pipe_outputfontTools.diff (__init__, __main__)
colorfontTools.diff.color
difffontTools.diff.diff
utilsfontTools.diff.utils
difflibPython’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) that fontTools.diff uses: SequenceMatcher without a junk function, with its “popular elements” heuristic (autojunk), and unified_diff.
utils
Port of fontTools.diff.utils, and of the parts of Python’s shutil that fontTools.diff uses.

Enums§

DiffError
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 in summarize) that are in both fonts and binary identical.
main
main: compares two fonts (see run), 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, or less -R) if standard output is a terminal.
run
run(argv): compares two fonts, writing the diff (or the summary, or the help) to out and the errors to err. 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.