Revision 11104 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/SimpleTextSymbol.java
SimpleTextSymbol.java | ||
---|---|---|
86 | 86 |
|
87 | 87 |
Point2D p = null; |
88 | 88 |
double rot=0; |
89 |
shp.transform(affineTransform); |
|
89 |
// shp.transform(affineTransform);
|
|
90 | 90 |
switch (shp.getShapeType()) { |
91 | 91 |
case FShape.POINT: |
92 | 92 |
FPoint2D fp=(FPoint2D) shp; |
... | ... | |
137 | 137 |
AffineTransform scaleInstance, Rectangle r) { |
138 | 138 |
FontRenderContext frc = g.getFontRenderContext(); |
139 | 139 |
GlyphVector gv = font.createGlyphVector(frc, text); |
140 |
gv. |
|
141 |
float fontSize = getFont().getSize(); |
|
140 |
float fontSize = getFont().getSize(); |
|
142 | 141 |
float fontScaleFactor = (float) ((getText().length()*fontSize) * 0.8) // text length with a 20% margin |
143 | 142 |
/ r.width; |
144 | 143 |
|
145 |
fontSize = fontSize * fontScaleFactor; |
|
144 |
fontSize = fontSize / fontScaleFactor; |
|
145 |
// if (fontSize > r.height) |
|
146 |
// fontSize = r.height; |
|
146 | 147 |
g.setFont(getFont().deriveFont(fontSize)); |
147 |
System.out.println(r);
|
|
148 |
g.drawString(getText(), r.x*0.9F, ( r.height*0.5F) + (fontSize*0.5F));
|
|
148 |
g.drawString(getText(), r.x*0.9F, ( r.height*0.5F) + (fontSize));
|
|
149 |
// g.drawString(getText(), r.x, r.height);//( r.height*0.5F) + (fontSize*0.5F));
|
|
149 | 150 |
|
150 | 151 |
|
151 | 152 |
} |
Also available in: Unified diff