-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8234916: [macos 10.15] Garbled text running with native-image
- Loading branch information
1 parent
c391000
commit c92a40e
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
javafx/patches/shared/0007-8234916-macos-10.15-Garbled-text-running-with-native.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 4ddf55428d06dddadfc8cd14baabdc4d17318ee2 Mon Sep 17 00:00:00 2001 | ||
From: Jose Pereda <[email protected]> | ||
Date: Thu, 5 Dec 2019 20:13:53 +0000 | ||
Subject: [PATCH] 8234916: [macos 10.15] Garbled text running with native-image | ||
|
||
Reviewed-by: prr | ||
--- | ||
.../graphics/src/main/native-font/coretext.c | 10 +++++++++- | ||
1 file changed, 9 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/modules/graphics/src/main/native-font/coretext.c b/modules/graphics/src/main/native-font/coretext.c | ||
index d84ba0fc1d..f02c626532 100644 | ||
--- a/modules/graphics/src/main/native-font/coretext.c | ||
+++ b/modules/graphics/src/main/native-font/coretext.c | ||
@@ -388,7 +388,15 @@ JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreateWithName) | ||
CGAffineTransform _arg2, *lparg2=NULL; | ||
jlong rc = 0; | ||
if (arg2) if ((lparg2 = getCGAffineTransformFields(env, arg2, &_arg2)) == NULL) goto fail; | ||
- rc = (jlong)CTFontCreateWithName((CFStringRef)arg0, (CGFloat)arg1, (CGAffineTransform*)lparg2); | ||
+ CFStringRef fontName = (CFStringRef)arg0; | ||
+ if (CFStringGetCharacterAtIndex(fontName, 0) == '.') { | ||
+ bool bold = CFStringFind(fontName, CFSTR("bold"), kCFCompareCaseInsensitive).location != kCFNotFound; | ||
+ CTFontRef font = CTFontCreateUIFontForLanguage(bold ? kCTFontUIFontEmphasizedSystem : kCTFontUIFontSystem, 0.0, NULL); | ||
+ rc = (jlong) CTFontCreateCopyWithAttributes(font, (CGFloat)arg1, (CGAffineTransform*)lparg2, NULL); | ||
+ CFRelease(font); | ||
+ } else { | ||
+ rc = (jlong) CTFontCreateWithName(fontName, (CGFloat)arg1, (CGAffineTransform*)lparg2); | ||
+ } | ||
fail: | ||
/* In only */ | ||
// if (arg2 && lparg2) setCGAffineTransformFields(env, arg2, lparg2); | ||
-- | ||
2.30.1 (Apple Git-130) | ||
|