GLYPHS(5)

✨ GLYPHS(5) ✨

okay bestie, so this is a page from the File Formats Manual, and it's all about .glyphs files πŸ’…


🌸 NAME 🌸

glyphs β€” the format of .glyphs files, periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

Glyph files (they've got the ``.glyph'' extension) are where Magic stores its commonly-used bit patterns β€” aka glyphs. Right now Magic uses these bit patterns for two whole things. First up: they define the patterns for programmable cursors, so every cursor shape (think the arrow for the wiring tool πŸ‘€) gets read in as a glyph straight from a glyph file. Second: the window manager uses glyphs to draw the icons sitting at the ends of scroll bars. And btw, glyph file names normally have the .glyph extension, no cap.

Glyph files are stored in ASCII format. Any line starting with ``#'' is a comment and gets ignored, and blank lines are ignored too. The first non-comment line in a glyph file has to have this syntax:

size nGlyphs width height

Here's the breakdown, bestie:

  • nGlyphs has to be a number giving the total number of glyphs stored in the file.
  • width and height give the dimensions of each glyph in pixels.
  • Every single glyph in the same file has to have the same size. No mixing, no chaos πŸ’€

After the size line comes a description for each of the glyphs. Each glyph is made of height lines, and each of those lines contains 2Γ—width characters. Every pair of characters maps to a bit position in the glyph, and the leftmost pair on the topmost line is the upper-left pixel of the glyph. iconic.

Now the first character of each pair tells you the color that shows up in that pixel. The color is a single character, and it has to be the short name of a display style in the current display style file. Some of the classic ones you'll see:

  • K for black πŸ–€
  • W for white 🀍
  • . for the background color β€” and when . shows up in a cursor, it means that pixel position is transparent, so the picture underneath peeks through the cursor ✨

Want more on that? Go read ``Magic Maintainer's Manual #3: Display Styles, Color Maps, and Glyphs'' β€” it's all in there.

The second character of each pair is normally blank, EXCEPT for one pixel per glyph which may contain a *'' in the second character. That '' is for programmable cursors and it marks the hot-spot: the pixel with the ``'' is the one the cursor is considered to be pointing at 🎯

fr fr, only one * per glyph β€” that's the whole point.

Wanna see an actual glyph file in the wild? Peep ∼cad/lib/magic/sys/color.glyphs 🌈


πŸ’– SEE ALSO πŸ’–


and that's the whole page, bestie 🫢 this one came from the 4th Berkeley Distribution, and yes, it's GLYPHS(5) β€” slay πŸ’…βœ¨

πŸ“¦ where this page comes from