Lines 126-132
Link Here
|
126 |
* @param size the font size |
126 |
* @param size the font size |
127 |
* @return true if the new Font changes the current Font |
127 |
* @return true if the new Font changes the current Font |
128 |
*/ |
128 |
*/ |
129 |
public boolean updateFont(String name, int size) { |
129 |
public boolean updateFont(String name, int size, float width) { |
130 |
|
130 |
|
131 |
FontMetricsMapper mapper = (FontMetricsMapper)fontInfo.getMetricsFor(name); |
131 |
FontMetricsMapper mapper = (FontMetricsMapper)fontInfo.getMetricsFor(name); |
132 |
boolean updateName = (!mapper.getFontName().equals( |
132 |
boolean updateName = (!mapper.getFontName().equals( |
Lines 136-142
Link Here
|
136 |
if (updateName || updateSize) { |
136 |
if (updateName || updateSize) { |
137 |
// the font name and/or the font size have changed |
137 |
// the font name and/or the font size have changed |
138 |
java.awt.Font font = mapper.getFont(size); |
138 |
java.awt.Font font = mapper.getFont(size); |
139 |
|
139 |
font = font.deriveFont(AffineTransform.getScaleInstance(width, 1.0)); |
140 |
currentGraphics.setFont(font); |
140 |
currentGraphics.setFont(font); |
141 |
return true; |
141 |
return true; |
142 |
} else { |
142 |
} else { |