PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plsym.c File Reference
#include "plplotP.h"
#include <float.h>
#include <ctype.h>
#include "plhershey-unicode.h"

Go to the source code of this file.

Macros

#define __PLSYM_H__
#define PLMAXSTR   300
#define STLEN   250

Functions

int hershey2unicode (int in)
static void pldeco (short int **sym, PLINT *length, const char *text)
static void plchar (signed char *xygrid, PLFLT *xform, PLINT base, PLINT oline, PLINT uline, PLINT refx, PLINT refy, PLFLT scale, PLFLT xpmm, PLFLT ypmm, PLFLT *p_xorg, PLFLT *p_yorg, PLFLT *p_width)
static PLINT plcvec (PLINT ch, signed char **xygr)
static void plhrsh (PLINT ch, PLINT x, PLINT y)
static void plhrsh2 (PLINT ch, PLINT x, PLINT y)
void c_plstring (PLINT n, const PLFLT *x, const PLFLT *y, const char *string)
void c_plsym (PLINT n, const PLFLT *x, const PLFLT *y, PLINT code)
void c_plpoin (PLINT n, const PLFLT *x, const PLFLT *y, PLINT code)
void c_plpoin3 (PLINT n, const PLFLT *x, const PLFLT *y, const PLFLT *z, PLINT code)
void c_plstring3 (PLINT n, const PLFLT *x, const PLFLT *y, const PLFLT *z, const char *string)
void c_pllab (const char *xlabel, const char *ylabel, const char *tlabel)
void c_plmtex (const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text)
void c_plptex (PLFLT wx, PLFLT wy, PLFLT dx, PLFLT dy, PLFLT just, const char *text)
void plstr (PLINT base, PLFLT *xform, PLINT refx, PLINT refy, const char *string)
PLFLT plstrl (const char *string)
PLINT plP_strpos (const char *str, int chr)
PLINT plP_stindex (const char *str1, const char *str2)
PLBOOL plP_stsearch (const char *str, int chr)
void plP_script_scale (PLBOOL ifupper, PLINT *level, PLFLT *old_scale, PLFLT *scale, PLFLT *old_offset, PLFLT *offset)
void c_plfont (PLINT ifont)
void plfntld (PLINT fnt)
void plfontrel (void)
int plhershey2unicode (int in)
const char * plP_FCI2FontName (PLUNICODE fci, const FCI_to_FontName_Table lookup[], const int nlookup)
void c_plmtex3 (const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text)
void c_plptex3 (PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, const char *text)
void c_plsfont (PLINT family, PLINT style, PLINT weight)
void c_plgfont (PLINT *p_family, PLINT *p_style, PLINT *p_weight)

Variables

static short int * fntlkup
static short int * fntindx
static signed char * fntbffr
static short int numberfonts
static short int numberchars
static short int indxleng
static short fontloaded = 0
static const char font_types [] = "nris"
static short symbol_buffer [PLMAXSTR]
static signed char xygrid [STLEN]

Detailed Description

Point-, symbol-, and string-plotting routines.

Definition in file plsym.c.

Macro Definition Documentation

#define __PLSYM_H__

Definition at line 38 of file plsym.c.

#define PLMAXSTR   300

Definition at line 56 of file plsym.c.

#define STLEN   250

Definition at line 57 of file plsym.c.

Function Documentation

void c_plfont ( PLINT  ifont)

Definition at line 1309 of file plsym.c.

void c_plgfont ( PLINT p_family,
PLINT p_style,
PLINT p_weight 
)

Definition at line 2106 of file plsym.c.

void c_pllab ( const char *  xlabel,
const char *  ylabel,
const char *  tlabel 
)

Definition at line 522 of file plsym.c.

void c_plmtex ( const char *  side,
PLFLT  disp,
PLFLT  pos,
PLFLT  just,
const char *  text 
)

Definition at line 567 of file plsym.c.

void c_plmtex3 ( const char *  side,
PLFLT  disp,
PLFLT  pos,
PLFLT  just,
const char *  text 
)

Definition at line 1578 of file plsym.c.

void c_plpoin ( PLINT  n,
const PLFLT x,
const PLFLT y,
PLINT  code 
)

Plot a glyph at the specified points. (This function is largely superseded by plstring which gives access to many[!] more glyphs.) code=-1 means try to just draw a point. Right now it's just a move and a draw at the same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK for now, though, and offers a 4X speedup over drawing a Hershey font "point" (which is actually diamond shaped and and therefore takes 4 strokes to draw). If 0 < code < 32, then a useful (but small subset) of Hershey symbols is plotted. If 32 <= code <= 127 the corresponding printable ASCII character is plotted.

