AgentforceTypography

object AgentforceTypography : Typography

The Agentforce type scale: a set of 23 text styles covering every text element the SDK draws, extending the Salesforce SharedUI Typography base class. AgentforceTypography.Default is the ready-made instance — start from it rather than constructing your own.

Declared in package com.salesforce.android.agentforcesdk.components.theme.

Properties

Property Type Description
bodyFontScale1Regular TextStyle Body text style at scale 1, regular weight
bodyFontScale1Semibold TextStyle Body text style at scale 1, semibold weight
bodyFontScale2Regular TextStyle Body text style at scale 2, regular weight
bodyFontScale2Semibold TextStyle Body text style at scale 2, semibold weight
bodyFontScaleBaseRegular TextStyle Base body text style, regular weight
bodyFontScaleBaseSemibold TextStyle Base body text style, semibold weight
bodyFontScaleNeg1Regular TextStyle Body text style at negative scale 1, regular weight
titlesFontScale3Regular TextStyle Title text style at scale 3, regular weight
titlesFontScale3Semibold TextStyle Title text style at scale 3, semibold weight
titlesFontScale4Regular TextStyle Title text style at scale 4, regular weight
titlesFontScale4Semibold TextStyle Title text style at scale 4, semibold weight
titlesFontScale5Regular TextStyle Title text style at scale 5, regular weight

This table lists the styles most commonly overridden. The full type scale has 23 styles — see the SDK source or ask the Android team for the complete list before publishing.

Set a font family for the whole scale

copyWithFontFamily(...) returns a new Typography with every style set to the given font family, leaving weight, size, and line height untouched.

import androidx.compose.ui.text.font.FontFamily
import com.salesforce.android.agentforcesdk.components.theme.AgentforceTypography

val brandFont = FontFamily(/* your Font(...) resources */)
val typography = AgentforceTypography.Default.copyWithFontFamily(brandFont)

Override individual styles

To change the weight, size, or line height of specific styles rather than the whole scale, derive from AgentforceTypography.Default and apply mergeWith(...), which returns a new Typography with only the given styles replaced:

import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.sp
import com.salesforce.android.agentforcesdk.components.theme.AgentforceTypography

val typography = AgentforceTypography.Default.mergeWith(
    bodyFontScale1Regular = TextStyle(fontSize = 16.sp, lineHeight = 22.sp),
)

Pass the result into createCustomAgentforceThemeManager(typography = typography), or set it on AgentforceThemeOverrides if you're overriding through AgentforceTheming.Overrides.

See also