Revision 39274

View differences:

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
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;
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/impl/AbstractVectorialLegend.java
159 159

  
160 160
        int resolution = properties.getPrintQuality();
161 161

  
162
        if (resolution == PrintAttributes.PRINT_QUALITY_NORMAL) {
163
            dpi = 300;
164
        } else if (resolution == PrintAttributes.PRINT_QUALITY_HIGH) {
165
            dpi = 600;
166
        } else if (resolution == PrintAttributes.PRINT_QUALITY_DRAFT) {
167
            dpi = 72;
162
        if (resolution == PrintAttributes.PRINT_QUALITY_DRAFT
163
            || resolution == PrintAttributes.PRINT_QUALITY_NORMAL
164
            || resolution == PrintAttributes.PRINT_QUALITY_HIGH) {
165
            dpi = PrintAttributes.PRINT_QUALITY_DPI[resolution];
168 166
        }
169 167

  
170 168
        FeatureSet featureSet = null;
branches/v2_0_0_prep/libraries/libCompat/src/org/gvsig/compat/print/PrintAttributes.java
12 12
	/**
13 13
	 * Constant to indicate a poor printing quality (useful for drafts, etc) 
14 14
	 */
15
	public static final int PRINT_QUALITY_DRAFT = 0;
15
    public static final int PRINT_QUALITY_DRAFT = 0;
16 16
	/**
17 17
	 * Constant to indicate a normal printing quality 
18 18
	 */
......
23 23
	public static final int PRINT_QUALITY_HIGH = 2;
24 24
	
25 25
	/**
26
	 * DPI standard values associated with indices
27
	 */
28
    public static final int[] PRINT_QUALITY_DPI = { 72, 300, 600 };
29
	
30
	/**
26 31
	 * Gets the print quality value for this object.
27 32
	 * @return the print quality value for this object.
28 33
	 */

Also available in: Unified diff