OpenStreetMap

Fonts missing from OSM Promotional Leaflets

Posted by alexkemp on 30 December 2018 in English (English)

OSM flyers

tl;dr:
You will need to install a combo of ubuntu font, a suitable Sans-Serif font (OpenSans family font is available via GitHub) + Inkscape in addition to mirroring locally the current GitHub OSM files. Then use Inkscape to import one of the SVG files, Save-As a PDF from it, and print from that. Rinse/repeat with the other SVG file:–

Updated PDFs + SVGs (identified by ‘r15371’) are currently available at https://github.com/alexkemp9/openstreetmap-promotional-leaflets. In addition I’ve made a pull-request (a request within Github for the original author to consider pulling-in my changes), so they may soon be available from the original source (next line).

Rewritten :: 2019-01-10

Andy Allan took the trouble to provide on GitHub (almost) all necessary components to print some funky little OSM flyers (information leaflets to present to folks on the street who, whilst you are mapping, say “What do you think you are doing?”) - see above, or at OSM Promotional Leaflets. Andy even offered to post some leaflets to me, and in the end I distributed ~4,000 of them across a period of 14 months. I call that outstanding practical assistance by Andy, and some excellent promotion for OSM.

As I get ready to do some more mapping in 2019 I need some more leaflets as there are just a handful left. I approached John E Wright printers on Huntingdon Street, Nottingham armed with the GitHub url + filename, but their Mac did not have any of the necessary fonts mentioned within osmflyer1.svg nor osmflyer2.svg, and display black rectangles instead. Worse, at home I discover those SVG files do not display correctly within any browser, nor GIMP, showing horrible black rectangles wherever text should be within the leaflet.

The OSM promo SVGs are each dated May 17, 2014 (although github saved them to my HDD as June 8, 2016) and have been created under Inkscape v0.48.3.1 r9886 (the current Debian/Devuan version is v0.92.1 r15371). Inkscape adopted the draft SVG1.2 at some point on or before v0.48.3.1, which is why the Validator gives numerous errors like this on the promo SVGs:

“SVG element flowRoot not allowed as child of SVG element g in this context”

…and why rsvg utilities such as rsvg-convert + browsers show large black rectangles when SVG1.2 features are included (see also this example of a flowroot bug). What seems particularly egregious is that when exported as a so-called “standard” SVG Inkscape still retains the deprecated v1.2 features. Ah well.

The current W3C Recommendation version of SVG is v1.1. A working draft for v1.2 was begun on 15 November 2002 and abandoned after 8 releases on 13 April 2005. The current working draft version is SVG2, which means that v1.2 is now deprecated (see also this WikiMedia bug report). That is a particular issue because all browsers (including the W3C Validator) only recognise SVG1.1 features.

All SVG files in the GitHub collection are dependent upon Inkscape and, in particular, contain flowed text. Current SVG clients & browsers are version 1.1 and do not recognise flowed text. Flowed text — text which wraps within a defined area — was introduced within the (now deprecated) SVG version 1.2, and Inkscape makes extensive use of v1.2 methods. In practical terms that means, by themselves, that the osm SVG files are useless; they require Inkscape.

This is how-to convert the osm SVGs from non-std SVG1.2 to std SVG1.1:

With the SVG loaded into Inkscape:–

  1. Press f8 (or click on the Text-button in the Mode column at LHS)
  2. Click on a section of text that is being flowed (and thus non-compliant)
  3. Whilst that text is selected, choose menu:Text | Convert to text
    (see also Inkscape | Frequently Asked Questions | Flowed text doesn’t show up in exported file)

Please be warned that all word edits need to be made before unflowing the text, and also that the process is very buggy, particularly in our case where emboldened text is embedded within a line. Fortunately there is a simple way of side-stepping all these bugs (either follow below steps, or edit from the ‘r15371’ SVGs as detailed at top):–

  1. Install Inkscape
  2. Load osmflyer1.svg and update to osmflyer1-modified.svg
    (the original SVG was produced under Inkscape v0.48.3.1, and the latest is v0.92.1; SVG standards shifted from 90dpi to 96dpi between the two versions (thanks to scruss for the link) and you will need to choose one of the two methods to update; I chose Auto, although this seems to have introduced an extra 2mm to all 4 leaflet dimensions)
  3. Export (using ‘Save As’) osmflyer1-modified.svg to osmflyer1-modified.pdf from inside Inkscape