Parameters
nNumber of points in x and y arrays.
xPointer to an array with X coordinates of points.
yPointer to an array with Y coordinates of points.
codeHershey symbol code (in "ascii-indexed" form with -1 <= code <= 127) corresponding to a glyph to be plotted at each of the n points.

Definition at line 167 of file plsym.c.

void c_plpoin3 ( PLINT  n,
const PLFLT x,
const PLFLT y,
const PLFLT z,
PLINT  code 
)

Plot a glyph at the specified 3D points. (This function is largely superseded by plstring3 which gives access to many[!] more glyphs.) Set up the call to this function similar to what is done for plline3. code=-1 means try to just draw a point. Right now it's just a move and a draw at the same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK for now, though, and offers a 4X speedup over drawing a Hershey font "point" (which is actually diamond shaped and therefore takes 4 strokes to draw). If 0 < code < 32, then a useful (but small subset) of Hershey symbols is plotted. If 32 <= code <= 127 the corresponding printable ASCII character is plotted.

Parameters
nNumber of points in x, y, and z arrays.
xPointer to an array with X coordinates of points.
yPointer to an array with Y coordinates of points.
zPointer to an array with Z coordinates of points.
codeHershey symbol code (in "ascii-indexed" form with -1 <= code <= 127) corresponding to a glyph to be plotted at each of the n points.

Definition at line 230 of file plsym.c.

void c_plptex ( PLFLT  wx,
PLFLT  wy,
PLFLT  dx,
PLFLT  dy,
PLFLT  just,
const char *  text 
)

Definition at line 707 of file plsym.c.

void c_plptex3 ( PLFLT  wx,
PLFLT  wy,
PLFLT  wz,
PLFLT  dx,
PLFLT  dy,
PLFLT  dz,
PLFLT  sx,
PLFLT  sy,
PLFLT  sz,
PLFLT  just,
const char *  text 
)

Definition at line 1950 of file plsym.c.

void c_plsfont ( PLINT  family,
PLINT  style,
PLINT  weight 
)

Definition at line 2062 of file plsym.c.

void c_plstring ( PLINT  n,
const PLFLT x,
const PLFLT y,
const char *  string 
)

Plot a glyph at the specified points. (This function largely supersedes plpoin and plsym because many[!] more glyphs are accessible with plstring.) The glyph is specified with a PLplot user string. Note that the user string is not actually limited to one glyph so it is possible (but not normally useful) to plot more than one glyph at the specified points with this function. As with plmtex and plptex, the user string can contain FCI escapes to determine the font, UTF-8 code to determine the glyph or else PLplot escapes for Hershey or unicode text to determine the glyph.

Parameters
nNumber of points in x and y arrays.
xArray of X coordinates of points.
yArray of Y coordinates of points.
stringPLplot user string corresponding to the glyph to be plotted at each of the n points.

Definition at line 103 of file plsym.c.

void c_plstring3 ( PLINT  n,
const PLFLT x,
const PLFLT y,
const PLFLT z,
const char *  string 
)

Plot a glyph at the specified 3D points. (This function largely supersedes plpoin3 because many[!] more glyphs are accessible with plstring3). Set up the call to this function similar to what is done for plline3. The glyph is specified with a PLplot user string. Note that the user string is not actually limited to one glyph so it is possible (but not normally useful) to plot more than one glyph at the specified points with this function. As with plmtex and plptex, the user string can contain FCI escapes to determine the font, UTF-8 code to determine the glyph or else PLplot escapes for Hershey or unicode text to determine the glyph.

Parameters
nNumber of points in x, y, and z arrays.
xArray of X coordinates of points.
yArray of Y coordinates of points.
zArray of Z coordinates of points.
stringPLplot user string corresponding to the glyph to be plotted at each of the n points.

Definition at line 306 of file plsym.c.

void c_plsym ( PLINT  n,
const PLFLT x,
const PLFLT y,
PLINT  code 
)

Plot a glyph at the specified points. (This function is largely superseded by plstring which gives access to many[!] more glyphs.)

Parameters
nNumber of points in x and y arrays.
xPointer to an array with X coordinates of points.
yPointer to an array with Y coordinates of points.
codeHershey symbol code corresponding to a glyph to be plotted at each of the n points.

