Re: DiaFont abstraction and namespacing



Le Sun, Jun 23, 2002, à 02:16:27PM +0200, Hans Breuer a écrit:

Hi Cyrille,
while trying to compile the wmf and Python plug-in again I've stumbled
over some 'possibly offending' comments in lib/font.h

Which comments ? 
 
It has to do with Style, which IMO should be called DiaFontStyle if
it should stay like it is. I'm not sure if the Pango concept
of splitting (Pango)Weight and (Pango)Style wouldn't work
better in Dia, too.

Well, it was feared on Saturday that exposing all this complexity to the
user might be too much. I'm don't have any strong opinions on this, frankly.

Whatever works best is good, I guess (also, the ability to derive another
face in the same family out of a DiaFont may be very useful to things like
the UML Class object -- specify the class font, and have the abstract class
version of it automatically).

Have you looked at Lars' new font selector widget, and its ability to
enumerate (and show) all the available faces for a family ?
 
What I propose is:

typedef enum
{
  DIA_FONT_FAMILY_ANY = 0
  DIA_FONT_SANS       = 1,
  DIA_FONT_SERIF      = 2,
  DIA_FONT_MONOSPACE  = 3
} DiaFontFamily;

Yuck! 

Means dia is now hardcoded to only three families ? (there are so many
available families on my system I have to scroll through three screenfuls of
the font widget -- with 1024 dots of vertical resolution).

Please keep the family a gchar* out of this guint... Merging pango::weight
and pango::style together seems good, and your way seems more powerful than
the gross approximation I made.

Some constants for the general (regular, bold, italic, bold-italic) styles
may be a useful thing to keep.

This would allow to store all this information in one guint,
get it with one function call and be able to separate the
required info for the respective plug-in. And all this
without including any Pango header. 

A fuure goal - when the question: who needs to know layouts ? 
is sorted out - is to _not_ include <pango/pango.h> in font.h
anymore.

Sounds very good. The ideal is to have the objects independent of any of
{gdk, gtk, pango}.

        -- Cyrille

-- 
Grumpf.




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