Re: GtkFontPickerButton



On Fri, 2003-03-07 at 03:33, Jody Goldberg wrote:
> On Thu, Mar 06, 2003 at 07:58:16PM -0500, Havoc Pennington wrote:
> > On Thu, Mar 06, 2003 at 07:26:45PM -0500, Jody Goldberg wrote:
> > >  
> > > If work is going to be done on it I'd really like to see something
> > > with the bells and whistles necessary for MS Office style
selection.
> > > 
> > 
> > Can you give us screenshots or description or ASCII art of what this
> > means? (Or say what to click on to get an example if we have Office
> > XP?)
> 
> Good point.
> Sadly I don't have access to Office XP, but the elements I'm
> thinking of in Office 2k are :
> 
> http://www.gnome.org/~jody/selector.png
> http://www.gnome.org/~jody/dialog.png
> 
> A couple of notes
> 1) I did not include the strikeout button in the selector because it
>    does not tend to be enabled by default.
> 
> 2) Yes the toolbar entries tend to be combos, but we can add those
>    later if necessary.
> 
> 3) In the dialog I intentionally chose one of the more obscure uses
>    of the standard dialog to highlight the addition of some custom
>    descriptive text and the desensitization of some of the elements
>    (the name and size in this example).
>    
> I don't advocate this as the one true UI by any stretch of the
> imagination, but it does seems like a decent target feature set.

Hmm, I don't think this is really relevant for the widget we're
discussing here, which is only a convenient way to open the existing
font selection dialog. You want to redesign/extend the font selection
dialog itself...

Anyway, I added the option to display the selected font style to the
GtkFontPickerButton, so that it can now look as seen in the attachments.
In doing this I discovered a little inconvenience in the Pango API:

pango_font_description_to_string() always uses the canonical names for
style and weight. But the font selection dialog displays the names found
in the fonts themselves, so in order to display the same information in
the picker, I have to obtain the corresponding PangoFontFace and use
pango_font_face_get_face_name(). Is there a better way to go from a
PangoFontDescription to the corresponding PangoFontFace than to search
for the matching family and then iterate over its faces to find the
maching one ?

Matthias

Attachment: font-picker1.png
Description: Binary data

Attachment: font-picker2.png
Description: Binary data

Attachment: font-picker3.png
Description: Binary data

Attachment: font-picker4.png
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]