diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/InlineBoxing.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/InlineBoxing.java index ce68a95e9..d3af33dde 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/InlineBoxing.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/InlineBoxing.java @@ -27,6 +27,7 @@ import org.w3c.dom.Element; +import com.openhtmltopdf.bidi.BidiSplitter; import com.openhtmltopdf.bidi.ParagraphSplitter.Paragraph; import com.openhtmltopdf.css.constants.CSSName; import com.openhtmltopdf.css.constants.IdentValue; @@ -337,7 +338,8 @@ private static void startNewInlineLine(LayoutContext c, BlockBox box, int breakA List pendingInlineLayers, int lineOffset, InlineBox inlineBox, LineBreakContext lbContext) { IdentValue align = inlineBox.getStyle().getIdent(CSSName.TEXT_ALIGN); - if (align != IdentValue.LEFT) { + if (align != IdentValue.LEFT && + (align != IdentValue.START || inlineBox.getTextDirection() != BidiSplitter.LTR)) { current.line.trimTrailingSpace(c); }