Closed bertfrees closed 8 years ago
Either make it a translator (TextTransform) feature or a formatter (dotify-formatter) feature.
In case we make it a formatter feature, the TextTransform API might have to be enhanced in order to be able to get the mapping between input and output.
Implementing letter-spacing in combination with pre-translation and hyphenation is somewhat challenging. (See also discussion at https://botbot.me/freenode/snaekobbi/2015-10-21.)
When word breaking is disabled, letter spacing can be applied in pre-translation simply by adding no-break spaces between letters: f o o b a r
(
= nbsp).
When word breaking is enabled but the "hyphenate-character" is supposed to behave like a regular letter -- in other words if letter-spacing:x
it is separated from the preceding letter by x spaces -- there is no problem either. We simply add a no-break space followed by a soft hyphen between the letters where the word can be broken: f o o -b a r
(`= nbsp and
-` = shy)
The result of breaking this word in the middle is:
f o o -
b a r
and the result of not breaking the word is:
f o o b a r
However, when word breaking is enabled and the hyphenate-character is supposed to be attached to the preceding letter, like this:
f o o-
b a r
there is currently no straightforward way to pre-translate text and control the line breaking by inserting white space and other special characters only.
Solution 1: Extend CSS to give more control over line and word breaking, either by defining the behavior of more special (white space) characters, or by creating more properties (or modifying/extending existing properties).
Solution 2: Perform translation while formatting, either completely while formatting or partly in pre-translation and partly in a second pass while formatting.
Since pre-translation is required mainly for the purpose of e-braille, which has not been fully specified yet, and for a yet to be specified editing format, I suggest we do the whole translation while formatting for now, and wait until the requirements for pre-translation have been properly specified.
Fixed by v1.9.8
Eithermake it a translator (TextTransform) featureor a formatter (dotify-formatter) feature.Eitheradd a 'letter-spacing' property,reuse the 'text-transform' property (https://github.com/snaekobbi/braille-css-spec/issues/12), or somehow support letter spacing in translator queries.Depends on:
Related issues: