LIBNETPBM_FONT(3)

πŸ“¦
version 11.13.03 Β· 2 versions
  • 11.13.03 Β· centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 10.86.51 Β· arch rolling
, in centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

libnetpbm_font β€” the Libnetpbm PBM Font Function Manual, aka the little corner of libnetpbm that teaches you how to draw text characters. Yes bestie, we're doing fonts today. πŸŽ€

This page lives in the Libnetpbm ...ion Manual(3), and it's the cutest little manual you ever did read. πŸ’…


✨ DESCRIPTION ✨

Okay so. This reference manual covers the functions in the libnetpbm library that let you access fonts so you can draw text characters β€” and it does all that using the PBM image format plus the libnetpbm in-memory image formats. πŸ¦‹

And here's the tea, bestie: we actually have very little information here. Fr fr. This page is mainly a framework for adding documentation later, if someone ever becomes interested in this facility. So it's giving "placeholder era" and we're at peace with that. πŸ™ˆ

But wait β€” note that the primary known user of this library is the Netpbm program pbmtext. You can use that program's source code as an example. That's your blueprint, go off. πŸ‘‘


🌸 Font Object 🌸

libnetpbm represents a font with an object of type struct font. The library provides functions to create these objects. Cute, right? πŸ’œ

The object these functions create is in newly allocated memory and β€” this is the important part β€” you can't actually free it. 😭 The memory may be in multiple pieces, pointing to each other, and libnetpbm provides no destroy function. (This is only because of implementation laziness.) So like... it's iconic but it is not giving cleanup. πŸ’€


🫢 The Functions 🫢

The functions are all declared in the pbmfont.h header file. Periodt.

pbm_defaultfont

Synopsis

struct font *
pbm_defaultfont(const char * which);

Description

This returns a font object representing a font built in to libnetpbm. πŸŽ€

which is the name of the desired built-in font. There are two:

  • bdf β€” a proportional font similar to Adobe's timR12 font. Slay. ✨
  • fixed β€” a fixed space font. The reliable one. The one that shows up on time. πŸ’…

The provenance of the built-in fonts are not known for sure, but in 2018, the bdf font was almost identical to a font on which Adobe and Digital Equipment Corporation once claimed copyright. That font was available in the X.org source code in a collection named font-adobe-75dpi, in a file named timR12.pcf.gz.

Ergo, it is likely that the font was copied into Netpbm from that font in 1991.

Bestie, listen carefully: you may need a copyright license from the copyright owners of that original font not only to copy the libnetpbm code, but to execute it β€” thus generating copies of the glyphs of the font. Not me being dramatic, that's literally what it says. 😭

The X.org files in 2018 indicate the following copyright claims, along with a license to the public to copy them:

              Copyright 1984-1989, 1994 Adobe Systems Incorporated.
              Copyright 1988, 1994 Digital Equipment Corporation.

              Permission to use, copy, modify, distribute and sell this
            software
              and its documentation for any purpose and without fee is hereby
              granted, provided that the above copyright notices appear in
            all
              copies and that both those copyright notices and this
            permission
              notice appear in supporting documentation, and that the names
            of
              Adobe Systems and Digital Equipment Corporation not be used in
              advertising or publicity pertaining to distribution of the
            software
              without specific, written prior permission.  Adobe Systems and
              Digital Equipment Corporation make no representations about the
              suitability of this software for any purpose.  It is provided
            'as
              is' without express or implied warranty.

pbm_dissectfont

pbm_loadfont

This function returns a font object for a font described in a file. πŸ¦‹ The file may be either a special PBM file or a BDF file. The function determines which it is and behaves as either pbm_loadpbmfont or pbm_loadbdffont accordingly. Iconic behavior honestly. ✨

pbm_loadpbmfont

pbm_loadbdffont2

pbm_loadbdffont

This is obsolete. New programs should use pbm_loadbdffont2 instead. No cap β€” move on, bestie. πŸ’…

pbm_expandbdffont

pbm_dumpfont


πŸŽ€ DOCUMENT SOURCE πŸŽ€

This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at

http://netpbm.sourceforge.net/doc/libnetpbm_font.html

And that's the whole page, bestie β€” no crumbs left behind. πŸ“ This was netpbm documentation, April 2018, living its best life inside the Libnetpbm ...ion Manual(3). Stay slaying, and remember: the font object can't be freed, so love it while you have it. πŸ’–πŸ‘‘

πŸ“¦ where this page comes from