Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2021-07-28-unvt-exercise-text-font

 2021-07-28-unvt-exercise-text-font

Exercise for preparing text fonts in pbf.

UBUKAWA Taro

July 28, 2021
Tweet

More Decks by UBUKAWA Taro

Other Decks in Technology

Transcript

  1. Additional UNVT Exercise - text font preparation 28 July 2021

    By Taro Ubukawa (Senior Geospatial Expert at UN Geospatial Information Section)
  2. Today’s contents - font preparation • We will prepare text

    fonts in pbf. It is a part of hosting process. • Our goal today: • Convert the text fonts from ttf/otf format. Produce Host Style Optimize Import UNVT workflow of developing vector tile for base map Supported by UNVT, open source scripts Source DB Web APP Users
  3. 1. Get the font • Please confirm the license of

    the font you want to prepare. • Apache license? Open font license? Or other license? • Each font has each license. • If you can use the fonts, download them (otf / ttf). • Save them at the working directory. Example: Roboto fonts from Google fonts. https://fonts.google.com/specimen/Roboto
  4. 2. Get the tool and start Docker • Clone “node-fontnik”

    from mapbox and start docker (unvt/nanban). • > git clone https://github.com/mapbox/node-fontnik • > cd node-fontnik • > Docker run -it --rm -v ${PWD}:/data unvt/nanban
  5. 2. Get the tool and start Docker (cont.) • Continue

    • > cd /data • > npm install • > make
  6. 3. Convert the fonts into pbf • Now you can

    convert the fonts • > ./bin.build-glyphs (source ttf/otf) (output location) source converted
  7. Summary • We can now make fonts in pbf from

    ttf/otf. • It is important to pay enough attention to the license of the fonts.
  8. References • Install Docker Desktop on Windows: https://docs.docker.com/docker-for-windows/install/ • mapbox/node-fontnik:

    https://github.com/mapbox/node-fontnik • UNVT: https://github.com/un-vector-tile-toolkit/font-edit-robot • hfu/noto-jp: http://github.com/hfu/noto-jp • Fujimura, H. (2021): UNVT Workshop: Introduction and Application https://speakerdeck.com/hfu/unvt-workshop-introduction-and-application