Pomax / BezierInfo-2

The development repo for the Primer on Bézier curves, https://pomax.github.io/bezierinfo
https://pomax.github.io/bezierinfo
Other
2.33k stars 289 forks source link

Improve zh-CN styling for CN/ascii transitions #88

Open Pomax opened 7 years ago

josherich commented 7 years ago

the styling space problem is that in most Chinese font, font kerning is too small between CJK characters and ascii characters, can't set the CSS value separately, I'll see if there's any webpack-loader like lib that handles this.

Pomax commented 7 years ago

CSS can do anything, if you add some JS to it. A custom loader is easy enough to write though, the build chain already uses enough of them, inserting a CJK spacer component for CJK/Latin boundaries that renders as a <wbr class='cjks-spacer'> or something should be pretty trivial.

I'm spending more time on the build system tomorrow, to figure out a purer HTML/CSS/JS delivery for the user, while keeping things nice and build-based for development, I can take a stab at adding that in too.

josherich commented 7 years ago

could be something like https://github.com/mastermay/text-autospace.js/blob/master/text-autospace.js

Pomax commented 7 years ago

I'll write something custom, but it'll do something similar to this (I've written block switchers before, to make things happen when switching between different unicode blocks, I can turn that into a webpack loader with not too much effort).