Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSTextField fails to render New Tai Lue in a NSTabViewController

Tags:

macos

cocoa

fonts

Apple's NSTextField and NSTextView, and even the TextEdit application is able to detect and use special fonts for New Tai Lue characters such as ᦀᦐᦑᦁ - Once the characters are detected the string / part of the string is rendered using the Noto Sans New Tai Lue font, or Helvetica Neue (On OS X 10.11)

Unfortunately the system font (Apple's San Fransisco) is unable to render the label if is placed inside one of the tabs in a NSTabViewController

New Tai Lue support is a requirement for the Chinese GB 18030 government standard

Below is the Storyboard code which reproduces the problem, and also illustrates how it's not a problem in Helvetica Neue. Replace the Main.storyboard in a sample app with this code to see the problem.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="gAs-9S-689">
    <dependencies>
        <deployment identifier="macosx"/>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
        <capability name="stacking Non-gravity area distributions on NSStackView" minToolsVersion="7.0" minSystemVersion="10.11"/>
    </dependencies>
    <scenes>
        <!--Window Controller-->
        <scene sceneID="wme-sq-rO2">
            <objects>
                <customObject id="OcQ-dx-Qcl" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
                <windowController showSeguePresentationStyle="single" id="gAs-9S-689" sceneMemberID="viewController">
                    <window key="window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="eeb-fj-fEf" customClass="NSPanel">
                        <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
                        <rect key="contentRect" x="425" y="0.0" width="480" height="270"/>
                        <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
                    </window>
                    <connections>
                        <segue destination="dTb-iK-pp7" kind="relationship" relationship="window.shadowedContentViewController" id="guv-gU-4Rk"/>
                    </connections>
                </windowController>
            </objects>
            <point key="canvasLocation" x="117" y="102"/>
        </scene>
        <!--Tab View Controller-->
        <scene sceneID="0yz-G7-5qk">
            <objects>
                <tabViewController selectedTabViewItemIndex="0" tabStyle="toolbar" id="dTb-iK-pp7" sceneMemberID="viewController">
                    <tabViewItems>
                        <tabViewItem identifier="" id="iID-PM-Tm3" userLabel="Debug Tab View Item"/>
                    </tabViewItems>
                    <viewControllerTransitionOptions key="transitionOptions"/>
                    <tabView key="tabView" type="noTabsNoBorder" id="mma-f0-sta">
                        <rect key="frame" x="0.0" y="0.0" width="467" height="300"/>
                        <autoresizingMask key="autoresizingMask"/>
                        <font key="font" metaFont="message"/>
                        <tabViewItems/>
                        <connections>
                            <outlet property="delegate" destination="dTb-iK-pp7" id="4Es-TA-rVr"/>
                        </connections>
                    </tabView>
                    <connections>
                        <outlet property="debugTabItemView" destination="iID-PM-Tm3" id="6Et-PM-Q3z"/>
                        <segue destination="dxy-Yn-i28" kind="relationship" relationship="tabItems" id="AC0-xw-WVl"/>
                    </connections>
                </tabViewController>
                <customObject id="KDj-aN-t0B" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="211" y="545"/>
        </scene>
        <!--Debug View Controller-->
        <scene sceneID="uZa-Jc-edu">
            <objects>
                <viewController id="dxy-Yn-i28" userLabel="Debug View Controller" customClass="DebugViewController" customModule="NewTaiLue" customModuleProvider="target" sceneMemberID="viewController">
                    <view key="view" id="gqP-Df-xL9">
                        <rect key="frame" x="0.0" y="0.0" width="450" height="100"/>
                        <autoresizingMask key="autoresizingMask"/>
                        <subviews>
                            <stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5cM-le-1O0">
                                <rect key="frame" x="151" y="41" width="147" height="44"/>
                                <subviews>
                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="J0h-Jz-L33">
                                        <rect key="frame" x="-2" y="27" width="151" height="17"/>
                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="System Regular: ᦀᦐᦑᦁ" id="AOD-Mp-Pqf">
                                            <font key="font" metaFont="system"/>
                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                                        </textFieldCell>
                                    </textField>
                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AtH-gl-fNJ">
                                        <rect key="frame" x="-2" y="0.0" width="144" height="19"/>
                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Helvetica Neue: ᦀᦐᦑᦁ" id="g3K-HT-4ux">
                                            <font key="font" size="13" name="HelveticaNeue"/>
                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                                        </textFieldCell>
                                    </textField>
                                </subviews>
                                <visibilityPriorities>
                                    <integer value="1000"/>
                                    <integer value="1000"/>
                                </visibilityPriorities>
                                <customSpacing>
                                    <real value="3.4028234663852886e+38"/>
                                    <real value="3.4028234663852886e+38"/>
                                </customSpacing>
                            </stackView>
                        </subviews>
                        <constraints>
                            <constraint firstItem="5cM-le-1O0" firstAttribute="centerX" secondItem="gqP-Df-xL9" secondAttribute="centerX" id="6UO-7V-O0y"/>
                            <constraint firstItem="5cM-le-1O0" firstAttribute="top" secondItem="gqP-Df-xL9" secondAttribute="top" constant="15" id="KqN-Ej-1EC"/>
                            <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="5cM-le-1O0" secondAttribute="bottom" constant="15" id="uLl-a1-LA2"/>
                        </constraints>
                    </view>
                </viewController>
                <customObject id="fm7-yt-7T9" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
                <customObject id="FeH-Cm-LSF" customClass="Preferences" customModule="NewTaiLue" customModuleProvider="target"/>
                <userDefaultsController representsSharedInstance="YES" id="noL-bh-qcN"/>
            </objects>
            <point key="canvasLocation" x="935" y="214"/>
        </scene>
    </scenes>
</document>
like image 366
Claus Jørgensen Avatar asked Nov 24 '25 17:11

Claus Jørgensen


1 Answers

Apple have fixed this issue in MacOS 10.12 (Sierra)

like image 180
Claus Jørgensen Avatar answered Nov 27 '25 13:11

Claus Jørgensen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!