You could and that's basically what TeX does, just without the CSS. There are even typesetting systems similar to (La)TeX, that can take XML as input, see Context [1] or Sile [2]. They’re just a step away from using HTML + CSS. Why isn’t there such system? I do not know.
It’s crazy, and that’s why hyphenation doesn’t really work that way. Both TeX and web browsers use Liang’s algorithm to split words. [1] It uses so-called patterns, which are short substrings of words in which numbers indicate how to divide the word. For example, the pattern “s1h” indicates that in the word “fishing”, a divider can be inserted between “s” and “h”. Patterns compete and can override each other, and the whole thing is quite complicated. As for your example with Qishan — the “s-h” probably overrides the “i-s” pattern.
(There have been a number of articles in TeX journals that explain the algorithm, such as [2].)
In CSS, automatic hyphenation must be explicitly turned on, see [3].
In TeX and in CSS, hyphenation points can be marked explicitly: in TeX with the \- macro and in CSS with the ­ or U+00AD character. In TeX you can also override the automatic division with \hyphenation{}.
The splitting algorithm in CSS is worse than the one in TeX, because it has to work in real time and because (good) splitting patterns are often missing.
> There is a problem because some licenses require attribution, but ignoring that...
Surely the solution would be to give credit to every author from the training corpus. I am looking forward to the 10 000 lines of copyrights in every header. :P
If Microsoft had trained it on its own code, there would be no such problems. Surely a company as large as Microsoft has produced enough code over the years to create a large enough training dataset.
There are cursive typefaces for the Latin script, e.g. [1]. There might even be some free ones. Making (good looking) fonts is hard work, but I don’t think making cursive fonts is that much harder.
As for some solutions: The choice of the writing instrument helps a lot. While fountain pens feel amazing to write with, one looks like a smurf after writing with one. Hard pencils are one of the better choices. Writing slower also helps a bit.
A “different” solution would be to write from right to left. I’ve tried it multiple times — both writing with mirrored symbols and writing non-mirrored symbols. The positive was that my hands were a lot cleaner. The negatives were that others couldn’t read what I wrote and that I looked as a crazy person.
> …then why aren't they just library functions in a scripting language?
I’d say they basically are. What’s the difference between Python’s sort and (let’s say) Bash’s sort? In Python I call sort to order a data structure like a list. In Bash I do the same, but on a different data structure. The crux of the matter is probably buried in semantics.
> I still don't see the beauty.
What I like about shell and pipelines is that they allow me to easily edit and play with text. I don’t need to think about opening nor closing files, I don’t need to think how to best represent the data I’m working with. In minutes I can get the information I need and I can move on.
[1]: https://commons.wikimedia.org/wiki/File:20180429-155847_Fris... [2]: https://commons.wikimedia.org/wiki/File:Ausgewachsenes_Wilds...