author | ohair |
Wed, 06 Apr 2011 22:06:11 -0700 | |
changeset 9035 | 1255eb81cc2f |
parent 7940 | 7d20d72dd3b9 |
child 9759 | 90976a831a86 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
7940
diff
changeset
|
2 |
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 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. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.font; |
|
27 |
||
28 |
import java.awt.geom.GeneralPath; |
|
29 |
import java.awt.geom.Point2D; |
|
30 |
import java.awt.geom.Rectangle2D; |
|
31 |
||
32 |
class NullFontScaler extends FontScaler { |
|
33 |
NullFontScaler() {} |
|
34 |
||
35 |
public NullFontScaler(Font2D font, int indexInCollection, |
|
36 |
boolean supportsCJK, int filesize) {} |
|
37 |
||
38 |
StrikeMetrics getFontMetrics(long pScalerContext) { |
|
39 |
return new StrikeMetrics(0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
|
40 |
0xf0,0xf0,0xf0,0xf0); |
|
41 |
} |
|
42 |
||
43 |
float getGlyphAdvance(long pScalerContext, int glyphCode) { |
|
44 |
return 0.0f; |
|
45 |
} |
|
46 |
||
47 |
void getGlyphMetrics(long pScalerContext, int glyphCode, |
|
48 |
Point2D.Float metrics) { |
|
49 |
metrics.x = 0; |
|
50 |
metrics.y = 0; |
|
51 |
} |
|
52 |
||
53 |
Rectangle2D.Float getGlyphOutlineBounds(long pContext, int glyphCode) { |
|
54 |
return new Rectangle2D.Float(0, 0, 0, 0); |
|
55 |
} |
|
56 |
||
57 |
GeneralPath getGlyphOutline(long pScalerContext, int glyphCode, |
|
58 |
float x, float y) { |
|
59 |
return new GeneralPath(); |
|
60 |
} |
|
61 |
||
62 |
GeneralPath getGlyphVectorOutline(long pScalerContext, int[] glyphs, |
|
63 |
int numGlyphs, float x, float y) { |
|
64 |
return new GeneralPath(); |
|
65 |
} |
|
66 |
||
67 |
long getLayoutTableCache() {return 0L;} |
|
68 |
||
69 |
long createScalerContext(double[] matrix, boolean fontType, int aa, |
|
7940
7d20d72dd3b9
6930980: Disable TrueType hinting for fonts known not to hint well
prr
parents:
5506
diff
changeset
|
70 |
int fm, float boldness, float italic, boolean disableHinting) { |
2 | 71 |
return getNullScalerContext(); |
72 |
} |
|
73 |
||
74 |
void invalidateScalerContext(long ppScalerContext) { |
|
75 |
//nothing to do |
|
76 |
} |
|
77 |
||
78 |
int getNumGlyphs() throws FontScalerException { |
|
886
7eb22e81bb28
6720240: IOB exception when getting font metrics of hershey font
igor
parents:
2
diff
changeset
|
79 |
return 1; |
2 | 80 |
} |
81 |
||
82 |
int getMissingGlyphCode() throws FontScalerException { |
|
83 |
return 0; |
|
84 |
} |
|
85 |
||
86 |
int getGlyphCode(char charCode) throws FontScalerException { |
|
87 |
return 0; |
|
88 |
} |
|
89 |
||
90 |
long getUnitsPerEm() { |
|
91 |
return 2048; |
|
92 |
} |
|
93 |
||
94 |
Point2D.Float getGlyphPoint(long pScalerContext, |
|
95 |
int glyphCode, int ptNumber) { |
|
96 |
return null; |
|
97 |
} |
|
98 |
||
99 |
/* Ideally NullFontScaler should not have native code. |
|
100 |
However, at this moment we need these methods to be native because: |
|
101 |
- glyph cache code assumes null pointers to GlyphInfo structures |
|
102 |
- FileFontStrike needs native context |
|
103 |
*/ |
|
104 |
static native long getNullScalerContext(); |
|
105 |
native long getGlyphImage(long pScalerContext, int glyphCode); |
|
106 |
} |