You can change anything you want. The source code is open.
I tried to use diff font like rubik but I get an 404 not found, even if I try to add it in the findFont func.
https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf
it's would say that
ajax.ts:161
GET https://fonts.openmaptiles.org/Rubik%20Regular/0-255.pbf 404 (Not Found)
Find Font Func
export const findFonts = (map) => {
const fontSet = new Set();
const { layers } = map.getStyle();
layers?.forEach?.((layer) => {
layer.layout?.["text-font"]?.forEach?.(fontSet.add, fontSet);
});
const availableFonts = [...fontSet];
const regularFont = availableFonts.find((it) => it.includes("Regular"));
if (regularFont) {
return [regularFont];
}
const anyFont = availableFonts.find(Boolean);
if (anyFont) {
return [anyFont];
}
return ["Rubik Regular"];
};
for some reason I can't edit,
this is what it's saying when I use Rubik font instead of Roboto in the findFont func.
ajax.ts:161
GET https://fonts.openmaptiles.org/Rubik%20Regular/0-255.pbf 404 (Not Found)
Well, the URL is returning 404, which means it doesn't exist.
Well, I know it doesn't exist.
any other work around? tip? or anything?
If you know what the error means, your previous statement makes no sense at all. Why say that you can't edit when you know you can edit and that's just the URL you're trying to doesn't exist.
no mate, by
for some reason I can't edit,
I meant the post not the code.
It doesn't exist. for that font, I want to use that support Arabic.
so may u please tell led me to the answer, all effort is appreciated.
I could do a pull req if I managed to fix the bug, so everyone can use it.
Again thank you.
Still. Your original comment says you can't change something because of CDN. You can clearly change the URL, so this has nothing to do with CDN or being able to change something. The issue is clearly just finding the font and linking to it.
hmmm, well I can't find a url that have a Rubik font and when I do it locally it's just doesn't work!
how can I upload font to the traccar cdn?
or how can I use something like this:
mapbox://fonts/mapbox/{fontstack}/{range}.pbf
You can send a pull request.
pull request for what exactly?
let me break it down:
//useMapStyles.js
line 20glyphs: 'https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf',
in this line I can't change it to be like this,glyphs: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
the console.logFetch API cannot load mapbox://fonts/mapbox/Rubik Regular/0-255.pbf. URL scheme "mapbox" is not supported.
and I don't know what to do exactly.
so? idk
and if u mean to add font to the traccar cdn by a pull req idk what I need to change exactly so the font would work
It sounds like the problem is again not what you said. I sounds like the problem is that you don't know how to get files from mapbox, not how to update the CDN.
Because you guys use "Roboto font" the Arabic characters aren't supported.
=> tried to do that and it didn't work, /fonts/Rubik/Regular. no luck.