(Added how-to directly accessing icons) |
m (→Viewing Icons: clarification) |
||
| (20 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | '''UBIK-Standard.ttf''' is a custom set of font icons developed primarily for use on the | + | '''UBIK-Standard.ttf''' is a custom set of font icons developed primarily for use on the Mobile Client, due to concerns over the legality of using Microsoft's Segoe MDL2 Assets icon font file on non-Windows platforms (ie. Android and iOS). Apart from this legal concern, having a standardized font icon set will contribute to having a more consistent look across the various platforms and clients as UBIK-Standard.ttf becomes more widely adopted. |
| + | {{Attention|UBIK-Standard is an <I>Icon Font</I>. For Mobile, the standard Text Font is [https://rsms.me/inter/ Inter], which is included in the resources and thus available to use immediately.}} | ||
| + | |||
| + | {{Attention|UBIK-Standard is currently only supported for the Mobile client.}} | ||
| + | |||
| + | ==Viewing Icons== | ||
{{Hint|The latest font set can be downloaded directly from here using the [[File:UBIK-Standard.zip]] file.}} | {{Hint|The latest font set can be downloaded directly from here using the [[File:UBIK-Standard.zip]] file.}} | ||
| − | + | There are two ways to view which icons are available in the set. | |
| + | The first requires installing [https://apps.microsoft.com/detail/9WZDNCRDXF41?hl=en-us&gl=AT&ocid=pdpshare Character Map] from the Microsoft store. | ||
| + | Then, download the UBIK-Standard.zip linked above and locate the UBIK-Standard.tff (inside the 'fonts' subfolder). Once the .ttf is also installed on your local PC, you can use the Character Map program you just installed to get a good overview of the full icon set. | ||
| − | |||
| − | + | [[File:Hexlabelsinmap.PNG]] | |
| − | + | ||
| − | |||
| − | |||
| + | For finding the human readable labels that can be used in your xamlx files to display specific icons, you must make sure to unzip UBIK-Standard.zip, then you can open the 'demo.html' file in your web browser. Search for the icon you want either by its Hex code or character value (which you can find in Character Map under the 'Glyph Code' section, or by pressing the Copy button, respectively). These are displayed in the demo.html file on the right and left under each icon, respecitvely. For searching by Hex code, only the last 2-3 characters are required, such as "26" or "123". | ||
| + | |||
| + | [[File:Textlabelsinweb.PNG]] | ||
| + | |||
| + | [[Category:Mobile|Icon Font]] | ||
| + | [[Category:Pages with broken file links|Icon Font]] | ||
| + | |||
| + | ==Usage== | ||
| + | |||
| + | ===Mobile Client=== | ||
Using XAML, Glyphs can be called in two ways. One method is to use the Hex Code, and another is the In-App Name. Of these two methods, the recommended method is to use the In-App Name, as it uses a natural language attribute as opposed to a glyph code, making it more immediately apparent which icon is being requested by the code. | Using XAML, Glyphs can be called in two ways. One method is to use the Hex Code, and another is the In-App Name. Of these two methods, the recommended method is to use the In-App Name, as it uses a natural language attribute as opposed to a glyph code, making it more immediately apparent which icon is being requested by the code. | ||
| Line 21: | Line 34: | ||
In the below example, <code>Glyph="{x:Static resources:UBIKIcons.User}"</code> is used to call the <I>User</I> symbol. | In the below example, <code>Glyph="{x:Static resources:UBIKIcons.User}"</code> is used to call the <I>User</I> symbol. | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
| + | Mobile(Xamarin): | ||
| + | |||
<ContentView | <ContentView | ||
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" > | xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" > | ||
| Line 33: | Line 48: | ||
<br> | <br> | ||
| + | |||
| + | |||
| + | |||
| + | |||
====Hex Code Usage==== | ====Hex Code Usage==== | ||
In the below example, the attribute <code>Glyph=</code> and the following Hex Code is used to call the <I>User</I> icon. These Hex codes can be found using a Character Map program, or by searching through the icon tables below. | In the below example, the attribute <code>Glyph=</code> and the following Hex Code is used to call the <I>User</I> icon. These Hex codes can be found using a Character Map program, or by searching through the icon tables below. | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
| + | Mobile(Xamarin): | ||
| + | |||
<ContentView | <ContentView | ||
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" > | xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" > | ||
| Line 47: | Line 68: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
| + | Mobile(Xamarin): | ||
| + | |||
<ContentView | <ContentView | ||
xmlns:resources="clr-namespace:UBIK.CPL.Resources;assembly=UBIK.CPL"> | xmlns:resources="clr-namespace:UBIK.CPL.Resources;assembly=UBIK.CPL"> | ||
| Line 63: | Line 86: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | == | + | == Available Icons== |
| − | + | There are two options available to a customizer wishing to browse available icons. | |
| − | + | {{Hint|If a required icon is not found in UBIK, it is instead possible to [[Xamarin_XAML#Custom_Icons|render custom icons using Path data]].}} | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | | | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | '''The best way''' is to download and unzip the [[File:UBIK-Standard.zip]] file. Once unzipped, open the "demo" webpage file to view all icons, as well as the [[Icon_Font#In-App_Name_Usage|human readable labels]] you can use to render them in your UI. Because the demo webpage does not provide a good overview of all the icons, it is possible to combine this approach with the second one described below using that to browse the icons, and then this method to retrieve the human readable labels for the icons you wish to use. | |
| − | + | <br> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | The second way requires installation of the [https://apps.microsoft.com/detail/9wzdncrdxf41?hl=en-US&gl=US| Character Map] tool from Microsoft. This can be used to browse the characters of all the fonts installed on your machine, so to use this method you should certainly download and install the latest version of UBIK-Standard.ttf above. The downside of using this method is that you don't have access to the human readable labels using this app. | ||
| + | {{Attention|Note that icons installed on your machine are not necessarily available to customers, as they only have access to the icons delivered through UBIK, which is version-dependent.}} | ||
| − | + | <br> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | == Known Issues == | ||
| + | ===Mobile Client=== | ||
| + | The development of the custom icon font on the Mobile client was hampered significantly by unexpected icon substitutions, which appeared to be vendor/device-specific. To avoid this issue, the individual icons in the text file were mapped to the Hex codes used by the most basic alphabet and symbol characters. | ||
| − | + | A second issue was encountered where using unstable behavior was observed when using UBIK-Standard.ttf for icons when the user switched tabs, leaving UBIK running in the background. In these cases, circular icon containers became square when switching back to the app, and the icon glyphs were no longer visible. However, using the <i>GlyphButton</i> and <i>GlyphLabel</i> elements (as opposed to simply <i>Button</i> and <i>Label</i>) seems to prevent this issue. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | == | + | ==Creation== |
| − | + | The process for creating icons is documented here. | |
| − | The | + | |
| − | + | ===Step 01: Asset Creation=== | |
| + | The first step is to find similar, open-source icons to tweak. [https://themes-pixeden.com/font-demos/7-stroke/ Pixeden], [https://lineicons.com/icons/ LineIcons], or [https://linea.io/ LineA], are good starting points, as they have a similar style. | ||
| + | |||
| + | When tweaking (for example, in Adobe Illustrator), use a stroke width of 3 for the base line thickness. | ||
| + | |||
| + | It is good practice to produce three sets of .SVGs; a stroke version, an expanded version, and a final version. The stroke version is more easily edited, but the lines must be 'expanded' in Illustrator to be imported as icons. Finally, duplicate the expanded version, and name it using the following syntax: | ||
| + | <code>001#ubik-U0x26</code> | ||
| + | |||
| + | * The first number is used to keep the icon list orderly. | ||
| + | * Add as many tags as desired using the # as separators. For example, a check mark icon may be listed as #ok#confirm#check. The - ends the tag portion of the syntax. | ||
| + | * The glyph code assigns the icon to a certain space on the character map. As different device vendors block different glyph code sets for different uses, it is good practice to overwrite the basic alphabet, numbers, and symbols, to ensure the icons work on a large range of devices. Starting from 21, glyph codes may use numbers, or letters from 2A (2 here being an example) to 2F. | ||
| + | |||
| + | ===Step 02: TTF Generation=== | ||
| + | [https://icomoon.io/app/ IcoMoon] is a useful online tool for generating the icon font, that can then be installed on a device or packaged into the client resources. | ||
| + | |||
| + | * Import Icons (top left) - Use this button to import an already existing font file, when creating additions, for example. | ||
| + | * On the Selection tab (bottom center), ensure that the desired set is fully selected, and shown with an orange outline. | ||
| + | * On the Generate Font tab (bottom right), double check the generated tags for the icons. The settings button beside the download button allows you to edit the font file name and version. | ||
| + | * The download button exports the .ttf, among other resources, in a .ZIP, that is then downloaded. | ||
| + | [[Category:Mobile|Icon Font]] | ||
[[Category:Pages with broken file links|Icon Font]] | [[Category:Pages with broken file links|Icon Font]] | ||
Latest revision as of 10:40, 12 March 2026
UBIK-Standard.ttf is a custom set of font icons developed primarily for use on the Mobile Client, due to concerns over the legality of using Microsoft's Segoe MDL2 Assets icon font file on non-Windows platforms (ie. Android and iOS). Apart from this legal concern, having a standardized font icon set will contribute to having a more consistent look across the various platforms and clients as UBIK-Standard.ttf becomes more widely adopted.
| UBIK-Standard is an Icon Font. For Mobile, the standard Text Font is Inter, which is included in the resources and thus available to use immediately. |
Viewing Icons
| The latest font set can be downloaded directly from here using the UBIK-Standard.zip file. |
There are two ways to view which icons are available in the set. The first requires installing Character Map from the Microsoft store. Then, download the UBIK-Standard.zip linked above and locate the UBIK-Standard.tff (inside the 'fonts' subfolder). Once the .ttf is also installed on your local PC, you can use the Character Map program you just installed to get a good overview of the full icon set.
For finding the human readable labels that can be used in your xamlx files to display specific icons, you must make sure to unzip UBIK-Standard.zip, then you can open the 'demo.html' file in your web browser. Search for the icon you want either by its Hex code or character value (which you can find in Character Map under the 'Glyph Code' section, or by pressing the Copy button, respectively). These are displayed in the demo.html file on the right and left under each icon, respecitvely. For searching by Hex code, only the last 2-3 characters are required, such as "26" or "123".
Usage
Mobile Client
Using XAML, Glyphs can be called in two ways. One method is to use the Hex Code, and another is the In-App Name. Of these two methods, the recommended method is to use the In-App Name, as it uses a natural language attribute as opposed to a glyph code, making it more immediately apparent which icon is being requested by the code.
The two below examples show how one might use both methods to create a User symbol.
In-App Name Usage
In the below example, Glyph="{x:Static resources:UBIKIcons.User}" is used to call the User symbol.
<ContentView
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" >
<controls:GlyphLabel
Glyph="{x:Static resources:UBIKIcons.User}"
HorizontalOptions="Center"
PrimaryColor="{DynamicResource UBIKLightTextColor}"
Style="{DynamicResource HeaderSymbolStyle}"
VerticalOptions="Center" />
Hex Code Usage
In the below example, the attribute Glyph= and the following Hex Code is used to call the User icon. These Hex codes can be found using a Character Map program, or by searching through the icon tables below.
<ContentView
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" >
<controls:GlyphLabel Glyph=""" HorizontalOptions="Center" />
Directly Accessing Icons
The icons can also be used like every other font by setting the FontFamily attribute. For example:
<ContentView
xmlns:resources="clr-namespace:UBIK.CPL.Resources;assembly=UBIK.CPL">
<Label HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="{x:Static resources:UBIKIcons.User}"
FontFamily="{x:Static UBIKSymbols}"
VerticalOptions="Center"
VerticalTextAlignment="Center" />
<!-- ... -->
</ContentView>
Available Icons
There are two options available to a customizer wishing to browse available icons.
| If a required icon is not found in UBIK, it is instead possible to render custom icons using Path data. |
The best way is to download and unzip the UBIK-Standard.zip file. Once unzipped, open the "demo" webpage file to view all icons, as well as the human readable labels you can use to render them in your UI. Because the demo webpage does not provide a good overview of all the icons, it is possible to combine this approach with the second one described below using that to browse the icons, and then this method to retrieve the human readable labels for the icons you wish to use.
The second way requires installation of the Character Map tool from Microsoft. This can be used to browse the characters of all the fonts installed on your machine, so to use this method you should certainly download and install the latest version of UBIK-Standard.ttf above. The downside of using this method is that you don't have access to the human readable labels using this app.
| Note that icons installed on your machine are not necessarily available to customers, as they only have access to the icons delivered through UBIK, which is version-dependent. |
Known Issues
Mobile Client
The development of the custom icon font on the Mobile client was hampered significantly by unexpected icon substitutions, which appeared to be vendor/device-specific. To avoid this issue, the individual icons in the text file were mapped to the Hex codes used by the most basic alphabet and symbol characters.
A second issue was encountered where using unstable behavior was observed when using UBIK-Standard.ttf for icons when the user switched tabs, leaving UBIK running in the background. In these cases, circular icon containers became square when switching back to the app, and the icon glyphs were no longer visible. However, using the GlyphButton and GlyphLabel elements (as opposed to simply Button and Label) seems to prevent this issue.
Creation
The process for creating icons is documented here.
Step 01: Asset Creation
The first step is to find similar, open-source icons to tweak. Pixeden, LineIcons, or LineA, are good starting points, as they have a similar style.
When tweaking (for example, in Adobe Illustrator), use a stroke width of 3 for the base line thickness.
It is good practice to produce three sets of .SVGs; a stroke version, an expanded version, and a final version. The stroke version is more easily edited, but the lines must be 'expanded' in Illustrator to be imported as icons. Finally, duplicate the expanded version, and name it using the following syntax:
001#ubik-U0x26
- The first number is used to keep the icon list orderly.
- Add as many tags as desired using the # as separators. For example, a check mark icon may be listed as #ok#confirm#check. The - ends the tag portion of the syntax.
- The glyph code assigns the icon to a certain space on the character map. As different device vendors block different glyph code sets for different uses, it is good practice to overwrite the basic alphabet, numbers, and symbols, to ensure the icons work on a large range of devices. Starting from 21, glyph codes may use numbers, or letters from 2A (2 here being an example) to 2F.
Step 02: TTF Generation
IcoMoon is a useful online tool for generating the icon font, that can then be installed on a device or packaged into the client resources.
- Import Icons (top left) - Use this button to import an already existing font file, when creating additions, for example.
- On the Selection tab (bottom center), ensure that the desired set is fully selected, and shown with an orange outline.
- On the Generate Font tab (bottom right), double check the generated tags for the icons. The settings button beside the download button allows you to edit the font file name and version.
- The download button exports the .ttf, among other resources, in a .ZIP, that is then downloaded.