You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RC1 fontRenderingContext does not seem to have proper hints for vector drawing. implementation leads to side-effects for example when fonts are drawn in vertically compressed way. Unfortunately I cannot produce simple test-case right now.
The renderingHints seems to be empty by default, but at least VALUE_FRACTIONALMETRICS_ON should be specified. Also the bitmap resolution is not reflecting any rasterization resolution being done later in process.
But as vector image is being created, code like
AffineTransform vectorFontScaling = new AffineTransform();
vectorFontScaling.setToScale( 100.0, 100.0);
fontRenderContext = new FontRenderContext( vectorFontScaling, true, true );
would give more predictable results (tested to remove the problems). This would basically tell to ignore anything relating to the rasterization in font handling.
If fonts are being rasterized (are they in PdfBox?), then fontRenderContext should be based on correct resolution of bitmap in order to produce good results.
The text was updated successfully, but these errors were encountered:
lpaatero
changed the title
Poor
fontRenderingContext is not good for vector drawing
Nov 17, 2021
I've just released version 0.34. It now sets rendering hint RenderingHints.KEY_FRACTIONALMETRICS to RenderingHints.VALUE_FRACTIONALMETRICS_ON by default.
In RC1 fontRenderingContext does not seem to have proper hints for vector drawing. implementation leads to side-effects for example when fonts are drawn in vertically compressed way. Unfortunately I cannot produce simple test-case right now.
Current code uses Graphics2G from bitmap:
The renderingHints seems to be empty by default, but at least VALUE_FRACTIONALMETRICS_ON should be specified. Also the bitmap resolution is not reflecting any rasterization resolution being done later in process.
But as vector image is being created, code like
would give more predictable results (tested to remove the problems). This would basically tell to ignore anything relating to the rasterization in font handling.
If fonts are being rasterized (are they in PdfBox?), then fontRenderContext should be based on correct resolution of bitmap in order to produce good results.
The text was updated successfully, but these errors were encountered: