Class: Fontisan::Export::TtxParser
- Inherits:
-
Object
- Object
- Fontisan::Export::TtxParser
- Defined in:
- lib/fontisan/export/ttx_parser.rb
Overview
TtxParser parses TTX XML format to font data
Parses fonttools-compatible TTX XML files and reconstructs font data that can be written back to binary formats.
Instance Method Summary collapse
-
#parse(ttx_xml) ⇒ Hash
Parse TTX XML content.
Instance Method Details
#parse(ttx_xml) ⇒ Hash
Parse TTX XML content
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fontisan/export/ttx_parser.rb', line 21 def parse(ttx_xml) doc = Nokogiri::XML(ttx_xml) ttfont = doc.at_xpath("/ttFont") raise "No ttFont root element found" unless ttfont { sfnt_version: parse_sfnt_version(ttfont["sfntVersion"]), glyph_order: parse_glyph_order(ttfont), tables: parse_tables(ttfont), } end |