Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/font/StrikeMetrics.java
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.font;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
/* These are font metrics: they are in user space, not device space.
* Hence they are not truly "strike" metrics. However it is convenient to
* treat them as such since we need to have a scaler context to obtain them
* and also to cache them. The old implementation obtained a C++ strike object
* that matched the Font TX + pt size only. It was wasteful of strike objects.
* This new implementation still has separate StrikeMetrics for 2 fonts that
* are really the same but are used in different device transforms, but at
* least it doesn't create a whole new strike just to get the metrics for
* a strike in a transformed graphics.
* So these metrics do not take into account the device transform. They
* are considered inherent properties of the font. Hence it may be that we
* should use the device transform to obtain the most accurate metrics, but
* typically 1.1 APIs do not provide for this. So some APIs may want to
* ignore the dev. tx and others may want to use it, and then apply an
* inverse transform. For now we ignore the dev. tx.
* "Font" metrics are representative of a typical glyph in the font.
* Generally speaking these values are the choice of the font designer and
* are stored in the font, from which we retrieve the values. They do
* not necessarily equate to the maximum bounds of all glyphs in the font.
* Note that the ascent fields are typically a -ve value as we use a top-left
* origin user space, and text is positioned relative to its baseline.
*/
public final class StrikeMetrics {
public float ascentX;
public float ascentY;
public float descentX;
public float descentY;
public float baselineX;
public float baselineY;
public float leadingX;
public float leadingY;
public float maxAdvanceX;
public float maxAdvanceY;
/* The no-args constructor is used by CompositeStrike, which then
* merges in the metrics of physical fonts.
* The approach here is the same as earlier releases but it is flawed
* take for example the following which ignores leading for simplicity.
* Say we have a composite with an element asc=-9, dsc=2, and another with
* asc=-7, dsc=3. The merged font is (-9,3) for height of -(-9)+3=12.
* Suppose this same font has been derived with a 180% rotation
* Now its signs for ascent/descent are reversed. Its (9,-2) and (7,-3)
* Its merged values are (using the code in this class) (7,-2) for
* a height of -(7)+-2 = =-9!
* We need to have a more intelligent merging algorithm,
* which so far as I can see needs to apply an inverse of the font
* tx, do its merging, and then reapply the font tx.
* This wouldn't often be a problem as there rarely is a font TX, and
* the tricky part is getting the information. Probably the no-args
* constructor needs to pass a TX in to be applied to all merges.
* CompositeStrike would be left with the problem of figuring out what
* tx to use.
* But at least for now we are probably no worse than 1.4 ...
* REMIND: FIX THIS.
*/
StrikeMetrics() {
ascentX = ascentY = Integer.MAX_VALUE;
descentX = descentY = leadingX = leadingY = Integer.MIN_VALUE;
baselineX = baselineX = maxAdvanceX = maxAdvanceY = Integer.MIN_VALUE;
}
StrikeMetrics(float ax, float ay, float dx, float dy, float bx, float by,
float lx, float ly, float mx, float my) {
ascentX = ax;
ascentY = ay;
descentX = dx;
descentY = dy;
baselineX = bx;
baselineY = by;
leadingX = lx;
leadingY = ly;
maxAdvanceX = mx;
maxAdvanceY = my;
}
public float getAscent() {
return -ascentY;
}
public float getDescent() {
return descentY;
}
public float getLeading() {
return leadingY;
}
public float getMaxAdvance() {
return maxAdvanceX;
}
/*
* Currently only used to merge together slot metrics to create
* the metrics for a composite font.
*/
void merge(StrikeMetrics other) {
if (other == null) {
return;
}
if (other.ascentX < ascentX) {
ascentX = other.ascentX;
}
if (other.ascentY < ascentY) {
ascentY = other.ascentY;
}
if (other.descentX > descentX) {
descentX = other.descentX;
}
if (other.descentY > descentY) {
descentY = other.descentY;
}
if (other.baselineX > baselineX) {
baselineX = other.baselineX;
}
if (other.baselineY > baselineY) {
baselineY = other.baselineY;
}
if (other.leadingX > leadingX) {
leadingX = other.leadingX;
}
if (other.leadingY > leadingY) {
leadingY = other.leadingY;
}
if (other.maxAdvanceX > maxAdvanceX) {
maxAdvanceX = other.maxAdvanceX;
}
if (other.maxAdvanceY > maxAdvanceY) {
maxAdvanceY = other.maxAdvanceY;
}
}
/* Used to transform the values back into user space.
* This is done ONCE by the strike so clients should not need
* to worry about this
*/
void convertToUserSpace(AffineTransform invTx) {
Point2D.Float pt2D = new Point2D.Float();
pt2D.x = ascentX; pt2D.y = ascentY;
invTx.deltaTransform(pt2D, pt2D);
ascentX = pt2D.x; ascentY = pt2D.y;
pt2D.x = descentX; pt2D.y = descentY;
invTx.deltaTransform(pt2D, pt2D);
descentX = pt2D.x; descentY = pt2D.y;
pt2D.x = baselineX; pt2D.y = baselineY;
invTx.deltaTransform(pt2D, pt2D);
baselineX = pt2D.x; baselineY = pt2D.y;
pt2D.x = leadingX; pt2D.y = leadingY;
invTx.deltaTransform(pt2D, pt2D);
leadingX = pt2D.x; leadingY = pt2D.y;
pt2D.x = maxAdvanceX; pt2D.y = maxAdvanceY;
invTx.deltaTransform(pt2D, pt2D);
maxAdvanceX = pt2D.x; maxAdvanceY = pt2D.y;
}
public String toString() {
return "ascent:x=" + ascentX + " y=" + ascentY +
" descent:x=" + descentX + " y=" + descentY +
" baseline:x=" + baselineX + " y=" + baselineY +
" leading:x=" + leadingX + " y=" + leadingY +
" maxAdvance:x=" + maxAdvanceX + " y=" + maxAdvanceY;
}
}
⏎ sun/font/StrikeMetrics.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, ≈888🔥, 5💬
Popular Posts:
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
JDK 11 java.management.jmod is the JMOD file for JDK 11 Management module. JDK 11 Management module ...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
JDK 17 jdk.hotspot.agent.jmod is the JMOD file for JDK 17 Hotspot Agent module. JDK 17 Hotspot Agent...
JAX-RPC is an API for building Web services and clients that used remote procedure calls (RPC) and X...