Comments (3)
I made a simple test case for this. As documented on the stringWidth() method, this is always off. I.e. the sum of all single char widths will never be the width of the complete string.
This is how it looks like without the rounding like FontDesignMetrics:
And this is how it looks like with the rounding:
You can see that the first case underestimates the string width, the second ("fixed") version overestimates the stringWidth.
So relying on this is broken in any way. But with this "fix" it is now broken the same way as in the JDK. So its now more consistent.
from pdfbox-graphics2d.
I just release version 0.37 with this fix.
from pdfbox-graphics2d.
Thank you for your quick response and the new release. Much appreciated.
from pdfbox-graphics2d.
Related Issues (20)
- fontRenderingContext is not good for vector drawing HOT 2
- Adding jaxb-api in the pom of extended-tests HOT 6
- Adding test scope to outer dependencies in the pom of extended-tests HOT 1
- stop-opacity on linearGradient stops are not rendered HOT 3
- Document how to reuse / share images inside a document across different Graphics2D
- Correctly support embedding the same image with different KEY_INTERPOLATION values. HOT 1
- mapColor parameters in RGBtoCMYKColorMapper HOT 1
- What is a good way to handle "Page N of M" drawing? HOT 2
- TestPPTXRendering.testPPTXRendering failing with libapache-poi-java from Debian 12 HOT 2
- RadialGradientPaint incorrect focal point location and transition direction HOT 1
- drawIssue with incorrect argument HOT 1
- drawRect does not properly close rectangle HOT 2
- String rotation HOT 3
- Exception in RadialGradientPaint HOT 4
- System.err in PdfBoxGraphics2DFontTextDrawer HOT 8
- Draw Attributed text only supports Font, while Family/Weight/Posture is an alternate way. HOT 4
- add pdfbox 3.0.0 support HOT 3
- InternalDeprecatedCOSCloner causing JPMS module issues HOT 3
- Reuse PDFCloneUtilities.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfbox-graphics2d.