ROOT
master
Reference Guide
Loading...
Searching...
No Matches
QuartzText.h
Go to the documentation of this file.
1
// @(#)root/graf2d:$Id$
2
// Author: Timur Pocheptsov 26/01/2012
3
4
/*************************************************************************
5
* Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#ifndef ROOT_QuartzText
13
#define ROOT_QuartzText
14
15
#include <vector>
16
17
#include <Cocoa/Cocoa.h>
18
19
#include "
CocoaUtils.h
"
20
#include "
GuiTypes.h
"
21
22
23
class
TAttText
;
24
25
/////////////////////////////////////////////////
26
// //
27
// TextLine - wrapper class for a CoreText's //
28
// CTLine: hide all the API, calls, objects, //
29
// CoreFoundation objects required to draw //
30
// a simple line of text and be able to //
31
// calculate text metrics. //
32
// //
33
/////////////////////////////////////////////////
34
35
namespace
ROOT
{
36
namespace
Quartz
{
37
38
// Core Text's CTLine wrapper.
39
class
TextLine
{
40
public
:
41
TextLine
(
const
char
*
textLine
, CTFontRef font);
42
TextLine
(
const
std::vector<UniChar> &
textLine
, CTFontRef font);
43
44
TextLine
(
const
char
*
textLine
, CTFontRef font,
Color_t
color);
45
TextLine
(
const
std::vector<UniChar> &
textLine
, CTFontRef font,
Color_t
color);
46
TextLine
(
const
char
*
textLine
, CTFontRef font,
const
CGFloat *
rgb
);
47
48
~TextLine
();
49
50
void
GetBounds
(
UInt_t
&
w
,
UInt_t
&
h
)
const
;
51
52
void
DrawLine
(
CGContextRef
ctx
)
const
;
53
void
DrawLine
(
CGContextRef
ctx
,
Double_t
x
,
Double_t
y
,
const
TAttText
&
att
)
const
;
54
private
:
55
CTLineRef
fCTLine
;
//Core Text line, created from Attributed string.
56
CTFontRef
fCTFont
;
//A font used for this CTLine.
57
58
void
Init
(
const
char
*
textLine
,
UInt_t
nAttribs
,
CFStringRef
*keys,
CFTypeRef
*values);
59
void
Init
(
const
std::vector<UniChar> &
textLine
,
UInt_t
nAttribs
,
CFStringRef
*keys,
CFTypeRef
*values);
60
61
TextLine
(
const
TextLine
&
rhs
);
62
TextLine
&
operator =
(
const
TextLine
&
rhs
);
63
};
64
65
//Aux. function which extracts glyphs, calculates their positions, draws glyphs with manual layout (GUI text).
66
void
DrawTextLineNoKerning
(
CGContextRef
ctx
, CTFontRef font,
const
std::vector<UniChar> &
text
,
Int_t
x
,
Int_t
y
);
67
68
const
extern
CTFontOrientation
defaultFontOrientation
;
69
const
extern
CTFontOrientation
horizontalFontOrientation
;
70
const
extern
CTFontOrientation
verticalFontOrientation
;
71
72
}
73
}
74
75
#endif
CocoaUtils.h
GuiTypes.h
h
#define h(i)
Definition
RSha256.hxx:106
Int_t
int Int_t
Signed integer 4 bytes (int)
Definition
RtypesCore.h:60
Color_t
short Color_t
Color number (short)
Definition
RtypesCore.h:100
w
winID w
Definition
TGWin32VirtualGLProxy.cxx:39
DrawLine
Option_t Option_t TPoint TPoint const char DrawLine
Definition
TGWin32VirtualXProxy.cxx:70
text
Option_t Option_t TPoint TPoint const char text
Definition
TGWin32VirtualXProxy.cxx:68
CGContextRef
ROOT::Detail::TRangeCast
Definition
TCollection.h:312
ROOT::Quartz::TextLine
Definition
QuartzText.h:39
ROOT::Quartz::TextLine::GetBounds
void GetBounds(UInt_t &w, UInt_t &h) const
Definition
QuartzText.mm:162
ROOT::Quartz::TextLine::operator=
TextLine & operator=(const TextLine &rhs)
ROOT::Quartz::TextLine::~TextLine
~TextLine()
Definition
QuartzText.mm:155
ROOT::Quartz::TextLine::fCTFont
CTFontRef fCTFont
Definition
QuartzText.h:56
ROOT::Quartz::TextLine::fCTLine
CTLineRef fCTLine
Definition
QuartzText.h:55
ROOT::Quartz::TextLine::TextLine
TextLine(const TextLine &rhs)
ROOT::Quartz::TextLine::Init
void Init(const char *textLine, UInt_t nAttribs, CFStringRef *keys, CFTypeRef *values)
Definition
QuartzText.mm:172
ROOT::Quartz::TextLine::TextLine
TextLine(const char *textLine, CTFontRef font)
Definition
QuartzText.mm:58
TAttText
Text Attributes class.
Definition
TAttText.h:21
double
unsigned int
y
Double_t y[n]
Definition
legend1.C:17
x
Double_t x[n]
Definition
legend1.C:17
ROOT::Quartz
Definition
QuartzFillArea.h:33
ROOT::Quartz::defaultFontOrientation
const CTFontOrientation defaultFontOrientation
Definition
QuartzText.mm:38
ROOT::Quartz::DrawTextLineNoKerning
void DrawTextLineNoKerning(CGContextRef ctx, CTFontRef font, const std::vector< UniChar > &text, Int_t x, Int_t y)
Definition
QuartzText.mm:270
ROOT::Quartz::horizontalFontOrientation
const CTFontOrientation horizontalFontOrientation
Definition
QuartzText.mm:39
ROOT::Quartz::verticalFontOrientation
const CTFontOrientation verticalFontOrientation
Definition
QuartzText.mm:40
ROOT
Definition
EExecutionPolicy.hxx:4
graf2d
quartz
inc
QuartzText.h
ROOTmaster - Reference Guide Generated on Fri Sep 11 2026 15:31:46 (GVA Time) using Doxygen 1.10.0