Skip to content

Complete Text view implementation #504

@Kyle-Ye

Description

@Kyle-Ye

Description

The Text view exists in OpenSwiftUI but is currently in a TODO state with incomplete implementation. Text is one of the most fundamental views in SwiftUI for displaying strings.

API Reference

SwiftUI's Text: https://developer.apple.com/documentation/swiftui/text

Expected API

struct Text: View {
    init(_ content: String)
    init(_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle? = nil, comment: StaticString? = nil)
    init(verbatim content: String)
    
    // Modifiers
    func font(_ font: Font?) -> Text
    func fontWeight(_ weight: Font.Weight?) -> Text
    func foregroundColor(_ color: Color?) -> Text
    func bold() -> Text
    func italic() -> Text
    func strikethrough(_ active: Bool = true, color: Color? = nil) -> Text
    func underline(_ active: Bool = true, color: Color? = nil) -> Text
    func kerning(_ kerning: CGFloat) -> Text
    func tracking(_ tracking: CGFloat) -> Text
    func baselineOffset(_ offset: CGFloat) -> Text
}

Current Status

  • Basic Text structure exists in: Sources/OpenSwiftUICore/Text/Text/TODO/Text.swift
  • Needs complete implementation with all standard modifiers

Use Case

Essential for displaying any text content in the UI. Currently commented out in multiple example files.

References

  • Example usage commented out in: Example/SharedExample/Animation/Timeline/AnimatedColorTimelineView.swift
  • Current TODO implementation: Sources/OpenSwiftUICore/Text/Text/TODO/Text.swift

Priority

Critical - Cannot build most UIs without Text view

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Top priorityenhancementNew feature or requesthelp wantedPR contribution is appreciated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions