Changeset 14361 in josm for trunk/src/com/kitfox
- Timestamp:
- 2018-10-25T22:03:02+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/kitfox/svg/Tspan.java
r14331 r14361 4 4 * All rights reserved. 5 5 * 6 * Redistribution and use in source and binary forms, with or 6 * Redistribution and use in source and binary forms, with or 7 7 * without modification, are permitted provided that the following 8 8 * conditions are met: 9 9 * 10 * - Redistributions of source code must retain the above 10 * - Redistributions of source code must retain the above 11 11 * copyright notice, this list of conditions and the following 12 12 * disclaimer. 13 13 * - Redistributions in binary form must reproduce the above 14 14 * copyright notice, this list of conditions and the following 15 * disclaimer in the documentation and/or other materials 15 * disclaimer in the documentation and/or other materials 16 16 * provided with the distribution. 17 17 * … … 27 27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 * OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 29 * OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 31 * Mark McKay can be contacted at mark@kitfox.com. Salamander and other 32 32 * projects can be found at http://www.kitfox.com … … 36 36 package com.kitfox.svg; 37 37 38 import com.kitfox.svg.util.FontSystem;39 import com.kitfox.svg.xml.StyleAttribute;40 38 import java.awt.Graphics2D; 41 39 import java.awt.Shape; … … 45 43 import java.awt.geom.Point2D; 46 44 import java.awt.geom.Rectangle2D; 45 46 import com.kitfox.svg.util.FontSystem; 47 import com.kitfox.svg.xml.StyleAttribute; 47 48 48 49 /** … … 229 230 //Get font 230 231 Font font = diagram.getUniverse().getFont(fontFamily); 231 if (font == null )232 if (font == null && fontFamily != null) 232 233 { 233 234 font = FontSystem.createFont(fontFamily, fontStyle, fontWeight, (int)fontSize); … … 243 244 float cursorX = (float)cursor.getX(); 244 245 float cursorY = (float)cursor.getY(); 245 246 246 247 String drawText = this.text; 247 248 drawText = drawText.trim(); … … 255 256 cursorX += dx[i]; 256 257 } 257 258 258 259 if (y != null && i < y.length) 259 260 { … … 263 264 cursorY += dy[i]; 264 265 } 265 266 266 267 xform.setToIdentity(); 267 268 xform.setToTranslation(cursorX, cursorY); … … 322 323 // } 323 324 //// i++; 324 // 325 // 325 326 // xform.setToIdentity(); 326 327 // xform.setToTranslation(cursorX, cursorY); … … 342 343 // cursorX += glyphMetrics.getAdvance() + letterSpacing; 343 344 // } 344 // 345 // 345 346 // cursor.setLocation(cursorX, cursorY); 346 347 // } … … 351 352 float cursorX = 0; 352 353 float cursorY = 0; 353 354 354 355 if (x != null) 355 356 { … … 439 440 float cursorX = 0; 440 441 float cursorY = 0; 441 442 442 443 FontRenderContext frc = g.getFontRenderContext(); 443 444
Note:
See TracChangeset
for help on using the changeset viewer.