Label

class ipkiss3.all.Label

Layout element which places text as a Label on the layout. The element will be exported as a GDSII label.

Parameters:
font: int and number >= 0, required

The font of the label. This is a positive integer

text: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters, required

The text to de displayed

layer: __Layer__, required

Layout layer on which the element needs to be placed

height: float and number > 0, optional

height of the text

alignment: optional
Alignment of the text. This is a tuple of constants indicating the horizontal and the vertical alignment.

Horizontal alignment can be constants.TEXT.ALIGN.CENTER (default), TEXT.ALIGN.LEFT, TEXT.ALIGN.RIGHT. Vertical alignment can be constants.TEXT.ALIGN.TOP (default), TEXT.ALIGN.MIDDLE, TEXT.ALIGN.BOTTOM.

coordinate: Coord2, optional

coordinate on which the text is aligned

transformation: GenericNoDistortTransform, optional

See also

PolygonText

Examples

import si_fab.all as pdk
import ipkiss3.all as i3

class GratingCouplerWithLabel(i3.PCell):
    class Layout(i3.LayoutView):
        def _generate_instances(self, insts):
            insts = i3.place_and_route(insts={"gc": pdk.FC_TE_1550()}, specs=[i3.Place("gc", (0, 0))])
            return insts

        def _generate_elements(self, elems):
            elems += i3.Label(
                layer=i3.TECH.PPLAYER.DOC,
                coordinate=(25, 0),
                text="out",
                alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.BOTTOM),
                font=i3.TEXT.FONT.DEFAULT,
                height=8,
            )
            elems += i3.Label(
                layer=i3.TECH.PPLAYER.DOC,
                coordinate=(0.0, 0.0),
                text="FC_TE_1550",
                alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.BOTTOM),
                font=i3.TEXT.FONT.DEFAULT,
                height=8,
            )
            return elems

layout = GratingCouplerWithLabel().Layout()
layout.visualize(annotate=True)
layout.write_gdsii("layout_with_Label.gds")
../../../../_images/ipkiss3-all-Label-1.png