how to load cached font file?

Stimulsoft Reports.JS discussion
Post Reply
robops
Posts: 22
Joined: Thu Dec 07, 2023 8:02 am

how to load cached font file?

Post by robops »

Hello,
I have a question about load font.For now,I'm using addFontFile with font file path.Although I have cached the font file in serviceworker,however,it request the online resources every time.
This is triggered by stimulsoft.
Image

This is triggered by browser.This is what i expected.
Image

Thank you .
Lech Kulikowski
Posts: 7884
Joined: Tue Mar 20, 2018 5:34 am

Re: how to load cached font file?

Post by Lech Kulikowski »

Hello,

Could you explain your issue in more detail?

Thank you.
robops
Posts: 22
Joined: Thu Dec 07, 2023 8:02 am

Re: how to load cached font file?

Post by robops »

Sure.
I am using Stimulsoft.Base.StiFontCollection.addFontFile() to load custom fonts (simhei.ttf). Although the font file is cached via Service Worker, calling addFontFile() triggers an XHR network request every time rather than serving it from the Service Worker cache.
Thank you.
Lech Kulikowski
Posts: 7884
Joined: Tue Mar 20, 2018 5:34 am

Re: how to load cached font file?

Post by Lech Kulikowski »

Hello,

Where, in which event, are you loading the font?
Also, please specify which version you are using - there have been improvements related to font caching, so check the latest build.

Thank you.
Post Reply