[OpenJDK 2D-Dev] RFR: 8167103: Intermittent font loading failure on macOS with JFXPanel application

Philip Race philip.race at oracle.com
Sat Nov 26 23:30:43 UTC 2016


It is just for debugging so not that important and
in any case at one point when I tried this using
the URL for the file not the folder "res" was set up
CFErrorRef was left as nil so it didn't get filled in any way ..

-phil.

On 11/24/16, 12:50 AM, Prasanta Sadhukhan wrote:
>
> Seems fine to me. Only thing is since "res" is being printed, it 
> suggests you are interested in knowing the return status of 
> CTFontManagerRegisterFontsForURL method
>
> in which case, I think it will be better if we pass |CFErrorRef 
> parameter instead of nil and print that out [maybe 
> via||CFErrorCopyDescription(_ err: CFError!)]||, so that we can know 
> the reason for failure better.
>
> Regards
> Prasanta
> |
> On 11/22/2016 8:15 AM, Philip Race wrote:
>>
>>
>> On 11/21/16, 4:17 PM, Sergey Bylokhov wrote:
>>> Looks fine, but are you sure that we need such mix of logging in the 
>>> debug build?
>>
>> Do you mean "any" logging or the mix in of the printf ?
>> Certainly the ifdef DEBUG pattern is used all over this file ..
>>
>>>  410 #ifdef DEBUG
>>>  411     NSLog(@"path is : %@", (NSString*)path);
>>>  412     NSLog(@"url is : %@", (NSString*)url);
>>>  413     printf("res is %d\n", res);
>>>  414 #endif
>>>
>>> I wonder from the specification of the old method which was used:
>>> https://developer.apple.com/reference/applicationservices/1563693-atsfontactivatefromfilereference?language=objc 
>>>
>>
>> Not sure exactly what you mean there but if you mean that the
>> Apple docs seem to have "deleted" the specification, yes, and
>> that was one reason to upgrade .. I didn't even know what
>> the limitations were on the old method.
>>
>> -phil.
>>
>>>
>>> On 22.11.16 1:34, Philip Race wrote:
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8167103
>>>> Webrev: http://cr.openjdk.java.net/~prr/8167103/
>>>>
>>>> This bug is a deadlock in MacOS platform font code when
>>>> JavaFX and Java2D are both calling platform font APIs.
>>>> This can happen in the context of Swing inter-op for FX.
>>>> It was previously seen when embedding Swing in FX (SwingNode)
>>>> in bug https://bugs.openjdk.java.net/browse/JDK-8120878
>>>> There was a workaround added for that case.
>>>> Now it is seen when loading embedding FX in Swing (JFXPanel)
>>>> What seems to work is switching 2D from using the deprecated
>>>> ATS API to the same CoreText API used by FX.
>>>>
>>>> The bug was reported against FX but since the fix is in 2D I've
>>>> recategorised it.
>>>>
>>>> -phil.
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20161126/bb75ab0a/attachment.html>


More information about the 2d-dev mailing list