Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGX11TTF.h
Go to the documentation of this file.
1// @(#)root/x11ttf:$Id$
2// Author: Olivier Couet 01/10/02
3// Author: Fons Rademakers 21/11/98
4
5/*************************************************************************
6 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#ifndef ROOT_TGX11TTF
14#define ROOT_TGX11TTF
15
16
17#include "TGX11.h"
18
19#include "TTF.h"
20
21#include "RConfigure.h"
22
23#ifdef R__HAS_XFT
24class TXftFontHash;
25#endif
26
27class TGX11TTF : public TGX11 {
28
29private:
30 enum EAlign {
31// clang++ <v20 (-Wshadow) complains about shadowing GuiTypes.h global variable kNone. Let's silence warning:
32#if defined(__clang__) && __clang_major__ < 20
33#pragma clang diagnostic push
34#pragma clang diagnostic ignored "-Wshadow"
35#endif
37#if defined(__clang__) && __clang_major__ < 20
38#pragma clang diagnostic pop
39#endif
40
43
44 FT_Vector fAlign; ///< alignment vector
45#ifdef R__HAS_XFT
46 TXftFontHash *fXftFontHash; ///< hash table for Xft fonts
47#endif
48
49 void Align(void);
51 Int_t bx, Int_t by);
55
56public:
57 TGX11TTF(const TGX11 &org);
58 ~TGX11TTF() override { }
59
60 Bool_t Init(void *display) override;
62 const char *text, ETextMode mode) override;
64 const wchar_t *text, ETextMode mode) override;
65 void SetTextFont(Font_t fontnumber) override;
67 void SetTextSize(Float_t textsize) override;
68
69#ifdef R__HAS_XFT
70 //---- Methods used text/fonts handling via Xft -----
71 //void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n);
72 FontStruct_t LoadQueryFont(const char *font_name) override;
73 void DeleteFont(FontStruct_t fs) override;
74 void DeleteGC(GContext_t gc) override;
75 void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len) override;
76 Int_t TextWidth(FontStruct_t font, const char *s, Int_t len) override;
80 void MapGCFont(GContext_t gc, FontStruct_t font) override;
81#endif
82
83 static void Activate();
84
85 ClassDefOverride(TGX11TTF,0) //Interface to X11 + TTF font handling
86};
87
88#endif
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
Definition GuiTypes.h:35
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
Handle_t Drawable_t
Drawable handle.
Definition GuiTypes.h:31
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
short Font_t
Font number (short)
Definition RtypesCore.h:95
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize DeleteFont
Option_t Option_t SetTextSize
Option_t Option_t mgn
Option_t Option_t fontnumber
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t SetTextFont
Option_t Option_t textsize
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t org
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window LoadQueryFont
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
Option_t Option_t TPoint TPoint DrawText
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Option_t Option_t TPoint TPoint const char text
Interface to low level X11 (Xlib).
Definition TGX11TTF.h:27
void RenderString(Int_t x, Int_t y, ETextMode mode)
Perform the string rendering in the pad.
Definition TGX11TTF.cxx:457
static void Activate()
Static method setting TGX11TTF as the acting gVirtualX.
Definition TGX11TTF.cxx:171
void Align(void)
Compute alignment variables.
Definition TGX11TTF.cxx:212
RXImage * GetBackground(Int_t x, Int_t y, UInt_t w, UInt_t h)
Get the background of the current window in an XImage.
Definition TGX11TTF.cxx:403
Bool_t Init(void *display) override
Initialize X11 system. Returns kFALSE in case of failure.
Definition TGX11TTF.cxx:183
void DrawImage(FT_Bitmap *source, ULong_t fore, ULong_t back, RXImage *xim, Int_t bx, Int_t by)
Draw FT_Bitmap bitmap to xim image at position bx,by using specified foreground color.
Definition TGX11TTF.cxx:243
FT_Vector fAlign
alignment vector
Definition TGX11TTF.h:44
TGX11TTF(const TGX11 &org)
Create copy of TGX11 but now use TrueType fonts.
Definition TGX11TTF.cxx:151
Bool_t IsVisible(Int_t x, Int_t y, UInt_t w, UInt_t h)
Test if there is really something to render.
Definition TGX11TTF.cxx:429
~TGX11TTF() override
Definition TGX11TTF.h:58
@ kTCenter
Definition TGX11TTF.h:41
@ kBRight
Definition TGX11TTF.h:42
@ kBCenter
Definition TGX11TTF.h:42
@ kMCenter
Definition TGX11TTF.h:41
@ kMRight
Definition TGX11TTF.h:41
@ kTRight
Definition TGX11TTF.h:41
This class is the basic interface to the X11 (Xlib) graphics system.
Definition TGX11.h:80
void DeleteGC(GContext_t gc) override
Explicitly delete a graphics context.
Definition GX11Gui.cxx:1032
Int_t TextWidth(FontStruct_t font, const char *s, Int_t len) override
Return length of string in pixels. Size depends on font.
Definition GX11Gui.cxx:2069
FontH_t GetFontHandle(FontStruct_t fs) override
Return handle to font described by font structure.
Definition GX11Gui.cxx:950
void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len) override
Draw a string using a specific graphics context in position (x,y).
Definition GX11Gui.cxx:2058
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition GX11Gui.cxx:2077
virtual FontStruct_t GetGCFont(GContext_t gc)
Return the font associated with the graphics context gc.
virtual void MapGCFont(GContext_t, FontStruct_t)
Map the XftFont with the Graphics Context using it.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17