PCHIQU(3NCARG)
π PCHIQU π β the NCAR GRAPHICS one
okay bestie, sit down, hydrate, because this is the character-drawing routine that literally does the most. π
β¨ NAME β¨
PCHIQU β draws high quality characters. By default, it uses the same database as the old NCAR Graphics routine PWRITX, but it can also use characters from any of the fontcap-defined databases, it has an improved interface, and it has so many more capabilities than PWRITX. it's giving glow-up. π
PLCHHQ is an alternate name for the routine PCHIQU. same queen, two names. π
πΈ 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β (input expressions of typeREAL) these specify positioning coordinates for the characters to be drawn. If the internal parameterMAhas the value0, these are given in the current user coordinate system; otherwise, they are given in an arbitrary X/Y coordinate system, as implied by the value ofMAand 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 argumentCNTR(described below, keep scrolling π«Ά) specifies how the characters are to be positioned relative to the point (XPOS,YPOS).CHRSβ (an input constant or variable of typeCHARACTER) specifies the characters to be drawn. The number of characters inCHRSis taken to beLEN(CHRS); to use characters "m" through "n" from a character variableCHRV, use the FORTRAN-77 substring notationCHRV(m:n).CHRSmay 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. πSIZEβ (an input expression of typeREAL) specifies the desired character size. If the internal parameterMAis 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 a1024x1024grid, 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).
- If
Example: Using CHRS = 'ABC' and SIZE = -2. will write three characters, each of which is about 32/1024 of 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, bestie, do this one. β
Example: Using CHRS = 'ABC' and SIZE = .05 will 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: Using CHRS = 'ABC' and SIZE = 13. (assuming there have been no calls to the SPPS routine SETI) will write three characters, each of which is about 13/1024 of 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 β it's giving "trust the process". 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. math girlies rise. π§
Note: As of version3.2of 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, useSIZE = 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. plot twist, literally.
ANGDβ (an input expression of typeREAL) is the angle, in degrees counterclockwise from the positive X axis, at which the character string is to be written. If the internal parameterTEis nonzero (by default, it is zero) and ifANGDis exactly360., then no characters are drawn byPCHIQU; 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 parametersDL,DR,DB, andDTand may be retrieved by calls toPCGETR. ghost-writing, but make it geometry. π»CNTRβ (an input expression of typeREAL) is the centering option. If the internal parameterCEis 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 value0.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. no notes taken, no receipts. π€
π C-BINDING DESCRIPTION π
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. periodt. π
β¨ FUNCTION CODES β¨
okay bestie, so the function codes you can use for all sorts of purposes in the input character string CHRS are described completely in the programmer doc for Plotchar. What's below is mostly a lil memory aid for someone who already knows how function codes work β no cap.
As the characters of CHRS get 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 shows up (defined by the internal parameter Β΄FCΒ΄ β a colon by default), it flips the scanner's state. So in 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 particular example, since function code "L" requests lower case, what would be drawn is ABCdef.) Occasionally, function codes may need to be separated by commas or blanks; this is necessary only when there would otherwise be a syntactical problem.
Fβ Switch to using the database specified by the value ofΒ΄FNΒ΄.F0β Switch to using the PWRITX database.Fnβ Switch to using fontcap-defined font "n".Rβ Switch to the "Roman" part of the PWRITX database. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Gβ Switch to the "Greek" part of the PWRITX database. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Pβ Use characters of principal size from the PWRITX database. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Iβ Use characters of indexical size from the PWRITX database. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Kβ Use characters of cartographic size from the PWRITX database. If characters are currently being used from a fontcap-defined font, there will be an appropriate shift in size.Uβ Switch to using upper case letters from the PWRITX database. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Unβ For the next n characters, switch to using upper case letters from the PWRITX database and then switch to lower case. If characters are currently being used from a fontcap-defined font, this function code will have no effect.Lβ Switch to using lower case letters from the PWRITX database. 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, switch to using lower case letters from the PWRITX database and then switch 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β Switch to writing "across" the frame, in the directionANGD. This is the normal mode.Dβ Switch to writing "down" the frame, in the directionANGD-90. This causes each character to be written beneath the previous one.Bβ Switch to subscript level.Bnβ For the next n characters, use subscript level and then revert to normal level.Sβ Switch to superscript level.Snβ For the next n characters, use superscript level and then revert to normal level.Eβ Switch to normal level in such a way as to allow for another sub- or superscript on the base character.Nβ Switch to normal level in such a way as not to allow for another sub- or superscript on the base character.Hnβ Offset by n digitization units in the directionANGD.HnQβ Offset by n blank widths in the directionANGD.Vnβ Offset by n digitization units in the directionANGD+90.VnQβ Offset by n blank heights in the directionANGD+90.Cβ Do a "carriage return".XnorXnQβ Zoom character width to n percent of normal.Ynβ Zoom character height to n percent of normal.YnQβ Zoom character height to n percent of normal and introduce a shift in the directionANGD+90sufficient to keep the bases of characters properly aligned.Znβ Same as "XnYn".ZnQβ Same as "XnQYnQ".nnnnβ An octal number may be used as a function code to select a particular character from the PWRITX database. 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, fcoord1, fcoord2.
π 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 Contouring and Mapping Tutorial; 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.
okay so that's literally the whole page bestie π
this one's from the UNIX man pages, dated March 1993, and it's PCHIQU(3NCARG) β iconic, periodt β¨π«Ά
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms