Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Custom font in PCF control

(0) ShareShare
ReportReport
Posted on by 32

Hello experts,

 

In my PCF control, I need to include a custom font (sap-icons.ttf) to display icon.

Is there any way to achieve that?

 

Thanks,

Kim Anh

  • Verified answer
    RMCoder Profile Picture
    219 on at
    Re: Custom font in PCF control

    If your font is web-hosted, you can import it in your CSS. Try following this short guide, which uses font-awesome.

     

    If your font is local to your machine you will need to upload it somewhere and do the same. I haven't tried this approach, but I found this article from 2016 that describes uploading the font file as a .CSS web resource to be used in an HTML page. I imagine you could do the same to host the font file for your PCF control.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: Custom font in PCF control

    Hi @kalluu91  , 

     

    The manifest doesn't support any ttf files. I needed that too, and the only workaround I could come up, was to try to declare it as image. So you can use in the manifest (eventually rename your ttf to a png to avoid checks here, or just remove the extension)

    <resources>
     <img path="your_path_to_ttf.png" />
    </resources>

    and in the end try to load it using context.resources.getResource(..)

     

    In some cases, there could work if you have the icons declared inside the css, using the icon url with a relative path  ( like  src: url(./your_ttf) ) . That would save you the loading the resource by yourself. But it works only sometimes, it depends what kind of app you are using.

     

    But all these are kind of unsupported. Would be great if you can find another way to get the icons.

     

    Hope this helps!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard