0 Replies Latest reply on Mar 11, 2011 1:38 AM by max.rozdobudko

    What difference between OpenType and OpenType that used Flash Player?


      The spec of SWF 10 format says that DefineFont4 tag contains FontData as OpenType font with CFF table:



      When present, this is an OpenType

      CFF font, as defined in the OpenType

      specification at www.microsoft.com/

      typography/otspec. The following

      tables must be present: ‘CFF ’, ‘cmap’,

      ‘head’, ‘maxp’, ‘OS/2’, ‘post’, and

      either (a) ‘hhea’ and ‘hmtx’, or (b)

      ‘vhea’, ‘vmtx’, and ‘VORG’. The ‘cmap’

      table must include one of the following

      kinds of Unicode ‘cmap’ subtables: (0,

      4), (0, 3), (3, 10), (3, 1), or (3, 0)

      [notation: (platform ID, platformspecific

      encoding ID)]. Tables such as

      ‘GSUB’, ‘GPOS’, ‘GDEF’, and ‘BASE’

      may also be present.

      Only present for embedded fonts.



      but I can't read these data as OpenType font.


      During the test I use these utils: fontswf and swfdump from Flex SDK ttx from AFDKO, and ARIAL.TTF font from Windows.


      Thes my steps:

      1. Compile SWF with embedded OpenType font using fontswf utility from Flex SDK.



      D:\sandbox>fontswf -a ArialEmbedded -o Arial.swf ARIAL.TTF Adobe Font SWF Conversion Utility Copyright (c) 2009 Adobe Systems, Inc. All rights reserved. Reading font from file:/D:/sandbox/ARIAL.TTF Generated SWF at D:\sandbox\Arial.swf in 8670ms



      2. Create dump this SWF using swfdump.



      D:\sandbox>swfdump -out Arail.swfx Arial.swf



      3. Open resulting SWFX file, it contains FontData in Base64:



      <DefineFont4 id='1' font='ArialEmbedded' hasFontData='true' smallText='false' italic='false' bold='false' langCode='0'>




      4. Convert this Base64 to Hexadecimal string and save it as file (f.e. font.otf) using HEX editor.

      5. Next when trying to dump the resulting file using ttx util, I got exception:



      C:\Apps\FDK\Tools\win>ttx sandbox/font.otf Dumping "sandbox/font.otf" to "sandbox\font.ttx"... Dumping 'GlyphOrder' table... An exception occurred during the decompilation of the 'CFF ' table Traceback (most recent call last):   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttx.py", line 289, in main     process(jobs, options)   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttx.py", line 274, in process     action(input, output, options)   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttx.py", line 171, in ttDump     disassembleInstructions=options.disassembleInstructions)   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttLib\__init__.py", line 267, in saveXML     self._tableToXML(tableWriter, tag, progress)   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttLib\__init__.py", line 303, in _tableToXML     table.toXML(writer, self)   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttLib\__init__.py", line 739, in toXML     glyphOrder = ttFont.getGlyphOrder()   File "C:\Apps\FDK\Tools\win\Python\Current\lib\site-packages\FontTools\fontToo ls\ttLib\__init__.py", line 411, in getGlyphOrder     self.glyphOrder = cff.getGlyphOrder() AttributeError: DefaultTable instance has no attribute 'getGlyphOrder'



      Maybe I did something wrong?