传统平台

替换现有字体图标

应用程序中的某些图标是使用图标字体显示的。 此类图标可替换为定制图标。

要替换现有字体图标,请执行以下步骤:
  1. 生成定制图标字体。 您可以从定制图像生成图标字体。
    注: 确保每个定制图像与要在应用程序中替换的相应图标的名称相同。
  2. 将所有生成的字体格式 (.ttf, .svg, .eot, .woff) 复制到 <RUNTIME>/extensions/wsc/webpages/ngstore/store/style/themes/fonts 文件夹。
  3. 将生成的图标字体的 CSS 复制到 "extn-app-store.scss" 文件,并确保 CSS 中的字体 URL 指向 (.ttf, .svg, .eot, .woff) 字体文件的位置。
    注:
    • 由于生成字体时使用的图标名称与应用程序中的图标名称相同,因此使用必须从中选取新图标的定制 font-family 来更新 CSS 非常重要。
    • 请勿将 CSS 中的缺省 font-family 替换为定制 font-family ,因为它将替换缺省应用程序字体图标。
  4. 测试定制。
用于替换现有字体图标的样本代码片段:
/* Specifying the custom icon font details */
   @font-face {
    font-family: 'custom-glyphicons';
    src: url('../fonts/custom-glyphicons.eot?uxyslh');
    src: url('../fonts/custom-glyphicons.eot?uxyslh#iefix') format('embedded-opentype'),
    url('../fonts/custom-glyphicons.ttf?uxyslh') format('truetype'),
    url('../fonts/custom-glyphicons.woff?uxyslh') format('woff'),
    url('../fonts/custom-glyphicons.svg?uxyslh#custom-glyphicons') format('svg');
    font-weight: normal;
    font-style: normal;
    }
/* Specifying the font-family to display the icons */ 
    .app-icon-findProducts_generic_02:before{
    content: "\e900";
    font-family: 'custom-glyphicons' !important;
    }