01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19:
20: package org.apache.batik.gvt.font;
21:
22: import java.text.AttributedCharacterIterator;
23: import java.util.Map;
24:
25: /**
26: * A font family class for unresolved fonts.
27: *
28: * @author <a href="mailto:bella.robinson@cmis.csiro.au">Bella Robinson</a>
29: * @version $Id: UnresolvedFontFamily.java 475477 2006-11-15 22:44:28Z cam $
30: */
31: public class UnresolvedFontFamily implements GVTFontFamily {
32:
33: protected GVTFontFace fontFace;
34:
35: /**
36: * Constructs an UnresolvedFontFamily with the specified familyName.
37: *
38: * @param fontFace The name of the font family.
39: */
40: public UnresolvedFontFamily(GVTFontFace fontFace) {
41: this .fontFace = fontFace;
42: }
43:
44: /**
45: * Constructs an UnresolvedFontFamily with the specified familyName.
46: *
47: * @param familyName The name of the font family.
48: */
49: public UnresolvedFontFamily(String familyName) {
50: this (new GVTFontFace(familyName));
51: }
52:
53: /**
54: * Returns the font-face information for this font family.
55: */
56: public GVTFontFace getFontFace() {
57: return fontFace;
58: }
59:
60: /**
61: * Returns the font family name.
62: *
63: * @return the family name.
64: */
65: public String getFamilyName() {
66: return fontFace.getFamilyName();
67: }
68:
69: /**
70: * Derives a GVTFont object of the correct size. As this font family is yet
71: * to be resolved this will always return null.
72: *
73: * @param size The required size of the derived font.
74: * @param aci The character iterator that will be rendered using the derived
75: * font.
76: */
77: public GVTFont deriveFont(float size,
78: AttributedCharacterIterator aci) {
79: return null;
80: }
81:
82: /**
83: * Derives a GVTFont object of the correct size from an attribute Map.
84: * @param size The required size of the derived font.
85: * @param attrs The Attribute Map to get Values from.
86: */
87: public GVTFont deriveFont(float size, Map attrs) {
88: return null;
89: }
90:
91: }
|