diff -r f4ba1d08a00c javafx-ui-common/src/com/sun/javafx/scene/text/TextLayout.java --- a/javafx-ui-common/src/com/sun/javafx/scene/text/TextLayout.java Mon Nov 19 17:00:44 2012 -0800 +++ b/javafx-ui-common/src/com/sun/javafx/scene/text/TextLayout.java Tue Nov 20 16:50:36 2012 -0800 @@ -17,7 +17,8 @@ static final int FLAGS_HAS_COMPLEX = 1 << 4; static final int FLAGS_HAS_EMBEDDED = 1 << 5; static final int FLAGS_WRAPPED = 1 << 6; - static final int FLAGS_LAST = 1 << 7; + static final int FLAGS_RTL_BASE = 1 << 7; + static final int FLAGS_LAST = 1 << 8; static final int ANALYSIS_MASK = FLAGS_LAST - 1; diff -r f4ba1d08a00c javafx-ui-common/src/javafx/scene/text/Text.java --- a/javafx-ui-common/src/javafx/scene/text/Text.java Mon Nov 19 17:00:44 2012 -0800 +++ b/javafx-ui-common/src/javafx/scene/text/Text.java Tue Nov 20 16:50:36 2012 -0800 @@ -138,7 +138,6 @@ * Creates an empty instance of Text. */ public Text() { - setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT); InvalidationListener listener = new InvalidationListener() { @Override public void invalidated(Observable observable) { checkSpan(); @@ -146,6 +145,13 @@ }; parentProperty().addListener(listener); managedProperty().addListener(listener); + // I need effective orientation here +// nodeOrientationProperty().addListener(new InvalidationListener() { +// @Override public void invalidated(Observable observable) { +// +// } +// }); +// setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT); setPickOnBounds(true); } @@ -180,6 +186,24 @@ isSpan = isManaged() && getParent() instanceof TextFlow; } + @Deprecated + public void impl_transformsChanged() { + //this is bad but it only here till I get effective orientation property + super.impl_transformsChanged(); + if (!isSpan()) { + if (getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) { + layout.setDirection(TextLayout.DIRECTION_RTL); + } else { + layout.setDirection(TextLayout.DIRECTION_LTR); + } + needsTextLayout(); + } + } + + public boolean isAutomaticallyMirrored() { + return false; + } + private void needsFullTextLayout() { if (isSpan()) { /* Create new text span every time the font or text changes @@ -235,6 +259,11 @@ layout.setContent(string, font); layout.setAlignment(getTextAlignment().ordinal()); layout.setWrapWidth((float)getWrappingWidth()); + if (getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) { + layout.setDirection(TextLayout.DIRECTION_RTL); + } else { + layout.setDirection(TextLayout.DIRECTION_LTR); + } } return layout; }