001: package com.etymon.pj.object;
002:
003: import java.io.*;
004: import java.util.*;
005: import com.etymon.pj.*;
006: import com.etymon.pj.exception.*;
007:
008: /**
009: A representation of a PDF font dictionary (abstract base class).
010: @author Nassib Nassar
011: */
012: public abstract class PjFont extends PjDictionary {
013:
014: /**
015: Creates a new font dictionary.
016: */
017: public PjFont() {
018: super ();
019: _h.put(PjName.TYPE, PjName.FONT);
020: }
021:
022: /**
023: Creates a font dictionary as a wrapper around a Hashtable.
024: @param h the Hashtable to use for this dictionary.
025: */
026: public PjFont(Hashtable h) {
027: super (h);
028: }
029:
030: public void setName(PjName name) {
031: _h.put(PjName.NAME, name);
032: }
033:
034: public PjObject getName() throws InvalidPdfObjectException {
035: return hget(PjName.NAME);
036: }
037:
038: public void setBaseFont(PjName baseFont) {
039: _h.put(PjName.BASEFONT, baseFont);
040: }
041:
042: public void setBaseFont(PjReference baseFont) {
043: _h.put(PjName.BASEFONT, baseFont);
044: }
045:
046: public PjObject getBaseFont() throws InvalidPdfObjectException {
047: return hget(PjName.BASEFONT);
048: }
049:
050: public void setFirstChar(PjNumber firstChar) {
051: _h.put(PjName.FIRSTCHAR, firstChar);
052: }
053:
054: public void setFirstChar(PjReference firstChar) {
055: _h.put(PjName.FIRSTCHAR, firstChar);
056: }
057:
058: public PjObject getFirstChar() throws InvalidPdfObjectException {
059: return hget(PjName.FIRSTCHAR);
060: }
061:
062: public void setLastChar(PjNumber lastChar) {
063: _h.put(PjName.LASTCHAR, lastChar);
064: }
065:
066: public void setLastChar(PjReference lastChar) {
067: _h.put(PjName.LASTCHAR, lastChar);
068: }
069:
070: public PjObject getLastChar() throws InvalidPdfObjectException {
071: return hget(PjName.LASTCHAR);
072: }
073:
074: public void setWidths(PjReference widths) {
075: _h.put(PjName.WIDTHS, widths);
076: }
077:
078: public PjObject getWidths() throws InvalidPdfObjectException {
079: return hget(PjName.WIDTHS);
080: }
081:
082: public void setEncoding(PjDictionary encoding) {
083: _h.put(PjName.ENCODING, encoding);
084: }
085:
086: public void setEncoding(PjName encoding) {
087: _h.put(PjName.ENCODING, encoding);
088: }
089:
090: public void setEncoding(PjReference encoding) {
091: _h.put(PjName.ENCODING, encoding);
092: }
093:
094: public PjObject getEncoding() throws InvalidPdfObjectException {
095: return hget(PjName.ENCODING);
096: }
097:
098: public void setFontDescriptor(PjReference fontDescriptor) {
099: _h.put(PjName.FONTDESCRIPTOR, fontDescriptor);
100: }
101:
102: public PjObject getFontDescriptor()
103: throws InvalidPdfObjectException {
104: return hget(PjName.FONTDESCRIPTOR);
105: }
106:
107: }
|