mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
an option to disable native rendering for rotated text (following JRE-19)
port commit ccc1ded6 from JBR 9 port from JBR 11 to JBR 15 (cherry picked from commit72fb9ff7c4) cherry picked from commita5bd092449
This commit is contained in:
@@ -120,6 +120,8 @@ public class FileFontStrike extends PhysicalStrike {
|
||||
private static native boolean isDirectWriteAvailable();
|
||||
private static boolean isXPorLater = false;
|
||||
|
||||
private static boolean useNativesForRotatedText;
|
||||
|
||||
private static boolean useDirectWrite;
|
||||
|
||||
// DirectWrite rendering options' values can be found in MSDN documentation
|
||||
@@ -150,6 +152,8 @@ public class FileFontStrike extends PhysicalStrike {
|
||||
if (isXPorLater) {
|
||||
AccessController.doPrivileged(new PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
String rotatedProperty = System.getProperty("rotated.text.native.rendering");
|
||||
useNativesForRotatedText = rotatedProperty == null || Boolean.parseBoolean(rotatedProperty);
|
||||
useDirectWrite = Boolean.getBoolean("directwrite.font.rendering") && isDirectWriteAvailable();
|
||||
if (useDirectWrite) {
|
||||
String options = System.getProperty("directwrite.font.rendering.options");
|
||||
@@ -287,7 +291,7 @@ public class FileFontStrike extends PhysicalStrike {
|
||||
pts = Math.abs(matrix[1]);
|
||||
}
|
||||
intPtSize = (int) pts;
|
||||
useNatives = rotation >= 0 && pts >= 3.0 && pts <= 100.0 &&
|
||||
useNatives = (rotation == 0 || rotation > 0 && useNativesForRotatedText) && pts >= 3.0 && pts <= 100.0 &&
|
||||
!((TrueTypeFont)fileFont).useEmbeddedBitmapsForSize(intPtSize);
|
||||
}
|
||||
if (FontUtilities.isLogging() && FontUtilities.isWindows) {
|
||||
|
||||
Reference in New Issue
Block a user