mirror of https://github.com/fltk/fltk
X11: More explicit warning when using rotated text w/o Xft.
The warning is issued to stderr only once (previously: every time rotated text was used). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
c2fd05633c
commit
34f5e4f752
11
FL/fl_draw.H
11
FL/fl_draw.H
|
@ -3,7 +3,7 @@
|
||||||
//
|
//
|
||||||
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2011 by Bill Spitzak and others.
|
// Copyright 1998-2016 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
|
@ -624,8 +624,8 @@ FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n=-1);
|
||||||
*/
|
*/
|
||||||
FL_EXPORT void fl_draw(const char* str, int x, int y);
|
FL_EXPORT void fl_draw(const char* str, int x, int y);
|
||||||
/**
|
/**
|
||||||
Draws a nul-terminated UTF-8 string starting at the given \p x, \p y location and
|
Draws a nul-terminated UTF-8 string starting at the given \p x, \p y
|
||||||
rotating \p angle degrees counter-clockwise.
|
location and rotating \p angle degrees counter-clockwise.
|
||||||
This version of fl_draw provides direct access to the text drawing
|
This version of fl_draw provides direct access to the text drawing
|
||||||
function of the underlying OS and is supported by Xft, Win32 and MacOS
|
function of the underlying OS and is supported by Xft, Win32 and MacOS
|
||||||
fltk subsets.
|
fltk subsets.
|
||||||
|
@ -638,6 +638,11 @@ inline void fl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->d
|
||||||
/**
|
/**
|
||||||
Draws at the given \p x, \p y location a UTF-8 string of length \p n bytes
|
Draws at the given \p x, \p y location a UTF-8 string of length \p n bytes
|
||||||
rotating \p angle degrees counter-clockwise.
|
rotating \p angle degrees counter-clockwise.
|
||||||
|
|
||||||
|
\note When using X11 (Unix, Linux, Cygwin et al.) this needs Xft to work.
|
||||||
|
Under plain X11 (w/o Xft) rotated text is not supported by FLTK.
|
||||||
|
A warning will be issued to stderr at runtime (only once) if you
|
||||||
|
use this method with an angle other than 0.
|
||||||
*/
|
*/
|
||||||
inline void fl_draw(int angle, const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); }
|
inline void fl_draw(int angle, const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); }
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -659,7 +659,13 @@ void Fl_Xlib_Graphics_Driver::draw(const char* c, int n, int x, int y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fl_Xlib_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {
|
void Fl_Xlib_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {
|
||||||
fprintf(stderr,"ROTATING TEXT NOT IMPLEMENTED\n");
|
static char warning = 0; // issue warning only once
|
||||||
|
if (!warning && angle != 0) {
|
||||||
|
warning = 1;
|
||||||
|
fprintf(stderr,
|
||||||
|
"libfltk: rotated text not implemented by X backend.\n"
|
||||||
|
" You should use the Xft backend. Check USE_XFT in config.h.\n");
|
||||||
|
}
|
||||||
this->draw(str, n, (int)x, (int)y);
|
this->draw(str, n, (int)x, (int)y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue