Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts #9

Open
humanitariandata opened this issue Aug 10, 2015 · 10 comments
Open

Fonts #9

humanitariandata opened this issue Aug 10, 2015 · 10 comments

Comments

@humanitariandata
Copy link

I am getting this error:
Failed to find font face 'Open Sans Bold' in FontSet 'fontset-0' in FontSet.

When running the following command on this style:

/usr/bin/tl copy -z 6 -Z 6 -b "2.532935 6.437926 2.560045 6.508226" tmstyle://./mapbox-studio-humanitarian-print.tm2 mbtiles://./tiles.mbtiles

npm ls mapnik shows:
digidoc@digidoc:~/osm$ npm ls mapnik
/home/digidoc/osm
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]

how does referencing the fonts work, and how can these be installed?

@mojodna
Copy link
Owner

mojodna commented Aug 10, 2015

It's probably going to be style-dependent. You may be able to install Open Sans globally (using Font Book or apt or whatever) and see tl pick it up.

Alternately, you can install https://github.com/mapbox/mapbox-studio-default-fonts (npm install mapbox-studio-default-fonts) and add a font-directory: url("node_modules/mapbox-studio-default-fonts/open-sans") (you may be able to point up a directory if you're using more fonts present) to the Map element in one of the .mss files.

@mojodna
Copy link
Owner

mojodna commented Aug 10, 2015

@varkor
Copy link

varkor commented Aug 14, 2015

@rodekruis — Did you manage to resolve this issue in the end? I've got Open Sans installed across my machine, but I'm still receiving the error, and I can't figure out how to get past it.

@humanitariandata
Copy link
Author

@varkor, not really. I had to take the font out of the project file to make it work. However, I was not able to get TL running on Ubuntu 14.04 since the dependencies are conflicting between the packages. Therefore mapnik is installed several times and this results in errors when running TL.

@mojodna
Copy link
Owner

mojodna commented Aug 14, 2015

@rodekruis the short-term workaround for multiple versions of mapnik is to install the version of mapnik you want to use at the top-level and then find . -type d -name mapnik to figure out which ones to delete after installation is complete (the one in the root is the only one that should exist). (The mapnik team is aware of the conflicts and is looking into ways to mitigate the errors.)

@varkor try setting MAPNIK_FONT_PATH (https://github.com/mapnik/node-mapnik/blob/master/lib/mapnik.js#L84-L91) so that it points to the directory containing fonts:

MAPNIK_FONT_PATH=/usr/local/fonts/... tessera mapnik://./project.xml

(@rodekruis this may help you out as well, sorry I'd forgotten about it..)

@humanitariandata
Copy link
Author

@mojodna thanks for the tips. The issue seems to be that abaculus requires mapnik 3.3.0 whereis TL requires a higher version.

@varkor
Copy link

varkor commented Aug 17, 2015

@mojodna Thanks! That fixed the font problem! It's getting further in the process now, but I'm hitting a different error now:

Error: Could not initialize ICU resources for expression: "([reflen] > 0) and ([reflen] <= 6) and ([ref].match('^I\ ?\d\d[\dA-Z](;.*|$)')) and ([ref].match('^I\ ?\d[\dA-Z]?(;.*|$)')) and ([ref].match('^US\ ?\d[\dA-Z]?(;.*|$)'))" in style 'road_label-us_shield' in Style

I don't suppose this looks familiar at all?

I think I might need to export ICU_DATA, but I'm not sure how I would go about finding the ICU path.

(Also, hope using this issue is okay—I know these are errors reported by Mapnik rather than tl specifically, but I haven't been able to find any reference to them anywhere, so I'm not sure where to ask. Thank you very much!)

@mojodna
Copy link
Owner

mojodna commented Aug 17, 2015

taps @springmeyer

@springmeyer
Copy link

@varkor - hey, I can help with the ICU issue. Yes, setting ICU_DATA might fix the problem, but its odd you would need to set it. Can you describe more about how you installed Mapnik/Node-mapnik? Based on how you installed I can give more guidance.

@varkor
Copy link

varkor commented Aug 17, 2015

I never directly installed it—I've installed TileMill and Mapbox Studio, as well as tl and various dependencies, which must have included Mapnik at some point or another. (I'm trying to convert the Emerald map style from Mapbox Studio to .mbtiles, if you're wondering what my goal is.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants