---
title: "font_modify"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/filter/font-modify'
  md: 'https://developer.shopline.com/docs/sline/filter/font-modify.md'
---

# font_modify


    Modifies the specified property of a font object and returns a new font object.

    Supported properties and valid values are as follows:
| **Property** | **Valid values** | **Description** |  
|-------------|----------------|----------------|  
| **`style`** | `"normal"` | Converts the font to its regular (non-italic) variant. |  
|  | `"italic"` | Converts the font to its italic variant (if available). |  
|  | `"oblique"` | Converts the font to its oblique variant (SHOPLINE fonts typically offer either italic or oblique, not both). |  
| **`weight`** | `100`–`900` (in 100-unit steps) | Adjusts the font weight to the specified value (example: `400` for normal, `700` for bold). |  
|  | `"normal"` | Shortcut for `weight: 400`. |  
|  | `"bold"` | Shortcut for `weight: 700`. |  
|  | `"+/-N"` (example: `"+200"`) | Increases/decreases the current weight by `N` (example: `400` → `600` with `"+200"`). |  
|  | `"lighter"` | Reduces the weight using CSS fallback rules (example: `700` → `400`). |  
|  | `"bolder"` | Increases the weight using CSS fallback rules (example: `400` → `700`). |  




    
`font | font_modify(key, value)` returns a [`font`](https://developer.shopline.com/docs/sline/object/font.md) object.
    



    
        ## Required params

        
            - `font` [`font`](https://developer.shopline.com/docs/sline/object/font.md)\: The given font object.
        
            - `key` `string`\: The property to be modified.
        
            - `value` `string`\: The new value for the property.
        
    





    
## Example

        
            

            

            

            
<SlineExample path={'/'} objects={ 
    [""] 
}>
```sline
Original weight: {{ settings.sort_title_font.weight }}

{{#var lighterFont = settings.sort_title_font | font_modify("weight", "lighter") /}}

h2 {
  font-weight: {{ lighterFont.weight }};
}

```
</SlineExample>
            
        
    
