Typography
ChatTypography class manages fonts and text styles throughout the chat interface.
Text Styles
| Property | Description | Default |
|---|---|---|
title | Screen titles, section headers | System Bold, 24pt |
headline | Important text, category names | System Semibold, 18pt |
body | Main body text, message content | System Regular, 16pt |
caption | Time stamps, auxiliary info | System Regular, 12pt |
button | Button text | System Semibold, 16pt |
Message Styles
| Property | Description |
|---|---|
message | Message text |
messageTime | Message timestamp |
messageSender | Sender 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.