Skip to content

Commit

Permalink
doc: update example (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lie-yan committed Apr 20, 2024
1 parent d43ca3d commit 11ce5d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Access to `MATH` table is fully supported.
```swift
do {
let helvetica = CTFontCreateWithName("Helvetica" as CFString, 12.0, nil)
let mathData = helvetica.createCachedMathData()
if !mathData.hasData() {
let mathTable = helvetica.createCachedMathTable()
if !mathTable.hasData() {
print("no MATH table")
}
}

do {
let lmmath = CTFontCreateWithName("Latin Modern Math" as CFString, 12.0, nil)
let mathData = lmmath.createCachedMathData()
print("axis height, in design units: \(mathData.getConstant(.axisHeight))")
let mathTable = lmmath.createCachedMathTable()
print("axis height, in design units: \(mathTable.getConstant(.axisHeight))")
}
```

Expand Down

0 comments on commit 11ce5d9

Please sign in to comment.