Hello,
Attached is a patch to add the standard GTK font-selection dialog for picking the font family name.
It works OK, but not great: To change a font family parameter (in the Text layer), you can hereby either edit the family name manually (as currently), or click on a small button to display the Font Selection Dialog (attached screenshot). I disabled the widgets that do not define the font family name (size, weight, type) because
I could not find a way to adapt multiple values (ie to change size, weight, style and family name, when the “current” value being modified is only the family name)
the possible values for weight & type are not the same in Pango (where eg normal is sometimes called regular) and Synfig (where eg: ultra bold exists), and same for size (Pango is in pt, Synfig is in [X,Y])
Shall I leave it as is? (easier to me… but the user may wonder why (s)he’s not allowed to pick another style and size in the dialog)
Or shall I create a new type of dialog that only displays the list of family and preview widgets? Or is there a way to completely hide the useless widgets (and their label) from this GtkFontSelectionDialog, and adapt its width accordingly?
This will make an enormous difference to Synfig Studio. Sometimes it’s not always obvious - particularly when you are using a font with several weights - what you need to type in the font box.
Inkscape had a similar problem to the one you found in Synfig Studio and solved it like this:
There’s a drop down that just selects the font with other drop downs to select the size, etc.
I agree on DaveJ:s suggestion. Looks cleaner and more consistent with Synfigs UI.
Inkscape also have a text tool. It would be sweet to have something similar in Synfig later on, but for now the font list is enough I think.
I agree a complete text settings dialog would be nice. For this I need to find a way to update multiple parameters of the font layer (family, size, weight, style) on return of this dialog and the current widget_value doesn’t seem to permit it easily. Is there any example of such a behaviour in Synfig yet?
Meanwhile I’ll try the dropdown way, it looks neater indeed. Thanks for your encouragements.
B.
Even if you find a way to pass those values to multiple parameters when edit the font parameter, the thing is that the text layer doesn’t use the weight and style parameters at all. It needs a total rework using cairo (pango) render instead of current render.
One question, how does the font selection works when the sif file is moved to other folder? I mean, are the font path stored absolute or relative to the file position?
If you don’t mind I would incorporate to the next code cycle.
Thanks for the patch!
-G
Just me being greedy, but there is another feature connected with type that you could add - that is to handle opening a .sif when the fonts used in it are not currently installed.
There are two possibilities - firstly just having a dialog box that warns you, and tells you which font is not installed. The second is to have some kind of font substitution window that Flash has, which allows you to pick substitute fonts.
For me, just having a warning dialog box (one that could be supressed with a “Don’t Warn Me Again” checkbox) to tell you that font X and font Y are used in the .sif file but not currently installed after opening a .sif would be a huge help and more than enough.