Skip to content

Commit 324c80a

Browse files
committed
Demo for verticalGlyphForm attribute; doesn't seem to do anything??
1 parent f57548a commit 324c80a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Demo macOS/Base.lproj/Main.storyboard

+12
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,27 @@
694694
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
695695
</textFieldCell>
696696
</textField>
697+
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tiJ-ag-Oyn">
698+
<rect key="frame" x="18" y="208" width="444" height="17"/>
699+
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Multiline Label" id="5Qq-Fr-LC0">
700+
<font key="font" metaFont="system"/>
701+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
702+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
703+
</textFieldCell>
704+
</textField>
697705
</subviews>
698706
<constraints>
699707
<constraint firstItem="eOJ-s0-hRz" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" constant="20" id="4Hz-3R-lVc"/>
700708
<constraint firstAttribute="trailing" secondItem="eOJ-s0-hRz" secondAttribute="trailing" constant="20" id="6Db-v4-AP0"/>
709+
<constraint firstAttribute="trailing" secondItem="tiJ-ag-Oyn" secondAttribute="trailing" constant="20" id="ach-rw-vF5"/>
710+
<constraint firstItem="tiJ-ag-Oyn" firstAttribute="top" secondItem="eOJ-s0-hRz" secondAttribute="bottom" constant="8" id="eqD-DH-kFx"/>
701711
<constraint firstItem="eOJ-s0-hRz" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="20" id="jpW-Oo-N85"/>
712+
<constraint firstItem="tiJ-ag-Oyn" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="20" id="kFY-b8-ezZ"/>
702713
</constraints>
703714
</view>
704715
<connections>
705716
<outlet property="label1" destination="eOJ-s0-hRz" id="SRa-YS-NFC"/>
717+
<outlet property="label2" destination="tiJ-ag-Oyn" id="F6d-aH-bFp"/>
706718
</connections>
707719
</viewController>
708720
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>

Demo macOS/ViewController.swift

+4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ import RichString
66
class ViewController: NSViewController {
77

88
@IBOutlet weak var label1: NSTextField!
9+
@IBOutlet weak var label2: NSTextField!
910

1011
override func viewWillAppear() {
1112
super.viewWillAppear()
1213
if let text1 = "This is some text"
1314
.fontSize(17)?.color(.blue).strikeThrough(style: .styleDouble) {
1415
label1.attributedStringValue = text1
1516
}
17+
18+
let text2 = "This is some text".verticalGlyphForm(1)
19+
label2.attributedStringValue = text2
1620
}
1721
}

0 commit comments

Comments
 (0)