I'm using multicell() in FPDF (PHP) to get justified text. For some reason Cyrillic (Russian) text is not properly handled by this function when width is set to 0 (0 is supposed to extend text up to the right margin of the page.).
Example (I'm using first English, then Russian paragraphs of text):
$pdf->MultiCell(0,5,'
Nam eleifend lorem eros. Donec vel condimentum sapien. Praesent eu dui quis nulla mattis lobortis. Morbi felis tellus, malesuada sit amet dapibus non, condimentum vel massa. Mauris consectetur dolor quis nunc vehicula, at pulvinar tortor euismod. Phasellus sed diam ac est dictum placerat. Ut vel odio neque. Phasellus euismod eget nibh sit amet egestas. Pellentesque vehicula, turpis sed fermentum ultrices, magna tortor maximus massa, eget consequat ipsum arcu eget ipsum. Morbi eleifend sem quis dolor efficitur aliquam. Phasellus ut egestas dolor. Nunc ultrices vel erat in consequat. Suspendisse ultricies scelerisque nisi a lacinia. Proin sed arcu laoreet, cursus ipsum vitae, sodales tellus. Nam vitae sodales nulla, id auctor metus. Cras quis sapien urna.
Nam bibendum nisl dignissim consequat hendrerit. Sed rutrum posuere hendrerit. Sed hendrerit, arcu ut finibus efficitur, tellus metus iaculis tortor, et eleifend quam risus ac mi. Praesent in arcu quis diam hendrerit dapibus id at tellus. Pellentesque accumsan ligula id augue eleifend hendrerit a nec quam. Integer nibh eros, efficitur non lectus a, viverra lobortis turpis. Cras vitae bibendum nunc. Aenean eu placerat eros, eget dictum massa. Nullam vel diam iaculis, tincidunt libero sed, ultrices sapien. Suspendisse maximus diam nunc, efficitur finibus ex fringilla in.
?‘???????µ?????‹?? ?????? ?????????????????????? ?????±?»?? ?? ???‚?°?????°???‚?µ ISO 4217 ??” RUB, ?†???„?????????? ??” 643; ???? ???µ???µ?¶?????? ???µ?„???????‹ 1998 ???????° ?????????»???·?????°?»???? ?????? RUR (810)[9]. ??‚???‚ ?†???„?????????? ?????? ??” 810 ??” ???????????»?¶?°?µ?‚ ?????????»???·?????°?‚?????? ???»?? ???????µ???°?†???? ?±?°???????????????… ???‡?µ?‚???? ?? ?? ???°???‚?????‰?µ?µ ?????µ????[10]. ???„???†???°?»?????‹?? ???????????» ??” ?‚? ??” ?±?‹?» ???‚???µ???¶???‘?? 11 ???µ???°?±???? 2013 ???????°[11].
???? ???°?????‹?? ?°???µ???‚???‚???° Bloomberg, ?? ???µ?¶?±?°???????????????? ???±???????‚?µ ?? ???????‚?µ???µ SWIFT ?? ???µ???????? ?? ???°?? 2013 ???? ???°?? 2014 ?????????? ?????»?? ?????????????????????? ?????±?»?? ???????‚?°?????»?° 0,35 % (0,62 % ?????????? ???°???µ?µ). ?????? ???‚???? ?????»?? ?°???µ???????°???????????? ?????»?»?°???° (?·?° ?‚???‚ ?¶?µ ?????????µ?¶???‚???? ?????µ???µ????) ??” 42 %, ?µ?????? ??” 32 %, ???°???? ??” 1,47 %. ?’ ?†?µ?»???? ?? ???µ?¶?±?°???????????????… ???°???‡?‘?‚?°?… ?????±?»?? ?·?°?????» 18 ???µ???‚?? ?????µ???? ?????µ?… ???°?»???‚ ???????°[12].
',0,'J');
This is the output:
English text is properly justified while Russian is terminated elsewhere.
I tried using different fonts, same result.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.