Some time ago Richard published a function for printing Arabic (you can find it in his Wiki under "Communication and Input-Output) and it occurred to me to see if that might throw any light on the subject. It probably would if I were smart enough to work out what the heck is going on, but as far as I can see, he doesn't use any of the dotted circle characters in the Arabic alphabet.
However, using a few bits from his code, I have come up with the following, which neatly illustrates the problem to which I referred: the dotted circle overwrites; what we need is some way of extracting the bit which is not the dotted circle and using only that bit.
Code: Select all
VDU 23,22,640;512;8,16,16,128+8
*FONT Times New Roman, 28
PROChebrew("השׁמים")
END
DEFPROChebrew(A$):LOCALB$
FORA%=!^A$TO!^A$+LENA$-1
IF?A%=&D7THEN
U%=((?A%AND&3F)<<6)+(A%?1AND&3F)
PRINT?A% ~U%
CASEU%OF
WHEN&5C1,&5C2:REM When it is one of the dotted circle characters
B$+=CHR$8
ENDCASE
B$+=CHR$?A%+CHR$A%?1
ELSE
U%=0
ENDIF
NEXT
VDU 23,16,2;0;0;0;13
VDU5:MOVE400,500:PRINTB$:VDU4
PRINTTAB(3)B$
VDU 23,16,0;0;0;0;13
ENDPROC
Note that in VDU5 mode the dotted circle overwrites but what it has overwritten is still visible. In VDU4 mode the dotted circle hides the previous character.
Here is basically the same routine, but this time the dotted circle character is inserted *before* the character which it affects. In VDU4 mode the SIN overwrites and hides the dotted circle, though as a simple CHR$8 does not work correctly with proportional fonts part of the dotted circle is still visible. In VDU5 mode (which is what my Display program requires) the dotted circle is still visible.
Code: Select all
VDU 23,22,640;512;8,16,16,128+8
*FONT Times New Roman, 28
PROChebrew("השׁמים")
END
DEFPROChebrew(A$):LOCALB$
FORA%=!^A$TO!^A$+LENA$-1
IF?A%=&D7THEN
U%=((?A%AND&3F)<<6)+(A%?1AND&3F)
PRINT?A% ~U%
CASEU%OF
WHEN&5C1,&5C2:REM When it is one of the dotted circle characters
B$=LEFT$(B$,LENB$-2)+CHR$?A%+CHR$A%?1+CHR$8+RIGHT$(B$,2)
OTHERWISE
B$+=CHR$?A%+CHR$A%?1
ENDCASE
ELSE
U%=0
ENDIF
NEXT
VDU 23,16,2;0;0;0;13
VDU5:MOVE400,500:PRINTB$:VDU4
PRINTTAB(3)B$
VDU 23,16,0;0;0;0;13
ENDPROC
Note that if you double up on the CHR$8 the dot is in the wrong place (but a different wrong place) in VDU5 mode and is completely overwritten and vanishes in VDU4 mode.
Grrrrrrr.