GSET_TEXT_FONT_PREC(3NCARG)

✨ GSET_TEXT_FONT_PREC ✨ (aka the NCAR Graphics glow-up for your letters)

okay so bestie, welcome to gset_text_font_prec from the NCAR Graphics manual (the 3NCARG section, we're in the C-binding girlie zone πŸ’…). Full name on the birth certificate: gset_text_font_prec (Set text font and precision). And what does she do? She sets the text font and precision. That's it. That's the whole job. Iconic, lowkey, no notes. πŸŽ€


🌸 SYNOPSIS 🌸

#include <ncarg/gks.h>

void gset_text_font_prec(const Gtext_font_prec *text_font_prec);

yes bestie, one function, one pointer, one struct. slay.


πŸ’– DESCRIPTION πŸ’–

So you pass in a Gtext_font_prec struct and it has two fields you need to care about, and I'm gonna walk you through both like we're doing a vibe check together. 🫢

text_font_prec.font

(Gint, Input) β€” this picks the text font that all your later calls to the gtext output primitive are gonna use. Here's the whole menu, no cap:
  • 1 β€” ASCII font (this is the default, the main character πŸ‘‘)
  • -2 β€” Hershey cartographic Roman
  • -3 β€” Hershey cartographic Greek
  • -4 β€” Hershey simplex Roman
  • -5 β€” Hershey simplex Greek
  • -6 β€” Hershey simplex script
  • -7 β€” Hershey complex Roman
  • -8 β€” Hershey complex Greek
  • -9 β€” Hershey complex script
  • -10 β€” Hershey complex italic
  • -11 β€” Hershey complex Cyrillic
  • -12 β€” Hershey duplex Roman
  • -13 β€” Hershey triplex Roman
  • -14 β€” Hershey triplex italic
  • -15 β€” Hershey Gothic German
  • -16 β€” Hershey Gothic English
  • -17 β€” Hershey Gothic Italian
  • -18 β€” Hershey math symbols
  • -19 β€” Hershey symbol set 1
  • -20 β€” Hershey symbol set 2

okay so important lore drop: the Hershey fonts are not standardized by GKS. They're locally implemented inside NCAR GKS-0A, and GKS literally requires that locally implemented fonts get assigned negative font numbers. That's why all the Hershey ones are negative, bestie, it's not a typo, it's the rules. πŸ“œ

wanna actually see the Hershey fonts? go look at the plots produced from the PLOTCHAR example β€” run "ncargex epltch" to get a metafile β€” and then examine the plot titled "PLCHHQ - FONTCAP DATABASES ADDED 6/90". The font numbers in that plot are the absolute values of the value for text_font_prec.font described up here. (PLOTCHAR doesn't have to follow the structures GKS imposes on font names for gset_text_font_prec, so it gets to be a little rebel about it. πŸ™ˆ)

text_font_prec.prec

(Input) β€” this one gives the precision used in later calls to the gtext output primitive, for the font type in text_font_prec.font. Options are:
  • GPREC_STRING β€” String precision (good). This is the GKS default.
  • GPREC_CHAR β€” Character precision (better).
  • GPREC_STROKE β€” Stroke precision (best). This is the default for NCAR GSK-0A.

so like, good β†’ better β†’ best, we love a glow-up arc. ✨


🌈 USAGE 🌈

real talk, there's a difference depending on how you get to the Hershey fonts:

  • if you access the Hershey fonts via gset_text_font_prec and gtext, then the characters are not stroked until viewing time.
  • if you access the Hershey fonts via PLOTCHAR, then the characters are stroked by PLOTCHAR itself.

and this can make a significant difference in metafile sizes, so choose wisely, bestie. it's giving "one tiny choice, big consequences." πŸ’€


πŸ¦‹ ACCESS πŸ¦‹

to use the GKS C-binding routines, you gotta load the ncarg_gks and ncarg_c libraries. link them, don't ghost them. πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

Online:

gtext(3NCARG), gset_text_path(3NCARG), gset_text_align(3NCARG), gset_char_ht(3NCARG), gset_char_space(3NCARG), gset_char_up_vec(3NCARG), gset_char_expan(3NCARG), gset_colr_rep(3NCARG), gset_text_colr_ind(3NCARG), ginq_text_path(3NCARG), ginq_text_align(3NCARG), ginq_text_font_prec(3NCARG), ginq_char_ht(3NCARG), ginq_char_space(3NCARG), ginq_char_up_vec(3NCARG), ginq_char_expan(3NCARG), plotchar(3NCARG), gks(3NCARG), ncarg_gks_cbind(3NCARG)

Hardcopy:

User's Guide for NCAR GKS-0A Graphics; NCAR Graphics Fundamentals, UNIX Version


Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.

bestie please actually read the license agreement, I'm begging πŸ₯Ί legal stuff is real stuff.

okay that's the whole page, you ate it, you understood it, periodt. πŸ’…

this was the GSET_TEXT_FONT_PREC(3NCARG) page from the NCAR GRAPHICS manual β€” the UNIX flavor, dated March 1993 β€” so shoutout to the vintage girlies who kept these docs alive. bye bestie, go stroke some characters πŸ¦‹βœ¨πŸŒΈ