|
Last change
on this file since 765 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /* Copyright (C) 2000 Free Software Foundation
|
|---|
| 2 |
|
|---|
| 3 | This file is part of libgcj.
|
|---|
| 4 |
|
|---|
| 5 | This software is copyrighted work licensed under the terms of the
|
|---|
| 6 | Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|---|
| 7 | details. */
|
|---|
| 8 |
|
|---|
| 9 | package gnu.gcj.xlib;
|
|---|
| 10 |
|
|---|
| 11 | import gnu.gcj.RawData;
|
|---|
| 12 |
|
|---|
| 13 | /**
|
|---|
| 14 | * An X11 Font, implemented as a wrapper around an X11 Font XID and
|
|---|
| 15 | * the associated Xlib XFontStruct structure.
|
|---|
| 16 | *
|
|---|
| 17 | * @author Rolf W. Rasmussen <[email protected]>
|
|---|
| 18 | */
|
|---|
| 19 | public final class Font extends XID
|
|---|
| 20 | {
|
|---|
| 21 |
|
|---|
| 22 | /**
|
|---|
| 23 | * @param lfdNamePattern a font name pattern following the
|
|---|
| 24 | * <em>X Logical Font Description Conventions</em>.
|
|---|
| 25 | */
|
|---|
| 26 | public Font(Display display, String lfdNamePattern)
|
|---|
| 27 | {
|
|---|
| 28 | this(display, loadFont(display, lfdNamePattern));
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | Font(Display display, RawData struct)
|
|---|
| 32 | {
|
|---|
| 33 | super(display, getXIDFromStruct(struct));
|
|---|
| 34 | structure = struct;
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | static native RawData loadFont(Display display, String lfdNamePattern);
|
|---|
| 38 |
|
|---|
| 39 | static native int getXIDFromStruct(RawData structure);
|
|---|
| 40 |
|
|---|
| 41 | public native int getAscent();
|
|---|
| 42 | public native int getDescent();
|
|---|
| 43 | public native int getMaxAscent();
|
|---|
| 44 | public native int getMaxDescent();
|
|---|
| 45 |
|
|---|
| 46 | public native int getStringWidth(String str);
|
|---|
| 47 |
|
|---|
| 48 | protected native void finalize();
|
|---|
| 49 |
|
|---|
| 50 | RawData structure;
|
|---|
| 51 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.