Select to view content in your preferred language

Arcgis fonts issue

3342
6
Jump to solution
03-10-2020 08:10 AM
KafilBaig
Regular Contributor

I am having issues on arcgis fonts . The arcgis api 4.x has a JavaScript file init.js where the fonts path is provided as https://static.arcgis.com/fonts where I am on the isolated environment with no internet access . 

When I try to add labels on the feature layer it gives error that fonts not found . 

I tried accessing the https://static.arcgis.com/fonts to download all the fonts to my local machine so that I can change the path in init.js file but I get error as page not found. 

Please guide me where i can download all the fonts .

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Currently, we do not offer the ability to download the fonts from static.arcigs.com. We are investigating the ability to package fonts for offline usage.

If you have ArcGIS Enterprise, at 10.7, there are a few fonts packaged with Enterprise in .pbf:

C:\Program Files\ArcGIS\Portal\apps\fonts

Alternatively, with ArcGIS Pro, you can create a map with label classes having the fonts you want, then create a vtpk (even if there is no data). Then unzip the vtpk and extract the fonts.

View solution in original post

0 Kudos
6 Replies
Noah-Sager
Esri Regular Contributor

Currently, we do not offer the ability to download the fonts from static.arcigs.com. We are investigating the ability to package fonts for offline usage.

If you have ArcGIS Enterprise, at 10.7, there are a few fonts packaged with Enterprise in .pbf:

C:\Program Files\ArcGIS\Portal\apps\fonts

Alternatively, with ArcGIS Pro, you can create a map with label classes having the fonts you want, then create a vtpk (even if there is no data). Then unzip the vtpk and extract the fonts.

0 Kudos
KafilBaig
Regular Contributor

Thanks for help Noah.

I took the few fonts packaged with Enterprise 10.7 and hosted in my server and pointed the https://static.arcgis.com/fonts to https://myserver.com/fonts .

It worked for me. Hope this helps for people who working in offline environment.

mahdicmptr
New Contributor

hello friends I have a similar problem. but I can't find above location . how can I download this fonts?

thank

0 Kudos
davidbeales
New Contributor
0 Kudos
Brice
by
Emerging Contributor
import esriConfig from "@arcgis/core/config.js";

esriConfig.fontsUrl = "/fonts";

You probably figured it out already, but this is an example of how you override the fonts URL for anyone else looking for the answer.  In our case, hosting it as a static file under the fonts folder.  We're having challenges with that file once deployed to IIS, but that's another story.

0 Kudos
ATFerguson
Occasional Contributor

Hi all, I am working with an offline installation of Experience Builder (v1.15), and I am trying to solve this fonts issue as well. I downloaded the .pbf fonts from my 10.8.1 Portal installation directory, hosted them in IIS on my server, and set the esriConfig.fontsUrl to point at my server.

This process works when I download my Experience and host it on the same server as my fonts. @Brice - you mentioned you were having issues once the app is deployed to IIS. Unfortunately, my dilemma is the opposite; I can access the fonts from IIS, but I am getting the following CORS error when I am developing my application from localhost:

"Access to fetch at 'https://my.host.server/fonts/arial-bold/0-255.pbf' from origin 'https://localhost.com:3001' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."

I adding a HTTP Response Header for localhost.com:3001 to my fonts folder in IIS, but I'm still not having much luck. I also tried hosting the same font files in <ArcGIS Experience Builder Installation Directory>/server/public/apps/fonts, and setting the esriConfig.fontsUrl dynamically with:

 

 

if (process.env.NODE_ENV === 'development') {
  esriConfig.fontsUrl = 'https://localhost.com:3001/apps/fonts'
} else {
  esriConfig.fontsUrl = 'https://my.host.server/fonts';
}

 

 

I am able to access the font files by entering 'https://localhost.com:3001/apps/fonts/arial-bold/0-255.pbf' into the browser, but when I try to load a Web Map with labels with Arial-Bold fonts, I get the following error: "[esri.views.2d.engine.webgl.TextureManager] e {name: 'mapview-invalid-resource', details: undefined, message: 'Couldn't find font arial-bold. Falling back to Arial Unicode MS Regular'"

 

@Brice & @KafilBaig - How are you able to access the hosted static fonts from localhost? Did you use a CORS header, a local copy, or something else? Any pointers would be greatly appreciated.

0 Kudos