Hello,
I would like to display camel-case variable names in GoJS text blocks. I want to impose a fixed width to the text block, and have GoJS split the text on camel-case word boundaries. To do so, I tried to insert the dedicated Unicode characters in the text, but GoJS seems to only consider spaces for word wrap. How could I achieve this?
Here is the code I tried: I modified the TextBlock sample on wrapping. I included a drawing of the results I expect.
diagram.add(
$(go.Part, "Vertical",
$(go.TextBlock, { text: "my Text Block", background: "lightgreen", margin: 2,
width: 50, wrap: go.TextBlock.WrapDesiredSize }),
$(go.TextBlock, { text: "my\u200BText\u200BBlock", background: "lightgreen", margin: 2,
width: 50, wrap: go.TextBlock.WrapDesiredSize }),
$(go.TextBlock, { text: "my\u00ADText\u00ADBlock", background: "lightgreen", margin: 2,
width: 50, wrap: go.TextBlock.WrapDesiredSize })
));
The zero-width space (ZWSP) is a non-printing character used in computerized typesetting to indicate word boundaries to text processing systems when using scripts that do not use explicit spacing, or after characters (such as the slash) that are not followed by a visible space but after which there may nevertheless be a line break. Normally, it is not a visible separation, but it may expand in passages that are fully justified. In HTML pages, the zero-width space can be used as a potential line...
In computing and typesetting, a soft hyphen (ISO 8859: 0xAD, Unicode U+00AD SOFT HYPHEN, HTML: ­ ­) or syllable hyphen (EBCDIC: 0xCA), abbreviated SHY, is a code point reserved in some coded character sets for the purpose of breaking words across lines by inserting visible hyphens. Two alternative ways of using the soft-hyphen character for this purpose have emerged, depending on whether the encoded text will be broken into lines by its recipient, or has already been preformatted by its...