Skip to content

Windows smoke tests fail on Greek text when DejaVu font path is unavailable #106

Description

@DrDimitriosChionis

Environment

  • Windows 10
  • Python 3.11.9
  • PyTorch 2.5.1+cu121
  • CUDA available with NVIDIA GeForce GTX 960M
  • glossapi_rs_cleaner built and installed successfully

Reproduction

From the development branch:

python -m pytest tests/test_pipeline_smoke.py -rs

The test suite starts correctly and CUDA is detected, but two smoke tests fail while generating PDFs containing Greek text.

Observed behaviour

The failures originate in fpdf with errors such as:

FPDFUnicodeEncodingException: Character "Κ" ... is outside the range of characters supported by the font used: "helvetica"

The test helper currently uses:

_FONT_PATH = Path("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf")

On Windows that Linux-specific path does not exist, so _write_pdf() falls back to Helvetica. Helvetica cannot encode the Greek strings used by the smoke tests, which causes the failures before the actual pipeline assertions are reached.

Expected behaviour

The smoke tests should be able to generate their Unicode test PDFs on supported development platforms without depending on a Linux-only font path.

Possible direction

A platform-independent Unicode font lookup for the tests, or a small bundled test font, would avoid the fallback to Helvetica and make the smoke tests portable across Windows and Linux.

I found this while setting up GlossAPI on Windows as a new contributor. I am happy to work on a small fix if this approach makes sense to the maintainers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions