+2
Fixed

Drawing Japanese characters makes the app extremely slow to type

Masashi Ono 9 years ago updated by Alexander Blach (Developer) 9 years ago 5

Thanks to the latest 2.2 update, viewing Japanese text in the Textastic is much more comfortable than ever! But sadly, here we got an another problem with Japanese.

Adding more than 2000 (or around) characters of Japanese to the text makes the text view extremely slow and I can hardly type. Here's what I found when the text view is filled with Japanese characters:

  • Scrolling through the text view full of Japanese feels a bit slower than that of English.
  • Tapping user interface components (such as buttons) works as usual.
  • Moving the cursor doesn't be affected by this problem.
  • Only inserting or deleting characters in the text view is affected rendering the typing almost impossible.

[Edit] I've prepared a couple of sample text files to reproduce this problem. You can download them from my gist:
https://gist.github.com/970488

Answer

Answer
Fixed
This should now work in the just-released version 3.0.
Hello,

yes, sorry, this is a known problem: all characters that aren't in the monospaced fonts supported by Textastic, incur a performance hit. Basically, Textastic has to search for another font that can draw this character. Deja-Vu Sans Mono for example supports the following scripts according to http://dejavu-fonts.org/wiki/Main_Page:

The following scripts are supported:

  • Latin (including European and African alphabets, IPA, ...)
  • Greek (including polytonic)
  • Cyrillic
  • Armenian
  • Georgian

Following scripts aren't available in all the styles:

  • Hebrew
  • N'ko
  • Tifinagh
  • Lao
  • Canadian Aboriginal Syllabics
  • Ogham
  • Arabic

If you know of a monospaced font that also includes Japanese characters with a license that I can work with, this would solve the problem and I'd be happy to include it in an update of Textastic.

Currently, it's ok if you only use Japanese characters for a few code comments, but unfortunately it's not really suited for long texts with many Japanese characters.
Thanks for your quick response, but what a pity! Unfortunately, monospace fonts of Japanese does almost always mean fonts which Japanese characters are exactly twice as wide as Latin characters, not as same width. See http://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms for more details about the story.

Thus there's no hope finding fonts which both Japanese and Latin characters have the same width. The only cure for this problem without modifying your drawing code is... to create a own font, like we do for TextMate.

Probably you can use the ForMateKonaVe font, which is just made for TextMate to fulfill this purpose, available in here: http://hetima.com/textmate/index.html (http://hetima.com/temp/ForMateKonaVe2006-11-02.zip for direct link). There's no explicit license for this font, but the font is composed from Konatsu (http://www.masuseki.com/rnote.php?u=be/konatu.htm) and BitStream Vera (http://www-old.gnome.org/fonts/) and both of them are licensed under the free-to-use license. So I believe the deliverable should be free to use, too.

Or perhaps I can spend some time to compose an own font for the Textastic (if only I could...) , which is not that a difficult task. I mean, the Textastic is definitely one of the best text editor for iPad I've ever seen, and I'd like to write some HTML files with tons of Japanese character in them. I'd like to help you out to solve this matter :)


Thanks for the link to the ForMatKonaVe font. I've downloaded it and the readme says:

ライセンス
--------------------
この作品は、クリエイティブ・コモンズの帰属-同一条件許諾(Creative Commons Attribution-ShareAlike) 2.5ライセンスの下でライセンスされています。
この使用許諾条件を見るには、

http://creativecommons.org/licenses/by-sa/2.5/
http://creativecommons.org/licenses/by-sa/2.5/deed.ja

をチェックするか、クリエイティブ・コモンズに郵便にてお問い合わせください。
住所は:559 Nathan Abbott Way, Stanford, California 94305, USA です。
--------------------
これは元にした小夏フォントと同じライセンスです。


So, according to Google translate, the font is under the same creative commons license as Konatsu and I think I could use that.

I will try out if it works with Textastic and if it does, I will add it in an update.

Marvelous! I (and probably other Japanese users) wish that works :)
One thing that would really help me: can you please send me one or two of those html files with many Japanese characters so I can test the performance with them? You can mail it to support@textasticapp.com
Answer
Fixed
This should now work in the just-released version 3.0.