×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    71

    I m trying to develop the custom Font application plz help

    Hi

    I m trying to develop the custom font application, i m using PNG files which contains some

    char images, trying to retrieve the characters & drawing the desired character.

    so

    if any body has done this type of custom font application or any other type of custom font application

    plz help me out

    if u provide the code that will be great help for me!!!!!!!!!

    Thanks in Advance

    Hidayath

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: I m trying to develop the custom Font application plz help

    check this code may be helpful

    CFont* editorFont = NULL;
    TFontSpec* fontSpec = NULL;
    fontSpec = new TFontSpec(_L("LatinPlain12"), 7);
    editorFont = CCoeEnv::Static()->CreateScreenFontL(*fontSpec);
    CCharFormatLayer* FormatLayer=CEikonEnv::NewDefaultCharFormatLayerL();
    TCharFormat charFormat;
    TCharFormatMask charFormatMask;
    FormatLayer->Sense(charFormat, charFormatMask);
    charFormat.iFontPresentation.iTextColor=KRgbBlack;

    // charFormat.iFontSpec = editorFont->FontSpecInTwips();
    // charFormatMask.SetAttrib(EAttColor);

    charFormatMask.SetAttrib(EAttFontHeight);
    charFormat.iFontSpec.iHeight = 150;
    FormatLayer->SetL(charFormat, charFormatMask);
    // contol->SetCharFormatLayer(FormatLayer);
    CRichText* text = iNameEd->RichText();
    text->ApplyCharFormatL(charFormat,charFormatMask,0,1);
    // control->ApplyCharFormatL(charFormat, charFormatMask);
    delete fontSpec;

    cheers

  3. #3
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    71

    Re: I m trying to develop the custom Font application plz help

    Thank u

    do we need to use .gdr file ?

    & can we draw more than one type of font like ARIAL, IMPACT etc in the same screen using ur code ?

    bcoz i tried with custom font example present in this forum, but when i try to draw more than one type of font its not drawing the different fonts , its drawing only one type of font.

    plz clarify

    Thanks
    Hidayath.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: I m trying to develop the custom Font application plz help

    #include <gdi.h>
    #include <txtfmlyr.h>
    #include <txtfrmat.h>
    #include <txtrich.h>
    #include <gulfont.hrh>
    Check these these header files and corresponding lib. Keep trying with diffrent fonts.

    Cheers

  5. #5
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    71

    Re: I m trying to develop the custom Font application plz help

    Hi

    I have included those header files.

    it says iNameEd is undefined identifier

    i hope u have defined this for ur own purpose of coding.

    i tried commenting some part & adding new part of code in the code u have given to me

    updated code is this

    CFont* editorFont = NULL;
    TFontSpec* fontSpec = NULL;
    fontSpec = new TFontSpec(_L("LatinPlain12"), 100);
    editorFont = CCoeEnv::Static()->CreateScreenFontL(*fontSpec);
    gc.UseFont(editorFont);
    const TPoint point(10,20);
    gc.DrawText(_L("Hi Hello how r u?"), point);
    gc.DiscardFont();
    delete fontSpec;

    i have drawn different fonts as well

    //Arial font
    fontSpec = new TFontSpec(_L("Arial"), 100);
    editorFont = CCoeEnv::Static()->CreateScreenFontL(*fontSpec);
    gc.UseFont(editorFont);
    const TPoint point1(10,40);
    gc.DrawText(_L("Hi Hello how r u?"), point1);
    gc.DiscardFont();
    delete fontSpec;

    //Impact font
    fontSpec = new TFontSpec(_L("Impact"), 100);
    editorFont = CCoeEnv::Static()->CreateScreenFontL(*fontSpec);
    gc.UseFont(editorFont);
    const TPoint point2(10,60);
    gc.DrawText(_L("Hi Hello how r u?"), point2);
    gc.DiscardFont();
    delete fontSpec;


    But it wont looks like much difference between each font types.

    bcoz when we open the fonts file present in our system at location C:\WINDOWS\Fonts\

    we can able to clearly distinguish between each of the font types

    but when i tried drawing using the above code in the screen , not able to distinguish between each of the font types

    all are looking alike, meant to say each font type style shud be different right.

    can u give me any suggestions plz

    Whether if we draw in TextEditor whether it will make any difference ?

    plz check my code & right now i m getting one panic when i exit the application

    panic is :-------> CTypefaceStore -14

    Thanks
    Hidayath.

  6. #6
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: I m trying to develop the custom Font application plz help

    oop's it's edit control ptr object.like this CEikRichTextEditor* iNameEd;
    Bye the Way where your display the font inside control?

    cheers

  7. #7
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: I m trying to develop the custom Font application plz help

    check this directory C:\Symbian\9.1\S60_3rd_MR\Epoc32\release\winscw\udeb\z\resource\fonts
    Will find the avilable font.
    cheers

  8. #8
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: I m trying to develop the custom Font application plz help

    try to check on target device.

    cheers

  9. #9
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    71

    Re: I m trying to develop the custom Font application plz help

    Thanks a LOt!!!!!!!!!!!

    Finally i m able to make the difference in the different types of font in emulator itself

    thanks a lot once again

    i m keeping all the font files in the location u said.

    this is the code snippet

    _LIT(KFont2,"Series 60 Hindi SemiBold");
    TBufC<sizeof(KFont2)> bufc1(KFont2);
    fontSpec = new TFontSpec(bufc1, 100);
    editorFont = CCoeEnv::Static()->CreateScreenFontL(*fontSpec);
    gc.UseFont(editorFont);
    const TPoint point1(10,40);
    gc.DrawText(_L("Hi Hello how r u?"), point1);
    //gc.DiscardFont(iFont);
    gc.DiscardFont();
    // control->ApplyCharFormatL(charFormat, charFormatMask);
    delete fontSpec;



    Take care

    Happy Week end!!!!!!!!!!

    can u send me ur gmail or yahoo ID plz

    Bye

    Thanks
    Hidayath

  10. #10
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    Re: I m trying to develop the custom Font application plz help

    hi hidayath
    i m also trying to create a tool which will provide own font style....
    as i saw you had work at this project..... can u plz guide me how to work or any kind of help which will u can if possible....
    plz

Similar Threads

  1. CRichText and Custom Font
    By kmsoomro in forum Symbian
    Replies: 0
    Last Post: 2006-10-07, 19:09
  2. custom font problem
    By allyfeng in forum Symbian
    Replies: 8
    Last Post: 2005-05-03, 15:08
  3. Problem of my custom Font in N-Gage
    By victoryzj in forum Symbian
    Replies: 0
    Last Post: 2004-09-05, 04:31
  4. How to Develop C++ Application for Symbian
    By Nokia_Archive in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-05-31, 16:40

Posting Permissions

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