This is PHP code I have so far:
https://gist.github.com/2eeba2ff31ebecb526e2
This is the result:
https://gist.github.com/cf07fe90922ac3dfcd22
Now say I need to get information that is referenced in this table:
object(ttfTableDirectoryEntry)#6 (4) {
["tag"]=>
string(4) "cmap"
["checksum"]=>
int(2553734765)
["offset"]=>
int(1556)
["length"]=>
int(1190)
}
How do I do that?
In general, I need to parse info for every of these tables.
This is what you get if you simply try to parse the data from offset with length.
object(ttfTableDirectoryEntry)#12 (4) {
["tag"]=>
string(4) "name"
["checksum"]=>
int(3955157420)
["offset"]=>
int(400)
["length"]=>
int(1153)
}
string(1153) "���>��������:����������:��������F�������"�L��������n�������
������������������5����������������� �#��������
�:������������������ ���t#�� ����� ����� ��D��� ��$��� ��#�� ��$��� ��j=�� ����� � �F��� �
�t#�� ��: �� ��: Copyright (c) 2010 by YouWorkForThem. All rights reserved.YWFT HLLVTKANormalYouWorkForThem: YWFT HLLVTKA: 2010YWFT HLLVTKA NormalVersion 1.000YWFTHLLVTKA-NormalYWFT HLLVTKA Normal is a trademark of YouWorkForThem.YouWorkForThemEric Carlson & Taechit Jiropaskosolhttp://www.youworkforthem.com�C�o�p�y�r�i�g�h�t� �(�c�)� �2�0�1�0� �b�y� �Y�o�u�W�o�r�k�F�o�r�T�h�e�m�.� �A�l�l� �r�i�g�h�t�s� �r�e�s�e�r�v�e�d�.�Y�W�F�T� �H�L�L�V�T�K�A�N�o�r�m�a�l�Y�o�u�W�o�r�k�F�o�r�T�h�e�m�:� �Y�W�F�T� �H�L�L�V�T�K�A�:� �2�0�1�0�Y�W�F�T�H�L�L�V�T�K�A�-�N�o�r�m�a�l�V�e�r�s�i�o�n� �1�.�0�0�0�Y�W�F�T� �H�L�L�V�T�K�A� �N�o�r�m�a�l� �i�s� �a� �t�r�a�d�e�m�a�r�k� �o�f� �Y�o�u�W�o�r�k�F�o�r�T�h�e�m�.�Y�o�u�W�o�r�k�F�o�r�T�h�e�m�E�r�i�c� �C�a�r�l�s�o�n� �&� �T�a�e�c�h�i�t� �J�i�r�o�p�a�s�k�o�s�o�l�h�t�t�p�:�/�/�w�w�w�.�y�o�u�w�o�r�k�f�o�r�t�h�e�m�.�c�o�m"
I tried to achieve this and went close to making it. However, at the end, I decided to use Python instead when parsing data. Anyway, if anyone decide that they want to go PHP way, here is what I have until this moment. It is one step close to getting glyph map. For a documentation on how to read the data, refer to http://developer.apple.com/fonts/ttrefman/RM06/Chap6.html.