From 1aa2b2fcb184faa8d861698f05aabf857d3878a6 Mon Sep 17 00:00:00 2001 From: Olivier Couet <olivier.couet@cern.ch> Date: Tue, 17 Feb 2015 16:13:42 +0100 Subject: [PATCH] Skeleton code for text methods with a wchar_t signature. --- graf2d/postscript/inc/TPDF.h | 4 ++-- graf2d/postscript/src/TPDF.cxx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/graf2d/postscript/inc/TPDF.h b/graf2d/postscript/inc/TPDF.h index 497677c8adf..a94958012b5 100644 --- a/graf2d/postscript/inc/TPDF.h +++ b/graf2d/postscript/inc/TPDF.h @@ -97,9 +97,9 @@ public: void SetMarkerColor( Color_t cindex=1); void SetTextColor( Color_t cindex=1); void Text(Double_t x, Double_t y, const char *string); - void Text(Double_t, Double_t, const wchar_t *){} + void Text(Double_t, Double_t, const wchar_t *); void TextNDC(Double_t u, Double_t v, const char *string); - void TextNDC(Double_t, Double_t, const wchar_t *){} + void TextNDC(Double_t, Double_t, const wchar_t *); void WriteCompressedBuffer(); virtual void WriteReal(Float_t r, Bool_t space=kTRUE); Double_t UtoPDF(Double_t u); diff --git a/graf2d/postscript/src/TPDF.cxx b/graf2d/postscript/src/TPDF.cxx index be07d88e649..9ee88a6e8db 100644 --- a/graf2d/postscript/src/TPDF.cxx +++ b/graf2d/postscript/src/TPDF.cxx @@ -2367,6 +2367,16 @@ void TPDF::Text(Double_t xx, Double_t yy, const char *chars) } +void TPDF::Text(Double_t, Double_t, const wchar_t *) +//______________________________________________________________________________ +{ + // Write a string of characters + // + // This routine writes the string chars into a PostScript file + // at position xx,yy in world coordinates. +} + + //______________________________________________________________________________ void TPDF::TextNDC(Double_t u, Double_t v, const char *chars) { @@ -2378,6 +2388,17 @@ void TPDF::TextNDC(Double_t u, Double_t v, const char *chars) } +//______________________________________________________________________________ +void TPDF::TextNDC(Double_t u, Double_t v, const wchar_t *chars) +{ + // Write a string of characters in NDC + + Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1()); + Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1()); + Text(x, y, chars); +} + + //______________________________________________________________________________ Double_t TPDF::UtoPDF(Double_t u) { -- GitLab