Skip to content

RTL Support and font style issue #558

@dorvega

Description

@dorvega

First, this is a very good library.
Second: I've got two issues with RTL

  1. I'm trying to implement style in Hebrew document as following:
    $section = $phpWord->addSection();
    $mainTitle = $section->addTextRun(array('align' => 'center'));
    $mainTitle->addtext(htmlspecialchars('כותרת ראשית'),array('rtl' => true, 'size' => 25, 'bold' => true, 'underline' => 'single'));

    but the bold attribute doesn't work.

  2. I'm trying to define style like this:
    $textFontStyle = array('rtl' => true); $phpWord->addFontStyle('textFontStyle', $textFontStyle);
    $textParagraphStyle = array('align' => 'right');
    $phpWord->addParagraphStyle('textParagraphStyle', $textParagraphStyle);
    $personalInfo = $section->addTextRun('textParagraphStyle');
    $personalInfo->addText( htmlspecialchars('שם:', ENT_COMPAT, 'UTF-8'), 'textParagraphStyle', 'textFontStyle' );
    $personalInfo->addText( htmlspecialchars(' '.$_POST['first_name'].' '.$_POST['last_name'] , ENT_COMPAT, 'UTF-8'), 'textParagraphStyle', 'textFontStyle' );

    But, the RTL is not working.

can someone can help me with that?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions