-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
114 lines (84 loc) · 3.55 KB
/
README
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
Emacs fontfile modes
--------------------
This is a collection of Major Modes for Emacs that are designed
to facilitate reading, ediing, and debugging files in various
font-development formats.
The formats supported are NOT binary font files themselves (such
as OpenType (.otf), TrueType (.ttf) or PostScript Type1 (.pfb).
To edit these formats, you need a font editor, such as the
free-software application FontForge. [1]
The formats supported DO include some font source formats, but
none of these modes is intended to turn Emacs into a visual font
editor. For that, you again need a font-editing application like
FontForge.
With all that negativity out of the way, here's what these modes
actually DO allow you to edit:
* OpenType feature-definition files (.fea)
* Unified Font Object (UFO) glyph files (.glif)
* FontForge spline-font database files (.sfd)
* FontForge native (i.e., non-Python) scripts (.pe or .ff)
* FontTools / TTX files (.ttx)
INSTALLATION:
-------------
These Emacs modes are defined in Emacs Lisp (.el) files. By
default, they expect to find themselves in your .emacs.d
directory, so if you don't know what else to try, copy them
(including the containing folder "fontfile-modes") into the
directory called .emacs.d that lives inside your home folder.
Next, you can TEST each mode by opening the appropriate file in
Emacs, typing
M-x
then typing
eval-buffer
and opening a file of the coresponding format.
If you want Emacs to automatically load the relevant mode whenever
you open a supported file format, just add a hook to your .emacs
file. For example, to automatically support .fea files, add
the lines:
(add-to-list 'load-path "~/.emacs.d/fontfile-modes")
(require 'fontfile-fea-mode)
anywhere in your .emacs file.
Currently, each mode is separate; it is provided in its own ELisp
function and must be invoked separately. This is a decision on my
part because I did not think it exceedingly likely that a user
would need to edit all five file types in one session on a regular
basis. Maintaining the syntax-highlighting and ElDoc structures
for all five modes would thus consume system resources
unnecessarily.
Here are the files to load for each mode:
* OpenType feature files: fontfile-fea-mode.el
* UFO glyph files: fontfile-ufo-mode.el
* FontForge SFD files: fontfile-sfd-mode.el
* FontForge scripts: fontfile-ffs-mode.el
* FontTools TTX files: fontfile-ttx-mode.el
USAGE:
------
All five modes support the following features:
* Syntax highlighting
* Auto-indentation
* Highlighting of well-know font table and tag types
* Optional help messages to define keywords and terms
*** NOTE ***
At the moment (May 1, 2015), I am in the middle of rewriting the
indentation code using Emacs SMIE, so autoindentation may be
broken. I hope to have this fixed again within a few days.
*** ∃TOИ ***
Syntax highlighting and indentation should work automatically.
The built-in help requires you to turn on a Minor Mode called
"Eldoc." To do so, type
M-x
then type
turn-on-eldoc-mode
Subsequently, whenever you pause the mouse cursor over a
keyword, function, or well-know table/tag, Emacs will show you
a brief description string in the message line at the bottom
of the window.
TTX and UFO's .glif are both XML-based formats, which enables
two additional features:
* Automatic validation (ensuring your edits remain well-formed XML)
* Element folding (letting you collapse or expand any element)
For TTX in particular, element folding can make navigating the
file much faster, since TTX files can be rather large.
References
----------
[1] - http://fontforge.github.io/