Skip to content

Bundle plots font, to eliminate external font dependencies#185

Merged
s-andrews merged 1 commit intos-andrews:liberationfontfrom
ewels:bundle-liberation-sans-font
Apr 13, 2026
Merged

Bundle plots font, to eliminate external font dependencies#185
s-andrews merged 1 commit intos-andrews:liberationfontfrom
ewels:bundle-liberation-sans-font

Conversation

@ewels
Copy link
Copy Markdown
Contributor

@ewels ewels commented Apr 13, 2026

The need for font requirements on the host system is a fairly frequent thorn when building and distributing FastQC - see the relevant bioconda recipe lines for fontconfig, font-ttf-dejavu-sans-mono. I've also hit Docker build errors for this a tonne of times over the years.

After playing with the FastQC source code a bit, I wondered if we could just bundle an open-source font instead of relying on the host system. turns out that I think it should be possible.

Claude summary 🤖

Embeds Liberation Sans (SIL OFL) so FastQC renders consistently without requiring system-installed fonts like Arial, fontconfig, or font-ttf-dejavu-sans-mono. This removes font packages from the bioconda dependency chain.

  • Add FontManager utility to load/register bundled TTF fonts
  • Use bundled font in all graph classes and SVG generator
  • Bold graph titles for better readability
  • SVG uses font stack: Liberation Sans, Arial, Helvetica, sans-serif
  • Font-metric-based x-axis label spacing to match previous output

Embeds Liberation Sans (SIL OFL) so FastQC renders consistently
without requiring system-installed fonts like Arial, fontconfig,
or font-ttf-dejavu-sans-mono. This removes font packages from the
bioconda dependency chain.

- Add FontManager utility to load/register bundled TTF fonts
- Use bundled font in all graph classes and SVG generator
- Bold graph titles for better readability
- SVG uses font stack: Liberation Sans, Arial, Helvetica, sans-serif
- Font-metric-based x-axis label spacing to match previous output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@s-andrews s-andrews changed the base branch from master to liberationfont April 13, 2026 13:53
@s-andrews
Copy link
Copy Markdown
Owner

Happy to take a look. Am merging into a branch so I can try it out and check what (if anything) breaks.

This will break all of the inegration tests which relied on pixel specific checks so those would need updating.

@s-andrews s-andrews merged commit 5659492 into s-andrews:liberationfont Apr 13, 2026
1 check failed
@ewels ewels deleted the bundle-liberation-sans-font branch April 13, 2026 14:02
@ewels
Copy link
Copy Markdown
Contributor Author

ewels commented Apr 13, 2026

Thanks! Sorry for not fixing the tests. I'll take a look at those now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants