Arrange — alignment, distribution, transform, boolean
The Arrange menu and the Transform toolbar group (which nests the Align dropdown) cover every geometric transform; boolean ops live in the Arrange menu, the right-click context menu, and on the U/D/I/X keys (see below).
Alignment and distribution
When 2+ shapes are selected, the alignment buttons light up:
- Align left, horizontal centers, right
- Align bottom, vertical centers, top
- Distribute horizontally (requires 3+ selected)
- Distribute vertically (requires 3+ selected)
Transform
With a selection, the Properties panel shows an inline Transform section — no modal dialogs. Type a value and press Enter (or click the button); the panel stays open so you can repeat (e.g. Rotate +90 twice):
- Move — translate by Δx / Δy in the active display unit.
- Rotate — arbitrary angle about the selection's centroid, with ±45/±90/180 preset chips.
]/[are still the quick ±90° keyboard steps. - Scale — uniform scale about the centroid (×0.25 / ×0.5 / ×2 / ×4 presets).
- Offset / Inflate / Deflate — polygon offset on selected boundaries (outset positive, inset negative; runs via
polygon-clipping).
Array… (Arrange → Array… or the toolbar), Polar array… (Arrange) and Chamfer / Fillet corners… (Arrange) remain their own parameter dialogs.
The component library also carries two shapes Clewin offers as direct tools: a Regular polygon (any number of sides, with the radius measured to a corner or to an edge — the across-flats dimension a hexagon is usually specified by) and a Trapezoid (independent top and bottom widths, plus a top offset that turns the isosceles shape into a right trapezoid). They are components rather than drawing tools on purpose: both shapes are defined by numbers, so typing them beats dragging and correcting, and a placed one stays editable from the Properties panel.
Polar array repeats the selection around a centre instead of along a lattice: give a centre, a number of copies and a swept angle. A full 360° sweep spaces the copies evenly all the way round — 4 copies land at 0/90/180/270, so the last one does not sit on top of the first. A partial sweep (say 90°) fans them across that arc with the first and last copies ON the endpoints. Rotate each copy with the arc is on by default, which is what a radial test structure wants; turn it off and each copy keeps its original angle while only its position revolves, which is what alignment marks and labels need. It works on shapes and on placed instances — unlike the rectangular Array, which sends a selected instance to promote-to-AREF instead. GDS has no radial array primitive, so every copy is a separate object rather than one array record; the count is capped at 2000 and the dialog shows the resulting angular step live. One undo step.
Generate identifiers… (Arrange) stamps systematic labels in one undo step — the no-scripting replacement for Clewin's label function. Array labels mode writes an A1..H12 grid (rows × cols, configurable pitch, alpha/numeric row & column schemes, prefix, A1/1A order) across a die array; Mask ID block mode stacks large human-readable lines (project / designer / version / mask turn). Both use the normal text + font pipeline, so the labels flatten to polygons on GDS export like any other text.
Search & replace cell references
Ctrl+Shift+F (or Edit → Search & replace cell refs…) opens a dialog that rewrites every SREF/AREF whose target is the "from" cell to point at the "to" cell instead. The dialog shows a live count of how many refs will be affected before you commit. Scope is the whole document.
Find shapes & instances
Ctrl+F (or Edit → Find shapes & instances…) opens a searchable list of everything in the active cell. Predicate grammar (terms separated by space = AND):
layer:N— only shapes on layer idNdatatype:N— only shapes on datatypeNkind:shape|path|text— restrict by shape kindref:CELL— match SREF/AREF whose target isCELLtext:NEEDLE— substring match on text-shape contentsarea>NUM/area<NUM— true polygon area filter (in nm²; bbox area for non-polygon shapes)width>NUM/width<NUM/width=NUM— path width filter (in nm) — e.g.kind:path width<450flags sub-min-width routes as a cheap pre-DRC pass
Click any row to centre the viewport on it and select it, or Select all to select every match in the active cell at once. (You can also select every shape on a layer from the Layers panel — hover a row and click the marquee icon.)
Convert path to polygon (Arrange → Convert path to polygon)
Design-rule width/spacing/area checks and the boolean/layer operations above all work on filled polygon area — a path shape (a centreline plus a width) is invisible to them, so a routed trace can carry a sub-minimum width or overlap a keep-out layer and neither DRC nor a layer boolean will ever see it. Select one or more widened paths and run this to replace each with a boundary polygon tracing its exact stroked outline — same layer, same datatype, joints mitred and end caps honoured (flush / round / square) exactly as the path already drew. A path carrying custom per-end extensions (GDS PATHTYPE 4) is extended along its centreline before stroking, so the polygon has the same footprint a GDS reader would draw for the original path rather than shrinking by the extension at each end. Once converted, the geometry is checkable and boolean-able like any other polygon.
Every selected path lands in exactly one outcome, and the toast accounts for all of them:
- Converted — a real, positive-width path became a polygon.
- Zero-width — a bare centreline has no area to stroke, so it's left alone rather than fabricating geometry that was never drawn.
- Too narrow — width is real but rounds away to nothing once snapped to integer nanometres; left alone rather than silently vanishing.
- Construction — a construction-flagged path (draw-only aid, never exported) is left alone rather than being turned into real, exportable geometry.
Any non-path shapes in the selection pass through untouched and aren't counted. Single undo step for the whole selection.
Close open contours (Arrange → Close open contours…)
Outlines drawn in AutoCAD are very often not polygons — they are separate LINE and ARC entities whose endpoints happen to meet. They look correct on screen, but they enclose no area, so they export to GDS as PATH records and expose nothing. The failure is invisible until the mask comes back blank.
This command chains those open paths into filled polygons, merges duplicate or overlapping segments, and drops zero-length remnants.
It also runs automatically on every DXF, DWG and SVG import, on by default. A Close open contours & heal geometry checkbox appears on the DWG and SVG import dialogs (DXF has no import dialog, so the Heal imported geometry toggle in Edit → Settings decides on its own); untick it to import the file exactly as drawn. GDS, OASIS and CIF are never healed — they carry a real area primitive, so an open path there is a path you meant, not a CAD export artifact. Whichever way it's set, the import tells you how many open segments it found — with healing on, it also states what changed (contours closed, gaps bridged, duplicate segments merged, zero-length segments dropped); with healing off, it names the count and points you at this dialog or the Settings toggle. A genuinely clean file says nothing.
Two settings, both of which exist because neither has a safe universal value:
- Endpoint tolerance (µm) — how far apart two endpoints may be and still count as the same point. Raise it if a drawing refuses to close; lower it if two separate features are being welded together. Defaults to 0.1 µm for DXF and DWG. For SVG import, which has no physical unit to anchor a fixed tolerance to, the tolerance instead scales down automatically with the drawing's own size — so a small icon-scale SVG doesn't get its opposite sides welded together, while a real mm-scale SVG heals the same as DXF/DWG.
- Minimum area to bridge a gap (µm²) — a chain that never closes is left alone unless it encloses at least this much area. This is what stops leader lines, centrelines and dimension marks — open by nature, enclosing nothing — from becoming zero-width slits of exposed resist, while still letting a real outline with a sloppy gap close. Defaults to 10 µm².
Chaining never crosses a layer or datatype boundary, and never touches a path that already has a width. Every removal is counted and reported. A chain that stays open keeps the paths it came from, but exact-duplicate and overlapping segments are merged away and zero-length remnants are dropped — the manual Arrange → Close open contours… command runs this as a single undo step.
Layer operations (Arrange → Layer operations…)
The selection-based booleans above replace whatever you select. Layer operations runs the same four ops (union / difference / intersect / XOR) between two whole layers instead, and is non-destructive: input layers A and B are left untouched, and the result is stamped onto a separate output layer — pick an existing layer or type a new layer/datatype number inline to create one on the spot. It refuses to run if the output layer is also input A or input B (writing back onto a source layer would just pile the result on top of the geometry that produced it) or if the output layer is locked.
Grow and Shrink size a single layer by a distance instead — layer B is ignored and a Distance (µm) box replaces it. This is true morphological sizing with round corners (a Minkowski offset), the same construction the design-rule checker uses, which is what stops a shrink from filling in a concave notch — a shrink that quietly welded a dumbbell's thin neck back into solid metal is the exact bug this avoids. Because the band construction costs roughly eight times a boolean on the same layer, grow/shrink is capped by input vertices (20 000) rather than shape count; past that it refuses immediately instead of grinding.
Tick Flatten instances first to expand every SREF/AREF in the active cell before collecting each side's shapes — off, only the active cell's own shapes on that layer are used, so geometry that only exists inside an instance is invisible to the op (same rule DRC uses, §8 below). Large jobs run on the same cancellable background worker as the selection-based booleans, above the same 20 000-vertex threshold. The whole operation — including creating the output layer if it didn't exist — is one undo step.
CIF export and import (File → Export ▸ Export CIF…)
CIF (Caltech Intermediate Form) is Clewin's third interchange format. Glyph
reads it (File → Open…, or drag a .cif in) and writes it
(File → Export ▸ Export CIF…).
Coordinates are written in nanometres via CIF's DS n 1 10 scale, and
layers are named L{layer}D{datatype} — the convention KLayout uses — so a
layer number and its datatype stay distinct instead of merging.
What CIF cannot carry, stated plainly rather than lost quietly:
- Widened paths become polygons. CIF's wire record has no portable end-cap rule — KLayout reads a bare wire back with its ends extended by half a width — so a path is stroked to its exact outline instead. The geometry is right; the "this is a path" structure is not preserved. Zero-width centrelines are kept as wires.
- A magnified reference is flattened. A CIF call carries mirror, rotation and position but no scale, so a ref placed at anything other than 1× is expanded into its parent. Every other reference keeps its hierarchy.
- Layer colours, stipples, visibility and field tone have no CIF equivalent —
export the layer map alongside (
File → Layer setup ▸ Export layer map) to carry the palette. - Text becomes a plain label: font, size and alignment are dropped.
Exports are checked against KLayout and gdstk on every release
(npm run validate:cif), so these are the only losses.
Opening a CleWin library. A CleWin structure library is itself a .cif, and
it carries each symbol's parameter declarations and its source script inside
CIF comments. Glyph reads them: open the file and the imported symbol shows the
parameters CleWin declared — name, default and the valid range — in the Properties
panel, along with a Show source script toggle. The layer colours CleWin stored
are picked up too, so an imported stack is not uniformly grey.
Those parameters are read-only, and the panel says so. Glyph does not run the C script that consumed them, so the geometry in the file is already generated and changing a number here could not rebuild it. You get the geometry, and you get a record of how it was made — which is enough to redraw or re-parameterise it in Glyph deliberately, and honest about what it is not. Imported script text is stored and displayed only; Glyph never executes it.
OASIS export and import (File → Export ▸ Export OASIS…)
OASIS (SEMI P39) is the modern, more compact companion to GDSII used in
foundry flows. Glyph reads it (File → Open…, or drag a .oas/.oasis file
in) and writes it (File → Export ▸ Export OASIS…, or pick a .oas filename in
Save as…).
Output is compressed by default. .oas is never bound for save-in-place —
Ctrl+S on a document opened from OASIS falls through to Save as… instead of
overwriting it — because the OASIS writer is lossy in two small, deliberate
ways: a round-capped path exports with a squared cap instead (OASIS has no
round-cap concept); and bitmaps and construction shapes are dropped, the same
exclusion every Glyph writer applies. Text size, font and PRESENTATION
justification now survive an OASIS round trip — OASIS's TEXT record has no
field for any of them, so they ride as element properties alongside the
string, layer, texttype and position, and are read back the same way, so a
GDS → OASIS → GDS trip no longer resizes your labels.
Grid presets (Shift + a number key)
Ten snap steps live on the number keys, Shift+1 through Shift+0. Pressing one
switches the grid to that fixed step and turns snapping on; the step is shown in a
brief toast so a keypress never changes the grid silently. The current preset is
ticked in View → Grid preset, which also lists all ten with their values.
Edit the ten values in Settings → Advanced → Grid presets. They are in
nanometres — a grid is an exact integer distance, and rounding it through a
display unit would change it. Reset restores the default ladder (1 nm to
100 µm).
They take Shift because the bare number keys belong to the KLayout keyboard
preset's hierarchy levels, and both migrant habits are worth keeping. Every one of
the ten is remappable in Edit → Keyboard shortcuts… like any other command.
EPS figure export (File → Export ▸ Export EPS…)
File → Export ▸ Export EPS… writes an Encapsulated PostScript figure — the vector
page format Clewin emits and every LaTeX toolchain consumes. It uses the
publication look by default (white ground, solid fills, outlines, a scale bar and
a legend), because reaching for EPS means making a figure for a paper.
Its one advantage over SVG is that the figure has a real printed size: it is
written at a width in millimetres, so it lands in your document at a known width
instead of at whatever the importing tool guesses. For full control over the
annotations, use File → Export ▸ Export figure… instead and pick a .eps filename there
— when its Size is set to Print, the mm width you enter is the EPS page
width.
Two things PostScript cannot do:
- No transparency. A layer drawn at partial opacity is blended onto the page background when the file is written. That looks identical for geometry that does not overlap; where two translucent layers cross, the blend you see on screen is not reproduced. The publication preset uses full opacity, so this only affects a deliberately translucent export.
- Base-13 fonts only. Label text is written in Courier, and any character
outside printable ASCII becomes
?rather than a silently wrong glyph.
Recipes (Edit → Recipes…)
A recipe is a saved, ordered list of editor commands you can re-run on any document — "run the design-rule check, then export per layer", every time, the same way. Add steps from the action picker, reorder them, save the recipe to a file, and load it again later. It is plain data: nothing in a recipe file is executed as code.
Steps can now carry parameters. Two actions run without opening their dialog when you fill in their fields:
- Layer operations — give an operation (
union,diff,intersect,xor,grow,shrink), the input layer numbers, an output layer, and for grow/shrink a distance in nanometres. This is what lets a recipe say "union layer 1 with layer 2 into layer 3" rather than just "open the layer-operations dialog". - Export per layer — name a layer number to write one mask, or leave it blank to write every layer that carries geometry.
Leaving a step's fields blank keeps the old behaviour: the action opens its dialog when the recipe reaches it, exactly as before. So a recipe you saved earlier runs identically today.
A step that names a parameter the action does not have, or gives it the wrong type, stops the recipe and says which step and why — it is not skipped. That matters most when nobody is watching: a step that quietly did nothing would let the run report success over a layout that is wrong.
Recipes are not atomic. Each step dispatches its own commands, so undo unwinds a recipe one step at a time rather than all at once.
Objects panel
The Objects tab in the left panel lists everything in the cell you are
editing — every polygon, path, text, bitmap, instance and array — with its kind,
its (layer, datatype), and its size. Click a row to select that object and frame
it. Type in the filter box to narrow the list by kind, layer, id or note.
It is the fastest way to answer "which object is on the wrong layer" on a symbol that renders wrong. A few details worth knowing:
- The list covers this cell's own contents, not the flattened hierarchy — an
instance appears as one row saying what it points at, and an array as one row
with its instance count (
3×4 = 12). - Construction guides and reference bitmaps are listed, each noted as not
exported, so a stray object is visible rather than hidden by the same rule that
keeps it out of your
.gds. - The list is virtualized, so a cell with hundreds of thousands of objects scrolls normally. Past 200 000 rows it says so rather than quietly stopping.
There is no per-object show/hide. Visibility is per layer and per cell; hiding an individual object would cost drawing speed on every frame for every design, and selecting the object plus isolating its layer covers most of the same need.
Alignment marks across a mask series (Verify → Place alignment marks… / Check mark alignment…)
Place alignment marks… puts one mark type at a list of wafer coordinates on every layer you tick, as a single undo step — so a five-mask series gets its marks from one action instead of twenty-five placements that have to agree by hand.
Emission is tone-aware. On a clear-field level the mark is drawn as geometry. On a level whose field tone is dark, the same mark is emitted as a clear window — the mark shape knocked out of a surround — because that is what prints the same image on a dark field. Drawing solid geometry there would print its complement, and the aligner would not find its mark. The dialog says which of the selected levels are dark-field before you commit.
Check mark alignment… is read-only: it finds small shapes on each layer, clusters them into marks, matches marks across layers, and reports any site where the layers disagree by more than 1 µm or where a layer is missing a mark the others have. It expands SREF/AREF instances first, so a mark that lives inside a sub-cell on one level and is drawn directly on another is still compared. On a document too large to expand (a full wafer step-and-repeat) it falls back to the active cell's own shapes and says so in the report rather than narrowing silently.
It is purely geometric, so it works on marks that were drawn by hand, imported from a foundry file, or copied between documents — nothing has to be tagged as a mark.
Related pages
- Boolean operations and layer merge — Union, difference, intersect, and XOR selected shapes, and merge every shape on the active layer into one polygon.
- Design-rule check (DRC) — Run min-width, min-spacing, and min-area checks with hierarchy flattening; step through violation markers on the canvas.