×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    9

    Question Font info for drawing text to bitmap contexts

    Hi all, just a question regarding writing text to a bitmap via CFbsBitGc. I'm able to write successfully using the following function to set the text font:

    Code:
    void CGLMessage::SetCurrentFont(const TDesC& aFontName, TInt aFontSize)
    	{
    	TFontSpec myFontSpec;
    	    
            myFontSpec = TFontSpec(aFontName, aFontSize);
    	myFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
    	
    	iBackBufferDevice->GetNearestFontInPixels(iFont,myFontSpec); 	// CFbsBitmapDevice
    	iBackBufferContext->UseFont(iFont);                             // CFbsBitGc
    	iBackBufferContext->SetPenStyle( CGraphicsContext::ESolidPen );	
    	}
    However when I change aFontName, my font doesn't change - even using standard font names "Courier", "Arial", or "Roman" doesn't make any difference. Is my font-changing function missing anything obvious?

    Also, I've been unable to find any reference material as to what font names I should be able to use - I don't know if this is different for different Symbian versions or different devices... Any clues?

    Thanks guys
    M

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Font info for drawing text to bitmap contexts

    you could check my Y-Tasks::Fonts from my homesite, with it you can check all different font that can be found from the device.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    9

    Re: Font info for drawing text to bitmap contexts

    thank you!

  4. #4
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Font info for drawing text to bitmap contexts

    Quote Originally Posted by symbianyucca View Post
    you could check my Y-Tasks::Fonts from my homesite, with it you can check all different font that can be found from the device.
    Recently i have noticed that Typeface font name are different on different device. Then how can we develop an application using Typeface font that can be installed on different devices??

    Also i noticed that some phone variant (specially Chinese variant) does not have Typeface font which support English, then how can we check that particular Typeface font will support English or not?

  5. #5
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: Font info for drawing text to bitmap contexts

    hi savaj...In my application english language was not shown, instead some boxes were shown, i.e it was some other font in the font, then i used the following and the correct font was then shown i.e english or it may show suitable font depending upon the support:

    TTypefaceSupport tfs;
    TBuf<32> FontName=_L("Roman");
    TFontSpec FontSpec1(tfs.iTypeface.iName, iHeightTwips);
    FontSpec1.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
    TFontSpec FontSpec2(tfs.iTypeface.iName, iHeightTwips);

  6. #6
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Font info for drawing text to bitmap contexts

    Quote Originally Posted by vineet.jain View Post
    hi savaj...In my application english language was not shown, instead some boxes were shown, i.e it was some other font in the font, then i used the following and the correct font was then shown i.e english or it may show suitable font depending upon the support:

    TTypefaceSupport tfs;
    TBuf<32> FontName=_L("Roman");
    TFontSpec FontSpec1(tfs.iTypeface.iName, iHeightTwips);
    FontSpec1.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
    TFontSpec FontSpec2(tfs.iTypeface.iName, iHeightTwips);
    Thanks vineet for reply.

    But this is not the solution of my problem, infact in your case you have not initialized Typeface font (i.e. tfs), so i guess it pickup default Typeface font.

    Moreover i guess you have not tested your application chinease variant.

Similar Threads

  1. Setting long title pane text without decreasing font size
    By Faider in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-07-03, 14:05
  2. [PyS60 1.4.4] Font on image example
    By cyke64 in forum Symbian
    Replies: 0
    Last Post: 2008-06-29, 02:15
  3. Problem executing Maze Racer
    By IFtechsupport in forum Mobile Java Games
    Replies: 1
    Last Post: 2006-09-22, 17:18
  4. How to redraw text over bitmap
    By flashcfm in forum Symbian User Interface
    Replies: 5
    Last Post: 2005-06-08, 12:26
  5. Font and Bitmap Server
    By soumyavrao in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2002-06-11, 10:12

Posting Permissions

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