mcfonts.coverage_reports#

Coverage reports are instances of mcfonts.coverage_reports.CoverageReport.

They contain information on the coverage of a specific font, and contain functions for displaying this information.

Module Contents#

Classes#

CoverageReport

A coverage report.

class mcfonts.coverage_reports.CoverageReport(chars: set[str], blocks: dict[str, int])#

A coverage report.

Contains information of the number of characters covered, and the blocks covered.

blocks: dict[str, int]#

A dictionary of {block name: number of characters of this block}.

chars: set[str]#

A set of the characters.

block_progress(show_empty: bool = True) None#

Print the block progress in each block.

✓ Basic Latin (U+0000-U+007F) [95/95, 100.00%] ~ Latin-1 Supplement (U+0080-U+00FF) [94/96, 97.92%]

And, if show_empty:

❌ Arabic (U+0600-U+06FF) [0/255, 0.00%]

Parameters:

show_empty -- If True, blocks with no support will be shown. If False, blocks with no support will be omitted.

block_summary(show_empty_blocks: bool = False) None#

Print a padded list of every block in the font, and their completion status.

0000-007F Basic Latin Complete 0080-00FF Latin-1 Supplement Partial

And, if show_empty_blocks is True:

0600-06FF Arabic None

Parameters:

show_empty_blocks -- If True, blocks with no support will be shown. If False, blocks with no support will be omitted.

char_table(show_offsets: bool = True, no_glyph_char: str = '▯') None#

Print a table of every character in this font.

▼ Block Elements (U+2580-U+259F) ▼

0 1 2 3 4 5 6 7 8 9 A B C D E F

U+258X ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ U+259X ▐ ░ ▒ ▓ ▔ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟

These are organized by their block, and order of appearance in the providers used to declare them.

If mcfonts.colors.USE_COLORS is True, a red or green color will be used to indicate if the character exists. If False, no_glyph_char will be displayed if the character does not exist.

Important

If a character is Private Use, it will not be shown.

Parameters:
  • show_offsets -- If True, show the individual offsets for each character in a table-like format. If False, don't show offsets.

  • no_glyph_char -- The character to display when a font has no glyph for a character in a table. Default is '▯'.

compare(other: Self) None#

Given other, a second instance of CoverageReport, compare the two, using self as a baseline.

The information compared is:

  • Character count

  • Blocks covered

Parameters:

other -- A second instance of mcfonts.coverage_reports.CoverageReport to compare to.