Link to the main program: placemat.ps
Links to documentation: ▶︎ Introduction, and a first placemat ▶︎ Fonts and glass decoration ▶︎ Compound Strings and non‑ASCII characters ▶︎ Page‑level controls ▶︎ Arrangement of glasses on the page ▶︎ Non‑Glasses Pages ▶︎ Document‑level controls ▷︎ Type sizes ▶︎ Translations ▶︎ Code injection ▶︎ Bitmap images ▶︎ Debugging
There are lots of fussy controls over the sizing of fonts. A few of these controls are, or are sometimes, worthwhile. Many others are superfluous — of use not more than rarely.
The controls more likely to be useful are sectioned worthwhile, the very fussy superfluous.
In the author’s old placemats, the most often changed, in order from most to least, are as follows.
-
FontSizesRatioTitlesMin
, typical values being99
(⇒ all forced to same size),1
(⇒ no effect), and other values ≥1.05
and ≤2
. -
TitleMaxHeightProportionInnerRadius
, typical values being either2
(⇒ ∞), or in the range1.25
–1.75
. -
BelowtitleMaxFontSizeProportionTitles
, to values in the range0.16666
–0.5
. Also, but less often, and to similar values,OvertitleMaxFontSizeProportionTitles
andAbovetitleMaxFontSizeProportionTitles
. -
CircletextFontSize
to values6
–16
. -
FontSizesSetsAboveBelowOver
, from[ 0 0 0 ]
to[ 0 0 1 ]
.
But, before detail can be explained, a flow of action is needed.
-
First, the circle text is sized. There are two parameters giving an indicative size, and others controlling whether this may be improved.
-
Then the
Titles
are sized, to use all the available space, subject to one-at-a-time constraints. That could still leave an ugly profusion of type sizes: one would not want different circles having theirTitles
set in 100pt, 104pt, 108pt, 108pt. So then there are constraints on which sets must be the same. For each set, all are set to the type size of the smallest. The process is repeated over the various sets, until it terminates. -
Then the
Abovetitles
,Belowtitles
, andOveritles
are sized. Again there are one-at-a-time constraints, and equality constraints.
These should be tackled in order.
The circle text is initially set to be CircletextFontSize
.
Also relevant is CircletextsMinNumSpacesBetween
, the gap between the items of Circlearrays
, measured in space widths.
Next, the font size can reduced to satisfy CircletextsMinCopies
.
Assume that these cause an item of Circlearrays
to fit around its circle 2.999 times.
This would be truncated to 2 times, with white space occupying the ‘0.999’ remainder.
Self-evidently, it would be aesthetically better to reduce the font size slightly, such that the text fits 3+ε times, making the gaps very close to CircletextsMinNumSpacesBetween
space widths.
By default, the font size is slightly adjusted for better aesthetics. Unless you need the font size to equal some exact value, allow this optimisation to do its magic.
This tweaking of the font size is enabled by the Boolean CircletextsTweakSize
.
There would be merit to allowing the first step of the optimusation to be an increase, permitted by the Boolean CircletextMaxFontSizeMayBeSlightlyExceeded
.
The number of copies of the Circletexts
is bounded above by CircletextsMaxCopies
; when this is invoked the the number of copies that would otherwise appear is on the top of the stack, so CircletextsMaxCopies
could be code referring to it, such code usually starting with a “dup
”.
Relevant when glasses spill over multiple pages, CircletextsSameFontSizeIfRadiiShrunkToBeSame
, constrains the size over pages compelled to have the same radius (see ShrinkRadii
).
(Technical note: CircletextsSameFontSizeIfRadiiShrunkToBeSame
should have the same Boolean value over any such set of pages.
Typically this is most easily achieved by having it depend on PageOrderingGlasses SheetNum get
or on ShrinkRadii SheetNum get
, rather than directly on SheetNum
.)
Broadly, the Titles
etc fit inside the Circlearrays
.
If a circle has a non-empty element of Abovetitles
, there should be space above the Title to hold that element. This is a constraint on the size of the Titles
, which are chosen such that the space above is at least TitleMinHeightForAbovetitleProportionInnerRadius
inner radii.
Likewise, Belowtitles
, below, TitleMinHeightForBelowtitleProportionInnerRadius
.
If the Titles
are to be as big as possible, these could be set to 0
.
Inside the Circlearrays
there is a ExclusionAnnulusProportionInnerRadiusTitlesAboveBelow
, defaulting to 0.
TitleMaxHeightProportionInnerRadius
ensures that the likes of “†” isn’t grossly outsized.
It would be ugly for there to be font sizes marginally different: 100pt, 104pt, 108pt, 108pt. The next few controls define sets, the font size of all of which are reduced to the smallest in the set.
- If larger÷smaller ≤
FontSizesRatioTitlesMin
, then the larger is collapsed to the smaller. Setting this to a large value causes all to be the same size. Setting this to any value ≤1 causes this to be ignored. Default is 1.1892 ≈ ∜2. It is one of the few sizing parameters which I do change.
-
FontSizesTitlesNotSmallerIfTitlesNotLonger
is a Boolean, which can constrains the size of a ‘W’ to be no smaller than that of a ‘ii’, and ensures that the latter’s font size equals that of a ‘SW’. Observe that this being true compelsTitles
of the same character count to be the same size. -
If two pages are in different sessions (lunch, evening) then there is no need for their sizes to be worked togther.
FontSizesSetsGlassesPages
is an array, of the same length asGlassesOnSheets
; pages are worked together if their elements areeq
ual. The default value ofFontSizesSetsGlassesPages
isPageOrderingGlasses
, which is typically used for separation into sessions. -
FontSizesTitlesEquivalences
is the same length asTitles
, and if two elements of this areeq
ual then the font sizes must be equal.
These four bullets are repeatedly applied until there are no more changes.
With the size of the Titles set, the space above and below can be used for the Abovetitles
and Belowtitles
, which are done jointly with the Overtitles
(henceforth, A, B, O).
-
Sizes are one-at-a-time constrained by
AbovetitleMaxFontSizeProportionTitles
,BelowtitleMaxFontSizeProportionTitles
, andOvertitleMaxFontSizeProportionTitles
. -
Should the sizes of the A, B, and O be independent?
FontSizesSetsAboveBelowOver
is an array of length 3, the elements referring to A, B, and O. Equal elements ⇒ considered together. As a guide, if fonts from different families ⇔ not together (i.e., work/Gotham-Book
with/GothamNarrow-Bold
, but neither with/Garamond
).
Analagous to the …Titles…
are:
-
ExclusionAnnulusProportionInnerRadiusTitlesAboveBelow
,ExclusionAnnulusProportionInnerRadiusOvertitles
, andFontSizesRatioAboveBelowOverMin
, the last of which defaults to 999, so forcing all to be the same size; -
FontSizesAbovetitlesEquivalences
,FontSizesBelowtitlesEquivalences
,FontSizesOvertitlesEquivalences
; -
and
FontSizesAboveBelowOverNotSmallerIfTitlesNotLonger
.
The VerticalMiddling parameters are for the fussy. The default values will almost always suffice.
How are the Titles to be vertically aligned? Centring each by itself causes their baselines to be misaligned, sometimes by an annoying small amount. So some sets should have a common baseline. But even that is wrong: vertically aligning “Pç” and “Pi” looks wrong: the tail of the cedilla, or of a ‘g’ or of a ‘y’, just seems aesthetically different. So the vertical alignment should be to a no-descender string.
VerticalMiddlingTitles
and VerticalMiddlingOvertitles
must be one of /MatchNone
, /MatchRow
, /MatchPage
, /MatchAll
, or /MatchString
.
The last of these causes it to use VerticalMiddlingStringTitles
and VerticalMiddlingStringOvertitles
.
But there are exceptions.
Whatever the alignment of “W09”, somehow “†” is different, and should be independently vertically centred.
So VerticalMiddlingTitlesAlwaysMatchNone
and VerticalMiddlingOvertitlesAlwaysMatchNone
are an array of exceptions, by default including:
†︎ ‡︎ $ £︎ €︎ ¥︎ + ++ +++ * ♠︎ ♥︎ ♦︎ ♣︎ ×︎ •︎ ·︎ ◊︎
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ τ υ φ χ ψ ω
☉︎ ☿︎ ♀︎ ♁︎ ♂︎ ♃︎ ♄︎ ♅︎ ♆︎ ♇︎
The even more pedantic parameters VerticalMiddlingIncludeBaselineTitles
and VerticalMiddlingIncludeBaselineOvertitles
say that, if the relevant string is wholly outside the baseline (i.e., bottom is positive or top is negative), the baseline is nonetheless included.