Class: Fontisan::Ufo::Writer
- Inherits:
-
Object
- Object
- Fontisan::Ufo::Writer
- Defined in:
- lib/fontisan/ufo/writer.rb
Overview
Writes a UFO source directory from a typed Fontisan::Ufo::Font.
Mirror of Reader. Writes, in order:
- `metainfo.plist` (UFO version stamp)
- `fontinfo.plist` (Info)
- `layercontents.plist` (UFO 3 only; layer ordering)
- `glyphs/contents.plist` (default-layer glyph order)
- `glyphs/<name>.glif` (per-glyph XML)
- `glyphs/<layer>/...` (additional layers)
- `kerning.plist`
- `features.fea`
- `lib.plist`
Constant Summary collapse
- UFO_VERSION_DEFAULT =
3
Instance Attribute Summary collapse
-
#font ⇒ Object
readonly
Returns the value of attribute font.
Instance Method Summary collapse
-
#initialize(font) ⇒ Writer
constructor
A new instance of Writer.
- #write(path, ufo_version: nil) ⇒ Object
Constructor Details
#initialize(font) ⇒ Writer
Returns a new instance of Writer.
22 23 24 |
# File 'lib/fontisan/ufo/writer.rb', line 22 def initialize(font) @font = font end |
Instance Attribute Details
#font ⇒ Object (readonly)
Returns the value of attribute font.
20 21 22 |
# File 'lib/fontisan/ufo/writer.rb', line 20 def font @font end |
Instance Method Details
#write(path, ufo_version: nil) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fontisan/ufo/writer.rb', line 28 def write(path, ufo_version: nil) @ufo_version = ufo_version || @font.ufo_version || UFO_VERSION_DEFAULT FileUtils.mkpath(path) (path) write_fontinfo(path) write_layercontents(path) write_glyphs(path) write_kerning(path) write_features(path) write_lib(path) path end |