TLF word adornment
Hi all,
I have seen an example of spell check adornment(http://www.matthewfabb.com/examples/tlf/spell_check_adornment.html). As tlf is not providing in-built functionality of spell check. So I also have implemented the same but I am facing some problems that I would like to ask. With the positive hope I would like to ask you my problems. The problems are as follows:
1. Getting red underline:
I tried to get the misspelt word with red underline but I didn't get how to do so? I have underlined the word using textDecoration property of span & color. But I am getting the world also in red. Can you please suggest me idea how to do?
2. TLF performance
Using Mihai Corlon example(http://corlan.org/2009/01/19/how-to-use-text-layout-framework-in-flex-32-or-air-15/). What I am doing is: on every space(keydown event) export flow xml(var xmlOut:XML = TextFilter.export(_textFlow,TextFilter.TEXT_LAYOUT_FORMAT,ConversionType.XML_TYPE) as XML;) then split each word in spans, on the basis of word correct or incorrect additional properties are added for misspelt(textDecoration='underline' & color='0xff0000'). Now this processed XML is imported to textflow(_textFlow = TextFilter.importToFlow(textInput, TextFilter.TEXT_LAYOUT_FORMAT);) with new container(Sprite) removing the old one.
I think there is something where I am doing wrong(importing the flow again, add/ remove container). All this make results in performance issues.
I would like to know that how its done on every character.
For the above all the problems existing with the TLF we are going to loose this platform & the project.
Help me in finding the alternatives.
Thanks in advance
Hi all,
I got the code for the spell check adornment. I have attached it. It sovles my problem 1 of getting red underline. But I am still having the problem 2 of performance.
What I understood from the code is:
The adornment is done on CompositionCompletionEvent.COMPOSITION_COMPLETE event.
I think may be this is resulting in low performance.
Suggest me the alternative to improve the performance.
Thanks in advance
Similar Messages
-
Problem with getting word count in TLF text
Hi,
I want to get the word count from my TLF text, but the problem is that I am not being able to handle th case for space.
I am using the findNextWordBoundary property of ParagraphElement as shown below:
private function countWords( para : ParagraphElement ) : void
var wordBoundary:int = 0;
var prevBoundary:int = 0;
while ( wordBoundary != para.findNextWordBoundary( wordBoundary ) )
// If the value is greater than 1, then it's a word, otherwise it's a space.
if ( para.findNextWordBoundary( wordBoundary ) - wordBoundary > 1)
wordCount += 1;
prevBoundary = wordBoundary;
wordBoundary = para.findNextWordBoundary( wordBoundary );
// If the value is greater than 1, then it's a word, otherwise it's a space.
if ( wordBoundary - prevBoundary > 1 )
var s:String = para.getText().substring( prevBoundary, wordBoundary );
lenTotal += s.length;
Now I have 2 issues here:
If my string is for eg: Hi, I am writing in "TLF". And I want to get its word count then
1) Suppose I take the case of the string Hi, . Then para.getText().substring( prevBoundary, wordBoundary ) gives the text as Hi i.e without the comma. Same case for the string "TLF forums" , It treats each " as a single word and not the whole "TLF" as a single word. Why doesn't it compute till spaces, that should be the ideal case. So until we don't give a space it should count the whole thing as a word.
2) So now the problem is I have applied a condition if ( wordBoundary - prevBoundary > 1 ) to check if it is a space i.e. if the diff is <= 1 it is a Space. But if I use this I miss out on single words. Like for eg if I have "Hi, This is a string" ,then 'a' is ignored too.
Now I could have added a check here along with the space check that the string between prevBoundary and wordBoundary is " "(i.e a space), Then also it is a problem as then the single words like a,&,I will be ignored.
So, now I am stuck with this issue and need some help from you guys.
ThanksfindNextWordBoundary is not going to serve your purpose. I'd propose doing something like this:
// didn't test this but something like this - whitespace matches any set of 1 or more white space characters
static const whiteSpaceRegExp:RegExp = /[u0020|u000A|u000D]*/
public static function countWords( para : ParagraphElement ) : void
return para.getText().split(whiteSpaceRegExp).length;
A good list of everything considered whitespace extracted from the unicode space can be found here:
http://sourceforge.net/adobe/tlf/svn/449/tree/trunk/textLayout/src/flashx/textLayout/utils /CharacterUtil.as
In function createWhiteSpaceObject
Hope that helps,
Richard -
Word wrapping: Tab behavior in TLF editor
Hi,
I have created an editor using TLF which has word-wrapping enabled. The editor also takes in the Tab key and places it at prober position. In case you insert Tab at the beginning of the line except for the first line then the TAB is inserted in the previous line and it does not get wrapped.
Is there any way in which I can acheive word wrapping for Tabs? I have observed similar behavior for SPACE as well.
Why is such a behavior in the both the cases?We are using the TLF bundled with Flex 4.1.0.16076, latest production release. You can verify the problem here in this demo:
http://labs.adobe.com/technologies/textlayout/demos/
Type two lines, make sure they wrap. At the beginning of the second line press the tab key multiple times. The tabs will stack up on the end of the first line.
If this is fixed in a newer version of TLF, is it safe to use with flex 4.1?
Thanks,
Ryan -
Embedding Images in TLF like MS Word
Hi All i am creating an Editor using TLF and i want to insert images in that. by Using InlineGraphicsElement we can achieve this. But i have a problem i want to give the functionality like MS Word. That We insert images in Word and later we open the document in any machine we are able to see that embedded images.
I want to have this functionality in my flex editor. So that i can embed images in my document itself.
Is there any way that we can directly embed images in the document. Please let me know your thoughts or any alternative for this.
Thanks
Regards
Amar Deep Singh
+91-9718383781
[email protected]hi,
Yes this can be achieved in SAPSCRIPT and not just bullets various other symbols too can be imparted in your form printing.
SE71>PAGEWINDOWS>TEXT EDITOR-->INSERT >CHARACTERS->SAP SYMBOLS.
Choose as per your requirement.
PS. You cannot see them in your print preview and but you get them when you take the print of your form output.
Thanks
Sharath -
TLF Font Size different from Word, Excel, Google Docs
I have Times New Roman size 10 font. In Word, Excel, and Google Docs the height of "Mg" in pixels is 12 but in my application and in the TLF Demo application the height is 9 pixels.
Anyone know why?
ThanksfontSize in FlashPlayer is in pixels not points and FlashPlayer has a 72 DPI screen resolution (see flash.system.Capabilities.screenDPI). These other apps may have a better handle on actual screen DPI. You could try scaling the fontSize setting.
Regards,
Richard -
ProLoader and TLF TextFields do not work together!
I'm using ProLoader to load a .swf that uses TLF. The master .swf loads the target .swf and all code executes as expected with one minor glitch: the content of the loader is white/blank. Has anyone else seen this!?
~~~~~~~~~~~~~~~~~~~~~~~~
Here is the full bug report that I tried to send Adobe, but they cap reports at 2000 characters and provide no option for uploading a source .zip. (Seriously, Adobe?) If you have time, and follow my instructions you will see how ProLoader won't even load a .swf with TLF on its stage. (Yes, I realize this different from my problem, but I'd like to demonostrate how buggy and inconsistent ProLoader is. The simple solution would be not to use TLF, and mostly likely, I will end up doing that.)
******BUG******
ProLoader loads .swf with TLF, but ProLoader is blank.
Steps to reproduce bug:
1. Download sample files (http://helpx.adobe.com/content/dam/kb/en/141/tn_14190/attachments/Load_External_SWF.zip) from the Tech Note, Load external SWF into another SWF (http://helpx.adobe.com/flash/kb/load-external-swf-swf.html).
2. Open ExternalSWF.fla and assign it a document class.
Here is mine:
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ExternalSWF extends MovieClip {
public static var DATA_LOAD_COMPLETE:String = "ExternalSWF_DataLoadComplete";
private var data_:String;
public function ExternalSWF() {}
//This function will be called from the .swf that loaded me.
public function loadData(data:String):void
data_ = data;
dispatchEvent(new Event(DATA_LOAD_COMPLETE));
public function get data():String { return data_; }
3. On ExternalSWF.fla's stage, change a classic TextFields into a TLF TextField.
4. In Loader_Movie.fla, change all flash.display.Loader instances to fl.display.ProLoader in order to load TLF TextFields. Also, add an event listener to myLoader for Event.COMPLETE. Here are my Loader_Movie.fla's Actions:
import flash.events.Event;
import fl.display.ProLoader;
var myLoader:ProLoader = new ProLoader(); // create a new instance of the ProLoader class
var url:URLRequest = new URLRequest("ExternalSWF.swf"); // in this case both SWFs are in the same folder
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, myLoaderIsLoaded);
myLoader.load(url); // load the SWF file
addChild(myLoader); // add that instance to the display list, adding it to the Stage at 0,0
myLoader.x = 10; // move the loaded SWF 10 pixels to the right (from the left edge)
myLoader.y = 175; // move the loaded SWF 175 pixels down from the top
// (optional) load a second external SWF file
var my2ndLoader:ProLoader = new ProLoader();
var url2:URLRequest = new URLRequest("ExternalSWF2.swf");
my2ndLoader.load(url2);
addChild(my2ndLoader); // optionally, you could put the 2nd SWF beneath
// the 1st by using addChildAt(my2ndLoader, 1);
// (optional) scaling of the 2nd SWF file
my2ndLoader.scaleX = 2; // scale the SWF horizontally by 200%
my2ndLoader.scaleY = 2; // scale the SWF vertically by 200%
function myLoaderIsLoaded(event:Event):void
trace("The first .swf has loaded so add event listeners");
var swf:ExternalSWF = ExternalSWF(myLoader.content);
swf.addEventListener(ExternalSWF.DATA_LOAD_COMPLETE, allFinished);
swf.loadData("foobar");
function allFinished(event:Event):void
trace("Here is the data we loaded: " + ExternalSWF(myLoader.content).data);
Results:
[Trace] Output
ReferenceError: Error #1056: Cannot create property __id0_ on ExternalSWF.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at ExternalSWF()
ExternalSWF is invisible; 4 loading dots appear instead.
Expected results:
Both .swfs load without incident.
Trace output:
The first .swf has loaded so add event listeners
Here is the data we loaded: foobar
Additional notes:
I discovered this bug when my main/master .swf used ProLoader to load another .swf (with TLF on a symbol in the libary). In this case, the ProLoader appeared blank/white, not even the 4 loading dots. However, all the code in both .swfs still ran as expected (shown via the Output panel dumping all expected trace statements until execution finished).
Environment:
Adobe FLash Professional CS5.5, Version 11.5.1.349
(bug discovered while running "Test Movie" in IDE)
Windows 7 Professional Service Pack 1
Intel(R) Core(TM)2 Duo CPU E4600 @ 2.40GHz 2.39 GHz
RAM: 6.00 GB
64-bit Operating SystemDo you have anything that uses TLF in your preloader? It's possible that the TLF framework has made your preloader so heavy that it merely appears to not be doing anything, but the actual case is that all that stuff has to load before it can show you anything.
You may find this helpful http://jeffkamerer.com/blog/2010/08/12/using-a-custom-preloader-loop-with-tlf-text/
However, I don't really understand why you feel you have to use TLF to bring in the text from Photoshop. I think you must mean PhotoShop PSD's, because PhotoShop PNG's will not contain editable text (though Fireworks ones can). I get Photoshop comps all the time and bring the text in as Classic Text. While it's not an exact match 100% of the time, it's as close a match as you're going to get based on the limitations of Classic text. I think there's no reason for your designers to be redoing the designs--you just need to play around with the import settings and figure out what gets you close and then what tweaks you need to do to get closer.
And, to answer your question, nearly everyone creates graphics for Flash files in Photoshop, despite Fireworks being the better tool. For whatever reason, designers often aren't very adventurous when it comes to learning new tools, and nearly all art schools teach PhotoShop.
I also don't have any trouble loading CS5.5 AS3 swfs (no TLF--I just don't need the hassle) with Document Classes using an ordinary Loader. So I think there's something not right about what you're doing if you've come to the conclusion that you can't load a swf with a Document Class. Try scaling back to the bare minimum, then working up.
Finally, I just don't "get" why people do two things that you're doing (or, I do, but I think it's unnecessary and a colossal failure on Adobe's part)
Instantiating everything through code. Not only are you wasting an inordinate amount of time/code in specifying layout, you also completely lose the natural capability of Flash to compile assets throughout the whole of the swf. This means you have to have a preloader, because literally everything you ever use is embedded before the first visual frame. Contrast to using the timeline, where all you need to load the visuals for the first frame is the Document Class (which you can keep light by coding to Interfaces) and the visuals for the first frame. Anything else you need to load, you can defer to the frame that you've selected for embedding your AS Classes on.
Using a preloader at all.
My preloading strategy is very simple. I put a spinner graphic in the first frame, with the word "Loading." The playhead will stop at the frame that I've specified to use for exporting my ActionScript Classes (10--this provides enough space for the label "Loading" to be readable). When the embedded Classes and whatever is needed to display frame 11 is loaded, the playhead will continue to frame 11 by itself, with no code. On Frame 11, I have a MC that is a named instance, and I have a getter/setter pair to catch it. When the setter triggers, I know I'm ready to start the logic.
However, you could do all sorts of things, like just putting a MC there that "is" the entirety of your other logic (has what is now the Document Class of the swf you're preloading as its BaseClass).
Anyway, maybe something in my ramble will help you. -
Using Squiggly with Spark TextArea causes TLF formatting to disappear
We are using a Spark TextArea component in our application to offer more enhanced text formatting options to our users. Yesterday we downloaded Squiggly since it's the only one available that seems to support the spark components. It is highlighting misspelled words correctly and does have a nice right-click context menu with suggestions, etc. However, when we select a word from the suggestion list and it replaces it in the text area, it seems to replace the entire contents of the textarea as plain text. Any formatting on the text such as bold, italics, font sizes, underlines, all immediately disappear once the misspelled word is replaced. We're using the SpellUI implementation. Below is some of the snippets of the code we're using to implement SpellUI:
protected function createTextArea():void {
_textArea = new TextArea();
_textArea.editable = true;
_textArea.enabled = true;
_textArea.textFlow = TextConverter.importToFlow(XML(dataModel.value)[0], TextConverter.TEXT_LAYOUT_FORMAT);
_textArea.textFlow.flowComposer.updateAllControllers();
_textArea.addEventListener(FlexEvent.CREATION_COMPLETE, setupSpellCheck, false, 0, true);
private function setupSpellCheck(event:Event=null):void {
logger.debug("setupSpellCheck", "Setting up spell check system...");
_textArea.removeEventListener(FlexEvent.CREATION_COMPLETE, setupSpellCheck);
resourceManager.localeChain = [localeStr];
enableSpellCheck();
enableSpellCheckContextMenu();
private function enableSpellCheck():void {
SpellUI.enableSpelling(_textArea, localeStr);
private function enableSpellCheckContextMenu():void {
var contextMenu:Object = {add:resourceManager.getString('SquigglyContextMenu', 'add'),
enable:resourceManager.getString('SquigglyContextMenu', 'enable'),
disable:resourceManager.getString('SquigglyContextMenu', 'disable')};
SpellUI.setSpellingMenuEntries(contextMenu);
As you can see, we're constructing a new TextArea control and setting it's textFlow by importing an existing textflow XML that we have saved in our database. Once the TextArea has dispatched the FlexEvent.CREATION_COMPLETE, we are setting up the spell check system and everything works ok until you actually correct a misspelled word by selecting it from the right-click suggestions list. The text initially imported may have any number of styles applied to it as I mentioned above. Once the spelling replacement occurs, all the formatting is wiped out for the entire text area.
Any thoughts?
-Jason KringenJust to give some more details, here's the TextFlow output from our TextArea before using the spell check word replacement:
<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" lineBreak="inherit" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p direction="ltr" justificationRule="auto" justificationStyle="auto" leadingModel="auto" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" textAlign="start" textAlignLast="start" textIndent="0" textJustify="interWord"><span>Text goes in here. </span><span alignmentBaseline="useDominantBaseline" backgroundAlpha="1" backgroundColor="transparent" baselineShift="0" breakOpportunity="auto" cffHinting="horizontalStem" color="#000000" digitCase="default" digitWidth="default" dominantBaseline="auto" fontFamily="Arial" fontLookup="embeddedCFF" fontSize="28" fontStyle="normal" fontWeight="bold" kerning="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" locale="en" renderingMode="cff" textAlpha="1" textDecoration="none" textRotation="auto" trackingLeft="0" trackingRight="0" typographicCase="default">misspeled</span><span> jhkjd het </span></p></TextFlow>
And here is the TextFlow output immediately after replacing a misspelled word:
<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" lineBreak="inherit" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p><span>Text goes in here. misspeled jhkjd get </span></p></TextFlow>
So it's obviously stripping out all of the TLF formatting and simply leaving the blank <p> and <span> tags without any of the formatting details. -
Word wrap splitting single word
When I have a line that doesn't fit a single word, instead of trying again on the next parcel where it might fit, TLF (or maybe text.engine) splits the single word between multiple lines. Is there any way to change this behavior?
One my colleagues who works on the Player reminded me that there *is* an option for controlling this behavior in the Player, so I was wrong about that, I'm sorry. The fitSomething parameter to TextBlock.createTextLine would get you what you want. I think it would get you the side effect that a long word might not fit anywhere, so you see the text in the container (and posssibly also other linked containers) stop short because of a long word you can't see (the one that didn't fit). If the long word is at the start of the container, you'd see the whole container empty. But this could be what you want.
So if you're overriding our code anyway, you could also try changing the way createTextLine is called.
- robin -
How can i copy line with text and image to ms word
When I insert an image in textflow using InlineGraphicElement it works, but when I copy the line with the image to MS Word it copies only the text (not the image).
How can i copy the image to MS Word?If you want copy formatted text and image to MS Word, you need to give MS Word rtf markup, because Word can recognize rtf markup but not TLF markup.
So you need to create a custom clipboard to paste a rtf markup. It's a large feature for you, because you need a tlf-rtf converter in your custom clipboard.
TLF Custom Clipboard Example:
package
import flash.display.Sprite;
import flash.desktop.ClipboardFormats;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.ITextImporter;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.edit.EditManager;
import flashx.textLayout.elements.*;
import flashx.undo.UndoManager;
// Example code to install a custom clipboard format. This one installs at the front of the list (overriding all later formats)
// and adds a handler for plain text that strips out all consonants (everything except aeiou).
public class CustomClipboardFormat extends Sprite
public function CustomClipboardFormat()
var textFlow:TextFlow = setup();
TextConverter.addFormatAt(0, "vowelsOnly_extraList", VowelsOnlyImporter, AdditionalListExporter, "air:text" /* it's a converter for cliboard */);
private const markup:String = '<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p><span color=\"0x00ff00\">Anything you paste will have all consonants removed.</span></p></TextFlow>';
private function setup():TextFlow
var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
var textFlow:TextFlow = importer.importToFlow(markup);
textFlow.flowComposer.addController(new ContainerController(this,500,200));
textFlow.interactionManager = new EditManager(new UndoManager());
textFlow.flowComposer.updateAllControllers();
return textFlow;
import flashx.textLayout.conversion.ITextExporter;
import flashx.textLayout.conversion.ConverterBase;
import flashx.textLayout.conversion.ITextImporter;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.IConfiguration;
import flashx.textLayout.elements.TextFlow;
class VowelsOnlyImporter extends ConverterBase implements ITextImporter
protected var _config:IConfiguration = null;
/** Constructor */
public function VowelsOnlyImporter()
super();
public function importToFlow(source:Object):TextFlow
if (source is String)
var firstChar:String = (source as String).charAt(0);
firstChar = firstChar.toLowerCase();
// This filter only applies if the first character is a vowel
if (firstChar == 'a' || firstChar == 'i' || firstChar == 'e' || firstChar == 'o' || firstChar == 'u')
var pattern:RegExp = /([b-df-hj-np-tv-z])*/g;
source = source.replace(pattern, "");
var importer:ITextImporter = TextConverter.getImporter(TextConverter.PLAIN_TEXT_FORMAT);
importer.useClipboardAnnotations = this.useClipboardAnnotations;
importer.configuration = _config;
return importer.importToFlow(source);
return null;
public function get configuration():IConfiguration
return _config;
public function set configuration(value:IConfiguration):void
_config = value;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.ListElement;
import flashx.textLayout.elements.ListItemElement;
class AdditionalListExporter extends ConverterBase implements ITextExporter
/** Constructor */
public function AdditionalListExporter()
super();
public function export(source:TextFlow, conversionType:String):Object
if (source is TextFlow)
source.getChildAt(source.numChildren - 1).setStyle(MERGE_TO_NEXT_ON_PASTE, false);
var list:ListElement = new ListElement();
var item1:ListItemElement = new ListItemElement();
var item2:ListItemElement = new ListItemElement();
var para1:ParagraphElement = new ParagraphElement();
var para2:ParagraphElement = new ParagraphElement();
var span1:SpanElement = new SpanElement();
span1.text = "ab";
var span2:SpanElement = new SpanElement();
span2.text = "cd";
list.addChild(item1);
list.addChild(item2);
item1.addChild(para1);
para1.addChild(span1);
item2.addChild(para2);
para2.addChild(span2);
source.addChild(list);
var exporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
exporter.useClipboardAnnotations = this.useClipboardAnnotations;
return exporter.export(source, conversionType);
return null; -
Hi
I am trying to implement a sample of TLF with feature of Tab for paragraph like word document. If user click in paragraph and press 'Tab' then it should work like same as we experience in Word.
Can any one guide me ?
Bharat PatelBy default TLF ignores the Tab key and it's used to navigate focus. This can be changed by creating a custom Configuration and passing it into the TextConverter or the TextFlow constructor. See the flashx.textLayout.elements.Configuration class. Note that once a TextFlow is constructed its Configuration cannot be changed.
There is a defaultConfiguration that is used when no Configuration is specified. So the simplest way to have all your TextFlows insert a tab on the tab key is to add this line to the startup before any TextFlows are created.
TextFlow.defaultConfiguration.manageTabKey = true;
Note that if you are using TLF wrapped by Flex or FlashCS5 then you'll have to work through the components and APIs they provide.
Hope that helps,
Richard -
Kerning/Letterspacing Problems with TLF - and more
Hello,
I have some troubles with TLF (RichEditableText - editable) and Letterspacing/Kerning.
Problem is, that I my application uses a different rendering-engine on the server-side. Textediting happens with a Flash/Flex Client displaying serverside stored layouts, mass-printing/spoolfile generating again is being done on the server side.
Now Text looks terrible (currently most annoying when using Verdana , size 10pt). Even when typing the same word twice letterspacing of the two words looks (and is by one Pixel) diffferent.
I could life with some differences happening here and there but the Layout and resulting Paragraph height it is a complete mess. Word wrapping accours on different words in almost every line compared to the serverside template-document.
Last hope is that I am doing things wrong.
Is this correct: 10 point fontsize equals 10 pixel fontsize in Flash (as flash.system.Capabilities always says DPI is 72)?
Fonts being used are embedded in MXML style declaration.
Thanks for any help
Regards
AndreasThe server side rendering engine is a complex system wich produces multiple output formats like PDF, AFP, PCL and so on using own and 3rd Pary Modules. Resulting (printed) Documents do always match each other. I know, that there can be slight differences resulting in an unwanted Linebreak.
But in the TLF output almost nothing looks like it should - it just does not match the template (screenrendering own C# Windows Textengine) or the print output. It is not about pixel, it's such a huge difference, sadly resulting in additional lines:
Picture shows Text in our Design Tool (Windows .NET Application) - Text is Verdana (regular/bold) 10pt
TLF Version - FontFamily "Verdana", Font-Size: 10
Same Text layouted in Word 2007 matching exaktly our Layout-Tool.
Typing twice I ment typing the same word in tlf editor.
Charspace between "M" and "ü" differs between 3 and 4 pixel, the same happens with "ü" and "l" - which is not a pretty look as you can see in the image.
Regards
Andreas -
Put the TLF vertical scrollbar on the left side in flash CS4
Hi, all
I’m using Arabic words on TLF so I want to put the vertical scrollbar on the left side. But I don’t know how to do it. Could anybody give me an example?
Thanks.Hi azeem
I have been learning how to deal with arabic fonts now in flash10 and from what i have read up so far adobe has stopped updating the TLF component and it is been said it will only reappear with flash11 again. So if there is a bug with 64 bit os , then it is stuck like that for now. Another point to mention while using the forums and from personal testing is that the adobe arabic font will not handle diacritics correctly. You should try use Arial version 4 (the arial that ships with vista , the arial that shipped with xp is also faulty).
Ian Pretorius -
I need to highlight some words (search results) in TLF text editor. I am using RichEditableText.
Please tell me how I can highlight more than one word at different places (in several paragraphs or spans).
I tried to use selectRange() function in RichEditableText. but it highlights only one occurence.
Thanks.Hi,
The same kind of stuff I have performed in my application . I am fully agreed with Robin's point but to be more explanatory you can do the following :
1. Find the begin and end of the text to be highligted. You can do it by using selection manager of text flow by the properties absoluteStart and absoluteEnd of selection manager
like
var _selMgr:ISelectionManager = textFlow.interactionManager;
if(_selMgr.hasSelection())
if(_selMgr.focused)
var begin:Number = _selMgr.absoluteStart;
var end:Number = _selMgr.absoluteEnd;
2. Once you get the begin and end you can get the start and end index of TextLine of the text flow like
var startTextFlowLineIndex:int = textFlow.flowComposer.findLineIndexAtPosition(begin);
var endTextFlowLineIndex:int = textFlow.flowComposer.findLineIndexAtPosition(end);
and then get textline as
var textFlowLine:TextFlowLine;
textFlowLine = textFlow.flowComposer.getLineAt(startTextFlowLineIndex);
from text flow line you can get text line using
textFlowLine.getTextLine()
methode
3. Get the bound of the first and last atom of the text lIne to draw a rectangle as
var startbounds:Rectangle = textLine.getAtomBounds(textLine.getAtomIndexAtCharIndex(begin));
var endbounds:Rectangle = textLine.getAtomBounds(textLine.getAtomIndexAtCharIndex(end));
Next very easy you can use sprite's graphic and drwa the rectangle.
Regards,
Gaurav Pandey -
Import a word document composed in Arabic font (.ttf) into a .fla
Hello Everyone;
I am developing an advance e-book in Flash. My client has composed about 500 books in arabic using Microsoft Word. My client wants search features in this book in which the user will type something in arabic & it will search the ebook text and give him results, so I cannot convert the text into vector or image I have to keep it as text. I want Import a word document composed in Arabic font (.ttf) into a .fla file without losing its formatting. Rightnow I am able to import the font using copy/paste from the word document into Flash, but it changes the font, but I fixed it by changing the text property from "classic text" to "TLF text" which fixed the font. Even though the copy/paste method works without formatting its not practical for my project because there are thousands of pages and copy/pasting them one by one frame by frame is time consuming & not practical.
I need a method or a third party software through which I can convert the word documents into fla or swf keep the font as text & very important without messing up the font and formatting.3rd Party software that can be tested for free:
print2flash
wordflashpoint -
Revision: 4285
Author: [email protected]
Date: 2008-12-10 16:08:28 -0800 (Wed, 10 Dec 2008)
Log Message:
Exposed TLF's new textJustify property on ParagraphElement as a CSS style for Gumbo components. It works with TextBox, TextGraphic, TextView, and components that use these primitives. When text is fully justified, this property determines whether the extra pixels are added between words or between any characters.
QE Notes: Please add tests for this new functionality.
Doc Notes: None
Bugs: None
Reviewer: Jason
Modified Paths:
flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as
flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextBlockCompose r.as
flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicParagraphFormatTextS tyles.asHello xhpx,
In your media queries your changing the .gridContainer but the #LayoutDiv1 is the same. The reason the color goes away is the media query for mobile sizes doesn't have the background color. Though I would remove #LayoutDiv1 from any media query since it doesn't need to change.
http://jsfiddle.net/gCka7/
hope this helps.
Chad Smith - BCGurus.com
also, creating a jsfiddle or just a link to the site could make it easier for debuging.
Maybe you are looking for
-
I would like to know how to change my Apple ID on my iMac to my current ID
I am having trouble using iCloud on my iMac. (2011 model) When I go into it, an older email address comes up not connected to my AppleID anymore. My other devices are fine with the new appleID but I don't know where to change it on the desktop. I wen
-
Hi everybody. i've got a problem running a simple example of JNI. I'm trying to call the method MessageBox of user32.dll, that is placed on system32 of course. This is the code: import java.io.*; public class NativeMFCMsg{ static { try { //System.loa
-
Capturing the time for rendering the JSFscreen.
I have a JSF application running on WAS6.1. We have some performance issues. The JSF rendering is taking long time to render the page. All the database operation ie querying the database and leaving the prerender method is happening so fast. So how c
-
safari tries to connect to a hotel wifi even though we are not at the hotel. the wifi is not listed in settings
-
How can I get my export feature to create a word document? I have a new Macbook Air and It seems to export docs into Adobe PDF's.