Modify the UI font generation process, add script

This commit is contained in:
Jean Pierre Cimalando 2020-10-05 22:29:04 +02:00
parent 5a2c2cc1b1
commit 9ada1cc210
5 changed files with 27 additions and 2 deletions

2
.gitignore vendored
View file

@ -21,6 +21,8 @@ clients/sfzprint
/vst/download/
/editor/external/fluentui-system-icons/
# gh-pages unstaged files:
_api/
_site/

View file

@ -13,7 +13,7 @@ set(EDITOR_RESOURCES
icon_white@2x.png
knob48.png
knob48@2x.png
Fonts/fluentui-system-regular-20.ttf
Fonts/sfizz-fluentui-system-r20.ttf
Fonts/Roboto-Regular.ttf
PARENT_SCOPE)

View file

@ -497,7 +497,7 @@ void Editor::Impl::createFrameContents()
};
auto createGlyphButton = [this, &theme](UTF8StringPtr glyph, const CRect& bounds, int tag, int fontsize) {
STextButton* btn = new STextButton(bounds, this, tag, glyph);
btn->setFont(new CFontDesc("Fluent System Regular W20", fontsize));
btn->setFont(new CFontDesc("Sfizz Fluent System R20", fontsize));
btn->setTextColor(theme->icon);
btn->setHoverColor(theme->iconHighlight);
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));

23
scripts/generate_ui_fonts.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
set -e
if ! test -d "src"; then
echo "Please run this in the project root directory."
exit 1
fi
root="`pwd`"
fonts="$root/editor/resources/Fonts"
if test ! -d editor/external/fluentui-system-icons; then
cd editor/external
git clone https://github.com/sfztools/fluentui-system-icons.git
cd fluentui-system-icons
else
cd editor/external/fluentui-system-icons
git checkout master
git pull origin master
fi
./generate_icons_font.py -s regular -w 20 -n 'Sfizz Fluent System R20' \
-o "$fonts/sfizz-fluentui-system-r20.ttf"