Skip to main content
Version: Next

Typography

ChatTypography class manages fonts and text styles throughout the chat interface.

Text Styles

PropertyDescriptionDefault
titleScreen titles, section headersSystem Bold, 24pt
headlineImportant text, category namesSystem Semibold, 18pt
bodyMain body text, message contentSystem Regular, 16pt
captionTime stamps, auxiliary infoSystem Regular, 12pt
buttonButton textSystem Semibold, 16pt

Message Styles

PropertyDescription
messageMessage text
messageTimeMessage timestamp
messageSenderSender name

Usage Example

let typography = ChatTypography()

// Customize fonts
typography.title = UIFont.boldSystemFont(ofSize: 28)
typography.body = UIFont.systemFont(ofSize: 17)
typography.caption = UIFont.systemFont(ofSize: 13)

// Message-specific fonts
typography.message = UIFont.systemFont(ofSize: 16)
typography.messageTime = UIFont.systemFont(ofSize: 11)

// Create theme with customized typography
let components = ChatComponents(typography: typography)
let theme = ChatTheme(components: components)

chatCenterSDK.theme = theme

Custom Fonts

To use custom fonts, register them in your app's Info.plist and apply:

let typography = ChatTypography()

// Apply custom font family
typography.title = UIFont(name: "YourCustomFont-Bold", size: 24)!
typography.body = UIFont(name: "YourCustomFont-Regular", size: 16)!
typography.caption = UIFont(name: "YourCustomFont-Light", size: 12)!

let theme = ChatTheme(components: ChatComponents(typography: typography))
note

Ensure custom fonts are properly registered in your application and available at SDK initialization time.