[Webkit-unassigned] [Bug 17427] Line breaking opportunities at the end of a text node are missed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 25 09:27:37 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=17427


Michael Saboff <msaboff at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msaboff at apple.com




--- Comment #23 from Michael Saboff <msaboff at apple.com>  2012-09-25 09:28:03 PST ---
(In reply to comment #17)
> (In reply to comment #13)
> > [1] and [2] talk about creating UText objects from discontinuous strings but it is not clear whether this feature is anything more than theoretical.
> 
> It is not theoretical. In fact Michael Saboff is doing something interesting with this to make Latin-1 work with ICU without making UTF-16 copies of the strings.

You can write your own UText "object", basically a UText struct with function pointers to "virtual" functions for your UText. See http://icu-project.org/apiref/icu4c/structUText.html for some details.  You can also look at my patch out for review at https://bugs.webkit.org/attachment.cgi?id=165221&action=review.  I do copy chunks because I'm starting with 8 bit source data and the ICU breaking code working with UText expects UChar data.

For read only uses, you don't need all the UText functions.  For breaking, I think you'll need clone (shallow only I think), nativeLength, access, extract, mapOffsetToNative, mapNativeIndexToUTF16 and close.  Your functions need to be set in pFuncs along with all the other UText fields, likely in your own makeUTextForCombinedRenderText method. Given that you have data across multiple elements, your access function will need to map in the appropriate element (RenderText) and it's offsets into the UText structure as part of access processing.  Using this method you shouldn't need to copy RenderText data.  THis method will only work on platforms that have version 4 or later of ICU, IIRC.

Hope this helps.

You changes and my changes are touching similar code.  I plan on changing  RenderText so that the m_text String can contain 8 bit data.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list