OpenType / opentype-layout

opentype-layout working group documents
18 stars 4 forks source link

Discussion: proper text shaping & layout for consoles or character grids #11

Open be5invis opened 5 years ago

be5invis commented 5 years ago

This is a discussion thread about how to properly support complex script in a console or a character grid.

Cases may get involved: image

mhosken commented 5 years ago

I agree that it would be good to have a table of monowidths for characters. I can imagine values from -1 (or even -2) to 2 (or more?) Where negative means the character inserts before other characters and 0 for traditional diacritics. Characters like U+1000 would have width 2 and so on. BTW The example myanmar cluster is not real (thankfully). The width of a cluster should be the same as the sum of the absolute widths of the characters in it.

On further (edited) thought, the negative value is for characters that add width to an existing cluster. So in effect we are also specifying a clustering algorithm at the same time. If the value is > 0 then it is a new cluster. If it is <=0 then it is part of an existing cluster.

Clearly a font would have to be trusted to fit within the space specified.

be5invis commented 5 years ago

@mhosken From my personal view, text layout on consoles is more like a weird case of justification. Also, most fonts for east asian / complex script are not monospace, even if they are, they may not share the width of the Latin fonts. For example, CJK fonts use width 1 EM for all EA glyphs, but Latin monospaces fonts are often wider than 1/2 EM, which means that if we fit one EA character into two Latin cells, we need to insert extra space around it.

mhosken commented 5 years ago

I think the bigger issue for fixed spacing is application support. If apps can lookup how far to move a cursor every arrow key, then what the font does is less important.

On Thu, 4 Apr 2019, 17:05 Belleve Invis, notifications@github.com wrote:

@mhosken https://github.com/mhosken From my personal view, text layout on consoles is more like a weird case of justification. Also, most fonts for east asian / complex script are not monospace, even if they are, they may not share the width of the Latin fonts. For example, CJK fonts use width 1 EM for all EA glyphs, but Latin monospaces fonts are often wider than 1/2 EM, which means that if we fit one EA character into two Latin cells, we need to insert extra space around it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenType/opentype-layout/issues/11#issuecomment-479835177, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbHbR5l6DN6hpyErf-O1Qv7AuQFFuyWks5vdc55gaJpZM4ccSRZ .

stone-zeng commented 5 years ago

I think math can also be considered as a kind of complex script and there is actually such demand to support monospaced math font.

davelab6 commented 5 years ago

cc @raphlinus