Skip to main content

ZWJ and ZWNJ

1 reply [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
douglas felt

Phil's right.

To be a bit more specific:

If ZWNJ or ZWJ is in the text, full text layout will be performed
(rather than a simple drawString).

In Arabic, ZWNJ will typically cause the font's ligature formation rules
to 'miss' the pair and so inhibit the ligature. When we do default
ligature formation (using Unicode presentation forms, e.g. for Arabic)
this will also inhibit ligature formation. If we use a font's formation
rules and there is a ZWJ it's pretty much up to the font whether a
ligature is formed or not. When we do default ligature formation we
follow the Unicode spec.

In Indic scripts, Unicode recommends certain kinds of behavior for ZWJ
and ZWNJ and we follow those rules in the shaping engine.

ZWJ and ZWNJ are converted to 'ignorable' glyphs by our glyph mapping
code and should not be visible when rendered.

Doug

Phil Race wrote On 07/24/06 07:40,:
> ---------------------- Information from the mail header -----------------------
> Sender: Discussion list for Java 2D API
> Poster: Phil Race
> Subject: Re: ZWJ and ZWNJ
> -------------------------------------------------------------------------------
>
> >I assume this means that neither will ever occupy any rendering space.
>
> It will likely depend on the font. If the font maps it to a zero width
> glyph then yes
> But if the font doesn't map it, and since JDK doesn't treat it
> specially, then it'll end up mapped to the missing glyph
> just like *any* character you try to display that's not present in the font.
> and the mssing glyph usually does occupy space.
>
> but hopefully you will only be using fonts that map these ..
>
> >What's the effect of ZWNJ and ZWJ on ligatures?
>
> http://www.unicode.org/standard/versions/Unicode3.0.1.html#Ligatures
>
> states :
> ZERO WIDTH NON-JOINER
>
> The intended semantic is to break both cursive connections and ligatures
> in rendering.
>
> ZERO WIDTH JOINER
>
> is more complex .. but it encourages ligatures that would not otehrwise
> be formed
> please check out URL above
>
>
> -phil.
>
> Peter B. West wrote:
>
>>Doug noted earlier that the implementation supports 0x200C (ZERO WIDTH
>>NON-JOINER) and 0x200D (ZERO WIDTH JOINER). Not supported (along with
>>ZWSP) is WORD JOINER 0x2060. I assume this means that neither will ever
>>occupy any rendering space.
>>
>>What's the effect of ZWNJ and ZWJ on ligatures? Will either or both
>>prevent the formation of ligatures?
>>
>>Thanks
>>Peter
>>
>>===========================================================================
>>To unsubscribe, send email to listserv@java.sun.com and include in the body
>>of the message "signoff JAVA2D-INTEREST". For general help, send email to
>>listserv@java.sun.com and include in the body of the message "help".
>>
>
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".