News for hackers. Stuff that matters.
Re:Requirements for Japanese Text Layout by nxobject on Sunday February 25, 2024 @04:48AM (#39499346)
Everything you wanted to know about Japanese typography, and more.
Re:Requirements for Japanese Text Layout by tkgally on Sunday February 25, 2024 @07:25AM (#39500229)
Yes, indeed. I’ve had a professional interest in Japanese typography for many years, having worked on many Japanese dictionaries and other publications, but this document contains much that I didn’t know.
Re:Requirements for Japanese Text Layout by nxobject on Sunday February 25, 2024 @06:33PM (#39506081)
+1 to that – in the document's note sections there are a lot of typographical rules of style/aesthetic rules of thumb that are probably out of the scope of a W3C-style purely algorithmic specification, are very useful (e.g. indentations, conventional head/subhead/running section formatting, etc.)
Re:Requirements for Japanese Text Layout by sylware on Sunday February 25, 2024 @06:30AM (#39499950)
Isn't text shapping more in the unicode scope than in w3c scope?
Re:Requirements for Japanese Text Layout by phonon on Sunday February 25, 2024 @02:09PM (#39503728)
This isn't glyph shaping, it's text layout.
Re:Requirements for Japanese Text Layout by sylware on Sunday February 25, 2024 @02:33PM (#39503979)
Which is called text shaping.

????

Re:Requirements for Japanese Text Layout by dhosek on Sunday February 25, 2024 @05:55PM (#39505786)
text shaping is not a thing. Unicode provides some basic parameterization (e.g., indicating where valid line breaks can occur in a text), but does not provide much more in the way of layout specification, nor should it. It’s a text encoding specification, not a typography specification. You will also notice that it does not include, e.g., specifications about Latin alphabet typographic ligatures either (e.g., f+f+i → ffi). The existence of some ligatures in the Unicode standard is a sop to backwards compatibility with older encodings only (this is also why Unicode includes superscript/subscript digits, box drawing characters and a number of inconsistencies in how different scripts are managed).
Re:Requirements for Japanese Text Layout by bradrn on Sunday February 25, 2024 @06:01PM (#39505840)
No, they’re different. ‘Shaping’ is deciding how to combine adjacent characters, mostly by changing their forms as needed, and secondarily by adjusting their horizontal or vertical positions. ‘Layout’ then involves taking those shaped characters and placing them on the page to form words and sentences. There’s some overlap — e.g. you could use shaping to implement the mojikumi rules in section 3.1.2 here — but by and large they’re separate things.
Re:Requirements for Japanese Text Layout by sylware on Sunday February 25, 2024 @07:53PM (#39506561)
I reread the descriptions of those c++ diarrheas which are those abomination of harfbuzz and icu, and indeed, this is a cluster f*ck of "text-layout-shaping" terminologies.

Until I get a plain and simple C99 implementation in the worse case scenario, I would stay away from those.

Re:Requirements for Japanese Text Layout by dougfelt on Sunday February 25, 2024 @10:29PM (#39507367)
Good luck finding a 'plain and simple' implementation that is as feature complete as either of those. International text layout is complex.
Re:Requirements for Japanese Text Layout by sylware on Monday February 26, 2024 @05:16AM (#39509537)
There was a unicode text shaper from Japan, a C library, l17n or something like that. But google is unable to find it again. Maybe it is gone.

But the right way to avoid like hell those c++ abominations (there are still people thinking coding c++ makes them smart, at best toxic, but no less worse) and start with roman script and incrementally add supported languages. I did venture in harfbuzz, there is no salvation, the coding is so much c++ brainf*cked better start clean and lean.

Re:Requirements for Japanese Text Layout by astrange on Monday February 26, 2024 @02:32AM (#39508501)
Funny enough, ICU was originally written in C++ by Apple for Pink/Taligent, then ported to Java, then ported back to C++.
Re:Requirements for Japanese Text Layout by sylware on Monday February 26, 2024 @05:11AM (#39509502)
Weird, I got before they started to enshitify ICU with c++, I remember having a plain and simple C version.
Re:Requirements for Japanese Text Layout by ngcc_hk on Sunday February 25, 2024 @06:14AM (#39499849)
Very interesting. And provide both Japanese and English version (both separately and together) is a God sent.
Re:Requirements for Japanese Text Layout by re5i5tor on Sunday February 25, 2024 @11:07AM (#39501907)
In season 2 of Tokyo Vice, they show character Jake, a reporter for newspaper Meicho Shimbun, using a native Japanese “word” processor to type in his stories. Really fascinating and seems to be authentic.
Re:Requirements for Japanese Text Layout by dhosek on Sunday February 25, 2024 @05:49PM (#39505753)
I remember being absolutely fascinated by the ability of 1980s/early 1990s Japanese laptops to manage input with a standard keyboard. Especially given the computing resources of the time, it seemed like serious dark magic.
Re:Requirements for Japanese Text Layout by wodenokoto on Sunday February 25, 2024 @11:26PM (#39507663)
The first time I watched battle royal I thought the hacking scene was film magic, because no way could the computer just change letters into Japanese characters like that.
Re:Requirements for Japanese Text Layout by astrange on Monday February 26, 2024 @02:28AM (#39508486)
Unlike Jake (Adelstein) himself, who whenever I've read any of his stories has obviously made it up. Especially the ones where he claims to know everyone in the yakuza.
Re:Requirements for Japanese Text Layout by wahnfrieden on Sunday February 25, 2024 @12:13PM (#39502549)
Web has great support for Japanese. Apple native support on iOS and macOS is relatively abysmal, with piss poor support for basic needs like ruby text.
Re:Requirements for Japanese Text Layout by nxobject on Sunday February 25, 2024 @01:37PM (#39503431)
Yeah – my understanding is that, if you really want a cross-platform product, you'll have to license a commercial engine.
Re:Requirements for Japanese Text Layout by wahnfrieden on Sunday February 25, 2024 @02:49PM (#39504124)
I like using web views including rendering them to png or pdf

Apple has some janky old UIKit and less-so AppKit support for Japanese that's portable to use from SwiftUI so I get by without needing web views for every label. However it's still nice to just use a web view for primary content.

There's zero input support for advanced Japanese features on native Apple platforms basically, like ruby text editing, but they can be bolted on cleverly with work. Or just use a web view.

Re:Requirements for Japanese Text Layout by tupuc_speedrap on Sunday February 25, 2024 @08:42PM (#39506795)
This makes sense, most people from California rarely even leave their state let alone go to a different country
Re:Requirements for Japanese Text Layout by astrange on Monday February 26, 2024 @02:29AM (#39508489)
Japan is the second largest iOS market.
Re:Requirements for Japanese Text Layout by o11c on Sunday February 25, 2024 @03:08PM (#39504261)
Hm, I'm having a weird and interesting issue with this website.

I'm using Firefox ESR with the (recommended) Auto Tab Discard [1] extension to save memory for idle background tabs. Unlike prior extensions AFAIU this should be using largely native browser code paths.

When I return to the jlreq page after it has idled out, all the Japanese text comes back and the "English" button is inoperative until I click one of the other language options.

Whose bug is this?

[1]: https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...

Re:Requirements for Japanese Text Layout by mjevans on Sunday February 25, 2024 @08:48PM (#39506838)
I have no proof, but I suspect it's a firefox bug, as I've noticed other behavior that seems a LOT like: some process forces a tab to reload, but that trigger isn't fed to plugins (E.G. Dark Reader, and pages that are unexpectedly blindingly bright).

ATD might be useful as a way of triggering this behavior more reliably by exercising the discard and reload tabs.

Re:Requirements for Japanese Text Layout by Cloudef on Sunday February 25, 2024 @06:22PM (#39506009)
Funny that this pops on the front page just as i posted this on show hn https://github.com/Cloudef/zig-budoux

This site also nicely demonstrates how poorly web browsers break japanese text

Re:Requirements for Japanese Text Layout by omoikane on Sunday February 25, 2024 @06:56PM (#39506250)
I like how they have a dedicated section for mixing Japanese and western language:

https://www.w3.org/TR/jlreq/#japanese_and_western_mixed_text...

I wonder if there are considerations for other combinations, such as mixing Japanese with right-to-left text. Maybe the other combinations are not nearly as common?

Re:Requirements for Japanese Text Layout by knuckleheadsmif on Sunday February 25, 2024 @10:06PM (#39507244)
It is common in some contexts. Unicode also has within it formatting rules for a lot of this stuff although not the kind of rules you’ll find in a manual of style or a typesetting rule book.

Japanese can flow top to bottom and right to left as well with in books that are read left to right.