Add the Neutral template family, template picker and text-only logo allowances
Linea (the vendor's original format.pdf design), Monogram and Serenity are rebuilt from the reference PDFs as one parametric family on the engine, with the user's logo in the measured slot, a home for every GST field and A4/Letter support. Adds static Montserrat, Open Sans and Poppins fonts and a generated Ms Madi outline for Serenity's vertical word. Text-only logo placeholders (Monolith, Tangerine) use a doc-derived allowance box. A Carbon TemplatePicker with committed thumbnails opens from the page setup controls.
This commit is contained in:
@@ -91,12 +91,14 @@ function align(target: Box, w: number, h: number, slot: TemplateSlot): Box {
|
||||
/**
|
||||
* Places the user's logo where a template's logo placeholder is. Contain-fit in the measured box, then
|
||||
* a shrink-only weight factor so a denser logo draws smaller and matches the placeholder's visual
|
||||
* weight. A wordmark (includesName) replaces the whole lockup; a mark replaces the icon only. The
|
||||
* legibility floor never pushes past the box: a box under MIN_LOGO_HEIGHT stays the limit.
|
||||
* weight. A wordmark (includesName) replaces the whole lockup; a mark replaces the icon only. A
|
||||
* text-only placeholder (Monolith's "CAVEIN", Tangerine's "Rimberio") fits the template's allowance
|
||||
* instead, with the weight factor still computed against the text's density. The legibility floor never pushes past the box: a box under MIN_LOGO_HEIGHT stays the limit.
|
||||
*/
|
||||
export function computeLogoPlacement({ logo, slot, scale = 1, available }: SlotLogoPlacementInput): SlotLogoPlacement {
|
||||
const wantLockup = logo.includesName || !slot.mark;
|
||||
const target = wantLockup ? (slot.lockup ?? slot.mark) : slot.mark;
|
||||
// A text-only placeholder is too small for a logo; its allowance (from the template docs) is the target.
|
||||
const target = slot.textOnly ? slot.allowance : wantLockup ? (slot.lockup ?? slot.mark) : slot.mark;
|
||||
if (!target) throw new Error("slot has neither a mark nor a lockup box");
|
||||
const slotKind = wantLockup ? "lockup" : "mark";
|
||||
const placeholderDensity = wantLockup ? slot.lockupDensity : slot.markDensity;
|
||||
|
||||
Reference in New Issue
Block a user