summaryrefslogtreecommitdiff
path: root/README.md
blob: 039db7ee9f950f99276214365eedc7964877c4ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
This is the source repository for Roboto: Google’s signature family
of fonts, the default font on Android and ChromeOS, and the
recommended font for Google’s visual language, Material Design.

It also contains the toolchain used in creating Roboto.

The font family supports all Latin, Cyrillic, and Greek characters in
Unicode 7.0, as well as the currency symbol for the Georgian lari, to
be published in Unicode 8.0.

The fonts are currently available in eighteen different styles.

[A subset of an earlier version of Roboto](https://www.google.com/fonts/specimen/Roboto) is available from Google Fonts, and can be used as a web font.

## Setup

#### Create a clean directory for roboto:

```bash
mkdir -p $HOME/roboto-src
cd $HOME/roboto-src
```

#### Download the code and dependencies:

```bash
git clone https://github.com/google/roboto.git
git clone https://github.com/behdad/fonttools.git
git clone https://github.com/robofab-developers/robofab.git
git clone https://github.com/typesupply/feaTools.git
git clone https://github.com/typemytype/booleanOperations.git
```

download [Cython](http://cython.org/#download) and extract it into
the current directory. On Ubuntu, Cython can also be downloaded and installed
via:

```bash
sudo apt-get install cython
```

##### For OTF generation:

```bash
git clone https://github.com/typesupply/ufo2fdk.git
```

To build the FDK yourself:

```bash
git clone https://github.com/adobe-type-tools/afdko.git
```

download the latest version of Python 2.7
[here](https://www.python.org/downloads/) and extract it into the current
directory.

If you're not building the FDK yourself, download the pre-built version
[here](http://www.adobe.com/devnet/opentype/afdko.html) and unzip it into the
current directory.

##### For TTF generation, on Ubuntu:

```bash
sudo apt-get install fontforge python-fontforge
```

##### For post-production:

```bash
git clone https://github.com/googlei18n/nototools
git clone https://github.com/rougier/freetype-py.git
```

download the latest tarball release of HarfBuzz
[here](http://www.freedesktop.org/wiki/Software/HarfBuzz/) and extract it into
the **home** directory as `$HOME/harfbuzz` (alternatively, you can download the
latest source from GitHub via
`git clone https://github.com/behdad/harfbuzz.git`).

#### Install dependencies:

You can install the necessary modules at the sytem level:

```bash
cd fonttools
sudo python setup.py install
cd ../robofab
sudo python setup.py install
cd ../feaTools
sudo python setup.py install
cd ../Cython-0.22
sudo python setup.py install
cd ../booleanOperations
sudo python setup.py install
cd ..
```

Or set `$PYTHONPATH` locally before running `make`:

```bash
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/fonttools/Lib"
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/robofab/Lib"
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/feaTools/Lib"
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/booleanOperations/Lib"
```

##### For OTF generation:

```bash
cd ufo2fdk
sudo python setup.py install
cd ..
```

Or:

```bash
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/ufo2fdk/Lib"
```

If building the FDK yourself, follow the instructions in `afdko/FDK/FDK Build Notes.txt`:

```bash
cd Python-2.7
./configure --prefix=AFDKOPythonBuild
make install
mv AFDKOPythonBuild ../afdko/FDK/Tools/osx/Python
cd ../fonttools
sudo ../afdko/FDK/Tools/osx/Python/bin/python setup.py install
cd ../afdko/FDK/Tools/Programs
./BuildAll.sh
cd ../..
./FinishInstallOSX
cd ../..
```

Otherwise:

```bash
cd FDK
./FinishInstallOSX
cd ..
```

In either case, use whatever install scripts and directory
(`FinishInstall[OSX|Linux|Windows.cmd]`,
`BuildAll[.sh|Linux.sh|.cmd]`,
`FDK/Tools/[osx|linux|win]`) are appropriate for your platform (more
detailed information can be found in `FDK/Read_Me_First.html`).

##### For post-production:

```bash
cd $HOME/harfbuzz
./configure
make
sudo make install
cd $HOME/roboto-src/
```

Install python modules to system:

```bash
cd noto
sudo python setup.py install
cd ../freetype-py
sudo python setup.py install
cd ..
```

Or:

```bash
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/noto"
PYTHONPATH="$PYTHONPATH:$HOME/roboto-src/freetype-py"
```

On Ubuntu (or other distributions of GNU/Linux, using the appropriate package
manager), make sure eog is installed:

```bash
sudo apt-get install eog
```

#### Running the toolchain:

```bash
cd roboto
make
```

## Dependencies
The Roboto build toolchain depends on:

- FontTools (https://github.com/behdad/fonttools)
- RoboFab (https://github.com/robofab-developers/robofab)
- NumPy and SciPy (http://www.numpy.org/)
- feaTools (https://github.com/typesupply/feaTools.git), for feature handling.
- BooleanOperations (https://github.com/typemytype/booleanOperations), for
  glyph overlap removal.
  - (requires Cython to install: http://cython.org/)

## OTF Generation
OTF generation depends on:

- ufo2fdk (https://github.com/typesupply/ufo2fdk)
- Open-source portions of the AFDKO
  (https://github.com/adobe-type-tools/afdko/releases)

The AFDKO from GitHub can be time consuming to setup. It is easier to just use
the variety which includes closed-source tools
(http://www.adobe.com/devnet/opentype/afdko.html), though these closed-source
portions are not used to build Roboto.

## TTF Generation
TTF generation depends on:

- FontForge (https://github.com/fontforge/fontforge)

Whose Python interface should be available on Ubuntu by default via `apt-get
install fontforge python-fontforge`.

## Post-Production
Post-production scripts (most of the code outside of the `fontbuild` directory,
e.g. for testing output) depend on:

- The nototools module, installed as part of Noto
  (https://github.com/googlei18n/nototools)
  - (Noto subsequently depends on HarfBuzz: https://github.com/behdad/harfbuzz)
- freetype-py (https://github.com/rougier/freetype-py)
- eog (https://wiki.gnome.org/Apps/EyeOfGnome)