跳转至

ui/core/token/typography/cfmaterial_typography_token_literals.h

Material Design 3 Typography Token String Literals. More...

Namespaces

Name
cf
cf::ui
cf::ui::core
cf::ui::core::token
cf::ui::core::token::literals

Detailed Description

Material Design 3 Typography Token String Literals.

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-26

Copyright: Copyright © 2026

Compile-time string constants for Material Design 3 typography tokens. These literals are used throughout the typography system to ensure consistency and avoid string duplication.

Source code

#pragma once

#include <cstdint>

namespace cf::ui::core::token::literals {

// =============================================================================
// Display Typography Token Literals
// =============================================================================

inline constexpr const char TYPOGRAPHY_DISPLAY_LARGE[] = "md.typography.displayLarge";

inline constexpr const char TYPOGRAPHY_DISPLAY_MEDIUM[] = "md.typography.displayMedium";

inline constexpr const char TYPOGRAPHY_DISPLAY_SMALL[] = "md.typography.displaySmall";

// =============================================================================
// Headline Typography Token Literals
// =============================================================================

inline constexpr const char TYPOGRAPHY_HEADLINE_LARGE[] = "md.typography.headlineLarge";

inline constexpr const char TYPOGRAPHY_HEADLINE_MEDIUM[] = "md.typography.headlineMedium";

inline constexpr const char TYPOGRAPHY_HEADLINE_SMALL[] = "md.typography.headlineSmall";

// =============================================================================
// Title Typography Token Literals
// =============================================================================

inline constexpr const char TYPOGRAPHY_TITLE_LARGE[] = "md.typography.titleLarge";

inline constexpr const char TYPOGRAPHY_TITLE_MEDIUM[] = "md.typography.titleMedium";

inline constexpr const char TYPOGRAPHY_TITLE_SMALL[] = "md.typography.titleSmall";

// =============================================================================
// Body Typography Token Literals
// =============================================================================

inline constexpr const char TYPOGRAPHY_BODY_LARGE[] = "md.typography.bodyLarge";

inline constexpr const char TYPOGRAPHY_BODY_MEDIUM[] = "md.typography.bodyMedium";

inline constexpr const char TYPOGRAPHY_BODY_SMALL[] = "md.typography.bodySmall";

// =============================================================================
// Label Typography Token Literals
// =============================================================================

inline constexpr const char TYPOGRAPHY_LABEL_LARGE[] = "md.typography.labelLarge";

inline constexpr const char TYPOGRAPHY_LABEL_MEDIUM[] = "md.typography.labelMedium";

inline constexpr const char TYPOGRAPHY_LABEL_SMALL[] = "md.typography.labelSmall";

// =============================================================================
// Line Height Token Literals
// =============================================================================

inline constexpr const char LINEHEIGHT_DISPLAY_LARGE[] = "md.lineHeight.displayLarge";

inline constexpr const char LINEHEIGHT_DISPLAY_MEDIUM[] = "md.lineHeight.displayMedium";

inline constexpr const char LINEHEIGHT_DISPLAY_SMALL[] = "md.lineHeight.displaySmall";

inline constexpr const char LINEHEIGHT_HEADLINE_LARGE[] = "md.lineHeight.headlineLarge";

inline constexpr const char LINEHEIGHT_HEADLINE_MEDIUM[] = "md.lineHeight.headlineMedium";

inline constexpr const char LINEHEIGHT_HEADLINE_SMALL[] = "md.lineHeight.headlineSmall";

inline constexpr const char LINEHEIGHT_TITLE_LARGE[] = "md.lineHeight.titleLarge";

inline constexpr const char LINEHEIGHT_TITLE_MEDIUM[] = "md.lineHeight.titleMedium";

inline constexpr const char LINEHEIGHT_TITLE_SMALL[] = "md.lineHeight.titleSmall";

inline constexpr const char LINEHEIGHT_BODY_LARGE[] = "md.lineHeight.bodyLarge";

inline constexpr const char LINEHEIGHT_BODY_MEDIUM[] = "md.lineHeight.bodyMedium";

inline constexpr const char LINEHEIGHT_BODY_SMALL[] = "md.lineHeight.bodySmall";

inline constexpr const char LINEHEIGHT_LABEL_LARGE[] = "md.lineHeight.labelLarge";

inline constexpr const char LINEHEIGHT_LABEL_MEDIUM[] = "md.lineHeight.labelMedium";

inline constexpr const char LINEHEIGHT_LABEL_SMALL[] = "md.lineHeight.labelSmall";

// =============================================================================
// All Tokens Array (for iteration)
// =============================================================================

inline constexpr const char* const ALL_TYPOGRAPHY_TOKENS[] = {
    // Display
    TYPOGRAPHY_DISPLAY_LARGE, TYPOGRAPHY_DISPLAY_MEDIUM, TYPOGRAPHY_DISPLAY_SMALL,
    // Headline
    TYPOGRAPHY_HEADLINE_LARGE, TYPOGRAPHY_HEADLINE_MEDIUM, TYPOGRAPHY_HEADLINE_SMALL,
    // Title
    TYPOGRAPHY_TITLE_LARGE, TYPOGRAPHY_TITLE_MEDIUM, TYPOGRAPHY_TITLE_SMALL,
    // Body
    TYPOGRAPHY_BODY_LARGE, TYPOGRAPHY_BODY_MEDIUM, TYPOGRAPHY_BODY_SMALL,
    // Label
    TYPOGRAPHY_LABEL_LARGE, TYPOGRAPHY_LABEL_MEDIUM, TYPOGRAPHY_LABEL_SMALL};

inline constexpr const char* const ALL_LINEHEIGHT_TOKENS[] = {
    // Display
    LINEHEIGHT_DISPLAY_LARGE, LINEHEIGHT_DISPLAY_MEDIUM, LINEHEIGHT_DISPLAY_SMALL,
    // Headline
    LINEHEIGHT_HEADLINE_LARGE, LINEHEIGHT_HEADLINE_MEDIUM, LINEHEIGHT_HEADLINE_SMALL,
    // Title
    LINEHEIGHT_TITLE_LARGE, LINEHEIGHT_TITLE_MEDIUM, LINEHEIGHT_TITLE_SMALL,
    // Body
    LINEHEIGHT_BODY_LARGE, LINEHEIGHT_BODY_MEDIUM, LINEHEIGHT_BODY_SMALL,
    // Label
    LINEHEIGHT_LABEL_LARGE, LINEHEIGHT_LABEL_MEDIUM, LINEHEIGHT_LABEL_SMALL};

inline constexpr size_t TYPOGRAPHY_TOKEN_COUNT = 15;

inline constexpr size_t LINEHEIGHT_TOKEN_COUNT = 15;

} // namespace cf::ui::core::token::literals

Updated on 2026-03-09 at 10:14:01 +0000