View Full Version : embedding fonts in Menu Bar component (MX2004pro)
dr.swank
11-10-2003, 09:50 AM
Hi All,
well, I am stumped. Here is my situation:
I am making a site that uses the menu Bar component from MX04pro and have all the style issues worked out, except 1. I want to use an alternate font which is not available as a standard on all os's. hence I try to set the "fontFamily" prop in a style object to the font I want, but it doesn't really work!
When I try to set the faonFamily to a font I am exporting for AS in the library it fails silently and gives me the default font. If I try and set a font via it's font name in my os (Mac 10.3) then it works, but the text is aliased really baddly. If I put a simple textfield on stage with the same font attached and exported it looks fine.
Does anyone have an idea how to get fonts into the Components in MX04 ??
thanx in advance. doc
dr.swank
11-10-2003, 10:24 AM
well, I am a step further and thought I would share the joy... apparently the MX04 UI components have all fonts below 12pt as aliased and default... go figure. I set the font to 12pt in the style declaration and it at least looks much better..
I will post the final solution if and when I find it.
Doc
dr.swank
11-10-2003, 01:32 PM
duhh...
well, as stupid as it sounds, it seems that the embedFonts prop is part of the CSSStyleDeclaration.. although don't thank MM for that knowledge. I ended up rooting through the entire class structure to finally find it in the CSSTextStyles.as ef file. So, assuming that my freinds machine really doesnt have the font installed, here is the code:
var styleObj = new mx.styles.CSSStyleDeclaration();
_global.styles.ubuStyle = styleObj;
with (styleObj) {
styleName = "ubuStyle";
themeColor = "haloBlue";
fontFamily = "65 Helvetica Medium";
embedFonts=true;
fontSize = 12;
fontStyle="bold";
color = 0x212621;
backgroundColor = 0xffffff;
borderColor = Oxffffff;
shadowColor = 0xffffff;
buttonColor = 0xffffff;
borderStyle = "none";
}
ubuMenuBar.setStyle("styleName", "ubuStyle");
if anyone gets a chance please test the fonts on site for me and tell me if what you see looks like the file I attached. Thanx you doc
Thank you so much for posting this solution! We had been going nuts trying to figure it out (in our case for TextArea and ComboBox components).
Just as an FYI--we had an additional issue to work out in that we need to use (and embed) several IPA Unicode characters. When you make a font symbol in the Library, not all characters get embedded. So we wound up modifying the Unicode Table.xml file that comes with Flash to include the range of characters that we needed.
Hope this helps someone else.
Thanks,
Kathryn
Kathryn Propst
Indiana University
Teaching and Learning Technologies Centers
kpropst@indiana.edu
dr.swank
05-14-2004, 03:03 PM
welcome Kathryn! and your welcome as well :)
could you post the changes in the xml file you made?? It would be very helpful.
cheers, doc
Hi,
We needed to add 4 IPA characters (2 characters, upper and lower case of each) so we added their ranges into the Unicode Table.xml file as follows. Our glyphs are in the last range in each below (0x0186 to 0x0190 and 0x0254 to 0x025B)
<fontEmbeddingTable>
<glyphRange name="Uppercase [A..Z] " id="1" >
<range min="0x0020" max ="0x0020" />
<range min="0x0041" max ="0x005A" />
<range min="0x0186" max ="0x0190" />
</glyphRange>
<glyphRange name="Lowercase [a..z] " id="2" >
<range min="0x0020" max ="0x0020" />
<range min="0x0061" max ="0x007A" />
<range min="0x0254" max ="0x025B" />
</glyphRange>
...
Thanks,
Kathryn
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.