Definition at line 123 of file plsym.c.

int hershey2unicode ( int  in)
static void plchar ( signed char *  xygrid,
PLFLT xform,
PLINT  base,
PLINT  oline,
PLINT  uline,
PLINT  refx,
PLINT  refy,
PLFLT  scale,
PLFLT  xpmm,
PLFLT  ypmm,
PLFLT p_xorg,
PLFLT p_yorg,
PLFLT p_width 
)
static

Definition at line 843 of file plsym.c.

static PLINT plcvec ( PLINT  ch,
signed char **  xygr 
)
static

Definition at line 1016 of file plsym.c.

static void pldeco ( short int **  sym,
PLINT length,
const char *  text 
)
static

Definition at line 1074 of file plsym.c.

void plfntld ( PLINT  fnt)

Definition at line 1362 of file plsym.c.

void plfontrel ( void  )

Definition at line 1431 of file plsym.c.

int plhershey2unicode ( int  in)

Definition at line 1458 of file plsym.c.

static void plhrsh ( PLINT  ch,
PLINT  x,
PLINT  y 
)
static

Definition at line 354 of file plsym.c.

static void plhrsh2 ( PLINT  ch,
PLINT  x,
PLINT  y 
)
static

Definition at line 448 of file plsym.c.

const char* plP_FCI2FontName ( PLUNICODE  fci,
const FCI_to_FontName_Table  lookup[],
const int  nlookup 
)

Definition at line 1516 of file plsym.c.

void plP_script_scale ( PLBOOL  ifupper,
PLINT level,
PLFLT old_scale,
PLFLT scale,
PLFLT old_offset,
PLFLT offset 
)

Calculate scale of font size and scale of magnitude of vertical offset associated with superscripts and subscripts. Notes on arguments: ifupper must be either TRUE or FALSE on every call to plP_script_scale. The contents of the location pointed to by the level pointer must be zero on the first call to plP_script_scale, but not modified externally from then on. The contents of the locations pointed to by all other pointer arguments are initialized internally, and should not be modified externally.

Parameters
ifupperValue which is TRUE if superscripting, i.e., if incrementing the previous level, and FALSE if subscripting, i.e., decrementing the previous level.
levelPointer to a location which contains the value of the superscript/subscript level. That value is 0, +-1, +-2, etc., for no superscript/subscript, the first level of superscript/subscript, the second level of superscript/subscript, etc. Before the call the value is the old level, and after the call the value will be incremented (ifupper TRUE) or decremented (ifupper FALSE) from the previous value.
old_scaleA pointer to a location that contains after the call the old font size scale value.
scaleA pointer to a location that contains after the call the font size scale value. This value is 0.75^{|level|} where |level| is the magnitude of the value of the superscript/subscript level after the call.
old_offsetA pointer to a location that contains after the call the old value of the magnitude of the superscript/subscript offset.
offsetA pointer to a location that contains after the call the value of the magnitude of the superscript/subscript offset which is zero for |level|=0 and sum_{i=1}^{i=|level|} 0.75^{i-1}, otherwise.

Definition at line 1270 of file plsym.c.

PLINT plP_stindex ( const char *  str1,
const char *  str2 
)

Definition at line 1201 of file plsym.c.

PLINT plP_strpos ( const char *  str,
int  chr 
)

Definition at line 1184 of file plsym.c.

PLBOOL plP_stsearch ( const char *  str,
int  chr 
)

Definition at line 1224 of file plsym.c.

void plstr ( PLINT  base,
PLFLT xform,
PLINT  refx,
PLINT  refy,
const char *  string 
)

Definition at line 783 of file plsym.c.

PLFLT plstrl ( const char *  string)

Definition at line 949 of file plsym.c.

Variable Documentation

signed char* fntbffr
static

Definition at line 49 of file plsym.c.

short int* fntindx
static

Definition at line 48 of file plsym.c.

short int* fntlkup
static

Definition at line 47 of file plsym.c.

const char font_types[] = "nris"
static

Definition at line 59 of file plsym.c.

short fontloaded = 0
static

Definition at line 53 of file plsym.c.

short int indxleng
static

Definition at line 51 of file plsym.c.

short int numberchars
static

Definition at line 50 of file plsym.c.

short int numberfonts
static

Definition at line 50 of file plsym.c.

short symbol_buffer[PLMAXSTR]
static

Definition at line 61 of file plsym.c.

signed char xygrid[STLEN]
static

Definition at line 62 of file plsym.c.