tag:blogger.com,1999:blog-4686657150124826716.post7618574075085653984..comments2023-10-16T04:02:52.545-07:00Comments on Flex and ActionScript Development Tips: Default stylesheet in an SWC (Flex Library Project), and embedded font rotationChris Callendarhttp://www.blogger.com/profile/14461038089756851470noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-4686657150124826716.post-54489279145351505662010-06-16T16:10:08.533-07:002010-06-16T16:10:08.533-07:00I still haven't gotten it to work in Flex 4 us...I still haven't gotten it to work in Flex 4 using the defaults.css file.<br /><br />I have succeeded in getting it to work using ActionScript <b>Embed</b> tag like this:<br /><br />[Embed(source='/verdana.ttf', fontName='localVerdana', mimeType='application/x-font-truetype', embedAsCFF='false', unicodeRange='U+0041-U+005A, U+0061-U+007A, U+0030-U+0039, U+0020-U+002F, U+003A-U+0040, U+005B-U+0060, U+007B-U+007E')]<br />public static var verdanaFont:Class;<br /><br />[Embed(source='/verdanab.ttf', fontName='localVerdana', fontWeight='bold', mimeType='application/x-font-truetype', embedAsCFF='false', unicodeRange='U+0041-U+005A, U+0061-U+007A, U+0030-U+0039, U+0020-U+002F, U+003A-U+0040, U+005B-U+0060, U+007B-U+007E')]<br />public static var verdanaBoldFont:Class;<br /><br />And then in the class you would set the style:<br /><b>setStyle("fontFamily", "localVerdana");</b><br /><br />The unicodeRange values are optional, they simply restrict to english letters, numbers, and punctuation to keep the SWF file size down.Chris Callendarhttps://www.blogger.com/profile/14461038089756851470noreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-4491441441067441952009-12-04T11:32:18.822-08:002009-12-04T11:32:18.822-08:00Hi there,
I haven't tried this out in Flex 4 y...Hi there,<br />I haven't tried this out in Flex 4 yet. If I find anything out I'll be sure to post it here.<br />Thanks for the comment.<br />ChrisChris Callendarhttps://www.blogger.com/profile/14461038089756851470noreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-28968106107456262562009-12-04T11:01:15.269-08:002009-12-04T11:01:15.269-08:00I had done this exact thing in a SWC build in Flex...I had done this exact thing in a SWC build in Flex 3.4 SDK. I can NOT get it to work with Flex 4! I end up having to place the fonts in the application itself which uses the SWC just to get it to build. Have you been able to do this with Flex 4 yet? I did not get a response on the Adobe forum. Thanks!Anonymoushttps://www.blogger.com/profile/10825290963945716866noreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-88474524321824200422009-09-18T13:46:37.774-07:002009-09-18T13:46:37.774-07:00I don't know a way to have Air compile the fil...I don't know a way to have Air compile the files, I only use Flex Builder. But I agree that it would be nice if you didn't have to load the SWF if the font was already installed on the client's os. I doubt that is possible though.Chris Callendarhttps://www.blogger.com/profile/14461038089756851470noreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-80192104860696088742009-09-17T20:01:17.155-07:002009-09-17T20:01:17.155-07:00Yo thanks for ur post , although it is like Mark s...Yo thanks for ur post , although it is like Mark said :). guess the best way is to make a font.css and (set compile to swf) it to swf and load it at run time with the stylemanager class, i used to have a as2 class that could read a css file and embeded the files needed at run time , this is more what i would like, also the option if a font is installed, say you want three huge fonts with all the glyphs visitors who have these fonts shouldnt have to load the swf.... lots of things to think about, is there a way to have air or something compile these files withouth having flex builder installed ??.. thanks again...<br />GreetzAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-47440166593612158332009-07-06T13:34:53.002-07:002009-07-06T13:34:53.002-07:00I think I've noticed your problem too. I gues...I think I've noticed your problem too. I guess it's no surprise why the the compiler takes so long building SWFs when it is trying to figure out which assets and classes to include!Chris Callendarhttps://www.blogger.com/profile/14461038089756851470noreply@blogger.comtag:blogger.com,1999:blog-4686657150124826716.post-56063853443194084272009-07-01T21:51:31.438-07:002009-07-01T21:51:31.438-07:00Hey man,
Thanks for the super useful post about p...Hey man,<br /><br />Thanks for the super useful post about putting a default stylesheet in a swc. However...<br /><br />it doesn't work. Well, let me clarify: your steps do work, but if you are using the default components (like customizing the look of a TabNavigator for example) and you don't use it in a particular swf, (because the swc library is shared across multiple swfs) it gives you a compiler warning and still embeds the graphics into your swf! Totally stupid, and defeats the entire point of placing your files in a swc.Markhttps://www.blogger.com/profile/03496555891661087013noreply@blogger.com