Problem loading fonts from JAR

Hi!

I’m trying to integrate a SmartKanban web-component into my application as an add-on.

First, I downloaded all the sources and placed them in the frontend folder in the application. Everything was fine, the component works great:

When I tried to transfer the component to another application for packaging in a JAR, there was a problem with loading fonts.
I arranged the folders in the same way.

When I try to open the view, nothing is displayed. The following message appears in the log:

GET https://localhost:8080/font/smart-icons/wppf2 net::ERR_ABORTED 404 (Not Found)

In the smart.default css file, the link to the font is formatted as follows:

@font-face {
    font-family: smart-icons;
    src: local("./font/smart-icons"), url(./font/smart-icons.woff2) format("woff2"), url(./font/smart-icons.woff) format("woff"), url(./font/smart-icons.ttf) format("truetype"), url(./font/smart-icons.eot) format("embedded-opentype");
    font-weight: 400;
    font-style: normal
}

When viewing the sources of the client side, no fonts were found.
However, when loading from the frontend folder in the application, everything loads correctly.

What is the correct way to load fonts when using JAR?

Thanks for your answer in advance.

Error log:

Client-side sources when using JAR:
image

Client-side sources when using frontend folder in the application:
image

The problem is still not resolved. Does anyone have any idea?

Currently unsupported, see running vaadin:prepare-frontend using directory dependency works, but jar dependencies filter away resources · Issue #19645 · vaadin/flow · GitHub

1 Like