OpendTect-6_4  6.4
fontdata.h
Go to the documentation of this file.
1 #ifndef fontdata_h
2 #define fontdata_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Bril
8  Date: 26/07/2000
9  RCS: $Id$
10 ______________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "enums.h"
16 #include "bufstring.h"
17 
21 {
22 public:
23 
24  enum Weight { Light, Normal, DemiBold, Bold, Black };
26  static int numWeight(Weight);
27  static Weight enumWeight(int);
28 
29  FontData(int ptsz=defaultPointSize(),
30  const char* fam=defaultFamily(),
31  Weight wght=defaultWeight(),
32  bool ital=defaultItalic());
33  FontData(const char* fms);
34 
36  bool getFrom(const char* fms);
37  void putTo(BufferString&) const;
38 
39  const char* family() const { return family_; }
40  int pointSize() const { return pointsize_; }
41  Weight weight() const { return weight_; }
42  bool isItalic() const { return italic_; }
43 
44  void setFamily( const char* f ) { family_ = f; }
45  void setPointSize( int ps ) { pointsize_ = ps; }
46  void setWeight( Weight w ) { weight_= w; }
47  void setItalic( bool yn ) { italic_ = yn; }
48 
49  static const char* defaultFamily();
50  static int defaultPointSize();
51  static Weight defaultWeight();
52  static bool defaultItalic();
53 
54  static void setDefaultFamily( const char* f );
55  static void setDefaultPointSize( int ps );
56  static void setDefaultWeight( Weight w );
57  static void setDefaultItalic( bool yn );
58 
59  static const char* const* universalFamilies();
61 
62  static const char* const* defaultKeys();
64 
65  enum StdSz { Control=0, Graphics2D, Graphics3D, Fixed,
66  Graphics2DSmall, Graphics2DLarge,
67  ControlSmall, ControlLarge };
68  static const char* key( StdSz ss );
69 
70 protected:
71 
75  bool italic_;
76 };
77 
78 #endif
#define mExpClass(module)
Definition: commondefs.h:160
const char * family() const
Definition: fontdata.h:39
bool italic_
Definition: fontdata.h:75
void setWeight(Weight w)
Definition: fontdata.h:46
bool isItalic() const
Definition: fontdata.h:42
int pointsize_
Definition: fontdata.h:73
Weight
Definition: fontdata.h:24
Data needed to make an actual font.
Definition: fontdata.h:20
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
BufferString family_
Definition: fontdata.h:72
int pointSize() const
Definition: fontdata.h:40
void setFamily(const char *f)
Definition: fontdata.h:44
void setItalic(bool yn)
Definition: fontdata.h:47
Weight weight_
Definition: fontdata.h:74
void setPointSize(int ps)
Definition: fontdata.h:45
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: fontdata.h:67
StdSz
Definition: fontdata.h:65
Weight weight() const
Definition: fontdata.h:41
Definition: fontdata.h:66

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019