DSTYLE(5)
π NAME π
dstyle β the format of .dstyle files, aka display styles. that's the whole vibe, bestie β¨
π DESCRIPTION π
okay so, display styles are literally just instructions for how to render information on a screen. each style describes one way of rendering stuff β like a solid area in red, or a dotted outline in purple, whatever the moment calls for π . different styles correspond to mask layers, highlights, labels, menus, window borders, and so on. if you want the full lore on how the styles are used, go read ``Magic Maintainer's Manual #3: Display Styles, Color Maps, and Glyphs'' β it ate, no cap.
dstyle files usually have names of the form x.y.dstylen, where:
xis a class of technologiesyis a class of displaysnis a version number (currently5)
the version number may increase in the future if the format of dstyle files changes. so like, don't get too attached to the 5. for example, the display style file mos.7bit.dstyle5 provides all the rendering information for our nMOS and CMOS technologies for color displays with at least 7 bits of color. iconic π
dstyle files are stored in ASCII as a series of lines. lines beginning with # are considered to be comments and are ignored (yes, your little notes are safe, go off). the rest of the lines of the file are divided up into two sections separated by blank lines. > there should not be any blank lines within a section. we do not do that here π
β¨ DISPLAY_STYLES SECTION β¨
the first section begins with a line:
display_styles planes
where planes is the number of bits of color information per pixel on the screen (between 1 and 8).
each line after that describes one display style and contains eight fields separated by white space:
style writeMask color outline fill stipple shortName longName
the meanings of the fields are:
styleβ the number of this style, in decimal. styles1through64are used to display mask layers in the edit cell. the style number(s) to use for each mask layer is (are) specified in the technology file. styles65-128are used for displaying mask layers in non-edit cells. if style x is used for a mask layer in the edit cell, style x+64is used for the same mask layer in non-edit cells. styles above128are used by the Magic code for various things like menus and highlights. see the filestyles.hin Magic for how styles above128are used. when redisplaying, the styles are drawn in order starting at1, so the order of styles may affect what appears on the screen. (order matters, bestie, it's giving very much "first come first served") πwriteMaskβ this is an octal number specifying which bit-planes are to be modified when this style is rendered. for example,1means only information in bit-plane 0 will be affected, and377means all eight bit-planes are affected.colorβ an octal number specifying the new values to be written into the bit-planes that are modified. this is used along withwriteMaskto determine the new value of each pixel that's being modified:
newPixel = (oldPixel & βΌwriteMask) | (color & writeMask)
the red, green, and blue intensities displayed for each pixel are not determined directly by the value of the pixel; they come from a color map that maps the eight-bit pixel values into red, green, and blue intensities. color maps are stored in separate files. (so like, don't come for the pixel value for your color opinions, it's not the one making the decisions π)
outlineβ if this field is zero, then no outline is drawn. if the field is non-zero, it specifies that outlines are to be drawn around the rectangular areas rendered in this style, and the octal value gives an eight-bit pattern telling how to draw the outline. for example,377means to draw a solid line,252means to draw a dotted line,360specifies long dashes, etc. this field only indicates which pixels will be modified: thewriteMaskandcolorfields indicate how the pixels are modified.fillβ this is a text string specifying how the areas drawn in this style should be filled. it must have one of the valuessolid,stipple,cross,outline,grid.solidmeans that every pixel in the area is to modified according towriteMaskandcolor.stipplemeans that the area should be stippled: the stipple pattern given bystippleis used to determine which pixels in the area are to be modified.crossmeans that an X is drawn in a solid line between the diagonally-opposite corners of the area being rendered.outlinemeans that the area should not be filled at all; only an outline is drawn (if specified byoutline).gridis a special style used to draw a grid in the line style given byoutline.
the styles cross and stipple may be supplemented with an outline by giving a non-zero outline field. the outline and grid styles don't make sense without an an outline, and solid doesn't make sense with an outline (since all the pixels are modified anyway). yeah, some of these combos are lowkey incompatible, read the room πΈ
stippleβ used whenfillisstippleto specify (in decimal) the stipple number to use.shortNameβ this is a one-character name for this style. these names are used in the specification of glyphs and also in a few places in the Magic source code. most styles have no short name; use a ``-'' in this field for them.longNameβ a more human-readable name for the style. it's not used at all by Magic. (literally just for us, a little treat π)
π¦ STIPPLES SECTION π¦
the second section of a dstyle file is separated from the first by a blank line. the first line of the second section must be:
stipples
and each additional line specifies one stipple pattern with the syntax:
number pattern name
numberis a decimal number used to name the stipple in thestipplefields of style lines.numbermust be no less than1and must be no greater than a device-dependent upper limit. most devices support at least15stipple patterns. (device-dependent?? yeah, it's giving "ask your device, not me" π)patternconsists of eight octal numbers, each from0-377and separated by white space. the numbers form an 8-by-8 array of bits indicating which pixels are to be modified when the stipple is used.- the
namefield is just a human-readable description of the stipple; it isn't used by Magic.
π FILES π
βΌcad/lib/magic/sys/mos.7bit.dstyle5
π SEE ALSO π
and that's the whole page, bestie π«Ά this one came from the 4th Berkeley Distribution, and it's DSTYLE(5) in the File Formats Manual. go forth and render things beautifully, mwah πβ¨
π¦ where this page comes from
- debian bookworm: magic 8.3.105+ds.1-1.1 Β· BSD-style
- fedora 43: magic 8.3.552-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 43: magic 8.3.651-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.623-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.684-1.fc44
- fedora 44: magic 8.3.685-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- nixos 26.05: magic-vlsi 8.3.629
- nixpkgs unstable: magic-vlsi 8.3.689
- ubuntu jammy: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu noble: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu resolute: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu stonking: magic 8.3.105+ds.1-1.1 Β· BSD-style
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms