Changeset 8110 in josm for trunk


Ignore:
Timestamp:
2015-03-03T16:29:28+01:00 (5 years ago)
Author:
bastiK
Message:

see #11194 - fix rendering of Bangla script (among others) when there is a halo

Text along the line still broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8085 r8110  
    2020import java.awt.font.GlyphVector;
    2121import java.awt.font.LineMetrics;
     22import java.awt.font.TextLayout;
    2223import java.awt.geom.AffineTransform;
    2324import java.awt.geom.GeneralPath;
     
    408409            g.setStroke(new BasicStroke(2*text.haloRadius, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
    409410            g.setColor(text.haloColor);
     411            Shape textOutline;
    410412            if (gv == null) {
    411413                FontRenderContext frc = g.getFontRenderContext();
    412                 gv = text.font.createGlyphVector(frc, s);
    413             }
    414             Shape textOutline = gv.getOutline(x, y);
     414                TextLayout tl = new TextLayout(s, text.font, frc);
     415                textOutline = tl.getOutline(AffineTransform.getTranslateInstance(x, y));
     416            } else {
     417                textOutline = gv.getOutline(x, y);
     418            }
    415419            g.draw(textOutline);
    416420            g.setStroke(new BasicStroke());
Note: See TracChangeset for help on using the changeset viewer.