font-selection dialog

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

  1. 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)
  2. 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?

Thanks for your help.
Berteh.
Select Font_disabled widgets.png
font-selection-dialog.patch.txt (16.6 KB)

First of all - HUGE THANKS! What a cool patch 8)

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:

fonts-inkscape.png

There’s a drop down that just selects the font with other drop downs to select the size, etc.

:smiley: Great!

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.

inkscape-font-dialog.png

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.

tells you which font is not installed.

It should be applied to external files (images, sifs) as well.

Excuse me but… how do I install this lovely feature again??

Great work berteh, you are a total hacker! :slight_smile: :slight_smile:

Is there a way to attach the patch? I’m having trouble doing text (animated text), and wanting to know.

It is on the first post.
-G

I’ve read…

But, where to put the patch?

The patch is useful if you’re success on build Synfig Studio on your platform. Once you’ve done that you have to apply the patch by this command:

$ patch -p0 < path_to_patch/path_file.diff

The p0 option may be p1 depending on where was the patch created in relation to the source code and were are you when running the mentioned command.

For further information about patch command see this: en.wikipedia.org/wiki/Patch_%28Unix%29

To learn how to build Synfig Studio from source read this: wiki.synfig.org/wiki/Dev:Build_Instructions

-G