| 1 |
#!/usr/bin/env python3 |
| 2 |
# SPDX-License-Identifier: GPL-2.0-only |
| 3 |
# Copyright (C) Akira Yokosawa, 2024 |
| 4 |
# |
| 5 |
# Ported to Python by (c) Mauro Carvalho Chehab, 2025 |
| 6 |
# |
| 7 |
# pylint: disable=C0103 |
| 8 |
|
| 9 |
""" |
| 10 |
Detect problematic Noto CJK variable fonts. |
| 11 |
|
| 12 |
or more details, see .../tools/lib/python/kdoc/latex_fonts.py. |
| 13 |
""" |
| 14 |
|
| 15 |
import argparse |
| 16 |
import sys |
| 17 |
import os.path |
| 18 |
|
| 19 |
src_dir = os.path.dirname(os.path.realpath(__file__)) |
| 20 |
sys.path.insert(0, os.path.join(src_dir, '../lib/python')) |
| 21 |
|
| 22 |
from kdoc.latex_fonts import LatexFontChecker |
| 23 |
|
| 24 |
checker = LatexFontChecker() |
| 25 |
|
| 26 |
parser=argparse.ArgumentParser(description=checker.description(), |
| 27 |
formatter_class=argparse.RawTextHelpFormatter) |
| 28 |
parser.add_argument("--deny-vf", |
| 29 |
help="XDG_CONFIG_HOME dir containing fontconfig/fonts.conf file") |
| 30 |
|
| 31 |
args=parser.parse_args() |
| 32 |
|
| 33 |
msg = LatexFontChecker(args.deny_vf).check() |
| 34 |
if msg: |
| 35 |
print(msg) |
| 36 |
|
| 37 |
sys.exit(1) |