[sword-devel] Sword support of indents and line breaks
DM Smith
dmsmith at crosswire.org
Fri Apr 12 12:12:18 MST 2013
I think there are bigger problems to solve first. I think Troy alluded to this in his response that there is a need to fix the whitespace problem. I think this causes most of the differences you see when rendering in most SWORD frontends.
The whitespace problem is exacerbated in that osis2mod takes the BSP container model and converts the containers into milestoned elements so that a verse can be displayed in a different context than a chapter as a whole (two examples: with in a table cell, in a list of verses). In most (all?) frontends the user can also choose to start each verse on a line to itself, changing the entire notion of paragraphs.
Regarding line break, you noted the <lb/> element provides just that.
Regarding paragraph formats, the <p> element does not define any. There is no notion of "justified", "indented", "line-spacing", "centering", .... that most word processors provide. These have to use the type/subType attribute extension. And as you noted, SWORD does not support these. Chris has suggested that we could allow <p type="x-indent"> as a way of handling this. I'd go a bit further and allow any type and subType x-yyy values on any element, to become a class attributes (without the x- ) on the resulting html element.
Regarding front-ends and paragraph display, most (all?) have a blank line between paragraphs, rather than indenting. A front-end might be able to make that a user choice.
In Him,
DM
On Apr 12, 2013, at 2:04 AM, John Austin <gpl.programs.info at gmail.com> wrote:
> Sword should support basic indents and line breaks. Content providers should be able to control the formatting of their texts and should not be required to assign their content to artificial <p>...</p> or other containers to do so. Although these containers might be useful, the text of some translation styles cannot be fit nicely into them. But often content providers do rightly desire their texts to appear with formatting similar to their printed texts, since this is exactly what the translators deemed easiest to read and understand.
>
> People who convert texts to Sword are often not at liberty to change the source texts to do so, and source texts in strange languages come with many unexpected language constructs. For these reasons it is important that Sword tries to offer content providers a simple, reliable way of formatting their own texts, without requiring them to fit into Sword's container scheme to do so.
>
> IBT of Russia is already using simple osis <milestone type="x-p-indent" /> and <lb /> to achieve all their formatting needs for their Sword modules. Currently, only xulsword supports both of these. But perhaps they should both be included in Sword's osis2html filters so that all front-ends can support them. At least something very similar should be adopted, if there is a strong reason not to adopt IBT's well tested method.
>
> Hard spaces and other such formatting are not acceptable solutions because they cannot be easily filtered. It is important that unformatted text can easily be obtained from formatted text since there are many uses for unformatted text, such as bookmark and cross-reference verse texts etc.
>
> Here is one example to show why forcing containers on a text is not a good idea. This is a section of SFM from the book of Ruth 1:8-12:
>
> \v 8 Йўлда давом этишаркан, Наима иккала келинига деди:
> \p — Боринглар, икковингиз ҳам оналарингизнинг уйларига қайтинглар. Менга ва марҳумларга бўлган иззат–ҳурматингиз учун Эгам сизларга ҳам марҳамат қилсин.
> \v 9 Икковларингизга ҳам яхши жойлардан ато қилсин, турмуш қуриб, ўз эрларингиз билан бахтли бўлинглар!
> \p Шундай деб Наима келинларини ўпди, иккаласи эса йиғлаб фарёд кўтаришди:
> \p
> \v 10 — Йўқ, биз сиз билан кетамиз, сизнинг халқингиз орасида яшаймиз, — дейишди.
> \v 11 Наима эса яна келинларига:
> \p — Қайтинглар, жон қизларим! — деди. — Мен билан кетганингиздан нима фойда?! Қорнимда яна ўғилларим бормидики сизларга умр йўлдоши бўлса?!*
> \v 12 Бўлди энди, қизларим, қайтинглар! Мен энди кексайдим, эрга тегишга ожизман. Борди–ю, мен, ҳали умид қилсам бўлади, деб шу кеча эрим билан қовушсаму ўғиллар туғсам,
>
> Here is a PDF of exactly what the translators designed this SFM to look like: http://ibt.org.ru/russian/bible/uzb/otcyr/08%20Rut%20-%20Uzbek%20Cyrillic.pdf
>
> And here is what it looks like in Sword format using only basic osis intents and line breaks, rendered by xulsword's osis2html filter: http://ibt.org.ru/en/text.htm?m=UZV&l=Ruth.1.1.1&g=0. As you can see, the Sword module renders this strange (to us) formatting of text just like the translators wanted.
>
> However, now imagine trying to programmatically apply <p>...</p>, <l>...</l> etc. constructs to the above SFM to achieve the same effect. The designers of the SFM in this case are using the \p tag to represent a simple indent (not a paragraph) in order to achieve their desired non-Western layout. One might try and argue that the SFM designers have done something wrong, but the point is that we have what we have. So Sword should provide a simple way for content providers to control the formatting of their texts. Basic indents and line breaks do the trick for Central Asian languages, and probably many others as well. Poetry is even made easy, by putting indents in series as desired.
>
>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
More information about the sword-devel
mailing list