That PDF appears good in a PDF viewer, GIMP & Chromium.

The following fonts are embedded within the PDF:–

  • Ubuntu
  • Ubuntu Bold
  • Ubuntu Italic
  • DejaViewSans

I never added DejaView via Inkscape so it must be an alias replacement for sans-serif (see below).

Final Bits & Bobs

The SVGs contain Frobisher fonts (a proprietary font). Those fonts are not used within the PDFs.

The Sans font has gone from the original SVGs and has been replaced by font-family:sans-serif at flowRoot3910, flowRoot3912, flowRoot3914, flowRoot3916, flowRoot3918, flowRoot3920 & rect3922. My Devuan system has then replaced sans-serif with DejaViewSans via the font alias mechanism.

So, display is still buggy for SVGs produced under Inkscape, but the program should be capable of producing PDFs effective for a printer. We shall see if that is true in the New Year.

I’ve used many DTP editors before but Inkscape is a bit opaque, made worse by the fact that after exporting to a PDF the filetype was switched from SVG to PDF (which should be read-only) (doh!).

Andy has asked me to do a pull request on the GitHub package (11 Jan: now completed), adding links for the fonts used for text in the SVG (it would have been wonderful if the graphics could have been vectors rather than PNG files, but I guess that that is currently asking too much). I will certainly do that, and will also add the PDFs to make it even easier for future users once I have found someone to print them so that I can confirm that they are fine (the University printer has given me a price that is twice what Andy paid!).

These are the fonts:–

Bitstream Vera Sans font

This seems to be used only in specialised circumstances (it is not used in a default EN leaflet).

Some translated text is in the Bitstream Vera Sans font, which is provided via gnome. The link above gives a link to a FTP site with multiple downloads available for version-1.10 of the font-family. askubuntu gives concise help for installation under ubuntu/debian/devuan (for me under Devuan the fonts were placed within /usr/share/fonts/truetype/bitstream-vera-1.10).

ubuntu font

Title + sub-title text is in the ubuntu font, which is the signature font for the ubuntu distribution. The link above gives a ZIP download for version-0.83 of the font-family. askubuntu gives concise help for installation under Ubuntu/Debian/Devuan (for me under Devuan the fonts were placed within /usr/share/fonts/truetype/ubuntu-0.83, though many other locations are available & legit to use; $ sudo fc-cache -fv will then re-cache all the fonts; re-start any apps using fonts).

Sans font

OpenSans family font is available via GitHub

Final, final words

The printer said that he prefers PDF files, preferably in X1A (2001) format, and this is a good example of why that is his preferred file-format.

The original printer still has not provided a quote, but 3 other printers have responded with quotes up to twice what Andy said his London-based printer charged. Yikes. Two printers have independently said that they want a PDF with a 3mm bleed for this kind of job, and that is what the newly-uploaded PDFs have. They also contain all embedded fonts, so should be print-ready.

Location: Thorneywood, Sneinton, City of Nottingham, East Midlands, England, NG3 2PB, United Kingdom

Comment from omgitsgela on 30 December 2018 at 15:23

I looked on the GitHub, but it seems the actual text, or the total design files for the leaflet, aren’t available. I’d like to print these at home for myself. Can someone share the design files, or provide the text data so someone can create a derivative of it that approximates the original idea?

Comment from alexkemp on 30 December 2018 at 15:48

Hi omgitsgela

All of the text is within the SVG files. All of the other files (PNG, etc.) are referenced inside those SVG files. Here are the links for you to check them out for yourself (hint: SVG files are plain text):-

osmflyer1.svg
osmflyer2.svg

Comment from omgitsgela on 30 December 2018 at 15:50

Thank you! I missed that somehow, probably thought the svg was an image. :P

