Skip to content

Conversation

@LukasHirt
Copy link
Collaborator

Description

We've included the Ubuntu font in the web container. This fixed the issue where the Ubuntu font was not being loaded in the PDF export due to CSP restrictions. The font is distributed under the open licence.

https://canonical.com/legal/font-licence

Motivation and Context

PDF export works without touching CSP configuration.

How Has This Been Tested?

  • test environment: macos, chrome
  • test case 1: try to export MD file to PDF

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

We've included the Ubuntu font in the web container. This fixed
the issue where the Ubuntu font was not being loaded in the PDF export
due to CSP restrictions. The font is distributed under the open licence.

https://canonical.com/legal/font-licence
@LukasHirt LukasHirt requested review from Copilot and mzner October 23, 2025 08:04
@LukasHirt LukasHirt self-assigned this Oct 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR resolves PDF export issues by bundling Ubuntu fonts locally instead of fetching them from external URLs, which were blocked by CSP restrictions. The fonts are included under the Ubuntu Font Licence 1.0.

  • Updated font URLs to point to local /fonts/ubuntu/ directory
  • Added Ubuntu font files and comprehensive licensing documentation
  • Created changelog entry documenting the fix

Reviewed Changes

Copilot reviewed 9 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/web-pkg/src/composables/webWorkers/exportAsPdfWorker/renderer.ts Changed font URLs from external https://pdf-lib.js.org to local /fonts/ubuntu/ paths
packages/web-container/fonts/ubuntu/copyright.md Added copyright notice for Ubuntu fonts
packages/web-container/fonts/ubuntu/TRADEMARKS.md Added trademark information
packages/web-container/fonts/ubuntu/README.md Added Ubuntu Font Family introduction and project information
packages/web-container/fonts/ubuntu/LICENCE-FAQ.md Added detailed licensing FAQ documentation
packages/web-container/fonts/ubuntu/LICENCE Added Ubuntu Font Licence Version 1.0 full text
packages/web-container/fonts/ubuntu/FONTLOG.md Added comprehensive font changelog and acknowledgements
packages/web-container/fonts/ubuntu/CONTRIBUTING.md Added contribution guidelines
changelog/unreleased/bugfix-include-ubuntu-font.md Added changelog entry describing the fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link

@LukasHirt LukasHirt merged commit 4fe910f into master Oct 23, 2025
4 checks passed
@LukasHirt LukasHirt deleted the fix/include-ubuntu-font branch October 23, 2025 10:59
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.

3 participants