wml::des::gfont(3)

๐Ÿ“ฆ
version 2.32.0 ยท 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

๐Ÿ’– wml::des::gfont โ€” Graphical Font Tag ๐Ÿ’–

okay bestie, sit down, hydrate, because this one is genuinely iconic. this is the manual page for wml::des::gfont from the EN Tools crew, and it's about a tag that makes your text look expensive.


โœจ NAME โœจ

wml::des::gfont โ€” the Graphical Font Tag, aka the glow-up your typography has been waiting for ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#use wml::des::gfont

<gfont [attributes]>One Single Line Of Text</gfont>
note the "One Single Line Of Text" thing, bestie. that's not a suggestion. that's the whole vibe. โœ‹

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so this is a nice interface to the gFONT program, which lives at http://www.engelschall.com/sw/gfont/. it gives you a <gfont> tag you can use kinda like the standard HTML <font> tag โ€” except instead of your webbrowser rendering it live, the text gets rendered offline through gfont into a GIF image. no cap.

and the perks?? the perks are everything:

  • All TeX-available fonts can be used. โ€” you get to use any TeX-available font instead of the tiny sad set that typical browsers support. and these fonts actually look how you want them to. like, Helvetica is Helvetica with <gfont>, whereas with the <font> tag it could be Arial or some totally different substituted font. the disrespect. ๐Ÿ’€
  • Fonts with much greater size can be used. โ€” with <gfont> you can crank the size attribute all the way up to +9, which is literally 200pt in size, while the HTML font tag usually taps out at +4. so yeah, <gfont> is the one for big headlines. main character energy fr. ๐Ÿ‘‘
  • You can create banners with colored backgrounds. โ€” the standard <font> tag can't do a different background color in HTML 3.2. <gfont> can. because it renders directly into a GIF image, and that background doesn't have to be transparent. slay. ๐Ÿ’…

and here's the little smart-girl detail: when an image is generated, a text file containing the command that was run gets created too, named after the image file with a .cmd suffix. so when WML gets re-run, it searches for that file and only executes gFONT if the command line has changed. efficiency queen. โœจ


๐ŸŽ€ ATTRIBUTES ๐ŸŽ€

  • base=filename โ€” normally the images created for a source file page.wml are named page.gfontXXX.gif, where XXX is a number starting at 000. if you use a base=foo attribute, the files come out as foo.gfontXXX.gif. and you can go full send and use a complete filename with a directory prefix โ€” like base=../../common/foo โ€” and then the GIFs get created as ../../common/foo.gfontXXX.gif. use this to send your images to a specific directory. bonus: base="" gives you images that are so-called hidden Unix files, aka dot-files. sneaky. ๐Ÿ™ˆ

and for max flexibility: when no base is specified but the variable GFONT_BASE is defined (usually from inside a .wmlrc file via -DGFONT_BASE~path/to/gfont/dir/base), that gets used instead. use it to redirect your created images into a particular directory.

you can also use the variable IMAGE_BASE, which defines in a single line all the base names for images generated by WML.

  • file=filename โ€” use this to explicitly set the output filename for the GIF image. usually you don't touch this, because you don't need to know the actual filename. but sometimes it's handy to set it explicitly. lowkey niche, highkey useful.
  • notag โ€” forces <gfont> to expand to nothing, i.e. no resulting <img> tag. the image itself is still generated though. combined with the file attribute above, you can generate images into particular files and then use them at other positions โ€” for instance inside <rollover> tags (see wml::des::rollover(3)). ๐ŸŒ€
  • color=#rrggbb โ€” sets the font (foreground) color. default is #000000, which is black.
  • bgcolor=#rrggbb โ€” sets the image background color. default is no color at all, i.e. a transparent background.
  • face=fontname โ€” sets the type of the used font, where fontname is actually any TeX-available font, or a name alias from the Fontmap file of gFONT. see gfont(1) for more details. default is Times.
  • size=number โ€” sets the relative size of the font, similar to the HTML 3.2 <font> tag. default is 0. here's the correspondence to pt-sizes:
 size:  -2 -1  0  1  2  3  4  5   6   7   8   9
   pt:  12 16 20 32 40 50 60 80 100 120 140 160

this leads to nearly the same font sizes for <font> and <gfont> tags on typical browser setups. math checks out. ๐Ÿงฎ

  • align=location โ€” this directly corresponds to the align attribute of the <img> tag.
  • crop โ€” indicates that the image should be cropped, i.e. the edges containing only the background color should get removed. โœ‚๏ธ
  • adjust=spec โ€” passes spec through to the -r option of gFONT, which adjusts the size of the final image. use this to expand the image and/or align it.
  • :img:ATTR=STR โ€” the ATTR=STR pairs get passed along to the <img> HTML tag.

๐ŸŒˆ EXAMPLE ๐ŸŒˆ

<gfont face="HelveticaBold" size=+6 color="#3333cc">
A sample Headerline
</gfont>

look at that. a whole headerline. gorgeous. โญ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com

๐Ÿซถ REQUIRES ๐Ÿซถ

  • Internal: P1, P2, P3, Image::Size (P5M)
  • External: gfont (PATH)

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

HTML <font> tag, gfont(1), http://www.engelschall.com/sw/gfont/


and that's the whole page, bestie!! this beauty came out of EN Tools, dated 2020-11-29, and it's page wml::des::gfont(3) in the manual. go forth and make your text look absolutely unreal ๐Ÿ’œโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from