Text problems
Blitz3D Forums/Blitz3D Programming/Text problems
| ||
I´ve run into a problem when I use non-english letters with the text command. When you run the little code below, the sentences with non-english characters in them will be clipped at the end. This only occurs when the font I´m using has letters with different widths, like Arial. With Courier there is no problem. Any ideas? Graphics 368,400,2 font = LoadFont("Arial",16) SetFont font Text 0,0,"This is just än exåmple öf the pröblems with nön-english letters" Text 0,20,"This is just an example of the problems with non-english letters" Text 10,40,"This is just än exåmple öf the pröblems with nön-english letters" Text 10,60,"This is just an example of the problems with non-english letters" Text 20,80,"This is just än exåmple öf the pröblems with nön-english letters" Text 20,100,"This is just an example of the problems with non-english letters" Text 30,120,"This is just än exåmple öf the pröblems with nön-english letters" Text 30,140,"This is just an example of the problems with non-english letters" WaitKey() End |
| ||
Worked fine on my machine once I changed that strange graphics mode to something that actually works. ;) The problem you're having is probably because the Text command doesn't wordwrap. |
| ||
No, the problem is that Blitz doesn´t handle non-english character well. The point with the program was to show that with only english letters the clipping is handled correctly at the end of the windows left edge. And "Graphics 368,400,2" is set to show that the clipping does not work with, in my case, swedish letters. How did it look if you run the code straight off? |
| ||
It doesn't work straight off. "Graphics 368,400,2" throws an error. How can you set a colour depth of 2? Changing to a proper graphics mode, the code works as expected, for me. |
| ||
Ooops! You´re right. It should be "Graphics 368,400,16,2".(although I don´t get an error) But if you set this mode, doesn´t the text get clipped incorrectly for you? And do you see the swedish letters correctly? |
| ||
Hmmm, yes, in that mode I do get clipping problems. That's one strange graphics mode, though. I was surprised it even worked, TBH. If you really need to use this mode, I can only suggest you post in the B3D bug reports forum. |
| ||
same here, text lookst exactly how it should look. I do have a problem wih text not showing up if the resolution is too small (i.e. 100x100) but that's not the case here. |
| ||
Well, the graphic mode is just an example. And since it is a window it can be of any size. But the clipping problem is still present in fullscreen mode. As long as you print some text(with Text) that goes beyond the right edge, and use non-english characters and a proportional font, you get this error. Test this: Graphics 800,600,16,1 font = LoadFont("Arial",16) SetFont font Text 0,0,"This is just än exåmple öf the pröblems with nön-english letters" Text 0,20,"This is just an example of the problems with non-english letters" Text 400,40,"This is just än exåmple öf the pröblems with nön-english letters" Text 400,60,"This is just an example of the problems with non-english letters" Text 430,80,"This is just än exåmple öf the pröblems with nön-english letters" Text 430,100,"This is just an example of the problems with non-english letters" Text 470,120,"This is just än exåmple öf the pröblems with nön-english letters" Text 470,140,"This is just an example of the problems with non-english letters" WaitKey() End |
| ||
Well it's cut off as an automatic lineshift, could be usefull ;) |