PCHIQU(3NCARG)
โจ PCHIQU โจ
okay bestie, sit DOWN, because this one is a whole legend ๐ This is the NCAR Graphics page for PCHIQU, a routine that draws high quality characters. By default it uses the same database as the old NCAR Graphics routine PWRITX, but plot twist: it can also pull characters from any of the fontcap-defined databases. It's got an improved interface and so many more capabilities than PWRITX โ it's giving main character energy, fr fr.
Also, heads up: PLCHHQ is an alternate name for the routine PCHIQU. Same girl, two names, iykyk. ๐
๐ธ SYNOPSIS ๐ธ
CALL PCHIQU (XPOS,YPOS,CHRS,SIZE,ANGD,CNTR)
๐ C-BINDING SYNOPSIS ๐
#include <ncarg/ncargC.h>
void c_pchiqu (float xpos, float ypos, char *chrs,
float size, float angd, float cntr)
๐ฆ DESCRIPTION ๐ฆ
XPOS,YPOS
These are input expressions of type REAL and they specify the positioning coordinates for the characters to be drawn. Here's the vibe check:
- If the internal parameter
MAhas the value0, these are given in the current user coordinate system. - Otherwise, they're given in an arbitrary X/Y coordinate system, as implied by the value of
MAand the nature of the routineCPMPXY. (For example, ifMAhas the value1and the default version ofCPMPXYis being used, thenXPOSis a longitude, in degrees, andYPOSis a latitude, in degrees.)
The argument CNTR (described below) specifies how the characters are to be positioned relative to the point (XPOS,YPOS). ๐ฏ
CHRS
This one is an input constant or variable of type CHARACTER and it specifies the characters to be drawn. The number of characters in CHRS is taken to be LEN(CHRS); to use characters "m" through "n" from a character variable CHRV, use the FORTRAN-77 substring notation "CHRV(m:n)". ๐
CHRS may contain characters to be drawn and "function codes", which are used for various purposes. The possible function codes are completely described in the programmer document for Plotchar and are summarized in a later section of this man page. (stay tuned bestie ๐)
SIZE
An input expression of type REAL specifying the desired character size. If the internal parameter MA is zero, then the following comments apply:
- If
SIZEis less than or equal to zero, its absolute value specifies the size as a multiple of the digitized size. On a 1024x1024 grid, principal-size capitals are aboutPWunits wide byPHunits high and the vertical spacing between lines isPVunits (by default,PW,PH, andPVare16,21, and32). Indexical-size capitals areIWunits wide byIHunits high and the vertical spacing between lines isIVunits (by default,IW,IH, andIVare12,13, and20). Cartographic-size capitals areCWunits wide byCHunits high and the vertical spacing between lines isCVunits (by default,CW,CH, andCVare8,9, and14).
Example: UsingCHRS = 'ABC'andSIZE = -2.will write three characters, each of which is about32/1024of the plotter frame in width. ๐
- If
SIZEis greater than zero, but less than one, it specifies the desired approximate width of a principal-size capital as a fraction of the distance across the plotter frame. This is the recommended scheme. โญ
Example: UsingCHRS = 'ABC'andSIZE = .05will write three characters, each of which is about 5 hundredths of the plotter frame in width.
- If
SIZEis greater than or equal to one, it specifies the desired approximate width of a principal-size capital in plotter coordinates, as defined by default or by a user call to the SPPS routineSETI. Note that use of the routineSETIis now discouraged. ๐ โ๏ธ
Example: UsingCHRS = 'ABC'andSIZE = 13.(assuming there have been no calls to the SPPS routineSETI) will write three characters, each of which is about13/1024of the plotter frame in width.
If MA is nonzero, then SIZE is the desired approximate width of a principal-size capital as a value in the X/Y coordinate system in which XPOS and YPOS are given.
In most of the databases used by PCHIQU, the character width varies from character to character. Most principal-size capitals will be a little wider than the value specified by SIZE (and a few will be narrower). So yeah, a little experimenting may be necessary to get just the size one wants. ๐ญ A rule of thumb that works pretty well when using all capitals is as follows:
SIZE = DLOS / REAL(NCIS)
where "DLOS" is the desired length of the string, in the fractional system, and "NCIS" is the number of characters in the string. ๐งฎ
Note: As of version 3.2 of NCAR Graphics, the size of all characters written byPCHIQUhas been reduced by a multiplicative factor (the internal parameterSA) whose default value is.88888888...The object of this is to make the size of characters written byPCHIQUconsistent with the size of characters written byPCMEQUandPCLOQU. If the value ofSAis not changed, then the height of principal-size capitals written byPCHIQUandPCMEQUwill be7/6times the value specified bySIZE. Thus, if the desired character height (CHRH) is known, use"SIZE = 6.*CHRH/7.". ๐
The values of the internal parameters PW, PH, PV, IW, IH, IV, CW, CH, and CV (as well as two others, PS and IS) may be changed by user calls to CPSETR. This can be used to change the effective size and shape of digitized characters in the PWRITX database (the effect is the same as if the characters had been digitized differently at the outset). If, for example, one were to double the value of PH, it would make the principal characters twice as tall as they are by default. (In this case, one would probably also want to double the value of PV, so as to make the vertical spacing between lines consistent with the character height.) ๐
Note that, if one changes the value of PW, IW, or CW, the meaning of a negative value of the argument SIZE may thereby be changed. โ ๏ธ
ANGD
An input expression of type REAL โ it's the angle, in degrees counterclockwise from the positive X axis, at which the character string is to be written. ๐
If the internal parameter TE is nonzero (by default, it is zero) and if ANGD is exactly 360., then no characters are drawn by PCHIQU; it just computes the distances, in the fractional coordinate system, from the point (XPOS,YPOS) to the left edge, the right edge, the bottom edge, and the top edge of a box enclosing the string. These are stored as the values of the parameters DL, DR, DB, and DT and may be retrieved by calls to PCGETR. ๐
CNTR
An input expression of type REAL โ the centering option. If the internal parameter CE is zero (the default), then:
CNTR = -1.means that(XPOS,YPOS)is the center of the left edge of the first character (if that character is to be written "across" the frame) or the center of the top edge of the first character (if that character is to be written "down" the frame).CNTR = 1.means that(XPOS,YPOS)is the center of the right edge of the last character (if the writing direction at the end of the character string is "across" the frame) or the center of the bottom edge of the last character (if the writing direction at the end of the character string is "down" the frame).CNTR = s, where"s"is any real number, means that(XPOS,YPOS)is a point obtained by linear interpolation along the line joining the two points mentioned above (the first point being associated with the value-1.and the second with the value+1.). The value"0."gives the midpoint of the line.
If CE is nonzero, then the value of CNTR is ignored. Text-extent quantities are computed and used to exactly center the output on the point (XPOS,YPOS). This is useful, among other things, for labeling each of a number of points with a single character; however, it works as desired only when QU is zero. ๐ซถ
Upon return from PCHIQU, all arguments are unchanged. โจ
๐ C-BINDING DESCRIPTION ๐
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. (no notes app, it's the same energy ๐ )
โจ FUNCTION CODES โจ
okay bestie, so the function codes that can do stuff in the input character string CHRS are fully described in the programmer doc for Plotchar. What's below is mostly a memory aid for someone who already knows how to use function codes โ think of it as your sparkle-notes, not the whole textbook. ๐
As CHRS gets scanned from left to right, the scanner is always in one of two states: either it's looking for characters to be drawn, or it's looking for characters to be interpreted as function codes. Every time the function-code signal character pops up โ that's the internal parameter ยดFCยด, a colon by default โ it flips the scanner's state. So in the character string ABC:L:DEF, "A", "B", and "C" get treated as characters to be drawn, "L" gets treated as a function code, and "D", "E", and "F" get treated as characters to be drawn. (In this exact example, since function code "L" requests lower case, what would be drawn is "ABCdef".) Sometimes function codes need to be separated by commas or blanks; that's necessary only when there'd otherwise be a syntactical problem. fr fr.
Fโ switches to using the database specified by the value ofยดFNยด. ๐ซF0โ switches to using thePWRITXdatabase.Fnโ switches to using fontcap-defined font n.Rโ switches to the โRomanโ part of thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, this function code has no effect.Gโ switches to the โGreekโ part of thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, this function code has no effect.Pโ uses characters of principal size from thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Iโ uses characters of indexical size from thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Kโ uses characters of cartographic size from thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Uโ switches to using upper case letters from thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Unโ for the next n characters, switches to using upper case letters from thePWRITXdatabase and then switches to lower case. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Lโ switches to using lower case letters from thePWRITXdatabase. If characters are currently being used from a fontcap-defined font, this function code will force the use of lower case letters from it.Lnโ for the next n characters, switches to using lower case letters from thePWRITXdatabase and then switches to upper case. If characters are currently being used from a fontcap-defined font, this function code will force the use of lower case letters from it.Aโ switches to writing โacrossโ the frame, in the directionANGD. This is the normal mode. ๐Dโ switches to writing โdownโ the frame, in the directionANGD-90. This causes each character to be written beneath the previous one.Bโ switches to subscript level.Bnโ for the next n characters, uses subscript level and then reverts to normal level.Sโ switches to superscript level.Snโ for the next n characters, uses superscript level and then reverts to normal level.Eโ switches to normal level in such a way as to allow for another sub- or superscript on the base character.Nโ switches to normal level in such a way as not to allow for another sub- or superscript on the base character.Hnโ offsets by n digitization units in the directionANGD.HnQโ offsets by n blank widths in the directionANGD.Vnโ offsets by n digitization units in the directionANGD+90.VnQโ offsets by n blank heights in the directionANGD+90.Cโ does a โcarriage returnโ.XnorXnQโ zooms character width to n percent of normal.Ynโ zooms character height to n percent of normal.YnQโ zooms character height to n percent of normal and introduces a shift in the directionANGD+90sufficient to keep the bases of characters properly aligned.Znโ same asXnYn.ZnQโ same asXnQYnQ.nnnnโ an octal number may be used as a function code to select a particular character from thePWRITXdatabase. The octal number for a given character is the sum of a font index (0 for Roman or 600 for Greek), a size index (0 for Principal, 200 for Indexical, or 400 for Cartographic), a case index (0 for Upper or 100 for Lower), and the octal equivalent of a character index (1-32 for A through Z, 33-44 for 0 through 9, or 45-57 for the individual characters,+,-,*,/,(,),$,=, blank, comma, or period). ๐ง
๐ EXAMPLES ๐
Use the ncargex command to see the following relevant examples: cmpit, cmpita, cmptit, cpexcc, elblba, cbex01, coex01, coex02, coex03, cpex10, epltch, sfex02, srex01, tpltch. โจ
๐ ACCESS ๐
To use PCHIQU or c_pchiqu, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. ๐ซถ
๐ SEE ALSO ๐
Online: plotchar, pcdlsc, pcgetc, pcgeti, pcgetr, pcloqu, pcmequ, pcmpxy, pcpnwi, pcrset, pcsetc, pcseti, pcsetr, ncarg_cbind.
Hardcopy: NCAR Graphics Fundamentals, UNIX Version.
๐ COPYRIGHT ๐
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
and that's the vibe check, bestie: this page is the PCHIQU(3NCARG) one, from the UNIX manual, dated March 1993. iconic. ๐๐
๐ฆ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 ยท LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 ยท LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 ยท LicenseRef-Callaway-BSD
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms