50 |
import java.awt.peer.FontPeer; |
import java.awt.peer.FontPeer; |
51 |
import java.io.IOException; |
import java.io.IOException; |
52 |
import java.io.InputStream; |
import java.io.InputStream; |
53 |
|
import java.io.ObjectInputStream; |
54 |
import java.io.Serializable; |
import java.io.Serializable; |
55 |
import java.text.AttributedCharacterIterator; |
import java.text.AttributedCharacterIterator; |
56 |
import java.text.CharacterIterator; |
import java.text.CharacterIterator; |
192 |
|
|
193 |
|
|
194 |
// The ClasspathToolkit-provided peer which implements this font |
// The ClasspathToolkit-provided peer which implements this font |
195 |
private ClasspathFontPeer peer; |
private transient ClasspathFontPeer peer; |
196 |
|
|
197 |
|
|
198 |
/** |
/** |
336 |
this.peer = getPeerFromToolkit(name, attrs); |
this.peer = getPeerFromToolkit(name, attrs); |
337 |
this.size = size; |
this.size = size; |
338 |
this.pointSize = (float) size; |
this.pointSize = (float) size; |
339 |
|
if (name != null) |
340 |
|
this.name = name; |
341 |
|
else |
342 |
|
this.name = peer.getName(this); |
343 |
} |
} |
344 |
|
|
345 |
public Font(Map attrs) |
public Font(Map attrs) |
360 |
peer = getPeerFromToolkit(name, attrs); |
peer = getPeerFromToolkit(name, attrs); |
361 |
size = (int) peer.getSize(this); |
size = (int) peer.getSize(this); |
362 |
pointSize = peer.getSize(this); |
pointSize = peer.getSize(this); |
363 |
|
if (name != null) |
364 |
|
this.name = name; |
365 |
|
else |
366 |
|
this.name = peer.getName(this); |
367 |
} |
} |
368 |
|
|
369 |
/** |
/** |
1324 |
return getLineMetrics(str, 0, str.length() - 1, frc); |
return getLineMetrics(str, 0, str.length() - 1, frc); |
1325 |
} |
} |
1326 |
|
|
1327 |
|
/** |
1328 |
|
* Reads the normal fields from the stream and then constructs the |
1329 |
|
* peer from the style and size through getPeerFromToolkit(). |
1330 |
|
*/ |
1331 |
|
private void readObject(ObjectInputStream ois) |
1332 |
|
throws IOException, ClassNotFoundException |
1333 |
|
{ |
1334 |
|
ois.defaultReadObject(); |
1335 |
|
|
1336 |
|
HashMap attrs = new HashMap(); |
1337 |
|
ClasspathFontPeer.copyStyleToAttrs(style, attrs); |
1338 |
|
ClasspathFontPeer.copySizeToAttrs(size, attrs); |
1339 |
|
peer = getPeerFromToolkit(name, attrs); |
1340 |
|
|
1341 |
|
} |
1342 |
} |
} |