Actionscript - Flash Text Engine - TextLine Calculates Height Incorrectly In Some Font?
Nov 14, 2011
I am using Flash Text Engine's TextBlock & TextLine to display text. However, I found that some font make TextLine calculate height incorrectly. Here is my sample code:
package users
{
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.events.Event;
[code]....
which means TextLine.textHeight, height, totalHeight, and result from getBounds give the same value, roughly 57.6 pixel So, my question is, how can I get the actual text height?Please don't tell me not to use Swansea. So far, I have tried 5-6 different fonts and only Swansea give me this problem.
View 1 Replies
Similar Posts:
Nov 26, 2009
I am using Flash Text Engine's TextBlock & TextLine to display text. However, I found that some font make TextLine calculate height incorrectly. Here is my sample code:
package users
{
import flash.display.Sprite;
[code].....
View 2 Replies
Nov 2, 2009
I have a textarea where I measure the textWidth and textHeight to make sure the user cannot enter more text than can fit in the text area. I also extended the textArea with a textHeightNow and textWidthNow that measure the textField's dimensions since they update w/out requiring validation. Now this works great for 90% of the embedded fonts I'm using but any fonts that have giant serifs are not measured properly, for instance look at the 'f's in this text area:You can see they get cut off on both sides because textWidth and textWidthNow both return an incorrect size not taking into account the massive serifs.
View 1 Replies
Jan 11, 2011
I currently have two problems with Flex 3 htmlText.
1) When I am setting my text's htmlText:
myText.htmlText = <html text stored in my mysql database>
It calculates the height way wrong. In most cases, a ton of padding (or whitespace) is added above and below the text. I am not sure what happens, but it calculates the textHeight way higher than normally.
2) If I put <span> tags in my html, it automatically strips them out (instead of just ignoring them). I am using the span tags to be able to dynamically find certain pieces of my text. For instance:
<span class="salutation">Dear,</span> <span class="tag">[First Name]</span>
is inserted in my htmlText, and I use them to parse out the salutation and tag of my variable data.
Any alternative ideas on how to parse out pieces of html? Any way to improve htmlText? How to correctly measure textHeight and/or remove padding?
View 2 Replies
Jan 6, 2010
I have a project coming up where I'll be rendering text paths on a circle; the text has to be dynamic, so I can't just bring in a precomputed set from illustrator. Now, laying text on a circle ought not be too hard, I'll do it per character with per character rotation. The trouble is, I can't seem to figure out how to get per-character advance from flash's font engine. It's 99% probable that I'm just overlooking something obvious. But as far as I can tell, the only way to get flash font metrics is via flash.text.engine.FontMetrics which ostensibly is per-font, not per-character.
A fallback that I'm not looking forward to implementing is pre-computing per-char advance on my own ( since this project will be using embedded fonts known in advance ). I've got ObjC code lying around for generating glyph maps for opengl, so I could generate that data offline and make it available to my flash code ( probably as static constants or some malarkey ).
View 3 Replies
Mar 26, 2004
ok i have a movie clip with a dynamic text field being animated... i have a text file with this in it
&textline1=time
&textline2=place
&textline3=year
&textline4=month
now how do i make the movie clip to first go from frame 1 to 10( last frame in teh movieclip) with the text time and then when the movie clip starts again it should say place and so on and so forth.. depending on how many textline variables i define in the text file?
View 5 Replies
May 30, 2010
I have a search and results page that I would like to highlight the keywords that were searched for, in the text of the results. It was suggested that I use TextLine for this, but I am having trouble figuring out how to make it work. I started a simple, compilable dummy application and was hoping someone could give me some tips on how to continue:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[code]....
View 2 Replies
May 10, 2009
how to create text input in flash.text.engine.i not found property for that in elementFornat ,TextLine,TextBox and...like type priperty in TextFiled
View 3 Replies
Nov 19, 2010
I have an odd problem in CS4/AS3 with one of my flash files where text is incorrectly rendered if the movieclip containing the text has a 3d matrix transform and quality is set to medium or low. It is easy to reproduce:
[Code]...
View 11 Replies
Oct 5, 2010
I am working on a as3 project in which the user select a font from Combo Box and that font SWF should be loaded Dynamically and then i need to change the font of the Dynamic text field.
I have swf font files downloaded from [URL]
My question is that how can i load the font swf dynamically from server and add them to the library and how can i use that swf to change the font of dynamic text field.
if there are embedded fonts in library the i can access them using this- --
var fontList:Array = Font.enumerateFonts();
for( var i:int=0; i<fontList.length; i++ )
{
trace( "font: " + fontList[ i ].fontName );
}
But How to use dynamically loaded Font swf as a font type.
View 1 Replies
Jun 16, 2010
How the heck do you Kern in Flash CS5 while using the new TLF text engine?
There's no letter-spacing control and the keyboard shortcut doesn't work.
I'm not interested in auto-kerning. I'm looking to tighten up large text like headlines and logos and stuff.I'm starting to suspect it can't do it.
View 8 Replies
Apr 29, 2009
in the TextFormat has align property to set alignment ;Code: Select allvar tfo:TextFormat=new TextFormat();tfo.align='right';how i can set alignment in the flash.text.engine
View 1 Replies
Apr 27, 2010
I am trying to something very simple but I can't find an option to do that. I have a button that updates the ElementFormat, it can take care of bold and italic but the problem is underline. I can't find an option to set it as "underlined" or "not underlined".
View 2 Replies
Jul 9, 2009
While creating one photo gallery I am facing one problem in controlling the Font Color, Font Size and other characteristics of a text loaded into a text field from an XML File. The name of the text field in question is �my_txt� it loads the title from the xml file attached herewith. how I can control the behavior of the text loaded in that text field.
[Code]...
View 1 Replies
Apr 27, 2010
I am trying to something very simple but I can't find an option to do that. I have a button that updates the ElementFormat, it can take care of bold and italic but the problem is underline. I can't find an option to set it as "underlined" or "not underlined".
View 0 Replies
Mar 15, 2011
I have a .fla file with a movieclip that has a dynamic text box in it. In my .as class file I'm setting the dynamic text's text with _clip.Score.text = "Points: " + _score.toString(). This seems like it would work but for some reason the following results happen:[code]
View 1 Replies
Dec 5, 2010
For this flash project I have a search engine that searches a XML database. This part I finally got working, but what I haven't managed to get to work yet is implement it with an input text field.
[Code]...
View 3 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
Jul 1, 2010
I am resizing a movie clips height automatically to match the height of some dynamic text that is displayed above it (will eventually be loading it from xml ). is there a way to keep a safe margin top and bottom? this is my code so far Text_Box_Graphic.height = Text_Box.height;
View 2 Replies
Nov 4, 2009
I bought a text scroller flash file and am now trying to tailor it to my needs.URL...It is composed of several movieclips which link to the an external text file. The external file starts off with this mytext= <font color="#000000" size="7">BACKGROUND</font> This file determines the size and color of the font but does not define the actual font itself, it also contains the content. There is a movieclip within the flash file where you can denote a device font or embed a font from the properties panel.Starting off I simply picked my font from the properties panel and used "anti-alias for animation". This seemed to work fine on the Flash preview and also once published online. However, once I used another computer to view my site the font changed and reverted to a default. This leads me to believe the font is linked to each computers font library. I am wondering if there is a way to override this and to link the font to a place on my server?I also tried to embed my font via the properties panel but it looks warped and unrecognizable, so thats out. Unless there is another way to embed fonts at stays true to the font? To add more fuel to the fire, the font I have to use is not html safe "Gotham" to be exact.URL,,,
View 2 Replies
Feb 11, 2010
How is it possible to replace text with the new (flashplayer 10) text engine? I've come this far:
ActionScript Code:
var font:FontDescription = new FontDescription("Arial");
var elementFormat:ElementFormat = new ElementFormat();
[Code].....
View 2 Replies
Dec 9, 2010
I have an html text field that displays content from an xml file, and a class that determines whether or not to show a scrollbar.The code that determines this is as straightforward as
if (field.maxScrollV>1){
showscrollbars()
}
And 9 times out of ten it is working. Sometimes - it seems when the html contains <li> - maxScrollV is reporting '2' and the scrollbars are showing, even though all text is visible onscreen and it will not actually scroll at all.
View 2 Replies
Jun 1, 2011
i have some problem with utilizing TLF, i need to parse through the text and get x and y for each character inside the textfield. This is what i have so far...
Getting every TextLine from the TextFlow:
if (textflow.flowComposer) {
for (var i:int = 0; i < textflow.flowComposer.numLines; i++) {
[code]....
This works for getting the bounding for each character but i still need some more data like what character is it and what font-size, font does it have? When doing a textLine.dump(); i think im getting this data but not the character, i get something called gid witch seems to point to the character in use but i don't know how to get exactly what character that is.
View 1 Replies
Aug 8, 2010
I recently purchased a flash template and after a lot of configuration and tailoring to my own requirements, I have the website look and feel exactly how I want it. I then proceeded to upload the site into cPanel and more specifically Apache, and unfortunately the display within the flash has now gone completely wrong. There are extra spaces in sentences where there were previously none and numerous images and text titles do not display any longer.his occurs in all browsers when viewed live but when viewed from my local computer via my hard drive all browsers display the content as normal??I am more of a Cisco/Network consultant therefore my knowledge in this area stretches a very small amount. I have added the Apache Handlers for .swf, .xml and the image formats but that's about as much as I know
View 9 Replies
Jul 25, 2002
i hv a bulk of text pages in my flash file. i want a search box that could identify specific keywords in those paras when asked for.
View 3 Replies
Sep 16, 2010
I have a really strange issue. If I insert a flash video from YouTube, BlipTV, JW Player etc. the text on the page is jagged and the links from the "Pages" drop down menu that overlays the video are all bunched up. This problem only occurs in Safari, you can see it for yourself here: cannot pinpoint why this is happeningEDIT: Fixed this myself by adding position: static to the list items. It seems position: relative was causing the problem.
View 1 Replies
Jan 30, 2009
I want write app with flash the receive string of user and search string into dynamic/static textbox but i want search with AND/OR feature, now How to write this app??
View 0 Replies
Jul 5, 2009
It searches for text strings then automatically selects those relevent.If I use something like -
search.text == "hmmm"
it wont find things like "poo hmmm" or "hmm" or "hm"
View 4 Replies
Dec 10, 2008
Problem 1: Flash crashes when a Blur filter is applied to a TextLine object.
Correction: It was not the Blur filter but this line, which caused a crash:
trace(tb.findNextWordBoundary(5));
whereby tb is a TextBlock element.
View 21 Replies
Jun 14, 2010
I have a function that calculates the angle between two objects (player and obj):
ActionScript Code:
private function GetAngleToPlayer():int
{
var player:* = GameHandler.instance.player;
[Code]....
It's not working as intended, for some reason I actually had to add the + 90 at the return statement for it to work.
View 9 Replies