1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package gnu.awt.xlib;
import java.awt.*;
import gnu.java.awt.ClasspathToolkit;
import gnu.java.awt.peer.ClasspathFontPeer;
import java.util.Locale;
import java.awt.font.*;
import java.awt.geom.*;
import java.text.CharacterIterator;
/**
* Classpath-compatible peer for a font
*/
public class XFontPeer extends ClasspathFontPeer
{
public XFontPeer (String name, int style)
{
this (name, style, 12 /* kludge */);
}
public XFontPeer (String name, int style, float size)
{
super (name, style, (int)size);
}
/**
* Implementation of {@link Font#canDisplay(char)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public boolean canDisplay (Font font, int c)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#canDisplay(String)},
* {@link Font#canDisplay(char [], int, int)}, and
* {@link Font#canDisplay(CharacterIterator, int, int)}.
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link
* Font#createGlyphVector(FontRenderContext, String)}, {@link
* Font#createGlyphVector(FontRenderContext, char[])}, and {@link
* Font#createGlyphVector(FontRenderContext, CharacterIterator)}.
*
* @param font the font object that the created GlyphVector will return
* when it gets asked for its font. This argument is needed because the
* public API of {@link GlyphVector} works with {@link java.awt.Font},
* not with font peers.
*/
public GlyphVector createGlyphVector (Font font, FontRenderContext frc, CharacterIterator ci)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#createGlyphVector(FontRenderContext,
* int[])}.
*
* @param font the font object that the created GlyphVector will return
* when it gets asked for its font. This argument is needed because the
* public API of {@link GlyphVector} works with {@link java.awt.Font},
* not with font peers.
*/
public GlyphVector createGlyphVector (Font font, FontRenderContext ctx, int[] glyphCodes)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getBaselineFor(char)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public byte getBaselineFor (Font font, char c)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getFontMetrics()}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public FontMetrics getFontMetrics (Font font)
{
throw new UnsupportedOperationException ();
}
/** Returns a name for the specified glyph. This is useful for
* generating PostScript or PDF files that embed some glyphs of a
* font. If the implementation follows glyph naming conventions
* specified by Adobe, search engines can extract the original text
* from the generated PostScript and PDF files.
*
* <p>This method is currently not used by GNU Classpath. However,
* it would be very useful for someone wishing to write a good
* PostScript or PDF stream provider for the
* <code>javax.print</code> package.
*
* <p><b>Names are not unique:</b> Under some rare circumstances,
* the same name can be returned for different glyphs. It is
* therefore recommended that printer drivers check whether the same
* name has already been returned for antoher glyph, and make the
* name unique by adding the string ".alt" followed by the glyph
* index.</p>
*
* <p>This situation would occur for an OpenType or TrueType font
* that has a <code>post</code> table of format 3 and provides a
* mapping from glyph IDs to Unicode sequences through a
* <code>Zapf</code> table. If the same sequence of Unicode
* codepoints leads to different glyphs (depending on contextual
* position, for example, or on typographic sophistication level),
* the same name would get synthesized for those glyphs. To avoid
* this, the font peer would have to go through the names of all
* glyphs, which would make this operation very inefficient with
* large fonts.
*
* @param font the font containing the glyph whose name is
* requested.
*
* @param glyphIndex the glyph whose name the caller wants to
* retrieve.
*
* @return the glyph name, or <code>null</code> if a font does not
* provide glyph names.
*/
public String getGlyphName (Font font, int glyphIndex)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getLineMetrics(CharacterIterator, int,
* int, FontRenderContext)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public LineMetrics getLineMetrics (Font font, CharacterIterator ci, int begin, int limit, FontRenderContext rc)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getMaxCharBounds(FontRenderContext)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public Rectangle2D getMaxCharBounds (Font font, FontRenderContext rc)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getMissingGlyphCode()}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public int getMissingGlyphCode (Font font)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getNumGlyphs()}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public int getNumGlyphs (Font font)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getPSName()}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public String getPostScriptName (Font font)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#getStringBounds(CharacterIterator, int,
* int, FontRenderContext)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public Rectangle2D getStringBounds (Font font, CharacterIterator ci, int begin, int limit, FontRenderContext frc)
{
throw new UnsupportedOperationException ();
}
/** Returns the name of this font face inside the family, for example
* <i>“Light”</i>.
*
* <p>This method is currently not used by {@link Font}. However,
* this name would be needed by any serious desktop publishing
* application.
*
* @param font the font whose sub-family name is requested.
*
* @param locale the locale for which to localize the name. If
* <code>locale</code> is <code>null</code>, the returned name is
* localized to the user’s default locale.
*
* @return the name of the face inside its family, or
* <code>null</code> if the font does not provide a sub-family name.
*/
public String getSubFamilyName (Font font, Locale locale)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#hasUniformLineMetrics()}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
public boolean hasUniformLineMetrics (Font font)
{
throw new UnsupportedOperationException ();
}
/**
* Implementation of {@link Font#layoutGlyphVector(FontRenderContext,
* char[], int, int, int)}.
*
* @param font the font object that the created GlyphVector will return
* when it gets asked for its font. This argument is needed because the
* public API of {@link GlyphVector} works with {@link java.awt.Font},
* not with font peers.
*/
public GlyphVector layoutGlyphVector (Font font, FontRenderContext frc, char[] chars, int start, int limit, int flags)
{
throw new UnsupportedOperationException ();
}
}
|