Skip to content

Commit 732e2ed

Browse files
committed
more sun.font business.
1 parent a91bb23 commit 732e2ed

File tree

80 files changed

+29558
-638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+29558
-638
lines changed

sources/net.sf.j2s.java.core/src/java/awt/Font.java

Lines changed: 504 additions & 499 deletions
Large diffs are not rendered by default.

sources/net.sf.j2s.java.core/src/java/awt/font/FontRenderContext.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public class FontRenderContext {
8383
*
8484
*/
8585
protected FontRenderContext() {
86-
// aaHintValue = VALUE_TEXT_ANTIALIAS_DEFAULT;
87-
// fmHintValue = VALUE_FRACTIONALMETRICS_DEFAULT;
86+
aaHintValue = VALUE_TEXT_ANTIALIAS_DEFAULT;
87+
fmHintValue = VALUE_FRACTIONALMETRICS_DEFAULT;
8888
defaulting = true;
8989
}
9090

@@ -114,16 +114,16 @@ public FontRenderContext(AffineTransform tx,
114114
if (tx != null && !tx.isIdentity()) {
115115
this.tx = new AffineTransform(tx);
116116
}
117-
// if (isAntiAliased) {
118-
// aaHintValue = VALUE_TEXT_ANTIALIAS_ON;
119-
// } else {
120-
// aaHintValue = VALUE_TEXT_ANTIALIAS_OFF;
121-
// }
122-
// if (usesFractionalMetrics) {
123-
// fmHintValue = VALUE_FRACTIONALMETRICS_ON;
124-
// } else {
125-
// fmHintValue = VALUE_FRACTIONALMETRICS_OFF;
126-
// }
117+
if (isAntiAliased) {
118+
aaHintValue = VALUE_TEXT_ANTIALIAS_ON;
119+
} else {
120+
aaHintValue = VALUE_TEXT_ANTIALIAS_OFF;
121+
}
122+
if (usesFractionalMetrics) {
123+
fmHintValue = VALUE_FRACTIONALMETRICS_ON;
124+
} else {
125+
fmHintValue = VALUE_FRACTIONALMETRICS_OFF;
126+
}
127127
}
128128

129129
/**

sources/net.sf.j2s.java.core/src/java/awt/font/GlyphVector.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,13 @@ public abstract float[] getGlyphPositions(int beginGlyphIndex, int numEntries,
557557
* @since 1.4
558558
*/
559559
public Rectangle getGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y) {
560-
Rectangle2D rect = getGlyphVisualBounds(index).getBounds2D();
561-
int l = (int)Math.floor(rect.getX() + x);
562-
int t = (int)Math.floor(rect.getY() + y);
563-
int r = (int)Math.ceil(rect.getMaxX() + x);
564-
int b = (int)Math.ceil(rect.getMaxY() + y);
565-
return new Rectangle(l, t, r - l, b - t);
560+
return null;
561+
// Rectangle2D rect = getGlyphVisualBounds(index).getBounds2D();
562+
// int l = (int)Math.floor(rect.getX() + x);
563+
// int t = (int)Math.floor(rect.getY() + y);
564+
// int r = (int)Math.ceil(rect.getMaxX() + x);
565+
// int b = (int)Math.ceil(rect.getMaxY() + y);
566+
// return new Rectangle(l, t, r - l, b - t);
566567
}
567568

