×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Question Still want bigger Font for CEikEdwin

    hi all,

    i have used following code for adding font and color for CEikEdwin.

    //Code added for Changing Font and color of UserName TextField
    const CFont* iMyFont;
    iMyFont = iEikonEnv->TitleFont();//AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont);//EAknHighestLogicalFont
    //Code added for Changing Font and Color of UserName TextField
    TCharFormatMask charFormatMask;
    TFontSpec fontspec =iMyFont->FontSpecInTwips();
    fontspec.iTypeface.SetIsProportional(ETrue);

    TCharFormat charFormat(fontspec.iTypeface.iName,fontspec.iHeight);
    charFormat.iFontPresentation.iTextColor=KRgbBlack;//u can change this according to u
    charFormatMask.SetAttrib(EAttColor );

    CCharFormatLayer* iCharform=CEikonEnv::NewDefaultCharFormatLayerL();
    iCharform->Sense( charFormat, charFormatMask );
    iCharform->SetL( charFormat, charFormatMask );


    iEdwinUsername->SetCharFormatLayer(iCharform);

    And size of CEikEdwin is set by following line of code in SizeChanged()-

    iEdwinUsername->SetExtent(TPoint(XPos+180,150),TSize(115,45));

    This font is looking great on emulator,But my TitleFont() is looking small on device.I want still bigger font.How to achieve this??


    Rohanwaugh

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    U can create ur own font and use that font if available fonts are not sufficient.

    here is code to create ur own font

    Code:
    	TFontSpec fontSpec = Normalfont->FontSpecInTwips();
    	if (aBold)
    	{
    		fontSpec.iHeight -= 35; // say
    	
    	}
    	else
    	{
    		fontSpec.iHeight -= 5;//say
    	
    	}
    	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
    	fontSpec.iFontStyle.SetPosture(EPostureUpright);
    	CFont * desiredfont = CEikonEnv::Static()->CreateScreenFontL(fontSpec);
    Now u can use ur desiredfont ....

    Thaanks

  3. #3
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: Still want bigger Font for CEikEdwin

    hi ,

    what is aBold in the code snippet posted by u??and what changes do i need to make in the code posted by me in the 1st post??

    Thanks for the reply.


    Rohanwaugh

  4. #4
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    That is just a boolean parameter to specify a bold font . anyway this may not be requred by u.Just change this twolines in ur code..
    Code:
    Const CFont* iMyFont;
    
    take it as a member varible if used later. (not necessary)
    iMyFont = iEikonEnv->GetDesiredFont();
    
    void GetDesiredFont()
    {
    TFontSpec fontSpec = Normalfont->FontSpecInTwips();
    fontSpec.iHeight -= 5;//change this parameter according to ur req.
    fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
    fontSpec.iFontStyle.SetPosture(EPostureUpright);
    iMyFont = CEikonEnv::Static()->CreateScreenFontL(fontSpec);
    }
    Thanks
    Last edited by kishore84; 2008-12-23 at 09:22.

  5. #5
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: Still want bigger Font for CEikEdwin

    hi,

    it is giving error that undefined identifier Normalfont.What is the error?
    Also showing error for line iEikonEnv->GetDesiredFont();


    Rohanwaugh

  6. #6
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    just try to put bit ur own logic. anyway
    CFont* Normalfont = CEikonEnv::Static()->AnnotationFont();//Titlefont according to ur req.

    see GetDesiredFont(); is ur userdefined func not a systemdefined func.

    Thanks

  7. #7
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: Still want bigger Font for CEikEdwin

    hi,

    sry to say but that code is not working.My font size hasn't increased.

    Rohanwaugh

  8. #8
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    have u changed this value

    fontSpec.iHeight -= 5;//change this parameter according to ur req.


    Thanks

  9. #9
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: Still want bigger Font for CEikEdwin

    hi
    yes I have changed the value.But still it is not working.I will give u a code which i am using .Let me know if i am wrong somewhere..

    const CFont* iMyFont = iEikonEnv->TitleFont();
    //Code added for Changing Font and Color of UserName TextField
    TCharFormatMask charFormatMask;
    TFontSpec fontspec =iMyFont->FontSpecInTwips();
    fontspec.iTypeface.SetIsProportional(ETrue);
    fontSpec.iHeight -= 10;//change this parameter according to ur req.

    TCharFormat charFormat(fontspec.iTypeface.iName,fontspec.iHeight);
    charFormat.iFontPresentation.iTextColor=KRgbBlack;//u can change this according to u
    charFormatMask.SetAttrib(EAttColor );

    CCharFormatLayer* iCharform=CEikonEnv::NewDefaultCharFormatLayerL();
    iCharform->Sense( charFormat, charFormatMask );
    iCharform->SetL( charFormat, charFormatMask );
    iEdwinUsername->SetCharFormatLayer(iCharform);

    Rohanwaugh

  10. #10
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    k , bit search in wiki and forum u will have some articles .also look at this thread

    http://discussion.forum.nokia.com/fo...ceikedwin+font

    otherwise i will give u sample code and also check ur code .. bit busy right now...

    Thanks

  11. #11
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Still want bigger Font for CEikEdwin

    Have u solved this pb. why u have write this line like this

    Code:
    CCharFormatLayer* iCharform=CEikonEnv::NewDefaultCharFormatLayerL();
    it is the pb it takes default char format.

    Insted use ur charformat like
    Code:
    CCharFormatLayer* iCharform = CCharFormatLayer::NewL(charFormat,charFormatMask);
    let me know the result...

    Thanks

  12. #12
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: Still want bigger Font for CEikEdwin

    hi

    Thanks Kishore84.It worked.U were correct.I was using default character Format.finally my problem got solved.Once again thanks.

    Regards.

    Rohanwaugh

Similar Threads

  1. font flags not working
    By jtullis in forum Python
    Replies: 10
    Last Post: 2008-12-10, 08:27
  2. Using the font from setting list in custom listbox
    By alav in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-11-05, 17:17
  3. How to get the name of the used font
    By chrishawaii in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-06-22, 06:55
  4. Replies: 7
    Last Post: 2006-06-08, 22:17
  5. Replies: 0
    Last Post: 2005-09-08, 05:00

Posting Permissions

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