Changeset 659 for trunk/src/org/expeditee/items/Text.java
- Timestamp:
- 01/07/14 15:26:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r655 r659 39 39 import org.expeditee.gui.FreeItems; 40 40 import org.expeditee.math.ExpediteeJEP; 41 import org.expeditee.settings.UserSettings; 41 42 import org.expeditee.settings.experimental.ExperimentalFeatures; 42 43 import org.nfunk.jep.Node; … … 112 113 private Justification _justification = Justification.left; 113 114 114 private int _spacing = -1;115 private float _spacing = -1; 115 116 116 117 private int _word_spacing = -1; 117 118 118 private int _initial_spacing = -1;119 120 private int _letter_spacing = -1;119 private float _initial_spacing = 0; 120 121 private float _letter_spacing = 0; 121 122 122 123 // used during ranging out … … 1192 1193 * The number of pixels to allow between each line 1193 1194 */ 1194 public void setSpacing( int spacing) {1195 public void setSpacing(float spacing) { 1195 1196 _spacing = spacing; 1196 1197 updatePolygon(); … … 1202 1203 * @return The spacing (inter-line) in pixels of this Text. 1203 1204 */ 1204 public int getSpacing() {1205 public float getSpacing() { 1205 1206 return _spacing; 1206 1207 } … … 1228 1229 * Additional spacing to add between letters. See {@link java.awt.font.TextAttribute#TRACKING} 1229 1230 */ 1230 public void setLetterSpacing( int spacing) {1231 public void setLetterSpacing(float spacing) { 1231 1232 _letter_spacing = spacing; 1232 1233 HashMap<TextAttribute, Object> attr = new HashMap<TextAttribute, Object>(); 1233 1234 attr.put(TextAttribute.TRACKING, spacing); 1234 this._font = this._font.deriveFont(attr); 1235 1236 if (this._font == null) { 1237 this._font = Font.decode(DEFAULT_FONT); 1238 } 1239 1240 this.setFont(this._font.deriveFont(attr)); 1235 1241 } 1236 1242 … … 1238 1244 * @return The spacing (proportional to the font size) between letters. See {@link java.awt.font.TextAttribute#TRACKING} 1239 1245 */ 1240 public int getLetterSpacing() {1246 public float getLetterSpacing() { 1241 1247 return _letter_spacing; 1242 1248 } 1243 1249 1244 public void setInitialSpacing( int spacing) {1250 public void setInitialSpacing(float spacing) { 1245 1251 _initial_spacing = spacing; 1246 1252 } 1247 1253 1248 public int getInitialSpacing() {1254 public float getInitialSpacing() { 1249 1255 return _initial_spacing; 1250 1256 }
Note:
See TracChangeset
for help on using the changeset viewer.