PolygonText
- class ipkiss3.all.PolygonText
Layout element which places text as a Group of Boundary elements or Path Elements. The elements created as such will be exported as GDSII polygons.
- Parameters:
- 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
- font: Font, optional
Font to be used for the text. These are IPKISS font objects which can be i3.TEXT.FONT.STANDARD(default),i3.TEXT.FONT.COMPACT and i3.TEXT.FONT.SIMPLE, or a positive integer (0,1,2) to look up the fonts.
- 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
Examples
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 class GratingCouplerWithPolygonText(i3.PCell): class Layout(i3.LayoutView): def _generate_instances(self, insts): insts = i3.place_and_route(insts={"gc": pdk.GratingCoupler()}, specs=[i3.Place("gc", (0, 0))]) return insts def _generate_elements(self, elems): elems += i3.PolygonText( layer=i3.TECH.PPLAYER.TEXT, coordinate=(0.0, 15.0), text="GRATING COUPLER", alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.BOTTOM), font=i3.TEXT.FONT.DEFAULT, height=8, ) return elems layout = GratingCouplerWithPolygonText().Layout() layout.visualize(annotate=True) layout.write_gdsii("layout_with_PolygonText.gds")
Different Fonts for PolygonText:
import ipkiss3.all as i3 i3.LayoutCell().Layout( elements=[ i3.PolygonText( layer=i3.Layer(0), text=font + ": abcdefghijklmnopqrstuvwxyz_0123456789", coordinate=(0.0, -75.0 * idx), alignment=(i3.TEXT.ALIGN.LEFT, i3.TEXT.ALIGN.BOTTOM), font=getattr(i3.TEXT.FONT, font), height=30, transformation=None, ) for idx, font in enumerate(["STANDARD", "COMPACT", "SIMPLE"]) ] ).visualize()