81 |
private native void dispose (); |
private native void dispose (); |
82 |
private native void setFont (String family, int style, int size, boolean useGraphics2D); |
private native void setFont (String family, int style, int size, boolean useGraphics2D); |
83 |
|
|
84 |
|
native void getFontMetrics(double [] metrics); |
85 |
|
native void getTextMetrics(String str, double [] metrics); |
86 |
|
|
87 |
protected void finalize () |
protected void finalize () |
88 |
{ |
{ |
89 |
if (GtkToolkit.useGraphics2D ()) |
if (GtkToolkit.useGraphics2D ()) |
161 |
|
|
162 |
public boolean canDisplay (Font font, char c) |
public boolean canDisplay (Font font, char c) |
163 |
{ |
{ |
164 |
throw new UnsupportedOperationException (); |
// FIXME: inquire with pango |
165 |
|
return true; |
166 |
} |
} |
167 |
|
|
168 |
public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit) |
public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit) |
169 |
{ |
{ |
170 |
throw new UnsupportedOperationException (); |
// FIXME: inquire with pango |
171 |
|
return -1; |
172 |
} |
} |
173 |
|
|
174 |
|
private native GdkGlyphVector getGlyphVector(String txt, |
175 |
|
Font f, |
176 |
|
FontRenderContext ctx); |
177 |
|
|
178 |
public GlyphVector createGlyphVector (Font font, |
public GlyphVector createGlyphVector (Font font, |
179 |
FontRenderContext ctx, |
FontRenderContext ctx, |
180 |
CharacterIterator i) |
CharacterIterator i) |
181 |
{ |
{ |
182 |
return new GdkGlyphVector(font, this, ctx, buildString (i)); |
return getGlyphVector(buildString (i), font, ctx); |
183 |
} |
} |
184 |
|
|
185 |
public GlyphVector createGlyphVector (Font font, |
public GlyphVector createGlyphVector (Font font, |
186 |
FontRenderContext ctx, |
FontRenderContext ctx, |
187 |
int[] glyphCodes) |
int[] glyphCodes) |
188 |
{ |
{ |
189 |
return new GdkGlyphVector (font, this, ctx, glyphCodes); |
return null; |
190 |
|
// return new GdkGlyphVector (font, this, ctx, glyphCodes); |
191 |
} |
} |
192 |
|
|
193 |
public byte getBaselineFor (Font font, char c) |
public byte getBaselineFor (Font font, char c) |
269 |
public Rectangle2D getStringBounds (Font font, CharacterIterator ci, |
public Rectangle2D getStringBounds (Font font, CharacterIterator ci, |
270 |
int begin, int limit, FontRenderContext frc) |
int begin, int limit, FontRenderContext frc) |
271 |
{ |
{ |
272 |
throw new UnsupportedOperationException (); |
GdkGlyphVector gv = getGlyphVector(buildString (ci, begin, limit), font, frc); |
273 |
|
return gv.getVisualBounds(); |
274 |
} |
} |
275 |
|
|
276 |
public boolean hasUniformLineMetrics (Font font) |
public boolean hasUniformLineMetrics (Font font) |