@@ -12,23 +12,19 @@ import Foundation
1212///
1313/// The system resolves a font's value at the time it uses the font in a given
1414/// environment because ``Font`` is a late-binding token.
15- public struct Font : Equatable , Hashable , Sendable {
15+ public struct Font : Sendable {
1616
1717 // private var library: FT_Library?
1818
1919 /// The provider of the font.
20- let provider : AnyFontBox
20+ let provider : AnyFontProvider
2121
2222 /// Creates a font with the given provider.
2323 ///
2424 /// - Parameter provider: The provider of the font.
25- private init ( provider: AnyFontBox ) {
25+ private init ( provider: AnyFontProvider ) {
2626 self . provider = provider
2727 }
28-
29- public static func == ( lhs: Font , rhs: Font ) -> Bool {
30- lhs. provider == rhs. provider
31- }
3228}
3329
3430extension Font {
@@ -228,20 +224,20 @@ extension Font {
228224 /// For fonts created from text styles, it could mean applying emphasized
229225 /// styling, which does not necessarily mean the bold weight specifically,
230226 /// so this modifier is not to be confused with
231- /// <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight(_:)>.
227+ /// <doc://com.apple.documentation/documentation/SwiftUI /Font/weight(_:)>.
232228 ///
233229 /// For example:
234230 ///
235231 /// Font.body.bold()
236232 ///
237233 /// will most likely get you the emphasized version of body text style,
238- /// which is often in <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight/semibold>
234+ /// which is often in <doc://com.apple.documentation/documentation/SwiftUI /Font/weight/semibold>
239235 /// weight. While
240236 ///
241237 /// Font.body.weight(.bold)
242238 ///
243239 /// will specifically get you the body text style font in the
244- /// <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight/bold>
240+ /// <doc://com.apple.documentation/documentation/SwiftUI /Font/weight/bold>
245241 /// weight.
246242 public func bold( ) -> Font {
247243 . init( provider: StaticModifierProvider ( base: provider, modifier: BoldModifier ( true ) ) )
@@ -252,20 +248,20 @@ extension Font {
252248 /// For fonts created from text styles, passing `true` could mean applying
253249 /// emphasized styling, which does not necessarily mean the bold weight
254250 /// specifically, so this modifier is not to be confused with
255- /// <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight(_:)>.
251+ /// <doc://com.apple.documentation/documentation/SwiftUI /Font/weight(_:)>.
256252 ///
257253 /// For example:
258254 ///
259255 /// Font.body.bold(true)
260256 ///
261257 /// will most likely get you the emphasized version of body text style,
262- /// which is often in <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight/semibold>
258+ /// which is often in <doc://com.apple.documentation/documentation/SwiftUI /Font/weight/semibold>
263259 /// weight. While
264260 ///
265261 /// Font.body.weight(.bold)
266262 ///
267263 /// will specifically get you the body text style font in the
268- /// <doc://com.apple.documentation/documentation/OpenSwiftUI /Font/weight/bold>
264+ /// <doc://com.apple.documentation/documentation/SwiftUI /Font/weight/bold>
269265 /// weight.
270266 ///
271267 /// Using:
@@ -281,7 +277,7 @@ extension Font {
281277
282278 /// Returns a fixed-width font from the same family as the base font.
283279 ///
284- /// If there's no suitable font face in the same family, OpenSwiftUI
280+ /// If there's no suitable font face in the same family, SwiftUI
285281 /// returns a default fixed-width font.
286282 ///
287283 /// The following example adds the `monospaced()` modifier to the default
@@ -304,7 +300,7 @@ extension Font {
304300 /// 
306302 ///
307- /// OpenSwiftUI may provide different fixed-width replacements for standard
303+ /// SwiftUI may provide different fixed-width replacements for standard
308304 /// user interface fonts (such as ``Font/title``, or a system font created
309305 /// with ``Font/system(_:design:)``) than for those same fonts when created
310306 /// by name with ``Font/custom(_:size:)``.
@@ -329,7 +325,7 @@ extension Font {
329325 /// Returns a font adding or removing fixed-width design from the same
330326 /// family as the base font.
331327 ///
332- /// If there's no suitable font face in the same family, OpenSwiftUI
328+ /// If there's no suitable font face in the same family, SwiftUI
333329 /// returns a default font.
334330 ///
335331 /// The following example adds the `monospaced()` modifier to the default
@@ -352,7 +348,7 @@ extension Font {
352348 /// 
354350 ///
355- /// OpenSwiftUI may provide different fixed-width replacements for standard
351+ /// SwiftUI may provide different fixed-width replacements for standard
356352 /// user interface fonts (such as ``Font/title``, or a system font created
357353 /// with ``Font/system(_:design:)``) than for those same fonts when created
358354 /// by name with ``Font/custom(_:size:)``.
@@ -407,13 +403,13 @@ extension Font {
407403
408404extension Font {
409405
410- /// The effective OpenSwiftUI font used in any given environment.
406+ /// The effective SwiftUI font used in any given environment.
411407 ///
412408 /// The font specified by environment, preferring first any developer
413409 /// spedified font, via ``EnvironmentValues/font``, then any framework
414- /// specified font, and finally the default OpenSwiftUI font.
410+ /// specified font, and finally the default SwiftUI font.
415411 public static var `default` : Font {
416- Font . system ( size : 16 )
412+ fatalError ( " not implemented yet " )
417413 }
418414}
419415
@@ -465,4 +461,11 @@ extension Font {
465461 public static func system( size: Double , weight: Font . Weight ? = nil , design: Font . Design ? = nil ) -> Font {
466462 . init( provider: SystemProvider ( size: size, weight: weight, design: design, textStyle: . body, maximumSize: nil ) )
467463 }
464+ }
465+
466+ extension Font : Equatable {
467+
468+ public static func == ( lhs: Font , rhs: Font ) -> Bool {
469+ ObjectIdentifier ( lhs. provider) == ObjectIdentifier ( rhs. provider)
470+ }
468471}
0 commit comments