servo / servo/font-kit

select_font tests fail when other fonts present on the system

Open
#217 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
840
Forks
137
Avg merge
4h 56m
Merged PRs (30d)
1

Description

I am seeing the following errors, because the tests are expecting DejaVu fonts to be the result. I have DejaVu fonts installed, but other fonts are being selected. My guess is that the results I am getting are "correct" for my system.

---- test::select_best_match_sans_serif stdout ----
thread 'test::select_best_match_sans_serif' panicked at tests/select_font.rs:57:13:
assertion `left == right` failed
  left: Some("arial.ttf")
 right: Some("DejaVuSans.ttf")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- test::select_best_match_bold_sans_serif stdout ----
thread 'test::select_best_match_bold_sans_serif' panicked at tests/select_font.rs:57:13:
assertion `left == right` failed
  left: Some("arialbd.ttf")
 right: Some("DejaVuSans-Bold.ttf")

---- test::select_best_match_monospace stdout ----
thread 'test::select_best_match_monospace' panicked at tests/select_font.rs:57:13:
assertion `left == right` failed
  left: Some("SourceCodePro-Regular.otf")
 right: Some("DejaVuSansMono.ttf")

---- test::select_best_match_serif stdout ----
thread 'test::select_best_match_serif' panicked at tests/select_font.rs:57:13:
assertion `left == right` failed
  left: Some("times.ttf")
 right: Some("DejaVuSerif.ttf")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the failing tests in tests/select_font.rs, especially the cases reported at line 57, and inspect how they choose and compare font filenames. The work is done when these tests no longer depend on unrelated fonts installed on the system while still checking the intended selection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.