This example shows how to use the LayoutEditShape function to reshape the input characters.
#include <layout.h> LAYOUT_OBJECT plh; UCHAR InpBuf[30]; UCHAR OutBuf[30]; ULONG InpSize = 30; ULONG OutSize = 30 ; LAYOUT_VALUES layout[2]; LAYOUT_TEXT_DESCRIPTOR Descr; ULONG index ; ULONG RC; RC= LayoutCreateObject (Locale_Arabic,&plh); /* or: Locale_Hebrew */ if (RC) { printf("Create Error! !!\n"); exit(0);} /* Define the LayoutValues that will need changing */ layout[0].name= TypeOfText|Orientation; layout[0].value=descr; /* using the OR operator, we set the bits in the Layout Descriptor * to describe the orientation of the buffer and the Type of Text * that we want for the output */ descr.in=TEXT_VISUAL|ORIENTATION_LTR; descr.out=TEXT_VISUAL|ORIENTATION_LTR; layout[1].name=0; /* End of change */ /* Set the LayoutValues */ RC=LayoutSetValues(plh,layout,&index); if (RC) { printf("SetValue Error at index %d !!!\n",index); exit(0); } /* Here we point to the character were we want to shape */ index = 4L; RC=LayoutEditShape(plh, TRUE, &index, InpBuf, &InpSize, OutBuf, &OutSize); RC = LayoutDestroyObject(plh); if (RC) { printf(" DESTROY Error!!!\n"); exit(0);}