×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Suzhou, China
    Posts
    107

    Text displayed backwards

    Hi

    I'm having a problem with text drawn with my function displaying backwards, can anyone assist?

    Code:
    	CWindowGc& gc=SystemGc();
    	
    	_LIT(KMyFontName,"Series S60 Sans");
    	const CFont* myFont = CEikonEnv::Static()->DenseFont();
    	gc.UseFont(myFont);
    	
    	TInt height = (myFont->AscentInPixels() * 3) / 2;
    	TInt baseline = (height / 2) + (myFont->AscentInPixels() / 2);
    	TInt margin = 5;
    
    	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    	gc.SetBrushColor(KRgbWhite);
    	gc.SetPenColor(KRgbBlack);
    	
    	CArrayFixSeg<TPtrC>* array = new CArrayFixSeg<TPtrC>(10);
    	AknTextUtils::WrapToArrayL(iText, 217, *myFont,*array);
    
    	gc.DrawRect(TRect(5, 5, 235, (height * array->Count()) + 15));
    
    	for (TInt i = 0; i < array->Count(); i++)
    		{
    	gc.DrawText(array->At(i), TRect(6, (height * i) + 8, 224, 
    			(height * (i + 1)) + 8), baseline, CGraphicsContext::ECenter, 
    			margin);
    		}
    English text displays fine, but Arabic text displays backwards.

    Regards

    Lionel

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Text displayed backwards

    May be AknBidiTextUtils class might ba helpful for you.

    Something like this:
    Code:
    TBuf<255>buffer (array->At(i));
    AknBidiTextUtils::ConvertToVisualAndClipL(buffer, *(myFont), text1Rect.Width(), text1Rect.Width(), AknBidiTextUtils::ERightToLeft);
    gc.DrawText(buffer, text1Rect, baseline, CGraphicsContext::ECenter, margin);

Similar Threads

  1. Predictive text disappearing
    By raul.cicero in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-02-19, 13:00
  2. Enumerated text setting item
    By WaelA in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-11-17, 06:05
  3. Number of rows of text displayed?
    By sridhar270 in forum General Development Questions
    Replies: 0
    Last Post: 2006-07-07, 07:55
  4. CRichText text problem
    By introuble in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-09-30, 17:29
  5. Replies: 1
    Last Post: 2002-08-14, 06:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×