09-26-2016, 08:36 PM
(09-25-2016, 08:43 PM)david.bluecame Wrote: Please when you select a TTF font file, in the file selection dialog you have to choose "all files", otherwise it will only show image files and the TTF folders will appear to be empty. Not sure if Micheus could do something to help here so that field automatically looks for TTF files?That is easy David. Just use another dialog properties variable with the proper file extension like:
Quote::If we try to select a system font - like for Windows 10 - the Fonts directory seems to be empty.
ImageFormats = images_format(),
BrowseProps = [{dialog_type,open_dialog}, {extensions,ImageFormats}],
FontProps = [{dialog_type,open_dialog}, {extensions,[{".ttf","True Type Fonts"}]}],
:
{?__(188, "Custom icon path "), {button,{text, get_pref(badge_custom_icon_path,Attr),
[{key,badge_custom_icon_path}, {props,BrowseProps}]}}},
{?__(240, "Font size factor"), {text, get_pref(badge_font_size_factor,Attr), [range(badge_font_size_factor), {key,badge_font_size_factor}]}},
{?__(241, "Custom font path "), {button,{text, get_pref(badge_font_path,Attr),
[{key,badge_font_path}, {props,FontProps}]}}}
Wouldn't be better get the font file information from using the data from a Font dialog? (it used the default font OS folder).
If so, we need to "stole" some code from the wpc_tt.erl - a lot of it to be honest - but, I believe we can migrate it to another module making it shareable with other modules. (we just need Dan's approval)