[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: RFR: 8240756: [macos] SwingSet2:TableDemo:Printed Japanese characters were garbled [v3]
From: Toshio Nakamura <tnakamura () openjdk ! java ! net>
Date: 2021-11-19 1:50:47
Message-ID: rZYnnyLgPJMcC_FsTRB3qQjOjSlwZKceSWeaSqt3syM=.e86a46bb-de0d-4d18-81de-43cd4fa20973 () github ! com
[Download RAW message or body]
On Thu, 21 Oct 2021 00:57:47 GMT, Toshio Nakamura <tnakamura@openjdk.org> wrote:
> > Hi,
> >
> > Could you review the fix?
> > When non-English characters were printed from JTable on MacOS, \
> > CTextPipe.doDrawGlyphs was called by OSXSurfaceData.drawGlyphs. However, \
> > CTextPipe seems not support glyph with slot number of composite fonts.
> > The slot data mask of GlyphVector is 0xff000000. In my environment, Japanese font \
> > was loaded at slot 4, and glyph data is like [0x40003e5]. Then, unexpected glyph \
> > was drawn.
>
> Toshio Nakamura has updated the pull request with a new target base due to a merge \
> or a rebase. The incremental webrev excludes the unrelated changes brought in by \
> the merge/rebase. The pull request contains seven additional commits since the last \
> revision:
> - 8240756: [macos] SwingSet2:TableDemo:Printed Japanese characters were garbled
> - revert previous proposal
> - Merge branch 'master' into 8240756
> - 2nd proposal
> - Revert previous change
> - Merge branch 'master' into 8240756
> merge master
> - 8240756: [macos] SwingSet2:TableDemo:Printed Japanese characters were garbled
Let me explain the fix a little bit more.
The native API for drawing with glyph vector, `CGContextShowGlyphsAtPoint()`, cannot \
set multiple fonts. So, the latest fix (c52a9f) switches the target font by Java code \
side, when 'slot' data is not 0, which means non-default font is used. This is \
completely changed from my previous proposals.
Also, I could finally create an automated test case. It compares drawing results by \
`SunGraphics2D.drawGlyphVector()` and `SunGraphics2D.drawString()` under \
`OSXOffScreenSurfaceData`. Since drawing positions can be different between these \
methods even if English characters, it tries to compare pixel counts. This can detect \
to use different glyphs.
I appreciate any comments.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3619
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic