Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGFont.cxx File Reference
#include "TGFont.h"
#include "TGClient.h"
#include "THashTable.h"
#include "TVirtualX.h"
#include "TObjString.h"
#include "TGWidget.h"
#include "TROOT.h"
#include "TError.h"
#include "TMath.h"
#include "strlcpy.h"
#include "snprintf.h"
#include <cerrno>
#include <cstdlib>
#include <climits>
#include <iostream>
Include dependency graph for TGFont.cxx:

Classes

struct  FontStateMap_t
 
struct  LayoutChunk_t
 
class  TNamedFont
 
struct  XLFDAttributes_t
 

Namespaces

namespace  ROOT
 This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
 

Macros

#define FONT_FAMILY   0
 
#define FONT_NUMFIELDS   6
 
#define FONT_OVERSTRIKE   5
 
#define FONT_SIZE   1
 
#define FONT_SLANT   3
 
#define FONT_UNDERLINE   4
 
#define FONT_WEIGHT   2
 
#define MAX_LINES   50
 
#define MAXUSE   128
 
#define XLFD_ADD_STYLE   5
 
#define XLFD_AVERAGE_WIDTH   11
 
#define XLFD_ENCODING   13
 
#define XLFD_FAMILY   1
 
#define XLFD_FOUNDRY   0
 
#define XLFD_NUMFIELDS   14
 
#define XLFD_PIXEL_SIZE   6
 
#define XLFD_POINT_SIZE   7
 
#define XLFD_REGISTRY   12
 
#define XLFD_RESOLUTION_X   8
 
#define XLFD_RESOLUTION_Y   9
 
#define XLFD_SETWIDTH   4
 
#define XLFD_SLANT   3
 
#define XLFD_SPACING   10
 
#define XLFD_WEIGHT   2
 

Enumerations

enum  ECharType { kCharNormal , kCharReplace , kCharSkip }
 
enum  EFontCharset { kFontCSNormal = 0 , kFontCSSymbol = 1 , kFontCSOther = 2 }
 
enum  EFontSetWidth { kFontSWNormal = 0 , kFontSWCondence = 1 , kFontSWExpand = 2 , kFontSWUnknown = 3 }
 
enum  EFontSpacing { kFontProportional = 0 , kFontFixed = 1 , kFontMono = 1 , kFontCharcell = 2 }
 

Functions

static int GetControlCharSubst (Int_t c, char buf[4])
 When displaying text in a widget, a backslashed escape sequence is substituted for control characters that occur in the text.
 
static char * GetToken (char *str)
 

Variables

static char gHexChars [] = "0123456789abcdefxtnvr\\"
 
static char gMapChars []
 
static const FontStateMap_t gOverstrikeMap []
 
static const FontStateMap_t gSlantMap []
 
static const FontStateMap_t gUnderlineMap []
 
static const FontStateMap_t gWeightMap []
 
static const FontStateMap_t gXlfdCharsetMap []
 
static const FontStateMap_t gXlfdgWeightMap []
 
static const FontStateMap_t gXlfdSetwidthMap []
 
static const FontStateMap_t gXlfdSlantMap []
 

Macro Definition Documentation

◆ FONT_FAMILY

#define FONT_FAMILY   0

Definition at line 68 of file TGFont.cxx.

◆ FONT_NUMFIELDS

#define FONT_NUMFIELDS   6

Definition at line 74 of file TGFont.cxx.

◆ FONT_OVERSTRIKE

#define FONT_OVERSTRIKE   5

Definition at line 73 of file TGFont.cxx.

◆ FONT_SIZE

#define FONT_SIZE   1

Definition at line 69 of file TGFont.cxx.

◆ FONT_SLANT

#define FONT_SLANT   3

Definition at line 71 of file TGFont.cxx.

◆ FONT_UNDERLINE

#define FONT_UNDERLINE   4

Definition at line 72 of file TGFont.cxx.

◆ FONT_WEIGHT

#define FONT_WEIGHT   2

Definition at line 70 of file TGFont.cxx.

◆ MAX_LINES

#define MAX_LINES   50

◆ MAXUSE

#define MAXUSE   128

◆ XLFD_ADD_STYLE

#define XLFD_ADD_STYLE   5

Definition at line 84 of file TGFont.cxx.

◆ XLFD_AVERAGE_WIDTH

#define XLFD_AVERAGE_WIDTH   11

Definition at line 90 of file TGFont.cxx.

◆ XLFD_ENCODING

#define XLFD_ENCODING   13

Definition at line 92 of file TGFont.cxx.

◆ XLFD_FAMILY

#define XLFD_FAMILY   1

Definition at line 80 of file TGFont.cxx.

◆ XLFD_FOUNDRY

#define XLFD_FOUNDRY   0

Definition at line 79 of file TGFont.cxx.

◆ XLFD_NUMFIELDS

#define XLFD_NUMFIELDS   14

Definition at line 93 of file TGFont.cxx.

◆ XLFD_PIXEL_SIZE

#define XLFD_PIXEL_SIZE   6

Definition at line 85 of file TGFont.cxx.

◆ XLFD_POINT_SIZE

#define XLFD_POINT_SIZE   7

Definition at line 86 of file TGFont.cxx.

◆ XLFD_REGISTRY

#define XLFD_REGISTRY   12

Definition at line 91 of file TGFont.cxx.

◆ XLFD_RESOLUTION_X

#define XLFD_RESOLUTION_X   8

Definition at line 87 of file TGFont.cxx.

◆ XLFD_RESOLUTION_Y

#define XLFD_RESOLUTION_Y   9

Definition at line 88 of file TGFont.cxx.

◆ XLFD_SETWIDTH

#define XLFD_SETWIDTH   4

Definition at line 83 of file TGFont.cxx.

◆ XLFD_SLANT

#define XLFD_SLANT   3

Definition at line 82 of file TGFont.cxx.

◆ XLFD_SPACING

#define XLFD_SPACING   10

Definition at line 89 of file TGFont.cxx.

◆ XLFD_WEIGHT

#define XLFD_WEIGHT   2

Definition at line 81 of file TGFont.cxx.

Enumeration Type Documentation

◆ ECharType

enum ECharType
Enumerator
kCharNormal 
kCharReplace 
kCharSkip 

Definition at line 189 of file TGFont.cxx.

◆ EFontCharset

Enumerator
kFontCSNormal 
kFontCSSymbol 
kFontCSOther 

Definition at line 171 of file TGFont.cxx.

◆ EFontSetWidth

Enumerator
kFontSWNormal 
kFontSWCondence 
kFontSWExpand 
kFontSWUnknown 

Definition at line 166 of file TGFont.cxx.

◆ EFontSpacing

Enumerator
kFontProportional 
kFontFixed 
kFontMono 
kFontCharcell 

Definition at line 161 of file TGFont.cxx.

Function Documentation

◆ GetControlCharSubst()

static Int_t GetControlCharSubst ( Int_t  c,
char  buf[4] 
)
static

When displaying text in a widget, a backslashed escape sequence is substituted for control characters that occur in the text.

Given a control character, fill in a buffer with the replacement string that should be displayed.

The return value is the length of the substitute string, buf is filled with the substitute string; it is not '\0' terminated.

c – The control character to be replaced. buf – Buffer that gets replacement string. It only needs to be 4 characters long.

Definition at line 2736 of file TGFont.cxx.

◆ GetToken()

static char * GetToken ( char *  str)
static

Definition at line 1900 of file TGFont.cxx.

Variable Documentation

◆ gHexChars

char gHexChars[] = "0123456789abcdefxtnvr\\"
static

Definition at line 259 of file TGFont.cxx.

◆ gMapChars

char gMapChars[]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 'a', 'b', 't', 'n', 'v', 'f', 'r', 0
}

Definition at line 266 of file TGFont.cxx.

◆ gOverstrikeMap

const FontStateMap_t gOverstrikeMap[]
static
Initial value:
= {
{ 1, "overstrike" },
{ 0, 0 }
}

Definition at line 215 of file TGFont.cxx.

◆ gSlantMap

const FontStateMap_t gSlantMap[]
static
Initial value:
= {
{ kFontSlantRoman, "roman" },
{ kFontSlantItalic, "italic" },
}
@ kFontSlantUnknown
Definition TGFont.h:48
@ kFontSlantRoman
Definition TGFont.h:45
@ kFontSlantItalic
Definition TGFont.h:46

Definition at line 204 of file TGFont.cxx.

◆ gUnderlineMap

const FontStateMap_t gUnderlineMap[]
static
Initial value:
= {
{ 1, "underline" },
{ 0, 0 }
}

Definition at line 210 of file TGFont.cxx.

◆ gWeightMap

const FontStateMap_t gWeightMap[]
static
Initial value:
= {
{ kFontWeightNormal, "normal" },
{ kFontWeightBold, "bold" },
}
@ kFontWeightBold
Definition TGFont.h:37
@ kFontWeightNormal
Definition TGFont.h:35
@ kFontWeightUnknown
Definition TGFont.h:41

Definition at line 198 of file TGFont.cxx.

◆ gXlfdCharsetMap

const FontStateMap_t gXlfdCharsetMap[]
static
Initial value:
= {
{ kFontCSNormal, "iso8859" },
{ kFontCSSymbol, "adobe" },
{ kFontCSSymbol, "sun" },
{ kFontCSOther, 0 }
}
@ kFontCSSymbol
Definition TGFont.cxx:172
@ kFontCSNormal
Definition TGFont.cxx:171
@ kFontCSOther
Definition TGFont.cxx:173

Definition at line 249 of file TGFont.cxx.

◆ gXlfdgWeightMap

const FontStateMap_t gXlfdgWeightMap[]
static
Initial value:
= {
{ kFontWeightNormal, "normal" },
{ kFontWeightNormal, "medium" },
{ kFontWeightNormal, "book" },
{ kFontWeightNormal, "light" },
{ kFontWeightBold, "bold" },
{ kFontWeightBold, "demi" },
{ kFontWeightBold, "demibold" },
}

Definition at line 223 of file TGFont.cxx.

◆ gXlfdSetwidthMap

const FontStateMap_t gXlfdSetwidthMap[]
static
Initial value:
= {
{ kFontSWNormal, "normal" },
{ kFontSWCondence, "narrow" },
{ kFontSWCondence, "semicondensed" },
{ kFontSWCondence, "condensed" },
}
@ kFontSWCondence
Definition TGFont.cxx:167
@ kFontSWNormal
Definition TGFont.cxx:166
@ kFontSWUnknown
Definition TGFont.cxx:169

Definition at line 241 of file TGFont.cxx.

◆ gXlfdSlantMap

const FontStateMap_t gXlfdSlantMap[]
static
Initial value:
= {
{ kFontSlantRoman, "r" },
{ kFontSlantItalic, "i" },
}
@ kFontSlantOblique
Definition TGFont.h:47

Definition at line 234 of file TGFont.cxx.