My next project has a requirement to display Japanese text which is displayed top-to-bottom and right-to-left (traditional Japanese writing style). Is it possible to set a UITextView
to layout text in this way? Below is an example of some text written in this way:
W H O E R L L L D O ! ,
Also, I need to be able to select it (so UILabel
is out). Is this going to turn into a totally custom view?
The answer, as it turns out, is "no it can't."
So, I built my own using Core Text, which is heavily based on the "SimpleTextInput". The key to this view is adding YES
to the kCTVerticalFormsAttributeName
key. Luckily enough, the selection logic is there already in the project, it is just not being used. I was easily able to add it by calling the appropriate methods inside a pan gesture (there was some monkey business with CTFrameGetLineOrigins
overwriting some of its neighboring memory but I was luckily able to resolve it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With