Classes
FontValidator
Validates font downloads and CSS generation.
Checks:
- Font configuration is valid
- Font files do…
FontValidator
Validates font downloads and CSS generation.
Checks:
- Font configuration is valid
- Font files downloaded (if fonts configured)
- CSS generated with correct @font-face rules
- Font file sizes are reasonable
- No broken font references in CSS
Inherits from
BaseValidatorMethods 1
validate
Run font validation checks.
validate
def validate(self, site: Site, build_context: BuildContext | Any | None = None) -> list[CheckResult]
Run font validation checks.
Parameters 2
site |
Site |
|
build_context |
BuildContext | Any | None |
Returns
list[CheckResult]
Internal Methods 4
_check_font_files
Check font files are downloaded.
_check_font_files
def _check_font_files(self, fonts_dir: Path, font_config: dict[str, Any]) -> list[CheckResult]
Check font files are downloaded.
Parameters 2
fonts_dir |
Path |
|
font_config |
dict[str, Any] |
Returns
list[CheckResult]
_check_font_css
Check font CSS structure and references.
_check_font_css
def _check_font_css(self, fonts_css_path: Path, fonts_dir: Path) -> list[CheckResult]
Check font CSS structure and references.
Parameters 2
fonts_css_path |
Path |
|
fonts_dir |
Path |
Returns
list[CheckResult]
_check_font_references
Check if font files referenced in CSS exist.
_check_font_references
def _check_font_references(self, css_content: str, fonts_dir: Path) -> list[str]
Check if font files referenced in CSS exist.
Parameters 2
css_content |
str |
|
fonts_dir |
Path |
Returns
list[str]
_check_font_sizes
Check font file sizes are reasonable.
_check_font_sizes
def _check_font_sizes(self, fonts_dir: Path) -> list[CheckResult]
Check font file sizes are reasonable.
Parameters 1
fonts_dir |
Path |
Returns
list[CheckResult]