@guidewire/web-font-builder

中文文档
0.0.1-alpha.10发布于 2024/01/25MIT近 30 天下载 5126

the pebbles icon font builder tool

原始使用文档
文档目录6 节
  1. Icons
  2. To use an existing icon glyph in a PCF (Most Common)
  3. To use an existing icon in SASS (Less Common)
  4. Add New Icons
  5. Adding Support for FontAwesome5 Pro
  6. Printing and Icons

Guidewire Icon Font Builder for Insurance Suite Applications

This package should be used via nvm @guidewire/web-font-builder from the webresources directory of your Insurance Suite Application This tool is only required if you've added new icons, or modified existing icons.

Icons

Icon fonts are generated from folders of SVG files.

Placing an svg file in the gw folder, or in the fa5 folder, and then running the font build process will update the various font files, and SASS mappings

To use an existing icon glyph in a PCF (Most Common)

  1. In PCF set the icon name field to the name of the svg file
  2. Set the icon Type to the correct setting. svgFile for the standard gw font, gwFontGlyph for the (currently setup as Font Awesome 5 Free), or the customer option if you've added a completely new font face.

To use an existing icon in SASS (Less Common)

  1. Almost every icon in the client, defined via SASS, will have a global themeable variable
  • meaning, if it's an icon in the north panel, not defined via PCF, then look in NorthPanel_themeable.scss and you'll likely find something like gw-NorthPanel--unsaved-work-icon-glyph: "bookmark" !default;
  • override the variable in you theme file to point to another icon glyph. If it's a gw icon, just use the glyph name, if it's a FontAwesome glyph, use the name for regular, or name-solid for solid, or name-light for light

Add New Icons

  • Add the icon.svg file to the gw icon folder
  1. Install NodeJS locally
  2. Navigate to the webresources folder of your Insurance Suite Application via a command line
  3. execute npx @guidewire/web-font-builder
  4. This will generate new font files, css files, and sass mappings
  5. These new files need to be checked in. Currently, this will cause a snowcat upgrade error, and modified files like font.css will be overwritten, work on that is in progress

Adding Support for FontAwesome5 Pro

  • Purchase a license from FontAwesome for the Pro fonts
  1. Download the svg files from FontAwesome
  2. Add them to the fa5 folders
  3. Run the "Add New Icons" instructions

Printing and Icons

  1. If a new icon is added or modified and is also used as part of the custom internal application PDF printing process (NOTE: this is NOT standard browser printing), AND that icon needs to be displayed in the final PDF (very few do), then a png file needs to be present in webresources/img/app/print-png following the naming pattern of print.svgFileName.[icon name here].png -We have provided export-png.js as a means of converting existing svg files to png files, but there are many free, and better, online alternatives

版本与发布记录

@guidewire/web-font-builder 共发布 9 个版本,首次发布于 2023/09/01;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.1-alpha.10latest2024/01/252 年前
0.0.1-alpha.92023/10/213 年前
0.0.1-alpha.72023/10/213 年前
0.0.1-alpha.62023/10/213 年前
0.0.1-alpha.42023/10/213 年前
0.0.1-alpha.32023/09/023 年前

其他发布通道:alpha → 0.0.1-alpha.2。

关于 @guidewire/web-font-builder 的常见问题

@guidewire/web-font-builder 是什么?

the pebbles icon font builder tool

如何安装 @guidewire/web-font-builder?

在项目目录运行 npm install @guidewire/web-font-builder,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 web-font-builder,可以用 npx web-font-builder 直接运行。

@guidewire/web-font-builder 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/guidewire__web-font-builder 是否存在。

@guidewire/web-font-builder 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16.15.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@guidewire/web-font-builder 可以商用吗?

@guidewire/web-font-builder 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@guidewire/web-font-builder 的下载量有多少?

根据 npm 官方下载统计,@guidewire/web-font-builder 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,126 次,日均约 171 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@guidewire/web-font-builder 还在维护吗?

最新版本 0.0.1-alpha.10 发布于 2024/01/25(2 年前);至今共发布 9 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/09/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。