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.

Attributes

PRIVATE_USE_PREFIX

class mcfonts.coverage_reports.CoverageReport(chars, blocks)

A coverage report.

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

Construct a coverage report.

Parameters:
chars : set[str]

A set of individual characters.

blocks : dict[str, int]

A dictionary of {block name: chars 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=True)

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 : bool

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

Return type:

None

block_summary(show_empty_blocks=False)

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 : bool

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

Return type:

None

character_table(show_offsets=True, unknown_character='▯')

Print a table of every character in this font.

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, padding_character will be displayed if the character does not exist.

Important

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

Example:

    ▼ 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 ▐ ░ ▒ ▓ ▔ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟
Parameters:
show_offsets : bool

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

unknown_character : str

The character to display when a font has no glyph for a character in a table. The default is U+25AF WHITE VERTICAL RECTANGLE.

Return type:

None

compare(other)

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 : Self

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

Return type:

None

mcfonts.coverage_reports.PRIVATE_USE_PREFIX : str = 'Private Use'

Last update: 2023 November 30