Changeset 10787 in josm for trunk/src/com/kitfox/svg/Tspan.java
- Timestamp:
- 2016-08-12T03:16:58+02:00 (10 years ago)
- File:
-
- 1 edited
-
trunk/src/com/kitfox/svg/Tspan.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/kitfox/svg/Tspan.java
r8084 r10787 231 231 { 232 232 font = new FontSystem(fontFamily, fontStyle, fontWeight, (int)fontSize); 233 // addShapeSysFont(addShape, font, fontFamily, fontSize, letterSpacing, cursor); 234 // return; 235 } 236 237 FontFace fontFace = font.getFontFace(); 238 int ascent = fontFace.getAscent(); 239 float fontScale = fontSize / (float) ascent; 233 } 240 234 241 235 AffineTransform xform = new AffineTransform(); 242 243 strokeWidthScalar = 1f / fontScale;244 236 245 237 float cursorX = (float)cursor.getX(); 246 238 float cursorY = (float)cursor.getY(); 247 239 248 // int i = 0;249 250 240 String drawText = this.text; 251 241 drawText = drawText.trim(); … … 267 257 cursorY += dy[i]; 268 258 } 269 // i++;270 259 271 260 xform.setToIdentity(); 272 261 xform.setToTranslation(cursorX, cursorY); 273 xform.scale(fontScale, fontScale);274 262 if (rotate != null) 275 263 { … … 287 275 } 288 276 289 cursorX += fontScale *glyph.getHorizAdvX() + letterSpacing;277 cursorX += glyph.getHorizAdvX() + letterSpacing; 290 278 } 291 279
Note:
See TracChangeset
for help on using the changeset viewer.
