Draw string and right to left text

BlitzMax Forums/BlitzMax Programming/Draw string and right to left text

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I'm interested in what support is required, if you can build modules you may want to try the following cludge and perhaps post or send me a screen-shot of what is still wrong.

brl.mod/max2d.mod/imagefont.bmx[83]:
	Global reversefont
	
	Method Draw( text$,x#,y#,ix#,iy#,jx#,jy# )

		For Local i=0 Until text.length
		
			Local n=CharToGlyph( text[i] )
			If n<0 Continue
			
			Local glyph:TImageGlyph=LoadGlyph(n)
			Local image:TImage=glyph._image
			
			If reversefont
				x:-glyph._advance*ix
				y:-glyph._advance*jx
			EndIf
			
			If image
				Local frame:TImageFrame=image.Frame(0)
				If frame
					Local tx#=glyph._x*ix+glyph._y*iy
					Local ty#=glyph._x*jx+glyph._y*jy			
					frame.Draw 0,0,image.width,image.height,x+tx,y+ty
				EndIf
			EndIf
			
			If Not reversefont
				x:+glyph._advance*ix
				y:+glyph._advance*jx
			EndIf
		Next
		
	End Method


after replacing the Draw method with the above rebuild modules and test like so:

Graphics 640,480

TImageFont.reversefont=True

DrawText "Hello",200,0
Flip

WaitKey