[OpenJDK 2D-Dev] RFR: 8169202: [macos] Font substitution does not work for supplementary characters
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Mon Nov 7 15:03:53 UTC 2016
Looks fine.
On 07.11.16 17:52, Dmitry Batrak wrote:
> Hello,
>
> I'd like to propose a patch for
> https://bugs.openjdk.java.net/browse/JDK-8169202.
> I have a Contributor status via agreement signed by JetBrains, hope
> someone can sponsor the patch.
> This repeats the proposal I've sent earlier to this mailing list,
> adding now a reference to the created OpenJDK issue.
>
> Currently, if requested font cannot render a Unicode character
> represented by a surrogate pair,
> no substitution is performed - Font.canDisplay will return false, and
> the character will be
> rendered as a 'missing' glyph. This behaviour doesn't violate any
> specification, but it looks like
> it can be easily improved, as underlying OS framework used under the
> hood does support surrogate pairs.
>
> The proposed change consists of two parts. First part is adjusting the
> code in CoreTextSupport.m
> to handle surrogate pairs while performing char-to-glyph mapping, by
> encoding non-displayable
> surrogate pairs using negative values of the codepoint, similar to how
> non-displayable BMP characters
> are encoded. Second part is fixing the rendering code (in
> CGGlyphImages.m), where wrong type was used
> to pass character values around, so that code for surrogate pairs
> handling, already present there,
> could work.
>
> Webrev for the fix is available at
> http://cr.openjdk.java.net/~avu/JDK-8169202/webrev.02/
> (kindly posted by my colleague, having access to cr.openjdk.java.net
> <http://cr.openjdk.java.net>).
>
> Best regards,
> Dmitry Batrak
--
Best regards, Sergey.
More information about the 2d-dev
mailing list