parsimonhi / animCJK

Draw animated Japanese characters (Kanji and Kana), Korean characters (Hanja) and Chinese characters (Hanzi) in correct stroke order using svg, free open-source code.
284 stars 72 forks source link

On the issue of graphicsKana.txt #19

Closed HiddenStar0412 closed 1 year ago

HiddenStar0412 commented 2 years ago

The stroke information of most kana characters in graphics Kana.txt, including "あ" or "ま," is not correct. Only the first few strokes are drawn and the rest are missing.

parsimonhi commented 2 years ago

Thank you for your report.

You are right. There was a problem with some kanas (those with an overlapping stroke). I just updated a new graphicsKana.txt file and the php script I used to generate it from the contents of the svgsKana folder (the script name is makeGraphicsFromSvgs4Kana.php).

Note that if you want to use graphicsKana.txt, there are some tricks to put in place to deal with overlapping strokes. These strokes are cut in several parts in order to avoid side effects when they are displayed. Unfortunately, the format of graphicsKana.txt doesn't allow to store this easily. The format of graphicsXxx.txt was designed for Chinese Hanzi, and none of them have overlapping strokes. And I can't change the format because animCJK is not the only project using it.

Therefore, it is not straightforward to rebuild kana svgs from graphicsKana.txt, although it is possible. Basically, retrieve which strokes were split (they have "medians" with more than 2 points in common) and then display all the split parts at once. This can be done with for example javascript, but it requires programming knowledge.