On Thu, Feb 01, 2024, Emilia Stoyanova wrote: > Do any of you have experience with creating ornamented page > borders? > > I have attached a pdf document, together with its pic(1) source > code, to illustrate exactly what I am going for.
This got me thinking: How would I tackle ornamental page borders in mom using a speciality font instead of pic(1) or groff's drawing escapes? This is what I came up with, using a glyph from the WmDesigns font. It's proof of concept only. The basic idea is that once you create a border with the desired size/leading/margins, it can be wrapped in a macro, inserted manually on the first page, and added to the top of the HEADER macro for subsequent pages in multi-page documents. This probably isn't what Emilia is looking for, but it may prove useful to mom users. pdf output attached. ---Begin--- .PAPER LETTER . .\" Choose glyph from border font .ds glyph \f[WmDesigns]l\f[] .ds width "\h'\w'\f[WmDesigns]l\f[]'u' . .\" Adjust size and leading of border glyph .PT_SIZE 17.5 .LS 27.75 .LEFT . .\" Adjust margins to compenseate for glyph width and height .\" Produces a border whose inner sides are 1 inch from page edges .L_MARGIN .75i .R_MARGIN .75i .T_MARGIN 1i .B_MARGIN .5i . .\" Use PAD to mark off string tabs that space glyphs evenly over line length .nr tab 0 1 .PAD \ "\*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]#\ \*[ST\n+[tab]]\*[width]\*[ST\n[tab]X]" \ NOBREAK . .\" Create string tabs .nr loop 18 .nr loop_count 0 1 .while \n+[loop_count]<=\n[loop] \{\ . ST \n[loop_count] L .\} . .\" Top .mk .TB 1 \" Call first tab explictly .nop \*[glyph] .nr loop_count 1 1 . .while \n+[loop_count]<=\n[loop] \{\ . TN \" Call remaining tabs with "tab next" to keep on same baseline . nop \*[glyph] .\} .TQ . .\" Left .while (\n[.t]-\n[.v])>\n[.v] \{\ . nop \*[glyph] .\} . .\" Right .rt .sp .RIGHT .while (\n[.t]-\n[.v])>\n[.v] \{\ . nop \*[glyph] .\} . .\" Bottom (same as top) .LEFT .TB 1 .nop \*[glyph] .nr loop_count 0 1 .while \n+[loop_count]<=\n[loop] \{\ . TN .nop \*[glyph] .\} ---End--- -- Peter Schaffter https://www.schaffter.ca
border-test.pdf
Description: Adobe PDF document