Line_number

Module path
kivydk.uix.widgets.line_number

Overview

Todo

  • Description of this module need to be implemented.

  • Fixing the rendering glitch when trying to customize the appearance.


Reference

class LineNumber(text_input, **kwargs)

Bases: Widget

align: OptionProperty

Horizontal alignment of the text.

Default

right

Options

left

center

right

background_color: ColorProperty

Current tint color of the background.

Default

[1, 1, 1, 1]

white

background_texture

Background image of the line numbers.

background_texture is a StringProperty and defaults to ‘atlas://data/images/defaulttheme/textinput’.

border

Border used for BorderImage graphics instruction. Used with background_texture. Can be used for a custom background.

It must be a list of four values: (bottom, right, top, left). Read the BorderImage instruction for more information about how to use it.

border is a ListProperty and defaults to [4, 4, 4, 4].

font_context

Font context. None means the font is used in isolation, so you are guaranteed to be drawing with the TTF file resolved by font_name. Specifying a value here will load the font file into a named context, enabling fallback between all fonts in the same context. If a font context is set, you are not guaranteed that rendering will actually use the specified TTF file for all glyphs (Pango will pick the one it thinks is best).

If Kivy is linked against a system-wide installation of FontConfig, you can load the system fonts by specifying a font context starting with the special string system://. This will load the system fontconfig configuration and add your application-specific fonts on top of it (this imposes a significant risk of family name collision, Pango may not use your custom font file, but pick one from the system)

Note

This feature requires the Pango text provider.

font_context is a StringProperty and defaults to None.

font_family

Font family, this is only applicable when using font_context option. The specified font family will be requested, but note that it may not be available, or there could be multiple fonts registered with the same family. The value can be a family name (string) available in the font context (for example a system font in a system:// context, or a custom font file added using kivy.core.text.FontContextManager). If set to None, font selection is controlled by the font_name setting.

Note

If using font_name to reference a custom font file, you should leave this as None. The family name is managed automatically in this case.

Note

This feature requires the Pango text provider.

font_family is a StringProperty and defaults to None.

font_name

Filename of the font to use. The path can be absolute or relative. Relative paths are resolved by the resource_find function.

font_name is a StringProperty and defaults to ‘Roboto’. This value is taken from Config.

font_size

Font size of the text in pixels.

font_size is a NumericProperty and defaults to 15 sp.

foreground_color

Current color of the foreground, in (r, g, b, a) format.

foreground_color is a ColorProperty and defaults to [0, 0, 0, 1] (black).

padding

[padding_left, padding_right].

padding also accepts a one argument form [padding_horizontal].

padding is a VariableListProperty and defaults to [4, 4].

Type:

Horizontal padding of the text

width_min

Minimum desired width of the text in pixels.

width_min is a NumericProperty and defaults to 18 sp.