568569
/**
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!--
2+
Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
3+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
5+
This code is free software; you can redistribute it and/or modify it
6+
under the terms of the GNU General Public License version 2 only, as
7+
published by the Free Software Foundation. Oracle designates this
8+
particular file as subject to the "Classpath" exception as provided
9+
by Oracle in the LICENSE file that accompanied this code.
10+
11+
This code is distributed in the hope that it will be useful, but WITHOUT
12+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
version 2 for more details (a copy is included in the LICENSE file that
15+
accompanied this code).
16+
17+
You should have received a copy of the GNU General Public License version
18+
2 along with this work; if not, write to the Free Software Foundation,
19+
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
21+
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
or visit www.oracle.com if you need additional information or have any
23+
questions.
24+
-->
25+
26+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
27+
<HTML>
28+
<HEAD>
29+
<META NAME=GENERATOR CONTENT="Claris Home Page 2.0">
30+
<X-SAS-WINDOW TOP=42 BOTTOM=589 LEFT=4 RIGHT=534>
31+
</HEAD>
32+
<BODY BGCOLOR="#FFFFFF">
33+
34+
<P>Provides classes and interfaces for the input method framework.
35+
This package enables text editing components to receive text input
36+
through input methods. Input methods are software components that let
37+
the user enter text in ways other than simple typing on a keyboard.
38+
They are commonly used to enter Japanese, Chinese, or Korean -
39+
languages using thousands of different characters - on keyboards with
40+
far fewer keys. However, the framework also supports input methods
41+
for other languages and the use of entirely different input
42+
mechanisms, such as handwriting or speech recognition.</P>
43+
44+
<H2>Package Specification</H2>
45+
46+
<UL>
47+
<LI><B><A HREF="{@docRoot}/../technotes/guides/imf/spec.html">Input Method
48+
Framework Specification</A></B>
49+
50+
<LI><B><A HREF="{@docRoot}/../technotes/guides/imf/api-reference.html">Input
51+
Method Client API Reference</A></B>
52+
</UL>
53+
54+
<H2>Related Documentation</H2>
55+
56+
<P>For overviews, tutorials, examples, guides, and tool
57+
documentation, please see:</P>
58+
59+
<UL>
60+
<LI><B><A HREF="{@docRoot}/../technotes/guides/imf/overview.html">Input Method
61+
Framework Overview</A></B>
62+
63+
<LI><B><A HREF="{@docRoot}/../technotes/guides/imf/api-tutorial.html">Input
64+
Method Client API Tutorial</A></B>
65+
</UL>
66+
67+
@since 1.2
68+
</BODY>
69+
</HTML>
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!--
2+
Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
3+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
5+
This code is free software; you can redistribute it and/or modify it
6+
under the terms of the GNU General Public License version 2 only, as
7+
published by the Free Software Foundation. Oracle designates this
8+
particular file as subject to the "Classpath" exception as provided
9+
by Oracle in the LICENSE file that accompanied this code.
10+
11+
This code is distributed in the hope that it will be useful, but WITHOUT
12+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
version 2 for more details (a copy is included in the LICENSE file that
15+
accompanied this code).
16+
17+
You should have received a copy of the GNU General Public License version
18+
2 along with this work; if not, write to the Free Software Foundation,
19+
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
21+
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
or visit www.oracle.com if you need additional information or have any
23+
questions.
24+
-->
25+
26+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
27+
<!--This file created 7/22/1999 11:47 by Claris Home Page version 2.0-->
28+
<HTML>
29+
<HEAD>
30+
<TITLE>Package java.awt.im.spi Description</TITLE>
31+
<META NAME=GENERATOR CONTENT="Claris Home Page 2.0">
32+
<X-SAS-WINDOW TOP=51 BOTTOM=592 LEFT=171 RIGHT=701>
33+
</HEAD>
34+
<BODY BGCOLOR="#FFFFFF">
35+
36+
<P>Provides interfaces that enable the development of input methods
37+
that can be used with any Java runtime environment. Input methods are
38+
software components that let the user enter text in ways other than
39+
simple typing on a keyboard. They are commonly used to enter
40+
Japanese, Chinese, or Korean - languages using thousands of different
41+
characters - on keyboards with far fewer keys. However, this package
42+
also allows the development of input methods for other languages and
43+
the use of entirely different input mechanisms, such as handwriting
44+
recognition.</P>
45+
46+
<H2><A NAME="package_specification"></A>Package Specification</H2>
47+
48+
<UL>
49+
<LI><B><A HREF="../../../../../technotes/guides/imf/spec.html">Input Method
50+
Framework Specification</A></B>
51+
52+
<LI><B><A HREF="../../../../../technotes/guides/imf/spi-reference.html">Input
53+
Method Engine SPI Reference</A></B>
54+
</UL>
55+
56+
<H4><A NAME="Packaging"></A>Packaging Input Methods</H4>
57+
58+
<P>Input methods are packaged as installed extensions, as specified
59+
by the <A HREF="../../../../../technotes/guides/extensions/index.html">Extension
60+
Mechanism</A>. The main JAR file of an input method must contain the
61+
file:</P>
62+
63+
<PRE> META-INF/services/java.awt.im.spi.InputMethodDescriptor</PRE>
64+
65+
<P>The file should contain a list of fully-qualified class names, one
66+
per line, of classes implementing the
67+
<CODE>java.awt.im.spi.InputMethodDescriptor</CODE> interface. Space
68+
and tab characters surrounding each name, as well as blank lines, are
69+
ignored. The comment character is <CODE>'#'</CODE>
70+
(<CODE>\u0023</CODE>); on each line all characters following the
71+
first comment character are ignored. The file must be encoded in
72+
UTF-8.</P>
73+
74+
<P>For example, if the fully-qualified name of the class that
75+
implements <CODE>java.awt.im.spi.InputMethodDesciptor</CODE> for the
76+
<EM>Foo</EM> input method is
77+
<CODE>com.sun.ime.FooInputMethodDescriptor</CODE>, the file
78+
<CODE>META-INF/services/java.awt.im.spi.InputMethodDescriptor</CODE>
79+
contains a line:</P>
80+
81+
<PRE> com.sun.ime.FooInputMethodDescriptor</PRE>
82+
83+
<P>The input method must also provide at least two classes: one class
84+
implementing the <CODE>java.awt.im.spi.InputMethodDescriptor</CODE>
85+
interface, one class implementing the
86+
<CODE>java.awt.im.spi.InputMethod</CODE> interface. The input method
87+
should separate the implementations for these interfaces, so that
88+
loading of the class implementing <CODE>InputMethod</CODE> can be
89+
deferred until actually needed.</P>
90+
91+
<H4><A NAME="Loading"></A>Loading Input Methods</H4>
92+
93+
<P>The input method framework will usually defer loading of input
94+
method classes until they are absolutely needed. It loads only the
95+
<CODE>InputMethodDescriptor</CODE> implementations during AWT
96+
initialization. It loads an <CODE>InputMethod</CODE> implementation
97+
when the input method has been selected.</P>
98+
99+
<H4><A NAME="PeeredComponents"></A>Java Input Methods and Peered Text
100+
Components</H4>
101+
102+
<P>The Java input method framework intends to support all
103+
combinations of input methods (host input methods and Java input
104+
methods) and components (peered and lightweight). However, because of
105+
limitations in the underlying platform, it may not always be possible
106+
to enable the communication between Java input methods and peered AWT
107+
components. Support for this specific combination is therefore
108+
platform dependent. In Sun's Java SE Runtime Environments, this
109+
combination is supported on Windows, but not on Solaris.</P>
110+
111+
<H2>Related Documentation</H2>
112+
113+
<P>For overviews, tutorials, examples, guides, and tool
114+
documentation, please see:</P>
115+
116+
<UL>
117+
<LI><B><A HREF="../../../../../technotes/guides/imf/overview.html">Input
118+
Method Framework Overview</A></B>
119+
120+
<LI><B><A HREF="../../../../../technotes/guides/imf/spi-tutorial.html">Input
121+
Method Engine SPI Tutorial</A></B>
122+
</UL>
123+
124+
@since JDK1.3
125+
</BODY>
126+
</HTML>

sources/net.sf.j2s.java.core/src/sun/awt/SunHints.java

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
package sun.awt;
3030

31+
import java.lang.annotation.Native;
32+
3133
////import java.lang.ref.WeakReference;
3234
//import java.util.HashMap;
3335
//
@@ -41,4 +43,101 @@
4143
// */
4244
public class SunHints {
4345
// moved to java.awt.RenderingHints
46+
47+
48+
// private static final int NUM_KEYS = 10;
49+
// private static final int VALS_PER_KEY = 8;
50+
51+
/**
52+
* Rendering hint key and values
53+
*/
54+
/*@native*/ public static final int INTKEY_RENDERING = 0;
55+
/*@native*/ public static final int INTVAL_RENDER_DEFAULT = 0;
56+
/*@native*/ public static final int INTVAL_RENDER_SPEED = 1;
57+
/*@native*/ public static final int INTVAL_RENDER_QUALITY = 2;
58+
59+
/**
60+
* Antialiasing hint key and values
61+
*/
62+
/*@native*/ public static final int INTKEY_ANTIALIASING = 1;
63+
/*@native*/ public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
64+
/*@native*/ public static final int INTVAL_ANTIALIAS_OFF = 1;
65+
/*@native*/ public static final int INTVAL_ANTIALIAS_ON = 2;
66+
67+
/**
68+
* Text antialiasing hint key and values
69+
*/
70+
/*@native*/ public static final int INTKEY_TEXT_ANTIALIASING = 2;
71+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_DEFAULT = 0;
72+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_OFF = 1;
73+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_ON = 2;
74+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_GASP = 3;
75+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_LCD_HRGB = 4;
76+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_LCD_HBGR = 5;
77+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_LCD_VRGB = 6;
78+
/*@native*/ public static final int INTVAL_TEXT_ANTIALIAS_LCD_VBGR = 7;
79+
80+
/**
81+
* Font fractional metrics hint key and values
82+
*/
83+
/*@native*/ public static final int INTKEY_FRACTIONALMETRICS = 3;
84+
/*@native*/ public static final int INTVAL_FRACTIONALMETRICS_DEFAULT = 0;
85+
/*@native*/ public static final int INTVAL_FRACTIONALMETRICS_OFF = 1;
86+
/*@native*/ public static final int INTVAL_FRACTIONALMETRICS_ON = 2;
87+
88+
/**
89+
* Dithering hint key and values
90+
*/
91+
/*@native*/ public static final int INTKEY_DITHERING = 4;
92+
/*@native*/ public static final int INTVAL_DITHER_DEFAULT = 0;
93+
/*@native*/ public static final int INTVAL_DITHER_DISABLE = 1;
94+
/*@native*/ public static final int INTVAL_DITHER_ENABLE = 2;
95+
96+
/**
97+
* Interpolation hint key and values
98+
*/
99+
/*@native*/ public static final int INTKEY_INTERPOLATION = 5;
100+
/*@native*/ public static final int INTVAL_INTERPOLATION_NEAREST_NEIGHBOR = 0;
101+
/*@native*/ public static final int INTVAL_INTERPOLATION_BILINEAR = 1;
102+
/*@native*/ public static final int INTVAL_INTERPOLATION_BICUBIC = 2;
103+
104+
/**
105+
* Alpha interpolation hint key and values
106+
*/
107+
/*@native*/ public static final int INTKEY_ALPHA_INTERPOLATION = 6;
108+
/*@native*/ public static final int INTVAL_ALPHA_INTERPOLATION_DEFAULT = 0;
109+
/*@native*/ public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
110+
/*@native*/ public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
111+
112+
/**
113+
* Color rendering hint key and values
114+
*/
115+
/*@native*/ public static final int INTKEY_COLOR_RENDERING = 7;
116+
/*@native*/ public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
117+
/*@native*/ public static final int INTVAL_COLOR_RENDER_SPEED = 1;
118+
/*@native*/ public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
119+
120+
/**
121+
* Stroke normalization control hint key and values
122+
*/
123+
/*@native*/ public static final int INTKEY_STROKE_CONTROL = 8;
124+
/*@native*/ public static final int INTVAL_STROKE_DEFAULT = 0;
125+
/*@native*/ public static final int INTVAL_STROKE_NORMALIZE = 1;
126+
/*@native*/ public static final int INTVAL_STROKE_PURE = 2;
127+
128+
/**
129+
* Image scaling hint key and values
130+
*/
131+
/*@native*/ public static final int INTKEY_RESOLUTION_VARIANT = 9;
132+
/*@native*/ public static final int INTVAL_RESOLUTION_VARIANT_DEFAULT = 0;
133+
/*@native*/ public static final int INTVAL_RESOLUTION_VARIANT_OFF = 1;
134+
/*@native*/ public static final int INTVAL_RESOLUTION_VARIANT_ON = 2;
135+
/**
136+
* LCD text contrast control hint key.
137+
* Value is "100" to make discontiguous with the others which
138+
* are all enumerative and are of a different class.
139+
*/
140+
/*@native*/ public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
141+
142+
44143
}

sources/net.sf.j2s.java.core/src/sun/awt/SunToolkit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public abstract class SunToolkit extends Toolkit implements
8181
// WindowClosingSupport,
8282
// WindowClosingListener,
8383
ComponentFactory {// ,
84-
// InputMethodSupport
85-
// {
84+
// InputMethodSupport
85+
// {
8686

8787
// 8014736: logging has been removed from SunToolkit
8888

0 commit comments

Comments
 (0)