Skip to content

Feature/brand center custom font support #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

ValerasNarbutas
Copy link
Contributor

  • Implemented PropertyFieldBrandFontPicker control to allow users to select fonts from SharePoint .
  • Added support for custom font tokens and preview capabilities.
  • Created interfaces for font tokens and control properties.
  • Developed the BrandCenterService to fetch font tokens from SharePoint.
  • Implemented the UI for the font picker using Fluent UI components.
  • Added documentation for usage and examples of the PropertyFieldBrandFontPicker.
Q A
Bug fix? [ ]
New feature? [x]
New sample? [ ]
Related issues? partially #625, mentioned in #625

What's in this Pull Request?

Add PropertyFieldBrandFontPicker control

New control(s)

PropertyFieldBrandFontPicker: New control that allows developers to select fonts from SharePoint Brand Center or system fonts [#625 ]

Description

This PR introduces a new property field control that enables developers to integrate SharePoint Brand Center fonts into their SPFx web parts. The control provides a dropdown interface with categorized font options and preview functionality.

Note: Until an official SharePoint Brand Center API is available, this control uses direct HTTP requests to the /_api/SiteFontPackages endpoint to retrieve font packages from the current site.

Features

  • Brand Center Integration: Automatically loads font packages from SharePoint Brand Center using the /_api/SiteFontPackages REST API
  • Font Categories: Organizes fonts into logical sections:
    "From this site" - Brand Center fonts from the current SharePoint site
    "From Microsoft" - System fonts (Segoe UI, Consolas, Bahnschrift)
  • Font Preview: Shows "Sample text preview" rendered in the selected font for better visualization
  • Custom Font Support: Allows developers to provide their own font tokens programmatically
  • Fluent UI Design: Follows standard Fluent UI dropdown patterns and styling
  • Error Handling: Graceful fallback to system fonts when Brand Center is unavailable

michaelmaillot and others added 3 commits April 30, 2025 16:37
- Implemented PropertyFieldBrandFontPicker control to allow users to select fonts from SharePoint .
- Added support for custom font tokens and preview capabilities.
- Created interfaces for font tokens and control properties.
- Developed the BrandCenterService to fetch font tokens from SharePoint.
- Implemented the UI for the font picker using Fluent UI components.
- Added documentation for usage and examples of the PropertyFieldBrandFontPicker.
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