zoukankan      html  css  js  c++  java
  • 设置CEikEdwin、CEikSecretEditor字体(转)

    设置CEikEdwin、CEikSecretEditor字体

    类归于: Symbian札记 — gio @ 1:37 下午

    1、CEikEdwin类并没有SetFont()函数,可以通过以下的代码实现字体的设置

    相关头文件:gdi.h, txtglobl.h

    相关库文件:gdi.lib, etext.lib

    代码:

    const CFont* iEdwinFont =  CEikonEnv::Static()->NormalFont();
    CGlobalText* globalText = (CGlobalText*)iEdwin->Text();
    TCharFormat charFormat;
    Mem::FillZ(&charFormat, sizeof(TCharFormat));
    TCharFormatMask charMask;
    Mem::FillZ(&charMask, sizeof(TCharFormatMask));
    TFontSpec sFontSpec = iEdwinFont->FontSpecInTwips();
    charFormat.iFontSpec.iTypeface = sFontSpec.iTypeface;
    charMask.SetAttrib(EAttFontTypeface);
    charFormat.iFontSpec.iHeight = sFontSpec.iHeight;
    charMask.SetAttrib(EAttFontHeight);
    charFormat.iFontPresentation.iTextColor = KRgbBlack;
    charMask.SetAttrib(EAttColor);
    globalText->ApplyCharFormatL(charFormat,charMask,0,iEdwin->TextLength());

    2、CEikSecretEditor密码框控件可以使用AknSetFont()函数来设置。

  • 相关阅读:
    Java中 Jwt
    Python中Jwt
    jwt流程
    Vue Demons
    Vue基础
    Mysql
    MongoDb
    2020/03/07-基础复习day_02
    2020/03/07-基础复习day_01
    基于springboot+dubbo的简易分布式小Demo
  • 原文地址:https://www.cnblogs.com/yaoliang11/p/2010585.html
Copyright © 2011-2022 走看看