I've tried various already suggested solutions but none worked.
I have a simple style
new Style({
text: new Text({
text: '\uf0d1',
scale: 1.5,
textBaseline: 'bottom',
font: '900 20px Font Awesome 5 Free',
fill: new Fill({ color: '#2196F3' }),
}),
})
And this is what is showed on the map
Only the box is showed instead of the icon.
To add, this is the Vue project with Nuxt, so the Font Awesome is imported via next-fontawesome
package and used across the project via component tags.
In my main scss file I have added @import '@fortawesome/fontawesome-free/css/all.css';
and tested on basic span like this
<span class="custom-icon"></span>
and in css
.custom-icon::before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
content: "\f007";
color: green;
}
So the codes are working fine but not on the map.
If anybody knows what is the problem I would be very thankful.
Figured it out if anybody needs it for future reference
@fortawesome/fontawesome-free/css/all.css
is imported in global CSSfont: '900 20px "Font Awesome 5 Free"'