home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.io.Serializable;
-
- public class Font implements Serializable {
- public static final int PLAIN = 0;
- public static final int BOLD = 1;
- public static final int ITALIC = 2;
- private transient int pData;
- private transient String family;
- protected String name;
- protected int style;
- protected int size;
-
- public Font(String var1, int var2, int var3) {
- SecurityManager.enablePrivilege("UniversalPropertyRead");
- this.family = System.getProperty("awt.font." + var1.toLowerCase(), var1);
- this.name = var1;
- this.style = var2;
- this.size = var3;
- }
-
- public String getFamily() {
- return this.family;
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getStyle() {
- return this.style;
- }
-
- public int getSize() {
- return this.size;
- }
-
- public boolean isPlain() {
- return this.style == 0;
- }
-
- public boolean isBold() {
- return (this.style & 1) != 0;
- }
-
- public boolean isItalic() {
- return (this.style & 2) != 0;
- }
-
- public void finalize() {
- this.dispose();
- }
-
- public synchronized native void dispose();
-
- public static Font getFont(String var0) {
- return getFont(var0, (Font)null);
- }
-
- public static Font getFont(String var0, Font var1) {
- String var2;
- try {
- var2 = System.getProperty(var0);
- } catch (Exception var8) {
- var2 = null;
- }
-
- if (var2 == null) {
- return var1;
- } else {
- String var3 = var2;
- int var4 = 12;
- byte var5 = 0;
- int var6 = var2.indexOf(45);
- if (var6 >= 0) {
- var3 = var2.substring(0, var6);
- var2 = var2.substring(var6 + 1);
- if ((var6 = var2.indexOf(45)) >= 0) {
- if (var2.startsWith("bold-")) {
- var5 = 1;
- } else if (var2.startsWith("italic-")) {
- var5 = 2;
- } else if (var2.startsWith("bolditalic-")) {
- var5 = 3;
- }
-
- var2 = var2.substring(var6 + 1);
- }
-
- try {
- var4 = Integer.valueOf(var2);
- } catch (NumberFormatException var7) {
- }
- }
-
- return new Font(var3, var5, var4);
- }
- }
-
- public int hashCode() {
- return this.name.hashCode() ^ this.style ^ this.size;
- }
-
- public boolean equals(Object var1) {
- if (var1 instanceof Font) {
- Font var2 = (Font)var1;
- return this.size == var2.size && this.style == var2.style && this.name.equals(var2.name);
- } else {
- return false;
- }
- }
-
- public String toString() {
- String var1;
- if (this.isBold()) {
- var1 = this.isItalic() ? "bolditalic" : "bold";
- } else {
- var1 = this.isItalic() ? "italic" : "plain";
- }
-
- return this.getClass().getName() + "[family=" + this.family + ",name=" + this.name + ",style=" + var1 + ",size=" + this.size + "]";
- }
- }
-