ActionScript 3.0 :: Flash HtmlText Embedded Font?
Mar 19, 2011
I'm in the middle of the painful transition to AS3, and have encountered a stonewall. In AS2 you could export any font for actionscript and use its identifier (for example "Font 1") in htmlText:
my_text.htmlText = <font face="Font 1" size="20">"+Some text+"</font>"
But what's the procedure in AS3, as fonts doesn't have identifiers, only a class name?
View 1 Replies
Similar Posts:
Jan 8, 2007
I have an html text field that I want to use as an ongoing chat field (dynamic) and since flash has alignment issues with images inside text, I thought I'd embed a nice picturesque font and then just code them apart
e.g <p><font face='_sans' size='12'>Hello </font><font size='21'> there</font></p>
The embedded font is the default font for the textbox, so only the non graphical text needs to have a font face. So in that example "Hello" would be in text and "there" would be the graphical font.
Problem is, after much trouble even getting the font to embed and appear, that the sans text never appears.Also, Iam constranied in that I have to publish as flash 6.
View 3 Replies
Sep 24, 2009
I have 3 embedded fonts in my library and I have given them a class name.Now I would like to use these fonts in HTML in a TextField object.How do I do this? I created a stylesheet and entered the font name, but it still picks it from my harddrive, because it doesn't work on other computers where the font is not installed.I have a font embedded named "Edo", and gave it the classname Edo.[code]
View 12 Replies
Oct 1, 2009
I have imported a font into the Flash library in an FLA file this way in the New font symbol dialog box:
[Code]....
I'd like to assign this font to a TextFormat instance, but as you can see, something is wrong or missing. But what?
View 3 Replies
Sep 10, 2010
I have an embedded font in my AIR/AS3 app that lacks support for most internationalcharacters. Using TextField and StyleSheet with the font-family property, I assumed I would simply need to do this:font-family: Interstate-Regular, _sans;This works if TextField.embedFonts = false; but then Interstate-Regular isn't embedded for users that don't have it on their system. With TextField.embedFonts = true; the text doesn't even show up. Is there a way to embed Interstate-Regular and still use _sans as a fallback system font without embedding it as well?
View 1 Replies
Feb 27, 2012
I have the following code in AS3:
var str:String = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lo<FONT COLOR="#0000FF">re<FONT FACE="GG Superscript">m</FONT></FONT><FONT FACE="GG Superscript"> Ip</FONT><FONT COLOR="#990000"><FONT FACE="GG
[Code]....
It seems htmlText is rearranging the html tags. Even though the output is the same, I need the original html back since I am making a text editor and the AFTER htmlText is messing up my tag calculations.
View 1 Replies
Nov 12, 2010
why does font embedding in Flash have to always be so difficult? I'm trying to add a new font for use in htmlText and its not working. I have a dynamic text box on the stage. I have Helvetica Medium, Helvetica Bold and Futura Bk and Futura Bk Bold fonts embedded using the Font Embedding panel. All four of these fonts work fine when I do the following:
[Code]...
View 9 Replies
Nov 21, 2011
I am trying to print a string with html formatting. Part of the formatting includes font face. I have found that my print job will not print any string that includes a font face declaration. I'm guessing because the font isn't embedded, but I'm not positive.
This works:
string = "<b>bold</b> not bold";
Doesn't work:
string = "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">this is my string</font></p></textformat>";
How can I get around this. I need the ability to print any font on a users computer.
View 1 Replies
Jan 21, 2011
I'm using Flex 4. I'm trying to apply a embedded font in all Alert components of the application, to get the same style that all the app, of course. I code in my CSS file:
[Code]...
The font-family worked to all componentes, but not to the Alert component. In alert the text message and title got unvisible. If I change to other font-family it works correctly, just the embedded font doesn't work on Alert component. Anyone got this problem? Obs: The embedded font worked in all the app, just the Alert no.
View 1 Replies
Nov 13, 2009
I have generated an swf file that contains my embedded font of specified Unicode range, then I am loading this swf into my application. The code in the generated file for the font, automatically registers the font using the Font.registerFont method. I then load this swf file into my application, I never add it to the display list, I just created an instance of the file so that the code is executed to register the font.
Then I use the font name when I create embedded text fields and there you go it works... well it used to, I am not having any luck at the moment though. Sometimes it displays fine, other times it all appears cut off and I see a few pixels of the text I am trying to display.... Anyone else had a similar issue? Know what it might be? I have created a class below that I am using for the embedded font text, any issues people see with this?
[Code]...
View 1 Replies
Dec 10, 2009
I'm using some fonts embedded in SWF in a program I'm developing. I need to use some specific font style like '37 Thin Condensed' and '26 Ultra Light Italic' etc... how can I specify these style when using fonts? I want to set style using AS3 code...
View 1 Replies
Jan 19, 2010
I have a timeLabel that is an instance of Label. When I trace the htmlText properties of that timeLabel I get:
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">0%</FONT></P>
How on Earth can I change the color of this font?
View 1 Replies
Dec 27, 2011
1. I need to put different font style in one single dynamic textfield. For example,the text is :"Welcome, Fred" and I want Fred to be bold and use "Vernada" as its font while others are left as "Arial"2. I am using embeded fonts and htmltext here, the strings are loaded from external xml files3. I found in the doc that the font tag could do this. So I set the embeded fonts to "Arial" for the dynamic textfield and add <FONT ACE="Vernada">Fred</FONT>in the xml files, but it will not show "Fred" at all4. Of course I added both "Arial" and "Vernada" into the library.5. The problem is when I change the embeded fonts into "Vernada" for the dynamic textfield and modify the xml like <FONT FACE="Vernada" SIZE="25">Fred</FONT>, it works this time. I mean the character size changed to 256. My conclusion is that the font tag only works when its font-family setting for its textfild is as the same that you want to set.
View 13 Replies
Jan 16, 2012
I'd like to remove the font tags from the htmlText string produced by a TextField leaving the surrounding nodes and any bold etc tags within intact.
Example partial output of htmlText:
<P ALIGN="LEFT"><FONT FACE="ChampagneLimo" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lorem Ipsum</FONT></P>
My plan was to avoid trying anything with regex and create an XML object.
However if I create a new XML object containing a root node and then attempt to appendChild the htmlText string so that I have a valid XML object to manipulate I run into a problem with html entities, see example below:
<html><P ALIGN="LEFT"><FONT FACE="...
How can the font tags be stripped from htmlText and how can I create a valid XML object from the htmlText string? My plan was to use the XML replace() method
View 1 Replies
Jul 4, 2008
So this only happens with text fields that are set directly on the stage at author time. Not text fields that are dynamically created through code. While yes, creating them through code is an awesome solution sometimes that's not really an option for me.
Code:
import flash.text.*;
// txt is a text field created on the stage with it's font set to "Verdana"
[code]......
View 5 Replies
Jan 27, 2011
I have embedded a Font in my flex app. That works on any components without problems.
@font-face {
src:url("../assets/fonts/wedtxtn.ttf");
fontFamily: "CSSFont";
cff: true;
}
However, when I try to apply the font to my TextFlow object, it is not working. However, it does work when I use the FTE and do it my self. I debugged through the TLF and the looks like the correct FontDescription is created.
Here is the code I use to create text (Full Source @ Pastbin)
var element:SpriteVisualElement = new SpriteVisualElement;
element.verticalCenter = 0;
element.horizontalCenter = 0;
// Create Text using TLF
var span:SpanElement = new SpanElement();
[Code] .....
View 1 Replies
Jun 29, 2011
I have two dynamic text boxes on stage - strap1 and strap2 respectively.Both text boxes use the same font; just different styles. e.g strap1 is Arial regular, strap2 is arial black.In order to get a good anti-alias, I have embeded both fonts. The problem is that the top font overwrites the second. So instead of strap1 being arial normal and strap2 arial black, both textboxes are arial normal.
View 2 Replies
Apr 6, 2011
I think the title says it all. I'm building website and I've come half way now just to notice that my clients cant see my font that supposed to be there. What I've learned so far is that in static text fields, flash should embed it itself since I can't reference to it + embedFonts property not working.[code]...
View 0 Replies
Jan 7, 2010
First off when I test this out, "Fixed!" becomes underlined too, and that only happens after I add the font color, second how do I get it to open in the same window?
[Code]...
View 1 Replies
May 11, 2010
So I have a MovieClip asset with a dynamic textfield sitting inside of it. I export my .fla as a .swc to use within Flash Builder 4, and create instances of the asset with code, populating the text dynamically from XML.
My issue is that even though I have htmlText enabled, bold and italics tags don't appear to be working. I have a feeling it is because when I created the asset in Flash CS4, the text field makes you specify the font, and the subset of that to use (Regular, Bold, Oblique, etc).
Is there any way to get the htmlText to render bold and italics tags properly without having to completely rethink the way I'm creating all these fields?
View 3 Replies
Aug 20, 2010
I am having a major issue with a textfield. I have a dynamic text field which receives html so its htmlText I cant use the regular textFormat as the overrides the bold tags in the html. So I need to use css. Minor complication I have to do inline css as I cant load external data due to the project specs. Not a problem I have done inline css pretty easy. But they want a non web safe font. Again no prob I can embed fonts via the library. The problem is getting the css to use the embed font from the library. I have tried adding the font as a object to my code and then in the css referencing it via myfont.fontName, as a string etc.. 5
View 2 Replies
Jan 19, 2011
I have a TextField and I am trying to display embedded images using htmlText:
var test:TextField = new TextField();
test.multiline = true;
test.wordWrap = true;[code]....
In this case the raftImg is in the Assets class. The problem is that the image does not align as it should (it always stays in upper left corner). If I load it using "../ blah/ img.gif" it works properly.
View 1 Replies
May 19, 2010
when the embedFonts is removed, it works perfectly as expect. Otherwise when an image is clicked, it selects the whole text around it.
testtext.htmlText="Curabitur dolor eros<a href='event:test'><img src='003.jpg'></a>eget odio.</p>";
testtext.embedFonts=true;
did anyone come across this before? is there another way to make an image clickable inside a dynamically loaded xml text?Alternatively can anyone suggest a method to style dynamic textfields instead of using html?I've tried with many different fonts, and many different stylesheets, its still the same.
View 1 Replies
Jul 15, 2010
I've got a number of related projects set up in Flash Builder. Each project gets its graphical assets from an exported SWC file (or multiple SWC files.) This works fine, but I wanted to create a shared project that contains stuff used across all projects. The first item in there is a screen with a number of clips containing dynamic text fields on them. This screen (and associated assets) are exported to a SWC and then I have written code in the shared project to add functionality to the screen and buttons. I'm using 2 fonts, both are embedded.
Both show up just fine in my test harness, but when I link the shared SWC and src folder (which is required in order to use this code/assets in the other projects) the textfields blank out if I try to set their text properties. If I leave the default text (set in the FLA) it shows up, and the static text fields in the FLA also show up, it's only when I set the text property.
I've tried a number of combinations, including removing embedding, exporting for ActionScript, setting all textfields in the shared project to dynamic, all with no luck. The main project does have the same font embedded, and I've checked that the same glyphs are selected in both the main and shared projects. I realize this is a rather complicated setup, but I have yet to find a workflow to allow a designer and developer to work on large projects that is better (but I'd love to hear one!)
View 2 Replies
Mar 7, 2011
My question is simple: Does a externally loaded swf inhert the embedded font of the main swf that loads it? so the do I have embedded the same font in both the main and externally loaded swf?
View 1 Replies
Jun 14, 2011
i would just like to ask why is the case that when i use embedfonts = true on a textfield, the textfield's text only resizes according to the textfield's height but not the textfield's width. meaning if i make the textfield's height bigger, the text also gets bigger in terms of height, but not width, can't the embedded font maintain aspect ratio according to the textfield height?
I'm only wondering about this because this is not the case when embedfonts= false
View 1 Replies
Dec 7, 2009
I have a .Swf, which has 3 fonts embedded in it, they are all exported in frame 1 for AS. This swf loads any number of external .swfs which have dynamically generated textfields inside of them. This text must be embedded text because effects may be applied to them. I do not want to embed the three fonts into every external swf, and do not think I should have to. The font exists in the Loading swf and I have registered the fonts to the global font list. If I print this list from the loaded swf, all three fonts are present, but when I try to use any of them, my textfiels are empty.
how do I utilize a font which is embedded in a swf, from a swf which has been loaded into that swf?
From my external swf, this code:
PHP Code:
var embeddedFonts:Array = Font.enumerateFonts(false);embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);trace(embeddedFonts);
[Code]....
which is exactly what I would expect. Yet, my text box is still blank. I have embedText = true on the text box, and have applied a string to the "text" property, so it's nothing silly liek that.
View 4 Replies
Mar 13, 2009
I have an English based flash set that I'm localizing in Japanese. The client has written to embed the fonts in a font.swf. So I figured I can just add 'New Font' for Japanese fonts, add the class ID to the script file:
var font:LoadFont = new
LoadFont('fonts.swf',['ArialRegular','ArialMedium',
'MSUIGothicReg', 'MSUIGothicBold']);
then export the fonts,swf, and launch the main.swf, JPN fonts should show up correctly. But instead, I get blanks for Japanese characters. Does anyone know what I missed? I've tried other methods: 1) add a layer in main file, 'Character Embedding' in Properties; 2) 'Character Embedding' each text boxes in main; none has worked.
View 1 Replies
Jul 17, 2009
in the attachment, you'll see the text display is quite awful despite the fact I embed Arial font in my application.
View 2 Replies
Feb 10, 2011
Then here is the code I'm using to create a new textbox and display text in the embedded font:
var myFont:Font = new Font1();
var myFormat:TextFormat = new TextFormat();myFormat.font = myFont.fontName;myFormat.size = 24;myFormat.bold = true;
[code]....
View 3 Replies