UmyaSpreadsheet.FontFunctions (umya_spreadsheet_ex v0.7.0)
View SourceFunctions for manipulating font styles in a spreadsheet.
Summary
Functions
Gets the bold state for a cell.
Gets the font color for a cell.
Gets the font family for a cell.
Gets the italic state for a cell.
Gets the font name for a cell.
Gets the font scheme for a cell.
Gets the font size for a cell.
Gets the strikethrough state for a cell.
Gets the underline style for a cell.
Sets the font weight (bold) for a cell.
Sets the font color for a cell.
Sets the font family for a cell.
Sets the font style to italic for a cell.
Sets the font name for a cell.
Sets the font scheme for a cell.
Sets the font size for a cell.
Sets the font strikethrough property for a cell.
Sets the font underline style for a cell.
Functions
Gets the bold state for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, is_bold}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, is_bold} = UmyaSpreadsheet.FontFunctions.get_font_bold(spreadsheet, "Sheet1", "A1")
Gets the font color for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, font_color}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, font_color} = UmyaSpreadsheet.FontFunctions.get_font_color(spreadsheet, "Sheet1", "A1")
Gets the font family for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, font_family}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, font_family} = UmyaSpreadsheet.FontFunctions.get_font_family(spreadsheet, "Sheet1", "A1")
Gets the italic state for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, is_italic}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, is_italic} = UmyaSpreadsheet.FontFunctions.get_font_italic(spreadsheet, "Sheet1", "A1")
Gets the font name for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, font_name}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, font_name} = UmyaSpreadsheet.FontFunctions.get_font_name(spreadsheet, "Sheet1", "A1")
Gets the font scheme for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, font_scheme}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, font_scheme} = UmyaSpreadsheet.FontFunctions.get_font_scheme(spreadsheet, "Sheet1", "A1")
Gets the font size for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, font_size}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, font_size} = UmyaSpreadsheet.FontFunctions.get_font_size(spreadsheet, "Sheet1", "A1")
Gets the strikethrough state for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, is_strikethrough}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, is_strikethrough} = UmyaSpreadsheet.FontFunctions.get_font_strikethrough(spreadsheet, "Sheet1", "A1")
Gets the underline style for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")
Returns
{:ok, underline_style}
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
{:ok, underline_style} = UmyaSpreadsheet.FontFunctions.get_font_underline(spreadsheet, "Sheet1", "A1")
Sets the font weight (bold) for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")is_bold
- Boolean indicating whether the font should be bold
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_bold(spreadsheet, "Sheet1", "A1", true)
Sets the font color for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")color
- The color code (e.g., "#FF0000" for red)
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
# Set text to red
:ok = UmyaSpreadsheet.FontFunctions.set_font_color(spreadsheet, "Sheet1", "A1", "#FF0000")
Sets the font family for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")font_family
- The font family: "roman" (serif), "swiss" (sans-serif), "modern" (monospace), "script", or "decorative"
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_family(spreadsheet, "Sheet1", "A1", "swiss")
Sets the font style to italic for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")is_italic
- Boolean indicating whether the font should be italic
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_italic(spreadsheet, "Sheet1", "A1", true)
Sets the font name for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")font_name
- The name of the font
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_name(spreadsheet, "Sheet1", "A1", "Arial")
Sets the font scheme for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")font_scheme
- The font scheme: "major", "minor", or "none"
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_scheme(spreadsheet, "Sheet1", "A1", "major")
Sets the font size for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")size
- The font size in points
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_size(spreadsheet, "Sheet1", "A1", 14)
Sets the font strikethrough property for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")is_strikethrough
- Boolean indicating whether the font should have strikethrough
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_strikethrough(spreadsheet, "Sheet1", "A1", true)
Sets the font underline style for a cell.
Parameters
spreadsheet
- The spreadsheet structsheet_name
- The name of the sheetcell_address
- The cell address (e.g., "A1", "B5")underline_style
- The underline style ("single", "double", "none")
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.FontFunctions.set_font_underline(spreadsheet, "Sheet1", "A1", "single")