_font

Text rasterisation feature leveraging Qt font and text layout support.

silx.gui.plot3d._font.getDefaultFontFamily()[source]

Returns the default font family of the application

silx.gui.plot3d._font.ULTRA_LIGHT = 0

Lightest characters: Minimum font weight

silx.gui.plot3d._font.LIGHT = 25

Light characters

silx.gui.plot3d._font.NORMAL = 50

Normal characters

silx.gui.plot3d._font.SEMI_BOLD = 63

Between normal and bold characters

silx.gui.plot3d._font.BOLD = 74

Thicker characters

silx.gui.plot3d._font.BLACK = 87

Really thick characters

silx.gui.plot3d._font.ULTRA_BLACK = 99

Thickest characters: Maximum font weight

silx.gui.plot3d._font.rasterText(text, font, size=-1, weight=-1, italic=False)[source]

Raster text using Qt.

It supports multiple lines.

Parameters:
  • text (str) – The text to raster
  • font (str or QFont) – Font name or QFont to use
  • size (int) – Font size in points Used only if font is given as name.
  • weight (int) – Font weight in [0, 99], see QFont.Weight. Used only if font is given as name.
  • italic (bool) – True for italic font (default: False). Used only if font is given as name.
Returns:

Corresponding image in gray scale and baseline offset from top

Return type:

(HxW numpy.ndarray of uint8, int)

Previous topic

utils

Next topic

viewer3DVolume.py

This Page