From c92a40eb4bfb224ff40435212594ef9b76631c37 Mon Sep 17 00:00:00 2001 From: Bylokhov <14138494+mrserb@users.noreply.github.com> Date: Wed, 6 Oct 2021 00:29:56 -0700 Subject: [PATCH] 8234916: [macos 10.15] Garbled text running with native-image --- ....15-Garbled-text-running-with-native.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 javafx/patches/shared/0007-8234916-macos-10.15-Garbled-text-running-with-native.patch diff --git a/javafx/patches/shared/0007-8234916-macos-10.15-Garbled-text-running-with-native.patch b/javafx/patches/shared/0007-8234916-macos-10.15-Garbled-text-running-with-native.patch new file mode 100644 index 00000000000..c3347dadde2 --- /dev/null +++ b/javafx/patches/shared/0007-8234916-macos-10.15-Garbled-text-running-with-native.patch @@ -0,0 +1,34 @@ +From 4ddf55428d06dddadfc8cd14baabdc4d17318ee2 Mon Sep 17 00:00:00 2001 +From: Jose Pereda +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) +