LCD font smoothing in Text has no effect
Thor Johannesson
thor.johannesson at oracle.com
Fri Jun 1 15:57:32 PDT 2012
I just wanted to elaborate on LCD Text when there is transparency.
Before 2.2 we would fallback to grayscale if any transparency was detected, in destination. In 2.2, LCD text is rendered with whatever color information is there. If there is no background color (completely transparent) then results of lcd blending will look like AA gray-scale text. So same rendered, just different results.
There are a lot of conditions where it does not make sense to use LCD text rendering. Leading to some restrictions.
Some current restrictions on LCD Text rendering:
- Certain effects will use a different render path
- Text paint must be a color
- BlendMode must be SRC_OVER (default)
- Stroked text will be rendered in gray scale.
- Very large text will be rendered as shapes (Gray)
- Platform support, and restrictions (Mac default is gray)
-Thor
On Jun 1, 2012, at 9:36 AM, Richard Bair wrote:
> OK, so what you see in SB was gray scale, but if you actually run the app produced using SceneBuilder, it would be LCD?
>
> Richard
>
> On Jun 1, 2012, at 9:33 AM, Jasper Potts wrote:
>
>> It's a known issue fixed in 2.2 as Phil said. No LCD text in transparent windows such as used in SceneBuilder. Should be fixed with SB 1.0 release on 2.2.
>>
>> Jasper
>>
>> On Jun 1, 2012, at 7:24 AM, Richard Bair <richard.bair at oracle.com> wrote:
>>
>>> Whoa, I found that surprising. Can you file a bug and we'll investigate.
>>>
>>> Thanks
>>> Richard
>>>
>>> On May 31, 2012, at 11:06 PM, John C. Turnbull wrote:
>>>
>>>> Hmm, works in a stand-alone application. Maybe it's a bug in Scene Builder?
>>>>
>>>> Thanks,
>>>>
>>>> -jct
>>>>
>>>> -----Original Message-----
>>>> From: Phil Race [mailto:philip.race at oracle.com]
>>>> Sent: Friday, 1 June 2012 15:16
>>>> To: John C. Turnbull
>>>> Cc: openjfx-dev at openjdk.java.net
>>>> Subject: Re: LCD font smoothing in Text has no effect
>>>>
>>>> I think you should try this outside of scene builder first to eliminate
>>>> that.
>>>> If SceneBuilder is creating a shaped window and you are embedded in it then
>>>> you won't get LCD text.
>>>>
>>>> -phil.
>>>>
>>>> On 5/31/12 10:01 PM, John C. Turnbull wrote:
>>>>> All I am doing is placing a Text object on top of a filled Rectangle
>>>>> in Scene Builder b40.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> -jct
>>>>>
>>>>> -----Original Message-----
>>>>> From: Phil Race [mailto:philip.race at oracle.com]
>>>>> Sent: Friday, 1 June 2012 14:23
>>>>> To: John C. Turnbull
>>>>> Cc: openjfx-dev at openjdk.java.net
>>>>> Subject: Re: LCD font smoothing in Text has no effect
>>>>>
>>>>> So are you using a shaped window or transparency ?
>>>>> In those cases you may get grayscale. The most recent 2.2 builds will
>>>>> fix this IFF the transparency is not under the text pixels.
>>>>>
>>>>> -phil.
>>>>>
>>>>> On 5/31/12 9:19 PM, John C. Turnbull wrote:
>>>>>> Looks like I am getting Direct3D...
>>>>>>
>>>>>> Prism pipeline init order: d3d j2d
>>>>>> Using t2k for text rasterization
>>>>>> Using dirty region optimizations
>>>>>> Prism pipeline name = com.sun.prism.d3d.D3DPipeline Loading D3D
>>>>>> native library ...
>>>>>> succeeded.
>>>>>> Direct3D initialization succeeded
>>>>>> (X) Got class = class com.sun.prism.d3d.D3DPipeline Initialized prism
>>>>>> pipeline: com.sun.prism.d3d.D3DPipeline OS Information:
>>>>>> Windows 7 build 7601
>>>>>> D3D Driver Information:
>>>>>> NVIDIA Quadro FX 5800
>>>>>> \\.\DISPLAY1
>>>>>> Driver nvd3dumx.dll, version 8.17.12.9635
>>>>>> Pixel Shader version 3.0
>>>>>> Device : ven_10DE, dev_05FD, subsys_059310DE
>>>>>>
>>>>>> ...but I still get greyscale antialiasing.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> -jct
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Phil Race [mailto:philip.race at oracle.com]
>>>>>> Sent: Friday, 1 June 2012 13:50
>>>>>> To: John C. Turnbull
>>>>>> Cc: openjfx-dev at openjdk.java.net
>>>>>> Subject: Re: LCD font smoothing in Text has no effect
>>>>>>
>>>>>> -Dprism.verbose=true to see which renderer is used.
>>>>>>
>>>>>> Are you getting 2D or D3D/OGL ?
>>>>>>
>>>>>> 2D isn't set up to do it and we probably won't fix that because it
>>>>>> won't matter once we stop using it in 3.0
>>>>>>
>>>>>> -phil.
>>>>>>
>>>>>> On 5/31/12 8:36 PM, John C. Turnbull wrote:
>>>>>>> I have never been able to see any difference when I set the font
>>>>>>> smoothing option to LCD in a Text control even with the latest
>>>>>>> JavaFX
>>>>>>> 2.2 drop. Gray scale antialiasing is still in use.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Is this something likely to be fixed soon?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -jct
>>>>>>>
>>>>
>>>
>
More information about the openjfx-dev
mailing list