PDA

View Full Version : multiple font support


jsebrech
01-24-2007, 04:38 PM
Hi everyone,

I'm probably going to be faced with the task of modifying my CAD application to have support for multiple fonts (besides Arial, which is currently hard-coded into the swf). These fonts will be rotated and scaled, so that means I need to use embedded fonts (right?). However, since this would bloat the file size too much, I need to load these on-demand, and more importantly, I need to make it easy for the administrator of the system to easily add additional fonts to the web application, without having to come back to us to get some fonts converted into library swf's.

Do the wise people of this site have some pointers or suggestions about where to look or how to go about this? I am really dreading having to write PHP code to convert TTF files to SWF, so anything that allows me to avoid that would be, in the immortal words of Lumberg, greeeeeat...

CyanBlue
01-24-2007, 04:47 PM
Hm... A CAD system done in Flash??? WoW...

Can you use Shared Font/Library approach??? Create multiple font SWF files and load them dynamically as you need, and then use it when it is loaded or something like that???

A couple of links for Shared Font/Shared Library stuff in no specific order for whoever need it...
http://www.quasimondo.com/archives/000227.php
http://web.archive.org/web/20021206180401/http://www.waxpraxis.org/archives/000062.html
http://www.sharedfonts.com/eng/index.html
http://www.rickworks.org/2006/08/05/preload-shared-fonts-in-flash/
http://www.heyotwell.com/heyblog/archives/000137.html
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14767
http://flashmove.com/forum/showthread.php?t=15006
http://www.informit.com/articles/article.asp?p=29304&seqNum=7&rl=1
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000462.html
http://www.adobe.com/cfusion/knowledgebase/index.cfm?event=view&id=KC.tn_14786&extid=tn_14786&dialogID=96078123&iterationID=1&sessionID=9630d7ed1cf936951563&stateID=0+0+23953386&mode=simple

jsebrech
01-25-2007, 08:21 AM
I was looking at the shared library approach, but like I explained in my original post, the customer needs to be able to add new fonts themselves easily. In other words, they can't use the flash IDE to generate these libraries. Since we currently have a PHP server-based approach, I am looking for a way to convert TTF to SWF from PHP. A difficulty factor is that over time we will be adding unicode support, and so i should be able to let the user decide which symbol sets to pick from the TTF to convert to SWF (instead of just converting latin1 symbols).

So far I've found these:
http://www.libming.net/moin.cgi/How_to_use_TrueType_Fonts
http://freemovie.sourceforge.net/ (promised in version 2)
http://osflash.org/swfmill (obviously)

If people are aware of others, please mention them. Command-line tools would be acceptable also, provided they have builds (or are buildable) on windows and *nix (since we support both platforms as server-side).

Incidentally, to explain what I'm talking about when I say CAD system, and because I'm actually quite proud of it, there's a screenshot attached :)

CyanBlue
01-25-2007, 02:08 PM
Ah... Very nice... I've done a prototype of such tool some time ago, and it never gone further than that because it had no capability to read the different floorplan layouts and way to generate the hotspots on the fly... :D

I did not know if you were looking for a way to generate such usable fonts from the TTF... Sounds like SWFMill is a good option to go, but I have no personal experience with that...

jsebrech
01-25-2007, 04:13 PM
It was about 3 months of analysis and 5 months of development and debugging, on a set of databases that already existed. So yeah, I guess "quick prototyping" isn't really the case there :)

If I'm not mistaken swfmill only converts latin1 characters (I seem to remember this from my experiences with it). But it looks like that's probably the way to go.

CyanBlue
01-25-2007, 04:24 PM
Yeah... That was something I had to do in a matter of month time frame... :(

Please keep me post on the solutions you find... I'd love to hear more...

One thought... Maybe it is whole lot easier to hire somebody to import 1000s of font files and generate the SharedLibrary SWF files out of it... That should work assuming that you can find a cheap labour and limiting the fonts to only that amount... :D

jsebrech
01-25-2007, 04:28 PM
There is still the issue of legality. This application opens autocad files, so the fonts used are the traditional CAD fonts used in the industry, which all require licensing fees. Including a thousand unlicensed fonts is probably not going to fly.

CyanBlue
01-25-2007, 05:14 PM
Ouch...