If you look at the BFont entry in the BeBook, you'll see that it does indeed have a Direction() call, which "The direction of the font affects the direction in which DrawString() draws the characters in a string, but not the direction in which it moves the pen" Doesn't this mean that even if set to "right to left", it would draw the keyboard input "abcd" as (from left to right!) abcd, but merely drawing each character 'backwards', so to speak? This would be consistent with how StyledEdit acts when I try to put Arabic characters into it (on BeOS). -Niklas On 11/6/06, Niklas Nisbeth <noisetonepause@xxxxxxxxx> wrote:
Hey Stephan. Don't worry. The only OS to my knowledge the get right-to-left scripts right is OS X, because it's absolutely anal about text rendering - and even on 10.3 it was a bit dodgy. I appriciate that it's difficult, and, let's face it, a bit of a niche for computers. I'm not really sure where to go from here (except for apple.com:S) as I know bugger all about text rendering on a computer, I just know how it needs to look when it's done. There's a GPL'd GTK editor called Katoob which is supposedly good for Arabic but I've not tried it. I'm going to try and look at the BFont headers and dig further into the Be Book and try to find out what's going on. Can anyone explain to me exactly what an Input Method is, BTW? I know that for Japanese writing, it takes more than one character to make one glyph (so you push more than one button on your keyboard to get one glyph on the screen) and that that's why you need something more advanced to help input_server interpret the keystrokes, but that's about it, and I'm not sure it applies to Perso-Arabic script.. -Niklas On 11/7/06, Stephan Assmus <superstippi@xxxxxx> wrote: > Hello Niklas, > > It could be that (the Haiku) TextView makes some unfortunate assumptions > about text direction, but actually that is a responsibility of BFont. IIRC, > there are methods in BFont, which tell you the direction. As far as Haiku > is concerned, the text rendering needs to be improved a lot. It only > supports one type of glyph spacing, while BFont knows about four or so > (B_BITMAP_SPACING, B_CHAR_SPACING...). I didn't bother at all with thinking > about right->left or bottom->top text rendering. I didn't know of a way to > test it, and I have basically no clue about it. I thought to myself, if > someone with the knowledge about proper text rendering is desperate enough, > then he should do it. :-) > > That being said, if you can test this on Haiku and it doesn't work, I can > at least try to help you to get it work properly. > > However, in pretty much any application, text rendering is done with the > BView::DrawString() method. It get's provided a "starting point" of the > text. In any of my own code, and virtually all code I came across from > other people, the point is calculated to be on the left side of the string. > So I would assume that even if we made the necessary changes in the Haiku > app_server, I'm afraid all applications would need to be adjusted. Or some > smart trick invented. Or, of course, I might be talking non-sense because I > just don't have enough of a clue. :-) > > Best regards, > -Stephan > >