Skip to content

Text and ports

Call / property Returns / behavior What it does and why
deck.text("label") Literal runtime String Creates a fixed String value in the deck. Use it as a runtime branch value or as part of a layout-dependent message.
context.texts((50, 0), pattern="*", match="glob", recursive=True) Texts; match also "exact" Reads labels from the GDS text layer, with exact or glob name matching. Use it to find named layout areas or labels needed by a rule.
text.content, text.x, text.y String and coordinate Number values Reads one label's text and X/Y position. Use the content to select labels and the position to build nearby markers or search areas.
texts.markers(half_size) Region; also on a bound Text Places a square around each label position. Use it to turn labels into polygon masks or visible findings; half_size is the distance from the center to each side.
context.ports(convention=..., ...) Ports; convention "kfactory"; invalid_metadata also "empty_with_warning" Reads connection-point metadata using the selected convention. Use the port collection for checks around interfaces rather than treating ports as ordinary drawn material.
ports.faces(inward=..., outward=...) Region from a port collection Builds face regions extending inward and outward from the ports. Use these regions for overlap, enclosure, or keepout checks around a connection opening.
texts.filter(...) Texts; symbolic predicate Keeps labels whose per-label condition is true. Use it when text matching alone is not enough, such as selecting by both content and position.
texts.map_regions(...) Region built from each item Builds a Region from each label and combines the results. Use it to make label-driven masks with sizes or positions chosen by a builder.
string.matches(pattern, match="exact"), string.equal(other) Predicate; match also "glob"; equality accepts String or Python str matches() checks exact text or a glob pattern; equal() compares with another String or Python string. Use the resulting condition to select labels or choose a runtime branch.

context.ports() options: port_type=None, gds=None, orientation=None, invalid_metadata="error" (or "empty_with_warning"). Use convention="kfactory". Port collection count, is_empty(), and faces() work without per-port builders.