Skip to content

Commit

Permalink
Added small fixes to the tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
n7s committed Aug 23, 2024
1 parent 31724c9 commit 6bb7bbe
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/smith/tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ smith configure

This is the first step in building any project. This command tells smith to set
up the build environment and search out all the programs that it may need for
the various tasks we may ask of smith. If a necessary program is missing smith
the various tasks. If a necessary program is missing smith
will stop at that point and indicate an error. Some programs are not strictly
necessary and smith can run with reduced functionality without them. Such missing
programs are listed in orange. All other programs that smith searches for and
necessary and smith can run with reduced functionality without them. It will just issue a warning. Such missing programs are listed in orange. All other programs that smith searches for and
finds are listed, along with their locations, in green. So you can see exactly
which program smith will use for any particular task. This is hepful especially in
cases where you may have a locally installed self-compiled version: you can more easily
Expand Down Expand Up @@ -85,7 +84,7 @@ smith build

It's good that we can create multiple fonts, but what do we do with them then?
There are two typical products that people want from a font project: a `.zip`
file containing the fonts and corresponding files (with Windows line-endings CR LF) and a tarball (with Linux/macOS line-endings LF). Smith can create these two products from a wscript, but it needs just a little more information to do so:
file containing the fonts and corresponding files (with Windows line-endings CR+LF) and a tarball (with Linux/macOS line-endings LF). Smith can create these two products from a wscript, but it needs just a little more information to do so:

[source,python,linenums]
----
Expand Down Expand Up @@ -134,20 +133,18 @@ this exercise we will add a process to the source font:
include::./tutorial/font4/wscript[]
----

The interest lies in line 8. Here we use a `process()` function to tell smith
The interest lies in line 6. Here we use a `process()` function to tell smith
that we want it to run a command over the source font before converting it to a
`.ttf`. A `process()` function takes a file which already exists (either in the
source tree or one that is generated by another process) and then runs the list
of `cmd()` function results over it in order. In this case, the command is to run
of `cmd()` function results over it in order.

In this case, the command is to run
a simple script that removes glyphs from the background layer in a UFO. The command
string takes some study. The program takes two command line parameters, an input
font file and an output font file. We represent these in the command string by
`${DEP}` (the dependent file) as the input and `${TGT}` as the output file.
smith will fill these in appropriately when it comes to run the command. In
addition, note the initial `'../'` at the start of the command string. This is
because all commands in smith are run from the `results` directory and so we
have to go up one level to get back to the project root where the `wscript` file
is and then from there we can navigate to the actual script.
smith will fill these in appropriately when it comes to run the command.

The rest of the new lines in this exercise are simply extra variables being used
to make the file easier to read, otherwise some of the lines would become
Expand Down

0 comments on commit 6bb7bbe

Please sign in to comment.