This document helps explain common workflows when using the Symbol Icon Manager.
Before starting, note that the font building scripts are setup for Windows right now. Building a font requires FontForge to be installed to the default path (with its own Python plugin as well). This should be very easy to get working on other systems though as the build script is in Python and the Windows script only launches the Python script.
- Start the application and go to the
Fonts
tab - Find the section for the font you wish to build and click the corresponding
[Build ... Font]
button. - The application will generate a FontForge Python script and download or copy all source SVG files that can be used to build a new font. The script and glyph SVG files will be added to a new directory within the application's executable directory. This output directory should automatically open for you.
- Run
build_win.bat
(on Windows) to build the font and watchoutput_font.ttf
be created automatically.- Note that if the script fails the first time, wait 30 seconds and try again. It's possible glyph SVGs are still being downloaded.
- Start the application and go to the
Icon Mapping
tab and then press[Load]
- Select a
.json
mapping file in the file picker or drop-down and open it, all mappings should now be visible in the view - Press [Build Font] and the application will generate a FontForge Python script and download or copy all source SVG files that can be used to build a new font. The script and glyph SVG files will be added to a new directory within the application's executable directory. This output directory should automatically open for you.
- Run
build_win.bat
(on Windows) to build the font and watchoutput_font.ttf
be created automatically.- Note that if the script fails the first time, wait 30 seconds and try again. It's possible glyph SVGs are still being downloaded.
- Rename the font file to whatever you like.
- Note that internally the font name will be 'Symbols' but can be renamed using FontForge.
A special step is needed after the .ttf file is generated to ensure the OS/2 table metrics are correct. This is mandatory for some applications. Unfortunately, there is an upstream bug in FontForge that prevents the Python script from being able to do this automatically (see here).
To set these metrics:
- Open the font .ttf in FontForge
- Navigate to the Font Information by clicking
[Element]
->[Font Info...]
- Then click on the
[OS/2]
side tab and the[Metrics]
tab - Set all metrics as shown below. These follow the SegoeFluent standard metrics.
- Click
[Save]
to close the metrics window - Finally, save the changes to the .ttf file by clicking
[File]
->[Generate Fonts...]
and then[Generate]
. Use default settings and only select the destination location. It is safe to ignore any warnings or errors during this process (Click[Generate]
again).
Font's built with the Symbol Icon Manager are usable in all XAML-based projects. These fonts are standard TrueType (.ttf) files.
- The font must be added to the project file and Build Action set to
AvaloniaResource
- Usually font files should be added to an /Assets/Fonts directory within your project.
- Reference the font in XAML:
- Within a
TextBlock
:FontFamily="avares://<app_name>/Assets/Fonts/output_font.ttf#Symbols"
- Within a
- The font must be added to the project file and
Build Action
set toContent
.- Usually font files should be added to an /Assets/Fonts directory within your project.
- Reference the font in XAML: ``
- Within a
TextBlock
:FontFamily="ms-appx:///Assets/Fonts/output_font.ttf#Symbols"
- As a new resource:
<FontFamily x:Key="SymbolThemeFontFamily">ms-appx:///Assets/Fonts/output_font.ttf#Symbols</FontFamily>
- Within a
Follow the process for WinUI/UWP. For further details see this blog.