I’m trying from months to use a different font from the standard one for labels.
I’ve read every possible documentation, that does not help.
Sometimes a custom font work, sometimes does not…
I’ve tried with fonts from GoogleFonts, and with fonts loaded from my server, the result is always unpredictable.
---- First example:
I’m using Roboto fonts on my html page for all text.
It work fine on my page, I wait 1 minute (!!!) before to show some label, but the label does not use Roboto, and it fallback to timesNewRoman
/* wait a minute… */
let entity = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(lng, lat),
label: {
text: “TESTLABEL”,
font: “500 15px Roboto”,
}
});
---- Second example:
I load custom fonts from my server:
@font-face {
font-family: Acumin-medium;
src: url(“fonts/Acumin-MPro.otf”) format(“opentype”);
}
@font-face {
font-family: Acumin-bold;
src: url(“fonts/Acumin-BdPro.otf”) format(“opentype”);
}
@font-face {
font-family: Acumin-regular;
src: url(“fonts/Acumin-RPro.otf”) format(“opentype”);
}
I don’t need them on my page, them are just a test for labels.
ONLY the “Acumin” font family that I’m using in my page is available for Labels, so if I want to use “Acumin” for Labels I have to use it somewhere in my page.
I’d really like some help to understand what’s going on with Cesium labels and fonts!
Many thanks!