Comment from Richard on 30 December 2018 at 16:12

AIUI Frobisher isn’t open source. (As the name would suggest, it’s very similar to the renowed Frutiger, which also isn’t open source.) However, Open Sans is pretty close in appearance to Frutiger and would probably be my first choice for an alternative.

Comment from ianlopez1115 on 30 December 2018 at 16:13

Per my use of WhatTheFont, the closest fonts or font families that could be used to replace Frobisher are the following: FF Transit Std, Frutiger, Humanist 777, Interval Next, Adora, Neue Frutiger Pro, Delargo DT, Lina, Bernino Sans and Schnebel Sans.

Comment from ianlopez1115 on 30 December 2018 at 16:14

Unfortunately, most of the fonts that I mentioned aren’t open source. I’d either go for Open Sans (per Richard) or use Gill Sans in this case.

Comment from RobJN on 30 December 2018 at 23:17

OSM UK has some flyers left. Happy to send a batch. Email me at rob@osmuk.org and I will arrange it. I’m hoping to make the New Year/January meeting Jerry advertised so can pass them to you there if you like?

Comment from alexkemp on 30 December 2018 at 23:22

Thanks for the offer, RobJN.

I’ve got the bit between my teeth now. My grandchildren both have their birthdays in January, so I’m unlikely to be there.

You really should never post your email address on a public website; far too many scrapers that pass such stuff to spammers.

Comment from scruss on 7 January 2019 at 13:58

Good work on the distribution and modification!

They require Inkscape to be effective (which is kind of in complete opposition to the premise of the open-source movement).

Hey, at least it requires open-source software to edit, not like open-source projects that require expensive commercial software. If it had been produced in InDesign, you couldn’t even think of opening it on Linux.

Inkscape’s got its quirks. I live in it, so those quirks seem natural to me in the same way that some people believe JOSM to be usable software. Using Inkscape for this flyer was a slightly odd choice for a DTP job, as Inkscape’s an illustration package.

  • It looks like these files were saved as Inkscape’s own dialect of SVG. It has never pretended to be web-friendly, and XML namespaces are used to keep the weird stuff separate. To make it standard, you need to save a copy as Plain SVG. Doing so loses some useful metadata that may affect your layout, so don’t work in plain SVG or any file format but Inkscape SVG.

  • Inkscape’s Save a copy … is really the Save As … that you were looking for. You need to save a lot in Inkscape, as it’ll sometimes throw you a crash. I still save reflexively after pretty much every action even though the package is infinitely more stable than it used to be.

  • These files pre-date the 90 dpi to 96 dpi shift in SVG standards. Consequently, dimensions may end up wonky. There may be nothing you can do about this.

  • The project is also likely too old to have colour management baked in. This could make the flyers appear unexpectedly garish or flat without careful proofing. Current Inkscape has colour management, but you have to enable it per project. It’s pretty much futile enabling colour management unless you’ve calibrated your display, though.

  • Inkscape makes the best PDF from Inkscape SVG as it understands the metadata that other parsers ignore. It’s not PDF/X compliant, though. For that, you’ll need Artifex’s GSView and the correct ICC profile for your particular print supplier’s setup. For a project like this without elaborate colour and stock needs, however, saving as a generic archival PDF/A will allow OSM volunteers anywhere¹ to print decent copies without all the rework you’ve had to do.

¹: anywhere except North America, that is. We use archaic paper sizes here that are incompatible with the rest of the world.

Comment from Mateusz Konieczny on 9 January 2019 at 20:08

I created https://github.com/gravitystorm/openstreetmap-promotional-leaflets/issues/4 to suggest improving documentation, make finding this easier for other people who will attempt to run reprint and and to notify author that the published materials are still useful.

Comment from ScubbX on 11 January 2019 at 15:32

Just for your information: Already some years ago I did a transformation of the OSM leaflets from the Inkscape to Scribus format. During this process I also have substituted the font dy a freely available one (Droid Sans).

All this is in this repository: https://github.com/scubbx/osm-at-flyer

Login to leave a comment