Font Operators

bpy.ops.font.case_set(case='LOWER')

Set font case

Parameters:case (enum in [‘LOWER’, ‘UPPER’], (optional)) – Case, Lower or upper case
bpy.ops.font.case_toggle()

Toggle font case

bpy.ops.font.change_character(delta=1)

Change font character code

Parameters:delta (int in [-255, 255], (optional)) – Delta, Number to increase or decrease character code with
bpy.ops.font.change_spacing(delta=1)

Change font spacing

Parameters:delta (int in [-20, 20], (optional)) – Delta, Amount to decrease or increase character spacing with
bpy.ops.font.delete(type='ALL')

Delete text by cursor position

Parameters:type (enum in [‘ALL’, ‘NEXT_CHARACTER’, ‘PREVIOUS_CHARACTER’, ‘SELECTION’, ‘NEXT_OR_SELECTION’, ‘PREVIOUS_OR_SELECTION’], (optional)) – Type, Which part of the text to delete
bpy.ops.font.file_paste(filepath="", filter_blender=False, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=True, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, display_type='FILE_DEFAULTDISPLAY')

Paste contents from file

Parameters:
  • filepath (string, (optional, never None)) – File Path, Path to file
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_backup (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_folder (boolean, (optional)) – Filter folders
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • display_type (enum in [‘FILE_DEFAULTDISPLAY’, ‘FILE_SHORTDISPLAY’, ‘FILE_LONGDISPLAY’, ‘FILE_IMGDISPLAY’], (optional)) –

    Display Type

    • FILE_DEFAULTDISPLAY Default, Automatically determine display type for files.
    • FILE_SHORTDISPLAY Short List, Display files as short list.
    • FILE_LONGDISPLAY Long List, Display files as a detailed list.
    • FILE_IMGDISPLAY Thumbnails, Display files as thumbnails.
bpy.ops.font.insert_lorem()

Insert placeholder text

bpy.ops.font.line_break()

Insert line break at cursor position

bpy.ops.font.move(type='LINE_BEGIN')

Move cursor to position type

Parameters:type (enum in [‘LINE_BEGIN’, ‘LINE_END’, ‘PREVIOUS_CHARACTER’, ‘NEXT_CHARACTER’, ‘PREVIOUS_WORD’, ‘NEXT_WORD’, ‘PREVIOUS_LINE’, ‘NEXT_LINE’, ‘PREVIOUS_PAGE’, ‘NEXT_PAGE’], (optional)) – Type, Where to move cursor to
bpy.ops.font.move_select(type='LINE_BEGIN')

Make selection from current cursor position to new cursor position type

Parameters:type (enum in [‘LINE_BEGIN’, ‘LINE_END’, ‘PREVIOUS_CHARACTER’, ‘NEXT_CHARACTER’, ‘PREVIOUS_WORD’, ‘NEXT_WORD’, ‘PREVIOUS_LINE’, ‘NEXT_LINE’, ‘PREVIOUS_PAGE’, ‘NEXT_PAGE’], (optional)) – Type, Where to move cursor to, to make a selection
bpy.ops.font.open(filepath="", filter_blender=False, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=True, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, relative_path=True, display_type='FILE_DEFAULTDISPLAY')

Load a new font from a file

Parameters:
  • filepath (string, (optional, never None)) – File Path, Path to file
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_backup (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_folder (boolean, (optional)) – Filter folders
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • display_type (enum in [‘FILE_DEFAULTDISPLAY’, ‘FILE_SHORTDISPLAY’, ‘FILE_LONGDISPLAY’, ‘FILE_IMGDISPLAY’], (optional)) –

    Display Type

    • FILE_DEFAULTDISPLAY Default, Automatically determine display type for files.
    • FILE_SHORTDISPLAY Short List, Display files as short list.
    • FILE_LONGDISPLAY Long List, Display files as a detailed list.
    • FILE_IMGDISPLAY Thumbnails, Display files as thumbnails.
bpy.ops.font.style_set(style='BOLD', clear=False)

Set font style

Parameters:
  • style (enum in [‘BOLD’, ‘ITALIC’, ‘UNDERLINE’, ‘SMALL_CAPS’], (optional)) – Style, Style to set selection to
  • clear (boolean, (optional)) – Clear, Clear style rather than setting it
bpy.ops.font.style_toggle(style='BOLD')

Toggle font style

Parameters:style (enum in [‘BOLD’, ‘ITALIC’, ‘UNDERLINE’, ‘SMALL_CAPS’], (optional)) – Style, Style to set selection to
bpy.ops.font.text_copy()

Copy selected text to clipboard

bpy.ops.font.text_cut()

Cut selected text to clipboard

bpy.ops.font.text_insert(text="", accent=False)

Insert text at cursor position

Parameters:
  • text (string, (optional, never None)) – Text, Text to insert at the cursor position
  • accent (boolean, (optional)) – Accent mode, Next typed character will strike through previous, for special character input
bpy.ops.font.text_paste()

Paste text from clipboard

bpy.ops.font.textbox_add()

Add a new text box

bpy.ops.font.textbox_remove(index=0)

Remove the textbox

Parameters:index (int in [0, inf], (optional)) – Index, The current text box

Unlink active font data block

Previous topic

Fluid Operators

Next topic

Gpencil Operators