Class: Fontisan::Tables::Post
- Inherits:
-
Binary::BaseRecord
- Object
- BinData::Record
- Binary::BaseRecord
- Fontisan::Tables::Post
- Defined in:
- lib/fontisan/tables/post.rb
Overview
Parser for the ‘post’ (PostScript) table
The post table contains PostScript information, primarily glyph names. Different versions exist (1.0, 2.0, 2.5, 3.0, 4.0) with varying glyph name storage strategies.
Reference: OpenType specification, post table
Constant Summary collapse
- STANDARD_NAMES =
Standard Mac glyph names for version 1.0 (258 glyphs) rubocop:disable Metrics/CollectionLiteralLength
%w[ .notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat ].freeze
- VERSION_2_0_RAW =
Version 2.0 as Fixed 16.16 constant
131_072
Instance Method Summary collapse
-
#glyph_names ⇒ Array<String>
Get glyph names based on version.
-
#italic_angle ⇒ Object
Get italic angle as float (Fixed 16.16 format).
-
#version ⇒ Object
Get version as float (Fixed 16.16 format).
Methods inherited from Binary::BaseRecord
Instance Method Details
#glyph_names ⇒ Array<String>
Get glyph names based on version
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fontisan/tables/post.rb', line 82 def glyph_names @glyph_names ||= case version when 1.0 STANDARD_NAMES.dup when 2.0 parse_version_2_names else [] end end |
#italic_angle ⇒ Object
Get italic angle as float (Fixed 16.16 format)
75 76 77 |
# File 'lib/fontisan/tables/post.rb', line 75 def italic_angle fixed_to_float(italic_angle_raw) end |
#version ⇒ Object
Get version as float (Fixed 16.16 format)
70 71 72 |
# File 'lib/fontisan/tables/post.rb', line 70 def version fixed_to_float(version_raw) end |