简体   繁体   English

在 SAP Fiori 启动板中使用自定义图标/字体

[英]Using custom icons/font in SAP Fiori launchpad

I am searching for a way to use custom icon fonts already in the Fiori Launchpad.我正在寻找一种方法来使用 Fiori Launchpad 中已有的自定义图标字体。

I found one way using the UI theme designer : https://blogs.sap.com/2015/12/19/custom-icons-in-fiori-launchpad/ .我找到了一种使用UI 主题设计器的方法: https ://blogs.sap.com/2015/12/19/custom-icons-in-fiori-launchpad/。 But as I understand these icons are only available with a custom theme.但据我了解,这些图标仅适用于自定义主题。

I am searching a way to register my own font so that the icons are available similar as the Fiori launch icons .我正在寻找一种方法来注册我自己的字体,以便图标可用,类似于Fiori 启动图标

Looks like they are stored here: /UI5/sap/ushell/themes/base/fonts/ and referenced by the default themes, like here: /UI5/sap/fiori/themes/sap_bluecrystal/library.css看起来它们存储在此处: /UI5/sap/ushell/themes/base/fonts/并由默认主题引用,例如此处: /UI5/sap/fiori/themes/sap_bluecrystal/library.css

@font-face {
  font-family: 'Fiori2';
  src: url("../../../../../UI5/sap/ushell/themes/base/fonts/sap-launch-icons.eot");
  src: url("../../../../../UI5/sap/ushell/themes/base/fonts/sap-launch-icons.eot?#iefix") format('embedded-opentype'), url("../../../../../UI5/sap/ushell/themes/base/fonts/sap-launch-icons.ttf") format('truetype');
  font-weight: normal;
  font-style: normal;
}

The icons are also available in the "Icon" selector of Fiori Launchpad Designer (FLPD) by name.这些图标也可按名称在Fiori Launchpad Designer (FLPD) 的“图标”选择器中使用。 So the questions are:所以问题是:

  1. Is it possible to use own fonts similar to existing fonts?是否可以使用类似于现有字体的自己的字体?
  2. If so, where and how should the font be placed?如果是这样,字体应该放在哪里以及如何放置?
  3. If so, where and how should the icon names be defined, so that they can be used like this: "sap-icon://myNameSpace/iconname" ?如果是这样,应该在哪里以及如何定义图标名称,以便可以像这样使用它们: "sap-icon://myNameSpace/iconname"

I know already how to do it inside my own apps using sap/ui/core/IconPool (For reference: https://ui5.sap.com/#/topic/21ea0ea94614480d9a910b2e93431291 ).我已经知道如何使用sap/ui/core/IconPool在我自己的应用程序中执行此操作(供参考: https ://ui5.sap.com/#/topic/21ea0ea94614480d9a910b2e93431291)。 But how to do it in a standard theme inside the Fiori Launchpad / Fiori launchpad Designer?但是如何在 Fiori Launchpad / Fiori Launchpad Designer中的标准主题中做到这一点?

Partly this issue can be solved by defining a custom icon font and replacing the icons in the buttons of the launchpad. 通过定义自定义图标字体并替换启动板按钮中的图标,可以部分解决此问题。 I've created a SAP Fiori Launchpad Plugin for custom icons . 我已经为自定义图标创建了一个SAP Fiori Launchpad插件 The main issue is that not all icons ie in the me area can be changed that way. 主要问题在于,并非所有图标(即me区域中的图标)都可以通过这种方式进行更改。 I've posted a fresh question Replace SAP Icons in SAP Cloud Platform Portal Service Launchpad with Custom Icons in the SAP Community. 我已经发布了一个新问题,即使用SAP Community中的“ 自定义图标”替换“ SAP Cloud Platform Portal服务启动板中的SAP 图标 ”。 Looking forward for some help. 期待获得帮助。

Fiori design guidelines explicitly warn not to use custom icons inside Fiori launchpad eg Tiles : Fiori 设计指南明确警告不要在 Fiori 启动板中使用自定义图标,例如Tiles

  • We have decided to stop unique launch icons being created for individual apps.我们已决定停止为单个应用程序创建独特的启动图标。 Creating a unique icon for every app was and is not scalable in terms of iconography and production [...].为每个应用程序创建一个独特的图标在图标和制作方面过去和现在都不可扩展 [...]。
  • Projects without a SAP Fiori ID do not get an individual icon.没有 SAP Fiori ID 的项目不会获得单独的图标。
  • Do not develop your own icons or use custom icons.不要开发自己的图标或使用自定义图标。

As such, there is currently no public APIs or documented solutions to provide custom icons for FLP.因此,目前没有公共 API 或文档化解决方案来为 FLP 提供自定义图标。

Update: found the Note 2411631 which says pretty much the same thing:更新:找到了注释 2411631 ,它说的几乎一样:

There is currently no officially supported method for adding custom icons to the Launchpad for use with tile creation.目前没有官方支持的方法可以将自定义图标添加到 Launchpad 以用于创建磁贴。

As well as the statement by Thorsten Dencker:以及 Thorsten Dencker 的声明

Changing the Icon Font is officially not supported by the SAP Theme Designer. SAP Theme Designer 正式支持更改图标字体。
[...] Issue coming up with custom CSS cannot be handled by the normal support process. [...] 自定义 CSS 的问题无法通过正常的支持流程处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM