Revision 39274 branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java

View differences:

AttrInTableLabelingStrategy.java
115 115

  
116 116
	private void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
117 117
			Cancellable cancel, PrintAttributes props) throws ReadException {
118
	    
118 119
		double scale = viewPort.getScale();
119 120

  
120 121
		SimpleTextSymbol sym = new SimpleTextSymbol();
......
199 200
						size = sym.getFont().getSize();
200 201
					}
201 202

  
203
                    double the_dpi = MapContext.getScreenDPI();
204
                    if (props != null) {
205
                        int len = PrintAttributes.PRINT_QUALITY_DPI.length;
206
                        int priq = props.getPrintQuality();
207
                        if (priq < 0 || priq >= len) {
208
                            throw new ReadException(featureStore.getName(),
209
                                new Exception("Bad print quality value: "
210
                                    + priq));
211
                        } else {
212
                            the_dpi = PrintAttributes.PRINT_QUALITY_DPI[priq];
213
                        }
214
                    }
215
	                    
202 216
					size = CartographicSupportToolkit.
203 217
								getCartographicLength(this,
204 218
													  size,
205 219
													  viewPort,
206
													  MapContext.getScreenDPI());
220
													  the_dpi);
207 221
					if (size <= MIN_TEXT_SIZE) {
208 222
						// label is too small to be readable, will be skipped
209 223
						// this speeds up the rendering in wider zooms
210 224
						continue;
211 225
					}
212 226

  
213
					sym.setFontSize(size);
227
					
228
					/*
229
					 * ym.setFontSize(int) assumes dpi = 72
230
					 */
231
                    sym.setFontSize(size*72/the_dpi);
232
                    
214 233

  
215 234
					if (useFixedColor){
216 235
						color = fixedColor;

Also available in: Unified diff