JayDee173 Posted February 18, 2010 Share Posted February 18, 2010 hello, Does anyone know how to get font info from a font file ... using php of course ! The stuff I need to extract is Font Family, Author, Copyright etc which is contained as attributes in the font file. Thanks so much, Cheers, Jay. Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/ Share on other sites More sharing options...
teamatomic Posted February 18, 2010 Share Posted February 18, 2010 http://blog.yctin.com/archives/how-to-get-name-table-from-ttf-font-file-using-php/ HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014195 Share on other sites More sharing options...
JayDee173 Posted February 18, 2010 Author Share Posted February 18, 2010 thanks HTH, But thats not quite what I was looking for (I have in fact already seen that script). If you open any TTF font file, you will see such attributes as: File Name, File Size, Version, Copyright, Font Family etc. Some font files have all of these fields populated, others only have minimal number of fields populated. I have seen various font archive websites in the past, that display each font file + these attributes - so there must be a way (php class?) to extract this information ????? Anyone done this sort of thing before? Cheers, Jay. Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014546 Share on other sites More sharing options...
teamatomic Posted February 19, 2010 Share Posted February 19, 2010 You open the file in windows and see all sorts of good stuff cause the windows font explorer says it's so, imagine that. The reason for that class is to take the greek and show it to you in a manner you can read, without windows conversion of the binary data. Open the file in a binary enabled editor and see whats really there. ¨ VVDMXtÚ|^ Ø àcmap?§Þò 2 lcvt J¯)| ?` ªfpgmÒ~¥ª 5€ ugasp ÒP glyf}õ_ Cd ~¦hdmx„@ ¸ $\headÐ aš , 6hhea"í d $hmtxÃýQ‰ ¨loca-e½ A Vmaxp& ˆ name¹Ãò  Çpost±´¯O ÏÔ {prepru@à :ø h ïëÅø_<õ °µz. ¹ÿœþºþfkú úþf þºþ¼k HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014576 Share on other sites More sharing options...
JayDee173 Posted February 19, 2010 Author Share Posted February 19, 2010 huh ? I'm just tring to find a script that will return the ttf attributes (e.g File Name, File Size, Version, Copyright, Font Family etc) The script at: http://blog.yctin.com/archives/how-to-get-name-table-from-ttf-font-file-using-php/ doesnt seem to do this. Anyone got any other ideas. Thanks fellas , your help is much appreciated! Cheers, Jay. Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014588 Share on other sites More sharing options...
teamatomic Posted February 19, 2010 Share Posted February 19, 2010 yes, i gues it dont work $ttf = new ycTIN_TTF(); //open font file if ($ttf->open("/home/test/arial.ttf")) { Array ( [0] => Typeface © The Monotype Corporation plc. Data © The Monotype Corporation plc/Type Solutions Inc. 1990-1992. All Rights Reserved [1] => Arial [2] => Regular [3] => Monotype:Arial Regular:Version 3.00 (Microsoft) [4] => Arial [5] => Version 3.00 [6] => ArialMT [7] => Arial® Trademark of The Monotype Corporation plc registered in the US Pat & TM Off. and elsewhere. [8] => Monotype Typography [9] => Monotype Type Drawing Office - Robin Nicholas, Patricia Saunders 1982 [10] => Contemporary sans serif design, Arial contains more humanist characteristics than many of its predecessors and as such is more in tune with the mood of the last decades of the twentieth century. The overall treatment of curves is softer and fuller than in most industrial style sans serif faces. Terminal strokes are cut on the diagonal which helps to give the face a less mechanical appearance. Arial is an extremely versatile family of typefaces which can be used with equal success for text setting in reports, presentations, magazines etc, and for display use in newspapers, advertising and promotions. [11] => http://www.monotype.com/html/mtname/ms_arial.html [12] => http://www.monotype.com/html/mtname/ms_welcome.html [13] => NOTIFICATION OF LICENSE AGREEMENT This typeface is the property of Monotype Typography and its use by you is covered under the terms of a license agreement. You have obtained this typeface software either directly from Monotype or together with software distributed by one of Monotype's licensees. of course it works. you're just a bit confused cause you were raised on windows. YOYO HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014607 Share on other sites More sharing options...
JayDee173 Posted February 19, 2010 Author Share Posted February 19, 2010 hey tomatic ... drop the attitute buddy ! Theres no need for it. We are all learning here ... if you dont want to offer support in a friendly and helpful manner - keep it to yourself! Try practicing being nice for a while (please, thankyou etc) ... you may find that people like you a bit more. Have a nice day. Peace everyone ! Cheers, Jay. Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014631 Share on other sites More sharing options...
teamatomic Posted February 19, 2010 Share Posted February 19, 2010 Yes, sorry, guess I'm having a bad day. HTH Teamtomic Link to comment https://forums.phpfreaks.com/topic/192479-get-font-info-from-a-font-file/#findComment-1014641 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.