-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP WORD reader - how to access the “Scale” property of a font #1853
Comments
It was decided independently. The problem is that the vendor\phpoffice\phpword\src\PhpWord\Reader\2007\AbstractPart class has a readFontStyle () method that generates default fields for reading in the $styleDefs variable (array). In these fields, add 'spacing'=> array(self::READ_VALUE, 'w:spacing'), 'scale' => array (self::READ_VALUE, 'w:w'). It is not clear why these fields were not there in the first place. It doesn't affect the speed in any way. The question is closed. |
I read the .docx file with the PHPWORD library. When iterating over the "sections" array, I get access to the "TextRun" element, in which I iterate over the "Text"elements (objects). The "Text" object has properties that are obtained using the $font = $text->getFontStyle () method. There is very little information about readers in the documentation. Reading properties using the method $fontFamily = $font->getName(). The size, color, and so on properties are read normally, but the "scale" property and some other properties are always empty. Who can tell you how to pull properties from the text? What was tried: different versions of the PHPWord library, viewing the entire object after reading $phpWord = $objReader->load($filename); debug($phpWord); does not give a positive result (the object is larger, but there are no properties anywhere either). Another feature noticed is that if the text style is set by default, the font size property remains empty, and if the font is changed, the value appears. The scale of course changed in different values in the document, but the value did not appear in the property. Is the reader working incorrectly? How to fix it. Thanks.
The text was updated successfully, but these errors were encountered: