g6/packages/site/docs/manual/advanced/iconfont.zh.md
Aaron e08c299a69
docs: update v5 site docs (#5162)
* docs: remove readme and navigation in site

* docs: remove v4 core concept docs

* docs: update history and lod plugin docs

* chore: update dumirc config

* docs: add api shape overview doc

* docs: update manual docs

* docs: update manual and tutorial docs

* chore: update dumirc

* docs: remove design sector

* docs: update docs meta data

* docs: update api docs
2023-11-20 09:50:36 +08:00

606 B

title order
使用 Iconfont 10

引入

参考帮助文档unicode 引用 一项将 Iconfont 引入项目。

使用

创建文本图形过程中,将 fontFamily 设置为 'iconfont' 即可。例如:

public drawLabelShape(
  model: NodeDisplayModel,
  shapeMap: NodeShapeMap,
): DisplayObject {
  return this.upsertShape(
    'text',
    'labelShape',
    {
      text: '&#....;', // 图标代码
      fontFamily: 'iconfont'
    },
    shapeMap,
    model,
  );
}