Retry formatted string update#53
Conversation
Support AttributedString wit Family, Weight, and Posture attributes
Co-authored-by: sonatype-lift[bot] <37194012+sonatype-lift[bot]@users.noreply.github.com>
Removed prelim test in favor of new test using FormattedString
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
|
I'll have a look into this PR tomorrow. Thanks for working on this. |
|
Note that in the updated code there is a specific part where I assume a horizontal move, that is in order for the translation for subscript and superscript to work properly (i.e. be back on baseline when the sub/superscript ends). This is likely the cause for the incorrect behaviour that you are seeing when there is an additional transformation that is not straight. |
|
Got back to it , to try to resolve this issue and be back on the main branch. |
|
Thanks for persisting on this. I'll likely won't have time to look into this before Thuesday. |
| <configuration> | ||
| <source>1.6</source> | ||
| <target>1.6</target> | ||
| <source>1.8</source> |
There was a problem hiding this comment.
I see why you prefer to set this to a value which allows to build with a current JDK. But we must stay on 1.6 here for compatibility with pdfbox-2.0. So you should use a JDK 8 to build this library. (E.g. Azul Zulu JDK 8 or something like this, which is current and maintained).
|
Something I completely forgot to mention in the readme: I use the Apache PDFBox Coding Conventions here, not because I find them great (I don't), but to stay in sync style wise with PDFBox. I've tested this by letting all test drivers run on this branch and then on master and compared the result. To do so, I did run all tests on master and copied the I've merged your new test drivers to master. But in your PR you deleted (I think because of a not correctly solved merge conflict) the "attributed_test_sup" test driver. As it is now, this PR would be a regression. So please look into this again when you have time. Thank you for at least trying to improve the situation here. |
|
Per the current pdfbox information it is java 7, which can be build with current jdk:
Apache PDFBox | Building PDFBox<https://pdfbox.apache.org/building.html>
PDFBox 2.0.x
* JDK 7
* Java Cryptography Extension (JCE)<https://pdfbox.apache.org/building.html#java-cryptography-extension-jce>
* Maven 3<http://maven.apache.org/>
________________________________
From: Emmeran Seehuber ***@***.***>
Sent: May 11, 2024 3:25 AM
To: rototor/pdfbox-graphics2d ***@***.***>
Cc: Frans Bouwmans ***@***.***>; Author ***@***.***>
Subject: Re: [rototor/pdfbox-graphics2d] Retry formatted string update (PR #53)
@rototor commented on this pull request.
________________________________
In pom.xml<#53 (comment)>:
@@ -102,8 +102,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.0</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.8</source>
I see why you prefer to set this to a value which allows to build with a current JDK. But we must stay on 1.6 here for compatibility with pdfbox-2.0.
—
Reply to this email directly, view it on GitHub<#53 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAE7NEENAAR5VTZCEWDW25LZBXBWVAVCNFSM6AAAAAA3BHF5O2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANJRGEYTSOBSGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
into rototor-master Reformatted using pdfbox coding conventions Changed to java 7 for compatibility with new jdk and per pdfbox guidance
|
This was a though one, spend a lot of debugging to come to the conclusion that the font actually will take all attributes from the attributed string and build the applicable transform in most cases. So now the font is created from the text attributes (that is not the TextAttribute.FONT which is a special case). |
|
Thanks doing work future here. I won't have time to look at this before next week :-( |
|
It has been a while, would be interested in getting this into a version with pdfbox 3.0 (for which you have done some work in another branch). |
|
Sorry, time has really been a rare resource on my side the last year :-( I think I did some quick tests but found some issue, but I don't remember the details... Yeah, I really should do a release of 2.x and 3.x branches with the newest releasted PDFBox versions ... but currently no idea when :-( |
|
Maybe a gentle ping to see if there is any time available to give this a push. |
|
Yeah, I see ... I set a reminder in my calender for Saturday. Hopefully that works out... |
|
I've released version 0.45 with this change and an also updated version 3.0.3 for PDFBox 3. |
|
Great, I have updated my dependencies and am now using the 3.0.3 version, all looks good. |






There was a conflict with your initial test, which has been resolved.
I do note that the output is still incorrect, but the test now shows that the attributed string (using the FormattedString to parse) results in output with sub, sup, strikethrough, bold, and italic text.