Class: Fontisan::Ufo::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/fontisan/ufo/reader.rb

Overview

Reads a UFO source directory into a typed Fontisan::Ufo::Font.

Reads, in order:

- `metainfo.plist`        (UFO version stamp; informational)
- `fontinfo.plist`         (Info)
- `layercontents.plist`    (layer ordering; optional in UFO 3)
- `glyphs/contents.plist`  (default-layer glyph order)
- `glyphs/<layer>/<name>.glif`  (per-glyph XML)
- `kerning.plist`          (Kerning)
- `features.fea`           (Features)
- `lib.plist`              (Lib)

Phase 1 reads fontinfo.plist + glyphs/contents.plist + minimal .glif (name, advance, unicodes). Full .glif decoding (contours, components, anchors) lands when the compiler layer is built.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(font) ⇒ Reader

Returns a new instance of Reader.



24
25
26
# File 'lib/fontisan/ufo/reader.rb', line 24

def initialize(font)
  @font = font
end

Instance Attribute Details

#fontObject (readonly)

Returns the value of attribute font.



22
23
24
# File 'lib/fontisan/ufo/reader.rb', line 22

def font
  @font
end

Instance Method Details

#readFontisan::Ufo::Font

Returns:



29
30
31
32
33
34
35
36
37
38
# File 'lib/fontisan/ufo/reader.rb', line 29

def read
  read_metainfo
  read_fontinfo
  read_layercontents
  read_glyphs_contents
  read_kerning
  read_features
  read_lib
  @font
end