Bidirectional text in Cocoa

Hi there,
Is there any programatic way to set the direction of a part of a sentence while the other part has an opposite direction?
For example a left to right sentence with some words in right to left:
Visual Position: ltr ltr ltr rtl rtl rtl ltr ltr
Locical Position: 1 2 3 7 6 5 8 9
Bests,
Soheil

What is bidirectional text?

Similar Messages

  • [svn] 4634: First part of glue code for allowing Halo components to use the new Text Layout Framework , in order to get functionality such as bidirectional text.

    Revision: 4634
    Author:   [email protected]
    Date:     2009-01-22 17:38:56 -0800 (Thu, 22 Jan 2009)
    Log Message:
    First part of glue code for allowing Halo components to use the new Text Layout Framework, in order to get functionality such as bidirectional text.
    Background:
    TLF is making this possible by implementing a TLFTextField class. It is a Sprite that uses TLF to implement the same properties and methods as the legacy TextField class in the Player. Thanks to the createInFontContext() bottleneck method in UIComponent, it can be used by a properly-written Halo component (such as those in Flex 3) without any modifications to the component.
    Note: Text should render similarly -- but is unlikely to render identically -- when a component uses TLFTextField vs. TextField. The width and height may be different, affecting layout; text could wrap differently; etc. This is a fact-of-life based on the fact that TLF/FTE and TextField are completely different text engines.
    Whether a Halo component uses TLF or not to render text will be determined in Flex 4 by a new style, textFieldClass. (Gumbo components always use TLF.)
    TLFTextField is currently only partially implemented. It does not yet support scrolling, selection, editing, multiple formats, or htmlText. Therefore it can only be used for simple display text, such as a Button label.
    Details:
    The TextStyles.as bucket 'o text styles now includes a non-inheriting textFieldClass style. It can be set to either mx.core.UITextField or mx.core.UITLFTextField. These are the Flex framework's wrapper classes around the lower-level classes flash.text.TextField (in the Player) and its TLF-based workalike, flashx.textLayout.controls.TLFTextField.
    The global selector in defaults.css currently sets it to mx.core.UITextField using a ClassReference directive. For the time being, all Halo components will continue to use the "real" TextField.
    The new UITLFTextField is a copy of UITextField, except that it extends TLFTextField instead of TextField. This class has been added to FrameworkClasses.as because no classes in framework.swc have a dependency on it. It will get soft-linked into applcations via the textFieldClass style.
    The TLFTextField class currently lives in a fourth TLF SWC, textLayout_textField.swc. This SWC has been added to various build scripts. The external-library-path for building framework.swc now includes all four TLF SWCs, because UITLFTextField can't be compiled and linked without them. However, since they are external they aren't linked into framework.swc.
    Properly-written Halo UIComponents access their text fields only through the IUITextField interface, and they create text fields like this:
    textField = IUITextField(createInFontContext(UITextField));
    (The reason for using createInFontContext() is to support embedded fonts that are embedded in a different SWF.)
    The createInFontContext() method of UIComponent has been modified to use the textFieldClass style to determine whether to create a UITextField or a UITLFTextField.
    With these changes, you can now write code like
    to get two Buttons, the first of which uses UITextField (because this is the value of textFieldClass in the global selector) and the second of which uses UITLFTextField. They look very similar, which is good!
    Currently, both Buttons are being measured by using an offscreen TextField. A subsequent checkin will make components rendering using UITLFTextField measure themselves using an offscreen TLFTextField so that measurement and rendering are consistent.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Deepa
    Modified Paths:
        flex/sdk/trunk/asdoc/build.xml
        flex/sdk/trunk/build.xml
        flex/sdk/trunk/frameworks/projects/framework/build.xml
        flex/sdk/trunk/frameworks/projects/framework/defaults.css
        flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITLFTextField.as

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • Bidirectional text in java swing for macintosh

    Hi,
    I have a problem in displaying bidirectional text in Swing text components in macintosh .But in awt components it is displayed properly.Please advice
    Thanks

    What is bidirectional text?

  • Support for Arabic text and Direction:rtl

    I am using HTML/CSS/Javascript to develop my application.
    I have been trying to get direction:rtl (right to left) to
    work to display Arabic text in the right form with no luck.
    Does Adobe AIR lack the support for this feature ? If so,
    what are the alternatives to Adobe AIR ??
    I hope one of the Adobe employees reply to this....

    > Any update on the Arabic support in Air ??
    http://labs.adobe.com/technologies/textlayout/
    "Bidirectional text, vertical text and over 30 writing
    systems including Arabic, Hebrew, Chinese, Japanese, Korean, Thai,
    Lao, the major writing systems of India, and others.
    Selection, editing and flowing text across multiple columns
    and linked containers, and around inline images"

  • Text Layout Framework columncount Undo problem

    Text Layout Framework columncount Undo problem ::
        The number of times columncount is changed it gets applied to textflow
    and those number of operation is stored in undoStack(UndoManger).But when i
    undo it, it comes back to intial state, without undoin step by step.
    I have given my source code..
    Y so or any other alternative to achieve this..
    Thanx in advance..  
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()">
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.container.ContainerController;
                import flashx.textLayout.conversion.ITextImporter;
                import flashx.textLayout.conversion.TextConverter;
                import flashx.textLayout.edit.EditManager;
                import flashx.textLayout.edit.IEditManager;
                import flashx.textLayout.edit.ISelectionManager;
                import flashx.textLayout.edit.SelectionState;
                import flashx.textLayout.elements.InlineGraphicElement;
                import flashx.textLayout.elements.ParagraphElement;
                import flashx.textLayout.elements.TextFlow;
                import flashx.textLayout.events.SelectionEvent;
                import flashx.textLayout.events.StatusChangeEvent;
                import flashx.textLayout.formats.Direction;
                import flashx.textLayout.formats.TextLayoutFormat;
                import flashx.undo.UndoManager;
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                import mx.controls.CheckBox;
                import mx.events.FlexEvent;
                import mx.events.SliderEvent;
                import spark.components.Group;
                import spark.components.TextArea;
                import spark.core.SpriteVisualElement;
                public var directions:ArrayCollection = new
    ArrayCollection(
                        {label:"Left-to-Right",
    data:Direction.LTR},
                        {label:"Right-to-Left",
    data:Direction.RTL}
                private var _textContainer:SpriteVisualElement = null;
                private static const textInput:XML = <TextFlow
    xmlns="http://ns.adobe.com/textLayout/2008">
                    <div>
                        <p><span>The Text Layout Framework is
    an extensible library, built on the new text engine in Adobe Flash Player 10,
    which delivers advanced, easy-to-integrate typographic and text layout features
    for rich, sophisticated and innovative typography on the web.
                    Some benefits provided by this framework
    include: 1) rich typographical controls, including kerning, ligatures,
    typographic case, digit case, digit width and discretionary hyphens
                    2) cut, copy, paste, undo and standard keyboard
    and mouse gestures for editing 3) selection, editing and flowing text across
    multiple columns and linked containers
                    4) bidirectional text, vertical text and over
    30 writing scripts including Arabic, Hebrew, Chinese, Japanese, Korean, Thai,
    Lao, Vietnamese, and others
                    5) vertical text, Tate-Chu-Yoko (horizontal
    within vertical text) and justifier for East Asian typography. Try editing this
    text and playing with the options below! Notice an inline image is also
    included.</span></p>
                    </div>
                    </TextFlow>;
                private var _textFlow:TextFlow;
                private function init():void {
                    _textContainer = new SpriteVisualElement();
                    canvas.addElement(_textContainer);
                    var importer:ITextImporter =
    TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
                    _textFlow = importer.importToFlow(textInput);
                    _textFlow.flowComposer.addController(new
    ContainerController(_textContainer, canvas.width-40, canvas.height));
                    _textFlow.interactionManager = new
    EditManager(new UndoManager());
                    _textFlow.flowComposer.updateAllControllers();
                private function changeNoColumns(event:Event):void {
                    var tlf:TextLayoutFormat = new
    TextLayoutFormat();
                    tlf.columnCount = cols.value;
                    tlf.columnGap = 15;
                    tlf.direction = direction.selectedItem.data;
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    em.selectAll();
                    (_textFlow.interactionManager as
    EditManager).applyFormat(tlf,tlf,tlf);
                    _textFlow.flowComposer.updateAllControllers();
                protected function
    undo_clickHandler(event:MouseEvent):void
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    trace("Can undo " + em.undoManager.canUndo() +
    " can redo " + em.undoManager.canRedo());
                    em.undo();
                protected function
    redo_clickHandler(event:MouseEvent):void
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    trace("Can undo " + em.undoManager.canUndo() +
    " can redo " + em.undoManager.canRedo());
                    em.redo();
            ]]>
        </fx:Script>
        <s:Panel title="Text Layout Framework Sample" width="100%"
    height="100%">
            <s:layout>
                <s:VerticalLayout paddingTop="8" paddingLeft="8"/>
            </s:layout>
            <s:VGroup>
                <s:Group id="canvas" width="600" height="200" />
                <s:HGroup width="100%" verticalAlign="middle">
                    <s:Label text="# Columns:"/>
                    <s:NumericStepper id="cols"  minimum="1"
    maximum="20" snapInterval="1" change="changeNoColumns(event)" />
                    <s:Label text="Text Direction:"/>
                    <s:DropDownList id="direction"
    change="changeTextDirection(event)" dataProvider="{directions}"
    selectedItem="{directions[0]}"/>
                    <s:Button label="Undo"
    click="undo_clickHandler(event)"/>
                    <s:Button label="Redo"
    click="redo_clickHandler(event)"/>
                </s:HGroup>
            </s:VGroup>
        </s:Panel>
    </s:WindowedApplication>

    It cannot be reproduced with TLF 3.0 + SDK 4.5.

  • Bi-derectional text and migration from Flex 3 to Flex 4

    Hi guys, Can we migrate our application from Flex 3 to Flex 4
    in order to support bi-directional text? I have been reviewing the
    new Text Layout Framework tutorial and I found out a set of new
    components that need to be used in order to support bi-di ext.
    What about the classical Flex components that we used to use
    in our application? do I need to re-write my application with the
    TLF components in order to support bi-di? Can’t I just set
    some new properties and re-compile my application?
    Please help
    Thank You

    For Flex 4, in addition to developing new "Gumbo" components
    which have an improved skinning architecture and use TLF, the Flex
    team is also planning to make it possible to have a few TLF
    features such as bidirectional text in some or perhaps all of the
    Halo components from Flex 3. These components currently use a
    Player class known as TextField. A class called TLFTextField is
    being developed which uses TLF to implement the same APIs as
    TextField, and therefore can replace TextField in the Halo
    components.
    This work is underway but not yet complete. Only a few
    components are currently working with this approach and there is no
    way at the moment to turn on bidirectionality. We are also starting
    to develop a UI-mirroring feature to allow the entire user
    interface -- not just the text -- to become right-to-left.
    So what you need -- the ability to write Arabic and Hebrew
    applications using only legacy Halo components -- is planned for
    Flex 4.
    Gordon Smith
    Adobe Flex SDK Team

  • How will adobe Flex SDK 3.2 supports arabic text on Mac Systems

    Hi,
    We have developed a webapplication using Adobe Flex SDK 3.2. the content in the application is in arabic language. We Arabic text on Mac Systems is unreadable, but the same arabic language/text is perfect and accurate if viewed in Windows systems.
    Please help us in finding a solution.
    What we need is the arabic text should be accurate and readable on Mac systems.
    Thankyou
    regards
    sandeep

    The legacy TextField class in Flash Player -- which is the basis for all text display in Flex 3 components -- does not properly support right-to-left or bidirectional languages such as Arabic. However, the newer Flash Text Engine (FTE) APIs in Player 10, and the Text Layout Framework (TLF) library that is built on top of FTE, support bidirectional text.
    If you use Flex 3.X you will have to write directly to the FTE or TLF APIs. If you use Flex 4.X, you can just use the Spark component set, which use FTE/TLF for text display. The MX components in Flex 4 still use TextField by default but can be configured to use FTE/TLF.
    Gordon Smith
    Adobe Flex SDK Team

  • DW CS5 rtl text snippits within ltr pages

    DW CS5 on MacOS 10.7.x
    I sometimes need to embed short snippets of right-to-left text in pages that are predominently left-to-right.
    Editing around these insertions is often very difficult.  Design View and Code View fall out of synch.   Once the snippets are inserted, successful adjustments often depend on placing the editing cursor at the opposite end of the text and editing there.  Yeah,  it is really difficult confusing editing text that isn't visible at the cursor.
    Since most of the mixed material comes to me in word-processing document form, I've tried inserting
         <span DIR="RTL"> ... </span>
    around each snippet and
        <span DIR="LTR"> ... </span>
    around everything in the original .DOC or .rtf, etc., then copying-and-pasting from that dic ti  to Code View.  This seems to help.
    Suggestions for best results?
    TIA

    Ken Binney:
    Thanks for your response.    I DID ask for a workaround!  (A specific reply further down.)
    I've continued to search and found some additional relevant material:
    1) This page contains some well-thought-out  examples of inserting RTL snippets in LTR Latin English text.  See the 2 x 2  table about 1/3 of the way down,  just below the text, "This example shows how browsers that support bidirectional text behave with different DIR attribute settings."
    Note the reversals (character and right- versus left-alignment) in the right column due to using dir="LTR" and dir="RTL" directives, which are shown in the left column.    What I see  makes intuitive sense to me.  It looks the same in recent versions of Firefox, Safari, and Chrome.  Which I guess means that these modern browsers all support bidirectional text.
    I  saved this page into a local file and opened it in DW.  Hmmm,  the reversals do NOT occur.  The two sentences in each of the right-hand boxes are identical.   Which, to me, implies: 
    DW CS5 Design View does NOT support bidirectional text. 
    (A possibly equivalent statement:  DW CS5 ignores "dir=" directives.)
    2) I should have mentioned from the start that I'm using Unicode throughout.    I think MacOS uses Unicode, and that's why RTL snippets inserted in LTR Latin English text work correctly in the Mac apps I checked.   I'm guessing the underlying mechanism is described here.
    Whew!  That's really a lot of industrial-strength tekkie material, but for this discussion, I think it boils down to this:  Unicode-capable apps insert and detect non-printable "Bidi Controls" indicating text direction.   I can maintain a Hebrew snippet in (say) LibreOffice: it is fully Unicode-capable.
    Is DW CS5 fully Unicode-capable?
    3) I found this article, which specifically addresses  your workaround.   Again, some high-powered tekkie material, but the relevant bottom line seems clear enough:  don't  use CSS to control text directionality, essentially because that's too far downstream.
    4) The definitive document on this issue might be this one from W3C.
    Much more dense tekkie material, unusually well-explained, but:  My head is spinning!   For the moment I'm going to concentrate on one section, The "missing space' phenomenon", here.
    I saved the markup for the second example (circle-arrow link at right), which I presume is completely valid.  When I tried to edit in and around the Hebrew text in DW CS5, I observed the same problems:  putting the insertion point here, resulted in editing there.
    Bottom line:  The evidence I've found so far is that DW CS5 does not have full bidirectional text support and/or does not fully support Unicode.   If so, I think that this is more than sufficient to explain the poor editing results I'm seeing.
    Here's a desperate hope:   The problems I'm observing can be fixed by flipping a hidden DW switch to activate full bidirectional text/Unicode operation.
    Am I interpreting the evidence correctly?   Please feel free to correct me, prove me wrong, and suggest alternatives.  Even better, please --anyone-- suggest a simple way I can get back to my  actual work,  which requires embedding RTF snippets in LTR text flows, with normal editing capabilities.
    TIA

  • Xcode text

    Hi
    I am having a problem, hope some of you can help me!!
    I started and created applescript for my first cocoa applescript application.
    I already got all my buttons hooked up to the code BUT, I can't get the text to work.
    In plain applescript, I can get results like time or weather by return text, say text or display dialog.
    How do I display text in cocoa applescript?!!!!
    I am using Xcode not applescript editor for this project.
    Please help me!!
    Thank you so much!!

    script AppDelegate
      property parent : class "NSObject"
        @private
        NSWindow *window
        myTextView's setString_(finalstring)
        property myTextView : missing value    set tickerArray to {"GOOG"}
        set missing value to finalString
        set finalString to ""
        repeat with theTicker in tickerArray
            set impNumbers to (do shell script "curl \"http://www.google.com/finance?client=ob&q=" & theTicker & "\" | sed 's/<[^>]*>//g' | grep -A12 \"google.finance.renderRelativePerformance();\"")
            if character 1 of paragraph 12 of impNumbers = "+" then
                set posNeg to true
                else if character 1 of paragraph 12 of impNumbers = "-" then
                set posNeg to false
            end if
            set finalString to finalString & (theTicker as string)
            if (number of characters of theTicker) < 3 then
                set spacer to "                              "
                else
                set spacer to "                     "
            end if
            set finalString to finalString & spacer & (paragraph 9 of impNumbers)
            set finalString to finalString & "          " & (character 1 of paragraph 12 of impNumbers) & ((characters 2 through (number of characters of paragraph 12 of impNumbers) of paragraph 12 of impNumbers) as string)
            if (character 2 of paragraph 13 of impNumbers) as string = "-" then
                set finalString to finalString & "          " & (paragraph 13 of impNumbers) & return
                else
                set finalString to finalString & "          (" & (character 1 of paragraph 12 of impNumbers) & (characters 2 through -1 of paragraph 13 of impNumbers) & return
            end if
        end repeat
    end
    end myTextView
              on applicationWillFinishLaunching_(aNotification)
      -- Insert code here to initialize your application before any files are opened
              end applicationWillFinishLaunching_
              on applicationShouldTerminate_(sender)
      -- Insert code here to do any housekeeping before your application quits
                        return current application's NSTerminateNow
              end applicationShouldTerminate_ 
    end script
    This is what I got.
    I linked it to a NSTextField in a Cocoa applescript application but it returns on error.
    Called:  OSACompile Error
    OSACompile "Text Test/AppDelegate.applescript"
        cd "/Users/Victor/Documents/Xcode Projects/Text Test"
        /usr/bin/osacompile -l AppleScript -d -o "/Users/Victor/Library/Developer/Xcode/DerivedData/Text_Test-gcjfkcupycpcwtauqv lttrqnyeme/Build/Products/Debug/Text Test.app/Contents/Resources/AppDelegate.scpt" "Text Test/AppDelegate.applescript"
    Text Test/AppDelegate.applescript:12: error: Expected end of line, etc. but found unknown token. (-2741)
    Command /usr/bin/osacompile failed with exit code 1
    What does this mean?????
    Please help me

  • Migration from Flex 3 to Flex 4

    I've migrated my project from flex 3 to flex 4 and all it's ok, the new project work fine.
    But I created my custom TitleWindow MX style and I created a swc library from Flash builder 4, all it's ok.
    When I use my custom TitleWindow in new project (compatible with mx+spark) it work fine when I add only mx component, when I add a <s:TextArea> for example, it throw this error in run-time: Skin for ForumTitleWindow1220.boxMessaggioInput.TextArea1227 cannot be found.
    where ForumTitleWindow1220 and boxMessaggioInput are my instance.
    in particolar the error is "throw(new Error(resourceManager.getString("components", "skinNotFound", [this])));"
    in SkinnableComponent to line 698.
    why?

    For Flex 4, in addition to developing new "Gumbo" components
    which have an improved skinning architecture and use TLF, the Flex
    team is also planning to make it possible to have a few TLF
    features such as bidirectional text in some or perhaps all of the
    Halo components from Flex 3. These components currently use a
    Player class known as TextField. A class called TLFTextField is
    being developed which uses TLF to implement the same APIs as
    TextField, and therefore can replace TextField in the Halo
    components.
    This work is underway but not yet complete. Only a few
    components are currently working with this approach and there is no
    way at the moment to turn on bidirectionality. We are also starting
    to develop a UI-mirroring feature to allow the entire user
    interface -- not just the text -- to become right-to-left.
    So what you need -- the ability to write Arabic and Hebrew
    applications using only legacy Halo components -- is planned for
    Flex 4.
    Gordon Smith
    Adobe Flex SDK Team

  • Firefox puts cursor at the end of a textarea, not at the beginning, how can I change this (serious usability nightmare when working with a wiki)?

    When I edit my DokuWiki a lot of text is displayed in the textarea. Until Firefox 4 the cursor was always at the beginning of the textarea, which made it easy to scroll down to the part I needed to edit. Now the cursor is always at the end. This is a serious usability nightmare for me. How can I change it that the cursor is at the beginning of the textarea text?

    Hello cor-el,
    thanks for your answer but unfortunately, this isn't it. I can toggle bidirectional text and the whole text is changed so that it aligns on the right side. But the problem I have is that the text is still aligns on the left side, editing is left-to-right, it's just the cursor that's at the end of the text.
    Best regards & thank you
    Daniel

  • Will Adobe flex support Arabic language on Mac OS

    Hi,
    We have developed a webapplication using Adobe Flex SDK 3.2. the content in the application is in arabic language. Unfortunately the arabic language is unreadable if viewed on Mac Os. but the same arabic language/text is perfect and accurate if viewed in Windows OS. kindly help us in finding a solution.
    What we need is the arabic text should be accurate and readable if viewed in Mac OS.
    Thankyou
    regards
    sandeep

    The legacy TextField class in Flash Player -- which is the basis for all text display in Flex 3 components -- does not properly support right-to-left or bidirectional languages such as Arabic. However, the newer Flash Text Engine (FTE) APIs in Player 10, and the Text Layout Framework (TLF) library that is built on top of FTE, support bidirectional text.
    If you use Flex 3.X you will have to write directly to the FTE or TLF APIs. If you use Flex 4.X, you can just use the Spark component set, which use FTE/TLF for text display. The MX components in Flex 4 still use TextField by default but can be configured to use FTE/TLF.
    Gordon Smith
    Adobe Flex SDK Team

  • Is anyone working on a TextField-compatible wrapper for TextFlow? Is FTETextField usable?

    We have a body of existing code that depends on the venerable TextField object, but we'd like to be able to take advantage of the new bidirectional text
    capabilities in the TLF.
    I see there is a class in the SDK called FTETextField, which says it implements the TextField API. Has anyone used this
    successfully to emulate a TextField with existing code?  I saw some blog entries as recently as February saying that
    the FTETextField was working only partially. Or are there other alternatives that people have been using?
    I have been thus far writing my own collection of compatibility routines, and am not sure whether to continue with that approach or try to work
    with the FTETextField as it stands, hoping it will sustain further improvements and support.
    Thanks,
    Henry

    There is a swc in the Adobe Flash CS 5 application (Flash Pro). If you look in <Flash application folder>/Common/Configuration/ActionScript 3.0/libs you will find a file named tlfRuntime.swc. You should be able to use this w/Flash Builder, although I'm not certain if anyone has done that yet. Anyway, you can use the class TLFTextField which should do what you want. But please note that this class is not included in the Open Source distribution. TLFTextField is documented in the AS documentation on Adobe's web site, and it does support the right-to-left layout direction, and the editing of it as well.
    Hope that works for you.

  • Column number of caret position

    How can I get column number of caret position. Of course I can use
      int dot = editorPane.getCaret().getDot();
      Element root = editorPane.getDefaultRootElement
      int lineIndex = root.getElementIndex(dot);
      Element lineElement = root.getElement(lineIndex);
      int lineStartOffset = lineElement.getStartOffset();
      int column = dot - lineStartOffset + 1;
    to find the column in a unidirectional text! But what I should do for bidirectional text that has Hebrew, Arabic, or another RTL language? Also with a monospaced font the code
      int dot = editorPane.getCaret().getDot();
      double x = editorPane.modelToView(dot).getX();
      int column = (int) x / someFontMetrics.stringWidth("0") + 1; This won't help anymore. What should I do? The code
      editorPane.getUI().modelToView(editorPane, dot, dotBias) won't work too. First because the dotBias cann't be accessed in DefaultCaret. Second in some cases it probably won't solve the problem.

    Thanks Stats! It won't work!
    Hmmm.... Actually many unicode characters have no width, such as \u064E (Arabic Fatha). Some of them are only for visual ordering purpose, such as \u202A (Left to Right Embedding).
    Paying more attention to English letters, we'll notice ligatures used in some fonts. For instance occurrence of the letters fi (f and i) will produce the one letter &#64257; (\uFB01).
    We saw the algorithm you suggest won't work even for English text! Two ways we have. (In fact these are two mthods I can suggest!)
    1. Using the final output after affecting ligatures and bidirectional algorithm, finding the position of the desired character!
    2. Using xy position of the caret and derive the column number for a fixed font.
    Actually I want to use the second way though the first one is easier and more efficient. That's it! All I want is just the xy position of the caret!
    But ANY IDEA?!

  • JavaFX with TreeGrid

    Good morning, I'm new here on the forum and am having some difficulties to test TreeGrid with JavaFX.
    To do this, I'm calling a html file in javafx, which aims only draw TreeGrid.
    The way I'm doing the TreeGrid returns the following error:
    [0]: Empty xml received from server from
    [0]: Can not load XML based TreeGrid
    [0]: Unknown style
    [0]: Empty xml received from server from
    In tag <bdo> I'm passing the values and Layout_Data Data_Data fixed and Upload_Format = 'json'.
    Looking at it, I thought the files and Text.xml DEFAULTS.XML were not being found, so I got to add the values Text_Url = "Grid / Text_xml" and Defaults_Url = "Grid / DEFAULTS.XML" but still giving error (have also verified the existence of these files).
    [0]: Empty xml received from server from Text_Url = 'Grid / Text.xml'
    [0]: Can not load XML based TreeGrid
    [0]: Unknown style
    [0]: Empty xml received from server from Defaults_Url = 'Grid / DEFAULTS.XML'
    So I would like to do with you as this can be fixed or if it really is possible to use TreeGrid with JavaFX.
    Thank you.

    In tag <bdo>I googled the bdo tag because I had never heard of it:
    http://www.w3schools.com/tags/tag_bdo.asp
    It is for specifying the direction of bidirectional text.
    bidirectional text is currently not supported in JavaFX, so it is unlikely to be supported in a html page hosted in WebView.
    Empty xml received from server fromYou were trying to load the html file from an internal jar resource, not hosted on a server, so that won't work unless the html file/javascript loaded has some absolute reference to a server and you actually have a server to return valid xml comsumable by whatever javascript control you are using.
    As other parts of your app are implemented in JavaFX, one approach you might want to consider is using the built-in Tree and Grid controls in JavaFX to achieve what you want rather than embedding javascript/html in WebView.

Maybe you are looking for

  • Multiple Users....One iTunes Library

    I am looking find a easier solution to a iTunes multiple user problem I have encountered.Firstly I have followed the steps outlined on numerous articles here to move the music content out of the home folder and move it to the first level of the hardd

  • Changing Pricing condition-JCV1

    Hi all i want to change the following conditon in PO ( relevant part) where in the > CVD is calculated wrong. ( 16% of Basic customs duty). ( CVD ought to be > 16% of material cost + basic customs duty). i have specified in IMG schema condition to ca

  • Template Help

    Hello all, I'm working on making a web site as easy to update as possible. I've got this site set up with PHP and MySQL using dreamweaver 8. I've set it up with a template so all pages can be updated and identical to every other page in design and la

  • Photoshop CC ver. 14.2.1  Is it the latest version? If not, how can I update the sw to the latest version?

    I have a licence for PS CC installed on Mac. I would like to know if the version I have (14.2.1) is the updated one.  If not, how can I download the latest version? Thanks in advance.

  • Issue after running OSX Update

    I have a MacBook Pro running 10.8.5 I ran the software update which required a reboot and ran until showing "About a Minute" then Hung I had to force a power off to clear it.  On Powering up it booted normally but on the last account opened Finder do