File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
tests/PhpWordTests/Writer/RTF/Style Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ protected function escapeMultibyteCharacter($code)
5656 protected function escapeSingleValue ($ input )
5757 {
5858 $ escapedValue = '' ;
59- $ utf16 = mb_convert_encoding ($ input , 'UTF-16BE ' , 'UTF-8 ' );
59+ $ utf16 = ( string ) mb_convert_encoding ($ input , 'UTF-16BE ' , 'UTF-8 ' );
6060 $ utf16len = strlen ($ utf16 );
6161 for ($ i = 0 ; $ i < $ utf16len ; $ i += 2 ) {
6262 $ code = (ord ($ utf16 [$ i ]) << 8 ) | ord ($ utf16 [$ i + 1 ]);
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ public function write()
137137 $ content .= $ this ->getValueIf ($ style ->getKerning () !== null , '\kerning ' . round ($ style ->getKerning () * 2 ));
138138
139139 // noProof
140+ // This is also specified above as \\langnp{$langId}
141+ // Not sure why, or if, both are needed.
140142 $ content .= $ this ->getValueIf ($ style ->isNoProof (), '\noproof\lang1024 ' );
141143
142144 // Background-Color
Original file line number Diff line number Diff line change @@ -235,6 +235,12 @@ public function testFontLang(): void
235235 $ style ->setLang (Language::EN_US );
236236 $ expect = '\lang1033\ltrch ' ;
237237 self ::assertEquals ($ expect , $ this ->removeCr ($ writer ));
238+
239+ $ style ->setRTL (false );
240+ $ style ->setLang (Language::EN_US );
241+ $ style ->setNoProof (true );
242+ $ expect = '\langnp1033\noproof\lang1024\ltrch ' ;
243+ self ::assertEquals ($ expect , $ this ->removeCr ($ writer ));
238244 }
239245
240246 /**
You can’t perform that action at this time.
0 commit comments