Project

General

Profile

Font » History » Version 2

Philippe May, 16/01/2020 19:35

1 1 Philippe May
h1. Fonts
2 1 Philippe May
3 1 Philippe May
Gisaf uses a custom font for symbols: @GisafSymbols@.
4 1 Philippe May
5 1 Philippe May
This same font is used in 2 different ways:
6 1 Philippe May
7 1 Philippe May
1. as normal font for the web interface, using css: eg, the symbols for the layer list.
8 1 Philippe May
9 1 Philippe May
1. for mapbox: Mapbox's rendering uses a WebGL component with its own specification, so the font needs to be converted (see below).
10 1 Philippe May
11 1 Philippe May
12 1 Philippe May
h2. Creation and update of characters
13 1 Philippe May
14 1 Philippe May
The main font file is created with BirdFont, and is in the git repository: @gisaf-app/src/assets/fonts/gisafSymbols.bf@.
15 1 Philippe May
16 1 Philippe May
It is then exported as ttf in Birdfont.
17 1 Philippe May
18 1 Philippe May
h2. Mapping of characters
19 1 Philippe May
20 1 Philippe May
Each character for a layer has a unicode number, which needs to be mapped to the layer it represents.
21 1 Philippe May
22 1 Philippe May
The mapping is done in 2 different places, following the 2 techniques quickly described above:
23 1 Philippe May
24 1 Philippe May
h3. CSS
25 1 Philippe May
26 1 Philippe May
In @gisaf-app/src/gisaf-icons.css@, the mapping is like @layer_name => unicode@, eg:
27 1 Philippe May
28 1 Philippe May
<pre>
29 2 Philippe May
.gisaf-V_VEGE_TMPL:before { content: '\e044' ! important;}
30 1 Philippe May
</pre>
31 1 Philippe May
32 1 Philippe May
h3. Mapbox
33 1 Philippe May
34 1 Philippe May
* For custom models, the Unicode is defined in the @symbols@ attribute
35 1 Philippe May
36 1 Philippe May
* For category-based models, the Unicode is defined in the @symbol@ column and can be set through the Gisaf admin.
37 1 Philippe May
38 1 Philippe May
h2. Build
39 1 Philippe May
40 1 Philippe May
In the @gisaf-app@ directory:
41 1 Philippe May
<pre>
42 1 Philippe May
./node_modules/.bin/build-glyphs src/assets/fonts/GisafSymbols.ttf src/assets/fonts/glyphs/GisafSymbols/
43 1 Philippe May
</pre>