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

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