diff options
Diffstat (limited to 'libjava/java/awt/Font.java')
-rw-r--r-- | libjava/java/awt/Font.java | 79 |
1 files changed, 77 insertions, 2 deletions
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java index 0850367..edf5144 100644 --- a/libjava/java/awt/Font.java +++ b/libjava/java/awt/Font.java @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation +/* Copyright (C) 1999, 2000 Free Software Foundation This file is part of libjava. @@ -8,8 +8,83 @@ details. */ package java.awt; -/* A *very* incomplete placeholder. */ +/** + * @author Warren Levy <warrenl@cygnus.com> + * @date March 16, 2000. + */ + +/** + * Written using on-line Java Platform 1.2 API Specification, as well + * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). + * Status: Stubbed; A very incomplete implementation. + */ public class Font { + // FIXME + + public static final int PLAIN = 0; + public static final int BOLD = 1; + public static final int ITALIC = 2; + public static final int ROMAN_BASELINE = 0; + public static final int CENTER_BASELINE = 1; + public static final int HANGING_BASELINE = 2; + protected String name; + protected int style; + protected int size; + protected float pointSize; + + public Font(String name, int style, int size) + { + this.name = name; + this.style = style & 0x3; // Only use lowest 2 bits. + this.size = size; + pointSize = size; // Assume some subclass can set a different val. + } + + public boolean isPlain() + { + if (style == PLAIN) + return true; + + return false; + } + + public boolean isBold() + { + if (style & BOLD == BOLD) + return true; + + return false; + } + + public boolean isItalic() + { + if (style & ITALIC == ITALIC) + return true; + + return false; + } + + public String getName() + { + return name; + } + + public int getStyle() + { + return style; + } + + public int getSize() + { + return size; + } + + public float getSize2D() + { + return pointSize; + } + + public static Font decode(String str) { return null; } // FIXME } |