×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    9

    Display global text object in upright style

    I careated a CGlobalText object to update my CEikEdwin text box in the view. I intend to keep all the text in upright style, so in the view constructor, I did:

    TCharFormat charFormat;
    TCharFormatMask charFormatMask;
    charFormat.iFontSpec.iFontStyle.SetPosture(EPostureUpright);
    charFormatMask.SetAttrib(EAttFontPosture);

    iParaFormatLayer = CParaFormatLayer::NewL();
    iCharFormatLayer = CCharFormatLayer::NewL(charFormat, charFormatMask);
    iGlobalText = CGlobalText::NewL(iParaFormatLayer, iCharFormatLayer);

    However, after I set the global text object to the CEikEdwin object as the following:

    iTextBox->SetDocumentContentL(*iGlobalText, CEikEdwin::ECopyText);

    All the texts are always in italic style. What is wrong?

    Thanks.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    this works for me quite well...
    Code:
    fontspec = subtitlefont->FontSpecInTwips();
    TCharFormat subtitlecharFormat( fontspec.iTypeface.iName, fontspec.iHeight );
    TCharFormatMask subtitlecharFormatMask;
    subtitlecharFormatMask.SetAll();
    subtitlecharFormatMask.SetAttrib(EAttFontUnderline); // set underline
    subtitlecharFormat.iFontPresentation.iUnderline=EUnderlineOn;
    subtitlecharFormatMask.SetAttrib(EAttColor); // set color
    subtitlecharFormat.iFontPresentation.iTextColor = KRgbHelpTextColorSubTitle;
    please look at subtitlecharFormatMask.SetAll(); line...

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    9
    sopta007:
    Thank you for your input. But it does not work for me, I tried the TCharFormatMask.SetAll(). Still, all text shows in italic.
    -dan

Posting Permissions

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