[poppler] change FontInfo::type() to enumerated value

Martin Kretzschmar m_kretzschmar at gmx.net
Sun Jul 3 09:42:31 PDT 2005


Am Samstag, den 02.07.2005, 14:18 +1000 schrieb Brad Hards:
> In working through the Qt4 bindings for FontInfo, I've found that having the 
> font type returned as a GooString isn't all that nice. It would be much nicer 
> to have an enumerated type (which it is in GfxFontInfo). So my proposal is to 
> make FontInfo::type() return an enumerated value, and to add 
> FontInfo::typeName() which return a GooString, in case anyone wants it.

IMHO with the ::type() it doesn't make much sense to expose
another ::typeName(). Any user of ::typeName() (who should be using a
wrapper anyway ;-)) has to convert to a non-goo string type anyway. So
he could convert from the enum as well.

> Any concerns with this patch?
> 
> Brad
> 
> Index: FontInfo.h
> ===================================================================
> RCS file: /cvs/poppler/poppler/poppler/FontInfo.h,v
> retrieving revision 1.2
> diff -u -4 -p -r1.2 FontInfo.h
> --- FontInfo.h  28 Jun 2005 22:49:15 -0000      1.2
> +++ FontInfo.h  2 Jul 2005 04:12:28 -0000
> @@ -5,25 +5,37 @@
>  #include "goo/GooList.h"
> 
>  class FontInfo {
>  public:
> -
> +  enum Type {
> +    unknown,
> +    Type1,
> +    Type1C,
> +    Type3,
> +    TrueType,
> +    CIDType0,
> +    CIDType0C,
> +    CIDTrueType
> +  };
> +

Why not use GfxFontType?

Regards,

Martin



More information about the poppler mailing list