Skip to content

Commit

Permalink
Translate Approaches to line breaking (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
xfq authored Nov 22, 2024
1 parent ad72d9a commit 265ae5f
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 5 deletions.
11 changes: 11 additions & 0 deletions articles/typography/linebreak-data/local.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
html[lang=zh-hans] .qterm {
quotes: "“" "”";
}

.table-vertical {
line-height: 1.4;
}

.nowrap {
white-space: nowrap;
}
2 changes: 1 addition & 1 deletion articles/typography/linebreak-data/translations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var trans = { }

trans.versions = ['en'];
trans.versions = ['en', 'zh-hans'];

trans.outofdatetranslations = [];

Expand Down
8 changes: 4 additions & 4 deletions articles/typography/linebreak.en.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h3>Space delimited words</h3>
</div>

<p>Looking at the above example, you will notice that the relative order of the English words has been rearranged across the line break. This is because horizontal bidirectional text is never read upwards, from line to line. This output is managed by the bidirectional reordering process, before line-break opportunities are calculated, and only affects the positioning of font glyphs. Characters in memory run in order of pronunciation, and don't change.</p>
<p>Vertically-set Chinese, Japanese, Korean, and Traditional Mongolian wrap words upwards, but the new line appears to the left for CJK, and right for Mongolian.</p>
<p>Vertically-set Chinese, Japanese, Korean, and Traditional Mongolian wrap words upwards, but the new line appears to the left for <abbr title="Chinese, Japanese &amp; Korean">CJK</abbr>, and right for Mongolian.</p>
</section>


Expand Down Expand Up @@ -439,7 +439,7 @@ <h3>Other special rules</h3>
<figcaption>A taling glyph appears at the end and start of the line when the word <span class="trans">kawon</span> is split before <span class="trans">won</span>.</figcaption>
</figure>
</div>
<p>This is not common in modern text, although that is not so surprising since in order to produce it a rather special algorithm is needed. When using old type setting techniques this (and the Tibetan example above) would be relatively easy to produce by adding some type to the end of a static row of type. However, Web pages are dynamic and the width of a line can change at any time, as the user changes the browser window dimensions. The behaviour shown has to be produced only when the break happens to fall in exactly the right place: as text reflows when the browser window width changes, the extra taling needs to disappear.</p></section>
<p>This is not common in modern text, although that is not so surprising since in order to produce it a rather special algorithm is needed. When using old typesetting techniques this (and the Tibetan example above) would be relatively easy to produce by adding some type to the end of a static row of type. However, Web pages are dynamic and the width of a line can change at any time, as the user changes the browser window dimensions. The behaviour shown has to be produced only when the break happens to fall in exactly the right place: as text reflows when the browser window width changes, the extra taling needs to disappear.</p></section>
</section>


Expand All @@ -457,12 +457,12 @@ <h2>Further reading</h2>
<p><a href="http://pioneer.netserv.chula.ac.th/~awirote/ling/snlp2007-wirote.pdf"><cite>Thoughts on Word and Sentence Segmentation in Thai</cite></a></p>
</li>
<li>
<p>Related links, <cite>International text layout and typography</cite></p>
<p>Related links, <cite>Language enablement</cite></p>
<ul><li><a href="https://www.w3.org/TR/typography/#line_breaking">Line breaking</a></li>
</ul>
</li>
<li>
<p>Related links, <cite>Authoring web pages</cite></p><ul><li><a href="https://www.w3.org/International/techniques/authoring-html#open=style">Styling &amp; layout</a>, <a href="https://www.w3.org/International/techniques/authoring-html.en?open=style&open=linebreaks">Managing line breaks</a></li>
<p>Related links, <cite>Authoring web pages</cite></p><ul><li><a href="https://www.w3.org/International/techniques/authoring-html#style">Styling &amp; layout</a>, <a href="https://www.w3.org/International/techniques/authoring-html.en?open=style&open=linebreaks">Managing line breaks</a></li>
</ul>
</li>
</ul>
Expand Down
Loading

0 comments on commit 265ae5f

Please sign in to comment.