Apple Text System User Interface Layer Programming Guide Manuel
Apple sur Fnac.com
- Pour voir la liste complète des manuels APPLE, cliquez ici
-->
ou juste avant la balise de fermeture -->
TELECHARGER LE PDF sur :
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextUILayer/TextUILayer.pdf
Commander un produit Apple sur Fnac.com
Voir également d'autres Guides et documentation APPLE :
Apple-InstrumentsUserGuide.pdf-manuel
Apple-Logic-Pro-9-TDM-Guide-manuel
Apple-macbook_air_users_guide.pdf-manuel
Apple-macbook_air-13-inch_mid-2012-qs_ta.pdf-manuel
Apple-AppStoreMarketingGuidelines-JP.pdf-Japon-manuel
Apple-macbook_pro_retina_qs_ta.pdf-manuel
Apple-ipad_user_guide_tu.pdf-manuel
Apple-ipad_user_guide_th.pdf-manuel
Apple-iphone_user_guide_gr.pdf-manuel
Apple-Nike_Plus_iPod_Sensor_UG_2A.pdf-manuel
Apple-ipad_manual_del_usuario.pdf-manuel
Apple-ipad_uzivatelska_prirucka.pdf-manuel
Apple-ipad_wifi_informations_importantes.pdf-manuel
Apple-Xsan_2_Admin_Guide_v2.3.pdf-manuel
Apple-macbook_pro-13-inch-late-2012-quick_start.pdf-manuel
Apple-CocoaDrawingGuide.pdf-manuel
Apple-Cryptographic-Services-Guide-manuel
Apple-Resource-Programming-Guide-manuel
AppleSafariVisualEffectsProgGuide.pdf-manuel
/Apple-WorkingWithUSB.pdf-manuel
Apple-macbook_pro-retina-mid-2012-important_product_info_f.pdf-manuel
Apple-iOS_Security_May12.pdf-manue
Apple-Mac-Pro-2008-Performance-and-Productivity-for-Creative-Pros
Apple-iPod_shuffle_4thgen_Manuale_utente.pdf-Italie-Manuel
Apple-KernelProgramming.pdf-manuel
Apple-Core-Data-Model-Versioning-and-Data-Migration-Programming-Guide-manuel
Apple-RED_Workflows_with_Final_Cut_Pro_X.pdf-manuel
Apple-Transitioning-to-ARC-Release-Notes-manuel
Apple-iTunes-Connect-Sales-and-Trends-Guide-manuel
Apple-App-Sandbox-Design-Guide-manuel
Apple-String-Programming-Guide-manuel
Apple-Secure-Coding-Guide-manuel
Apple_AirPort_Networks_Early2009.pdf-manuel
Apple-TimeCapsule_SetupGuide_TA.pdf-manuel
Apple-time_capsule_4th_gen_setup.pdf-manuel
Apple-TimeCapsule_SetupGuide.pdf-manuel
Apple-TimeCapsule_SetupGuide_CH.pdf-Chinois-manuel
Apple-CodeSigningGuide.pdf-manuel
Apple-ViewControllerPGforiOS.pdf-manuel
Apple-KeyValueObserving.pdf-manuel
Apple-mac_mini-late-2012-quick_start.pdf-manuel
Apple-OS-X-Mountain-Lion-Core-Technologies-Overview-June-2012-manuel
Apple-OS-X-Server-Product-Overview-June-2012-manuel
Apple-Apple_Server_Diagnostics_UG_109.pdf-manuel
Apple-PackageMaker_UserGuide.pdf-manuel
Apple-Instrumentos_y_efectos_de_Logic_Studio.pdf-Manuel
Apple-ipod_nano_kayttoopas.pdf-Finlande-Manuel
Apple_ProRes_White_Paper_October_2012.pdf-Manuel
Apple-wp_osx_configuration_profiles.pdf-Manuel
Apple-UsingiTunesProducerFreeBooks.pdf-Manuel
Apple-ipad_manual_do_usuario.pdf-Portugais-Manuel
Apple-Instruments_et_effets_Logic_Studio.pdf-Manuel
Apple-ipod_touch_gebruikershandleiding.pdf-Neerlandais-Manuel
AppleiPod_shuffle_4thgen_Manual_del_usuario.pdf-Espagnol-Manuel
Apple-Premiers-contacts-avec-votre-PowerBook-G4-Manuel
Apple_Composite_AV_Cable.pdf-Manuel
Apple-iPod_shuffle_3rdGen_UG_DK.pdf-Danemark-Manuel
Apple-iPod_classic_160GB_Benutzerhandbuch.pdf-Allemand-Manuel
Apple-VoiceOver_GettingStarted-Manuel
Apple-iPod_touch_2.2_Benutzerhandbuch.pdf-Allemand-Manuel
Apple-Apple_TV_Opstillingsvejledning.pdf-Allemand-Manuel
Apple-iPod_shuffle_4thgen_Manuale_utente.pdf-Italie-Manuel
Apple-iphone_prirucka_uzivatela.pdf-Manuel
Apple-Aan-de-slag-Neerlandais-Manuel
Apple-airmac_express-80211n-2nd-gen_setup_guide.pdf-Thailande-Manuel
Apple-ipod_nano_benutzerhandbuch.pdf-Allemand-Manuel
Apple-aperture3.4_101.pdf-Manuel
Apple-Pages09_Anvandarhandbok.pdf-Manuel
Apple-nike_plus_ipod_sensor_ug_la.pdf-Mexique-Manuel
Apple-ResEdit-Reference-For-ResEdit02.1-Manuel
Apple-ipad_guide_de_l_utilisateur.pdf-Manuel
Apple-Compressor-4-Benutzerhandbuch-Allemand-Manuel
Apple-AirPort_Networks_Early2009_DK.pdf-Danemark-Manuel
Apple-MacBook_Pro_Mid2007_2.4_2.2GHz_F.pdf-Manuel
Apple-MacBook_13inch_Mid2010_UG_F.pdf-Manuel
Apple-Xserve-RAID-Presentation-technologique-Janvier-2004-Manuel
Apple-MacBook_Pro_15inch_Mid2010_F.pdf-Manuel
Apple-AirPort_Express-opstillingsvejledning.pdf-Danemark-Manuel
Apple-DEiPod_photo_Benutzerhandbuch_DE0190269.pdf-Allemand-Manuel
Apple-Final-Cut-Pro-X-Logic-Effects-Reference-Manuel
Apple-iPod_touch_2.1_Brugerhandbog.pdf-Danemark-Manuel
Apple-Remote-Desktop-Administratorhandbuch-Version-3.1-Allemand-Manuel
Apple-Qmaster-4-User-Manual-Manuel
Apple-Server_Administration_v10.5.pdf-Manuel
Apple-ipod_classic_features_guide.pdf-Manuel
Apple-iPhone_Finger_Tips_Guide.pdf-Anglais-Manuel
Apple-Boitier-de-l-ordinateur-Manuel
Apple-Guide_de_configuration_de_l_Airport_Express_5.1.pdf-Manuel
Apple-iMac_Mid2010_UG_F.pdf-Manuel
Apple-MacBook_13inch_Mid2009_F.pdf-Manuel
Apple-MacBook_Mid2007_UserGuide.F.pdf-Manuel
Apple-Designing_AirPort_Networks_10.5-Windows_F.pdf-Manuel
Apple-Administration_de_QuickTime_Streaming_et_Broadcasting_10.5.pdf-Manuel
Apple-Opstillingsvejledning_til_TimeCapsule.pdf-Danemark-Manuel
Apple-iPod_nano_5th_gen_Benutzerhandbuch.pdf-Manuel
Apple-AirPort_Extreme_Installationshandbuch.pdf-Manuel
Apple-Final_Cut_Express_4_Installation_de_votre_logiciel.pdf-Manuel
Apple-MacBook_Pro_15inch_2.53GHz_Mid2009.pdf-Manuel
Apple-Network_Services.pdf-Manuel
Apple-Aperture_Performing_Adjustments_f.pdf-Manuel
Apple-Supplement_au_guide_Premiers_contacts.pdf-Manuel
Apple-Administration_des_images_systeme_et_de_la_mise_a_jour_de_logiciels_10.5.pdf-Manuel
Apple-Mac_OSX_Server_v10.6_Premiers_contacts.pdf-Francais-Manuel
Apple-Designing_AirPort_Networks_10.5-Windows_F.pdf-Manuel
Apple-Mise_a_niveau_et_migration_v10.5.pdf-Manue
Apple-MacBookPro_Late_2007_2.4_2.2GHz_F.pdf-Manuel
Apple-Mac_mini_Late2009_SL_Server_F.pdf-Manuel
Apple-Mac_OS_X_Server_10.5_Premiers_contacts.pdf-Manuel
Apple-iPod_touch_2.0_Guide_de_l_utilisateur_CA.pdf-Manuel
Apple-MacBook_Pro_17inch_Mid2010_F.pdf-Manuel
Apple-Comment_demarrer_Leopard.pdf-Manuel
Apple-iPod_2ndGen_USB_Power_Adapter-FR.pdf-Manuel
Apple-Feuille_de_operations_10.4.pdf-Manuel
Apple-Time_Capsule_Installationshandbuch.pdf-Allemand-Manuel
Apple-F034-2262AXerve-grappe.pdf-Manuel
Apple-Mac_Pro_Early2009_4707_UG_F
Apple-imacg5_17inch_Power_Supply
Apple-Logic_Studio_Installieren_Ihrer_Software_Retail
Apple-Aperture_Getting_Started_d.pdf-Allemand
Apple-getting_started_with_passbook
Apple-iPod_mini_2nd_Gen_UserGuide.pdf-Anglais
Apple-Deploiement-d-iPhone-et-d-iPad-Reseaux-prives-virtuels
Apple-Mac_OS_X_Server_Glossaire_10.5
Apple-iphone_bluetooth_headset_userguide
Apple-Administration_des_services_reseau_10.5
Apple-iPod_nano_4th_gen_Manuale_utente
Apple-iBook-G4-Getting-Started
Apple-Guide_des_fonctionnalites_de_l_iPod_classic
Apple-Guide_de_configuration_d_Xsan_2
Apple-MacBook_Late2006_UsersGuide
Apple-Mac_mini_Mid2010_User_Guide_F.pdf-Francais
Apple-PowerBookG3UserManual.PDF.Anglais
Apple-Installation_de_votre_logiciel_Logic_Studio_Retail
Apple-Pages-Guide-de-l-utilisateur
Apple-MacBook_Pro_13inch_Mid2009.pdf.Anglais
Apple-MacBook_Pro_15inch_Mid2009
Apple-Installation_de_votre_logiciel_Logic_Studio_Upgrade
Apple-airportextreme_802.11n_userguide
Apple-iPod_classic_160GB_User_Guide
Apple-iPod_nano_5th_gen_UserGuide
Apple-ipod_touch_features_guide
Apple-Wireless_Mighty_Mouse_UG
Apple-Advanced-Memory-Management-Programming-Guide
Apple-iOS-App-Programming-Guide
Apple-Concurrency-Programming-Guide
Apple-MainStage-2-User-Manual-Anglais
Apple-iMacG3_2002MultilingualUserGuide
Apple-iBookG3_DualUSBUserGuideMultilingual.PDF.Anglais
Apple-Guide_de_l_utilisateur_de_Mac_Pro_Early_2008
Apple-Installation_de_votre_logiciel_Logic_Express_8
Apple-iMac_Guide_de_l_utilisateur_Mid2007
Apple-imacg5_20inch_OpticalDrive
Apple-FCP6_Formats_de_diffusion_et_formats_HD
Apple-prise_en_charge_des_surfaces_de_controle_logic_pro_8
Apple-Aperture_Quick_Reference_f
Apple-aluminumAppleKeyboard_wireless2007_UserGuide
Apple-ipod_shuffle_features_guide
ApplePowerMacG5_(Early_2005)_UserGuide
Apple-MacBook_Pro_Early_2008_Guide_de_l_utilisateur
Apple-Nouvelles-fonctionnalites-aperture-1.5
Apple-premiers_contacts_2e_ed_10.4.pdf-Mac-OS-X-Server
Apple-premiers_contacts_2e_ed_10.4
Apple-Keynote2_UserGuide.pdf-Japon
Apple-Welcome_to_Tiger.pdf-Japon
Apple-XsanAdminGuide_j.pdf-Japon
Apple-PowerBookG4_UG_15GE.PDF-Japon
Apple-Xsan_Migration.pdf-Japon
Apple-Xserve_Intel_DIY_TopCover_JA.pdf-Japon
Apple-iPod_nano_6thgen_User_Guide_J.pdf-Japon
Apple-Aperture_Photography_Fundamentals.pdf-Japon
Apple-nikeipod_users_guide.pdf-Japon
Apple-QuickTime71_UsersGuide.pdf-Japon
Apple-iMacG5_iSight_UG.pdf-Japon
Apple-Aperture_Performing_Adjustments_j.pdf-Japon
Apple-iMacG5_17inch_HardDrive.pdf-Japon
Apple-iPod_shuffle_Features_Guide_J.pdf-Japon
Apple-MacBook_Air_User_Guide.pdf-Japon
Apple-MacBook_UsersGuide.pdf-Japon
Apple-iPad_iOS4_Brukerhandbok.pdf-Norge-Norvege
Apple-Apple_AirPort_Networks_Early2009_H.pd-Norge-Norvege
Apple-iPod_classic_120GB_no.pdf-Norge-Norvege
Apple-Xserve_Intel_DIY_ExpansionCardRiser_JA.pdf-Japon
Apple-iMacG5_Battery.pdf-Japon
Apple-Logic_Pro_8_Getting_Started.pdf-Japon
Apple-PowerBook-handbok-Norge-Norveg
Apple-iWork09_formler_og_funksjoner.pdf-Norge-Norvege
Apple-MacBook_Pro_15inch_Mid2010_H.pdf-Norge-Norvege
Apple-MacPro_HardDrive_DIY.pdf-Japon
Apple-iPod_Fifth_Gen_Funksjonsoversikt.pdf-Norge-Norvege
Apple-MacBook_13inch_white_Early2009_H.pdf-Norge-Norvege
Apple-GarageBand_09_Komme_i_gang.pdf-Norge-Norvege
Apple-MacBook_Pro_15inch_Mid2009_H.pdf-Norge-Norvege
Apple-imac_mid2011_ug_h.pdf-Norge-Norvege
Apple-iDVD_08_Komme_i_gang.pdf-Norge-Norvege
Apple-MacBook_Air_11inch_Late2010_UG_H.pdf-Norge-Norvege
Apple-iMac_Mid2010_UG_H.pdf-Norge-Norvege
Apple-MacBook_13inch_Mid2009_H.pdf-Norge-Norvege
/Apple-iPhone_3G_Viktig_produktinformasjon_H-Norge-Norvege
Apple-MacBook_13inch_Mid2010_UG_H.pdf-Norge-Norvege
Apple-macbook_air_13inch_mid2011_ug_no.pdf-Norge-Norvege
Apple-Mac_mini_Early2009_UG_H.pdf-Norge-Norvege
Apple-ipad2_brukerhandbok.pdf-Norge-Norvege
Apple-iPhoto_08_Komme_i_gang.pdf-Norge-Norvege
Apple-MacBook_Air_Brukerhandbok_Late2008.pdf-Norge-Norvege
Apple-Pages09_Brukerhandbok.pdf-Norge-Norvege
Apple-MacBook_13inch_Late2009_UG_H.pdf-Norge-Norvege
Apple-iPhone_3GS_Viktig_produktinformasjon.pdf-Norge-Norvege
Apple-MacBook_13inch_Aluminum_Late2008_H.pdf-Norge-Norvege
Apple-Wireless_Keyboard_Aluminum_2007_H-Norge-Norvege
Apple-NiPod_photo_Brukerhandbok_N0190269.pdf-Norge-Norvege
Apple-MacBook_Pro_13inch_Mid2010_H.pdf-Norge-Norvege
Apple-MacBook_Pro_17inch_Mid2010_H.pdf-Norge-Norvege
Apple-Velkommen_til_Snow_Leopard.pdf-Norge-Norvege.htm
Apple-TimeCapsule_Klargjoringsoversikt.pdf-Norge-Norvege
Apple-iPhone_3GS_Hurtigstart.pdf-Norge-Norvege
Apple-Snow_Leopard_Installeringsinstruksjoner.pdf-Norge-Norvege
Apple-iMacG5_iSight_UG.pdf-Norge-Norvege
Apple-iPod_Handbok_S0342141.pdf-Norge-Norvege
Apple-ipad_brukerhandbok.pdf-Norge-Norvege
Apple-GE_Money_Bank_Handlekonto.pdf-Norge-Norvege
Apple-MacBook_Air_11inch_Late2010_UG_H.pdf-Norge-Norvege
Apple-iPod_nano_6thgen_Brukerhandbok.pdf-Norge-Norvege
Apple-iPod_touch_iOS4_Brukerhandbok.pdf-Norge-Norvege
Apple-MacBook_Air_13inch_Late2010_UG_H.pdf-Norge-Norvege
Apple-MacBook_Pro_15inch_Early2011_H.pdf-Norge-Norvege
Apple-Numbers09_Brukerhandbok.pdf-Norge-Norvege
Apple-Welcome_to_Leopard.pdf-Japon
Apple-PowerMacG5_UserGuide.pdf-Norge-Norvege
Apple-iPod_touch_2.1_Brukerhandbok.pdf-Norge-Norvege
Apple-Boot_Camp_Installering-klargjoring.pdf-Norge-Norvege
Apple-MacOSX10.3_Welcome.pdf-Norge-Norvege
Apple-iPod_shuffle_3rdGen_UG_H.pdf-Norge-Norvege
Apple-iPhone_4_Viktig_produktinformasjon.pdf-Norge-Norvege
Apple_TV_Klargjoringsoversikt.pdf-Norge-Norvege
Apple-iMovie_08_Komme_i_gang.pdf-Norge-Norvege
Apple-iPod_classic_160GB_Brukerhandbok.pdf-Norge-Norvege
Apple-Boot_Camp_Installering_10.6.pdf-Norge-Norvege
Apple-Network-Services-Location-Manager-Veiledning-for-nettverksadministratorer-Norge-Norvege
Apple-iOS_Business_Mar12_FR.pdf
Apple-PCIDualAttachedFDDICard.pdf
Apple-Aperture_Installing_Your_Software_f.pdf
Apple-User_Management_Admin_v10.4.pdf
Apple-Compressor-4-ユーザーズマニュアル Japon
Apple-Network_Services_v10.4.pdf
Apple-iPod_2ndGen_USB_Power_Adapter-DE
Apple-AirPort_Express_Opstillingsvejledning_5.1.pdf
Apple-MagSafe_Airline_Adapter.pdf
Apple-L-Apple-Multiple-Scan-20-Display
Apple-Administration_du_service_de_messagerie_10.5.pdf
Apple-iMac_Intel-based_Late2006.pdf-Japon
Apple-iPhone_3GS_Finger_Tips_J.pdf-Japon
Apple-Power-Mac-G4-Mirrored-Drive-Doors-Japon
Apple-atadrive_pmg4mdd.j.pdf-Japon
Apple-iPod_touch_2.2_User_Guide_J.pdf-Japon
Apple-Mac_OS_X_Server_v10.2.pdf
Apple-AppleCare_Protection_Plan_for_Apple_TV.pdf
Apple-DVD_Studio_Pro_4_Installation_de_votre_logiciel
Apple-PowerBookG4_17inch1.67GHzUG
Apple-iMac_Intel-based_Late2006
Apple-Installation_de_votre_logiciel
Apple-guide_des_fonctions_de_l_iPod_nano
Apple-Administration_de_serveur_v10.5
Apple-Mac-OS-X-Server-Premiers-contacts-Pour-la-version-10.3-ou-ulterieure
Apple-iBookG3_14inchUserGuideMultilingual
Apple-mac_pro_server_mid2010_ug_f
Apple-Motion_Supplemental_Documentation
Apple-iphone_guide_de_l_utilisateur
Apple-macbook_air_11inch_mid2011_ug_fr
Apple-NouvellesfonctionnalitesdeLogicExpress7.2
Apple-Mac_Pro_Early2009_4707_UG
Apple-guide_de_l_utilisateur_de_Numbers08
Apple-Guide_de_configuration_et_d'administration
Apple-mac_integration_basics_fr_106.
Apple-iPod_shuffle_4thgen_Guide_de_l_utilisateur
Apple-081811_APP_iPhone_Japanese_v5.4.pdf-Japan
Apple-Recycle_Contract120919.pdf-Japan
Apple-World_Travel_Adapter_Kit_UG
Apple-iPod_nano_6thgen_User_Guide
Apple-Mac_mini_Early2009_UG_F.pdf-Manuel-de-l-utilisateur
Apple-Compressor_3_Batch_Monitor_User_Manual_F.pdf-Manuel-de-l-utilisateur
Apple-Premiers__contacts_avec_iDVD_08
Apple-Mac_mini_Intel_User_Guide.pdf
Apple-Prise_en_charge_des_surfaces_de_controle_Logic_Express_8
Apple-mac_integration_basics_fr_107.pdf
Apple-Final-Cut-Pro-7-Niveau-1-Guide-de-preparation-a-l-examen
Apple-Logic9-examen-prep-fr.pdf-Logic-Pro-9-Niveau-1-Guide-de-preparation-a-l-examen
Apple-aperture_photography_fundamentals.pdf-Manuel-de-l-utilisateu
Apple-emac-memory.pdf-Manuel-de-l-utilisateur
Apple-Apple-Installation-et-configuration-de-votre-Power-Mac-G4
Apple-Guide_de_l_administrateur_d_Xsan_2.pdf
Apple-premiers_contacts_avec_imovie6.pdf
Apple-Tiger_Guide_Installation_et_de_configuration.pdf
Apple-Final-Cut-Pro-7-Level-One-Exam-Preparation-Guide-and-Practice-Exam
Apple-ard_admin_guide_2.2_fr.pdf
Apple-systemoverviewj.pdf-Japon
Apple-Xserve_TO_J070411.pdf-Japon
Apple-premiers_contacts_avec_iwork_08.pdf
Apple-services_de_collaboration_2e_ed_10.4.pdf
Apple-iPhone_Bluetooth_Headset_Benutzerhandbuch.pdf
Apple-Guide_de_l_utilisateur_de_Keynote08.pdf
APPLE/Apple-Logic-Pro-9-Effectsrfr.pdf
Apple-Logic-Pro-9-Effectsrfr.pdf
Apple-iPod_shuffle_3rdGen_UG_F.pdf
Apple-iPod_classic_160Go_Guide_de_l_utilisateur.pdf
Apple-iBookG4GettingStarted.pdf
Apple-Administration_de_technologies_web_10.5.pdf
Apple-Compressor-4-User-Manual-fr
Apple-MainStage-User-Manual-fr.pdf
Apple-PowerBookG4_15inch1.67-1.5GHzUserGuide.pdf
Apple-MacBook_Pro_15inch_Mid2010_CH.pdf
Apple-LED_Cinema_Display_27-inch_UG.pdf
Apple-MacBook_Pro_15inch_Mid2009_RS.pdf
Apple-macbook_pro_13inch_early2011_f.pdf
Apple-iphone_user_guide-For-iOS-6-Software
Apple-iDVD5_Getting_Started.pdf
Apple-guide_des_fonctionnalites_de_l_ipod_touch.pdf
Apple_macbook_pro_13inch_early2011_f
Apple_Guide_de_l_utilisateur_d_Utilitaire_RAID
Apple_Time_Capsule_Early2009_Setup_F
Apple_iphone_4s_finger_tips_guide_rs
apple_iphone_gebruikershandleiding
apple_apple_tv_3rd_gen_setup_tw
apple_macbook_pro-retina-mid-2012-important_product_info_ch
apple_Macintosh-User-s-Guide-for-Macintosh-PowerBook-145
Apple_ipod_touch_user_guide_ta
Apple_TV_2nd_gen_Setup_Guide_h
Apple_ipod_touch_manual_del_usuario
Apple_iphone_4s_finger_tips_guide_tu
Apple_macbook_pro_retina_qs_th
Apple-Manuel_de_l'utilisateur_de_Final_Cut_Server
Apple-Cinema_Tools_4.0_User_Manual_F
Apple-Personal-LaserWriter300-User-s-Guide
Apple-QuickTake-100-User-s-Guide-for-Macintosh
Apple-User-s-Guide-Macintosh-LC-630-DOS-Compatible
Apple-iPhone_iOS3.1_User_Guide
Apple-iphone_4s_important_product_information_guide
Apple-iPod_shuffle_Features_Guide_F
Apple-Premiers_contacts_avec_iMovie_08
Apple-macbook_pro-retina-mid-2012-important_product_info_br
Apple-macbook_pro-13-inch-mid-2012-important_product_info
Apple-macbook_air-11-inch_mid-2012-qs_br
Apple-Manuel_de_l_utilisateur_de_MainStage
Apple-Compressor_3_User_Manual_F
Apple-guide_de_configuration_airport_express_4.2
Apple-Instruments_et_effets_Logic_Express_8
Apple-Manuel_de_l_utilisateur_de_WaveBurner
Apple-Macmini_Guide_de_l'utilisateur
Disque dur, ATA parallèle Instructions de remplacement
Apple-final_cut_pro_x_logic_effects_ref_f
Apple-Leopard_Installationshandbok
Apple-thunderbolt_display_getting_started_1e
Apple-Compressor-4-Benutzerhandbuch
Apple-macbook_air_11inch_mid2011_ug
Apple-macbook_air-mid-2012-important_product_info_j
Apple-iPod-nano-Guide-des-fonctionnalites
Apple-iPod-nano-Guide-des-fonctionnalites
Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation
Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation
Apple-Manuel_de_l_utilisateur_d_Utilitaire_de_reponse_d_impulsion
Apple-Aperture_2_Raccourcis_clavier
Apple-livetype_2_user_manual_f
Apple-macbook_air_guide_de_l_utilisateur
Apple-MacBook_Early_2008_Guide_de_l_utilisateur
Apple-Keynote-2-Guide-de-l-utilisateur
Apple-PowerBook-User-s-Guide-for-PowerBook-computers
Apple-Macintosh-Performa-User-s-Guide-5200CD-and-5300CD
Apple-Macintosh-Performa-User-s-Guide
Apple-iPod-nano-Guide-des-fonctionnalites
Apple-iPad-User-Guide-For-iOS-5-1-Software
Apple-Boot-Camp-Guide-d-installation-et-de-configuration
Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation
Power Mac G5 Guide de l’utilisateur APPLE
Guide de l'utilisateur PAGE '08 APPLE
Guide de l'utilisateur KEYNOTE '09 APPLE
Guide de l'Utilisateur KEYNOTE '3 APPLE
Guide de l'Utilisateur UTILITAIRE RAID
Guide de l'Utilisateur Logic Studio
Power Mac G5 Guide de l’utilisateur APPLE
Guide de l'utilisateur PAGE '08 APPLE
Guide de l'utilisateur KEYNOTE '09 APPLE
Guide de l'Utilisateur KEYNOTE '3 APPLE
Guide de l'Utilisateur UTILITAIRE RAID
Guide de l'Utilisateur Logic Studio
Guide de l’utilisateur ipad Pour le logiciel iOS 5.1
PowerBook G4 Premiers Contacts APPLE
Guide de l'Utilisateur iphone pour le logiciel ios 5.1 APPLE
Guide de l’utilisateur ipad Pour le logiciel iOS 4,3
Guide de l’utilisateur iPod nano 5ème génération
Guide de l'utilisateur iPod Touch 2.2 APPLE
Guide de l’utilisateur QuickTime 7 Mac OS X 10.3.9 et ultérieur Windows XP et Windows 2000
Guide de l'utilisateur MacBook 13 pouces Mi 2010
Guide de l’utilisateur iPhone (Pour les logiciels iOS 4.2 et 4.3)
Guide-de-l-utilisateur-iPod-touch-pour-le-logiciel-ios-4-3-APPLE
Guide-de-l-utilisateur-iPad-2-pour-le-logiciel-ios-4-3-APPLE
Guide de déploiement en entreprise iPhone OS
Guide-de-l-administrateur-Apple-Remote-Desktop-3-1
Guide-de-l-utilisateur-Apple-Xserve-Diagnostics-Version-3X103
Guide-de-configuration-AirPort-Extreme-802.11n-5e-Generation
Guide-de-configuration-AirPort-Extreme-802-11n-5e-Generation
Guide-de-l-utilisateur-Capteur-Nike-iPod
Guide-de-l-utilisateur-iMac-21-5-pouces-et-27-pouces-mi-2011-APPLE
Guide-de-l-utilisateur-Apple-Qadministrator-4
Guide-d-installation-Apple-TV-3-eme-generation
User-Guide-iPad-For-ios-5-1-Software
Text System User
Interface Layer
Programming GuideContents
Introduction to Text System User Interface Layer 4
Who Should Read This Document 4
Organization of This Document 4
See Also 5
The User-Interface Layer: NSTextView Class 6
Creating an NSTextView Object 8
Creating an NSTextView Object Programmatically 12
Putting an NSTextView Object in an NSScrollView 14
Setting Up the Scroll View 14
Setting Up the Text View 15
Assembling the Pieces 16
Setting Up a Horizontal Scroll Bar 16
Using Multiple NSTextViews 17
Plain and Rich Text Objects 18
Setting Text Attributes 20
Kerning 20
Ligatures 21
Setting Text Margins 22
Document Revision History 24
Index 25
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
2Figures, Tables, and Listings
Creating an NSTextView Object 8
Figure 1 Cocoa-Text palette 8
Figure 2 Edit menu 9
Figure 3 Text menu 9
Figure 4 Font panel 10
Creating an NSTextView Object Programmatically 12
Listing 1 Creating an NSTextView object programmatically 12
Putting an NSTextView Object in an NSScrollView 14
Listing 1 Setting up the scroll view 14
Listing 2 Setting up the text view 15
Listing 3 Assembling the pieces 16
Listing 4 Setting up a horizontal scroll bar 16
Plain and Rich Text Objects 18
Table 1 RTF control words recognized by all text objects 18
Setting Text Margins 22
Figure 1 Text margins and insets 22
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
3Text System User Interface Layer describes the high-level user interface to the Cocoa text system through the
NSTextView class.
Who Should Read This Document
You should read this document if your application needs to present a user interface to the full capabilities of
the text system, that is, if your users need to edit substantial amounts of text.
To understand this material you should have a general understanding of Cocoa programming conventions,
and you should have read Cocoa Text Architecture Guide .
Organization of This Document
This document contains the following articles:
●
"The User-Interface Layer: NSTextView Class" (page 6) describes the capabilities and features of the
NSTextView class, through which most applications interact with the text system.
●
"Creating an NSTextView Object" (page 8) explains how to instantiate an NSTextView object using
Interface Builder.
●
"Creating an NSTextView Programmatically" (page 12) explains how to create an NSTextView object in
code and cause it to create its supporting web of text-handling objects.
●
"Putting an NSTextView Object in an NSScrollView" (page 14) shows how to programmatically configure
an NSTextView object with scroll bars.
●
"Using Multiple NSTextViews" (page 17) describes the attributes held in common by multiple text views
configured to share a single layout manager.
●
"Plain and Rich Text Objects" (page 18) explains the difference between plain text and rich text and lists
the RTF control words that any text object recognizes.
●
"Setting Text Attributes" (page 20) discussestext attributes and the action methods you can use to control
them programmatically.
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
4
Introduction to Text System User Interface Layer●
"Setting Text Margins" (page 22) describes the values, maintained by various text system objects, that
affect the apparent margins surrounding text on a printed page or display.
See Also
For more information, refer to the following documents:
● Cocoa Text Architecture Guide provides an overview of the Cocoa text system. It also explains how the text
system supports entering and modifying text and attributesthrough user interaction with the user interface
layer.
● Text System Storage Layer Overview describes the facilities that the Cocoa text system uses to store the
text and geometric shape information used for text layout.
Introduction to Text System User Interface Layer
See Also
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
5The vast majority of applications interact with the text system through one class: NSTextView. An NSTextView
object provides a rich set of text-handling features and can:
● Display text in various fonts, colors, and paragraph styles
● Display images
● Read text and images from (and write them to) disk or the pasteboard
● Let users control text attributes such as font, superscripting and subscripting, kerning, and the use of
ligatures
● Cooperate with other views to enable scrolling and display of the ruler
● Cooperate with the Font panel (Fonts window) and Spelling panel
● Support various key bindings, such as those used in Emacs
The interface that this class declares (and inherits from its superclass NSText) lets you programmatically:
● Control the size of the area in which text is displayed
● Control the editability and selectability of the text
● Select and act on portions of the text
NSTextView objects are used throughout the Cocoa user interface to provide standard text input and editing
features.
An NSTextView object is a convenient package of the most generally useful text-handling features. If the
features of the NSTextView class satisfy your application’s requirements and you need more programmatic
control over the characters and attributes that make up the text, you’ll have to learn something about the
object that stores this data, NSTextStorage.
One of the design goals of NSTextView is to provide a comprehensive set of text-handling features so that you
should rarely need to create a subclass. In its standard incarnation, NSTextView creates the requisite group of
objects that support the text system—NSTextContainer, NSLayoutManager, and NSTextStorage objects. Here
are the major features that NSTextView adds to those of NSText:
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
6
The User-Interface Layer: NSTextView Class● Rulers. NSTextView works with the NSRulerView classto let users control paragraph formatting, in addition
to using commands in the Text menu provided by Interface Builder, which is available as a submenu of
the Format menu as well as a menu in the menu bar.
●
Inputmanagement and key binding. Certain key combinations are bound to specific NSTextView methods
so that the user can, for example, move the insertion point without using the mouse.
● Marked text attributes. NSTextView defines a set of text attributes that support special display
characteristics during input management. Marked text attributes affect only visual aspects of text—color,
underline, and so on—they don’t include any attributes that would change the layout of text.
● File and graphic attachments. The extended textsystem provides programmatic accessto text attachments
as instances of NSTextAttachment, through the NSTextView and NSTextStorage classes.
● Delegate messages and notifications. NSTextView adds several delegate messages and notifications to
those used by NSText. The delegate and observers of an NSTextView can receive any of the messages or
notifications declared by either class.
The User-Interface Layer: NSTextView Class
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
7The easiest way to use the text system is through Interface Builder. Interface Builder’s Cocoa-Text palette,
shown in Figure 1, supplies a specially configured NSScrollView object that contains an NSTextView object as
its document view. This NSTextView is configured to work with the NSScrollView and other user-interface
controls such as a ruler, the Font menu, the Edit menu, and so on.
Figure 1 Cocoa-Text palette
Using Interface Builder’s Info window (also called the inspector) you can specify, among other things, whether
the contained NSTextView allows multiple fonts and embedded graphics.
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
8
Creating an NSTextView ObjectMuchmore of NSTextView’sfunctionality is accessible throughmenu commands. Interface Builder’s Cocoa-Menus
palette offers the ready-made Edit menu that contains text-editing commands shown in Figure 2.
Figure 2 Edit menu
The Cocoa-Menus palette also has the Text menu, shown in Figure 3, which contains paragraph style controls
and provides user access to the document’s ruler.
Figure 3 Text menu
Creating an NSTextView Object
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
9The Cocoa-Menus palette also has the system Font panel (or Fonts window) shown in Figure 4.
Figure 4 Font panel
By default, most of the commands in these menus operate on the first responder, that is, the view within the
key window that the user has selected for input. (See the reference documentation for NSResponder, NSView,
and NSWindow for more information on the first responder.) In practice, the first responder is the object that’s
displaying the selection, a drawing object in the case of a graphical selection or an NSTextView in the case of
a textual selection. By adding these menus to your application, you can offer the user access to many powerful
text-editing features.
NSTextViews cooperate with the Servicesfacility through the Servicesmenu, also available fromthe Cocoa-Menus
palette. By simply adding the Services menu item to your application’s main menu, the NSTextViews in your
application can access services provided by other applications. For example, if the user selects a word within
an NSTextView and chooses the Mail > Send Selection service, the NSTextView passes its selected text to the
Mail application which places the text in a new message.
Interface Builder offers these direct ways of accessing the features of the text system. You can also configure
your own menu items or other controls within Interface Builder to send messages to an NSTextView object.
For example, you can make an NSTextView output its text for printing or faxing by sending it a print: or
fax: message. One way to do thisisto drag a menu item from the Cocoa-Menus palette into your application’s
File menu and hook it up to an NSTextView (either through the first responder or by direct connection). By
specifying that the item send a print: message to its target, the NSTextView’s contents can be printed or
faxed when the application is running.
Creating an NSTextView Object
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
10Interface Builder also offers other objects—of the NSTextField and NSForm classes—that make use of NSTextView
objects for their text-editing facilities. In fact, all NSTextField and NSForm objects within the same window
share the same NSTextView object (known as the field editor), thus reducing the memory demands of an
application. If your application requires standalone or grouped text fields that support editing (and all the
other facilities provided by the NSTextView class), these are the classes to use.
Using the Info window (inspector), you can set many text-related attributes of these controls. For example,
you can specify whether the text in a text field is selectable, editable, scrollable, and so on. The Info window
also lets you set the text alignment and background and foreground colors.
Creating an NSTextView Object
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
11At times, you may need to assemble the text system programmatically. You can do this in either of two ways:
by creating an NSTextView object and letting it create its network of supporting objects or by building the
network of objects yourself. In most cases, you’ll find it sufficient to create an NSTextView object and let it
create the underlying network of text-handling objects, as discussed in this article. If your application has
complex text-layout requirements, you’ll have to create the network yourself;see “Creating Text System Objects”
in Cocoa Text Architecture Guide for information.
You create an NSTextView object programmatically in the usual way: by sending the alloc and init...
messages. You can also create an NSTextView object using either of these methods:
● initWithFrame:textContainer: (the designated initializer)
● initWithFrame:
The method that takes one argument, initWithFrame:, is the simplest way to obtain an NSTextView
object—it creates all the other components of the text system for you. If you use the method that takes two
arguments, initWithFrame:textContainer:, you must create the other components yourself.
Listing 1 shows how you can create an NSTextView object, given an NSWindow object represented here by
aWindow.
Listing 1 Creating an NSTextView object programmatically
/* determine the size for the NSTextView */
NSRect cFrame =[[aWindow contentView] frame];
/* create the NSTextView and add it to the window */
NSTextView *theTextView = [[NSTextView alloc] initWithFrame:cFrame];
[aWindow setContentView:theTextView];
[aWindow makeKeyAndOrderFront:nil];
[aWindow makeFirstResponder:theTextView];
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
12
Creating an NSTextView Object ProgrammaticallyThis code determines the size for the text view’s frame rectangle by asking aWindow for the size of its content
view. The NSTextView is then created and made the content view of aWindow using setContentView:.
Finally, the makeKeyAndOrderFront: and makeFirstResponder: messages display the window and cause
the text view to prepare to accept keyboard input.
The initWithFrame: method not only initializes the receiving NSTextView object, it causes the object to
create and interconnect the other components of the text system. This is a convenience that frees you from
having to create and interconnect them yourself.
Creating an NSTextView Object Programmatically
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
13A scrolling text view is commonly required in applications, and Interface Builder provides an NSTextView
configured just for this purpose. However, at times you may need to create a scrolling text view
programmatically.
The process consists of three steps: setting up the NSScrollView, setting up the NSTextView, and assembling
the pieces. This article describes these steps in terms of a typical text view configured with a vertical scroll bar
only, then shows alternate statements used to configure a horizontal scroll bar.
Setting Up the Scroll View
Assuming an object has the variable theWindow that represents the window where the scrolling view is
displayed, you can set up the NSScrollView using the code in Listing 1.
Listing 1 Setting up the scroll view
NSScrollView *scrollview = [[NSScrollView alloc]
initWithFrame:[[theWindow contentView] frame]];
NSSize contentSize = [scrollview contentSize];
[scrollview setBorderType:NSNoBorder];
[scrollview setHasVerticalScroller:YES];
[scrollview setHasHorizontalScroller:NO];
[scrollview setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
Note that the code creates an NSScrollView that completely coversthe content area of the window it’s displayed
in. It also specifies a vertical scroll bar but no horizontal scroll bar, since this scrolling text view wraps text
within the horizontal extent of the NSTextView, but letstext flow beyond the vertical extent of the NSTextView.
To use a horizontal scroll bar, you must configure the scroll view and text view slightly differently, as described
in "Setting Up a Horizontal Scroll Bar" (page 16).
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
14
Putting an NSTextView Object in an NSScrollViewFinally, the code sets how the NSScrollView reacts when the window it’s displayed in changes size. Turning on
the NSViewWidthSizable and NSViewHeightSizable bits of its resizing mask ensures that the NSScrollView
grows and shrinks to match the window’s dimensions.
Setting Up the Text View
The nextstep isto create and configure an NSTextView to fit in the NSScrollView. Listing 2 showsthe statements
that accomplish this step.
Listing 2 Setting up the text view
theTextView = [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0,
contentSize.width, contentSize.height)];
[theTextView setMinSize:NSMakeSize(0.0, contentSize.height)];
[theTextView setMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
[theTextView setVerticallyResizable:YES];
[theTextView setHorizontallyResizable:NO];
[theTextView setAutoresizingMask:NSViewWidthSizable];
[[theTextView textContainer]
setContainerSize:NSMakeSize(contentSize.width, FLT_MAX)];
[[theTextView textContainer] setWidthTracksTextView:YES];
Listing 2 specifies that the NSTextView’s width and height initially match those of the content area of the
NSScrollView. The setMinSize: message tells the NSTextView that it can get arbitrarily small in width, but
no smaller than its initial height. The setMaxSize: message allows the receiver to grow arbitrarily in either
dimension. These limits are used by the NSLayoutManager when it resizes the NSTextView to fit the text laid
out.
The next three messages determine how the NSTextView’s dimensions change in response to additions or
deletions of text and to changes in the scroll view’s size. The NSTextView is set to grow vertically as text is
added but not horizontally. Its resizing mask is set to allow it to change width in response to changes in the
width of its superview. Since, except for the minimum and maximum values, the NSTextView’s height is
determined by the amount of text it has in it, its height should not change with that of its superview.
The last two messages in this step are to the NSTextContainer, not the NSTextView. One message sets the text
container’s initial width to that of the scroll view and its height to the maximum size of the text view. The last
message tells the NSTextContainer to resize its width according to the width of the NSTextView. Recall that
Putting an NSTextView Object in an NSScrollView
Setting Up the Text View
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
15the text system lays out text according to the dimensions stored in NSTextContainer objects. An NSTextView
provides a place for the text to be displayed, but its dimensions and those of its NSTextContainer can be quite
different. The setWidthTracksTextView:YES message ensures that as the NSTextView is resized, the width
dimension stored in its NSTextContainer is likewise resized, causing the text to be laid out within the new
boundaries.
Assembling the Pieces
The last step is to assemble and display the pieces. Listing 3 shows the statements that accomplish this step.
Listing 3 Assembling the pieces
[scrollview setDocumentView:theTextView];
[theWindow setContentView:scrollview];
[theWindow makeKeyAndOrderFront:nil];
[theWindow makeFirstResponder:theTextView];
Setting Up a Horizontal Scroll Bar
To set up both horizontal and vertical scroll bars, use the statements in Listing 4 in place of the corresponding
statements in the previous listings.
Listing 4 Setting up a horizontal scroll bar
[[theTextView enclosingScrollView] setHasHorizontalScroller:YES];
[theTextView setHorizontallyResizable:YES];
[theTextView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[[theTextView textContainer] setContainerSize:NSMakeSize(FLT_MAX, FLT_MAX)];
[[theTextView textContainer] setWidthTracksTextView:NO];
This code fragment adds the horizontal scroll bar to the scroll view and makes the text view horizontally
resizable so it can display text of any width. The code sets the text view’s resizing mask so that it changes in
both width and height in response to corresponding changes in its superview. The next-to-last message sets
both dimensions of the text container to an arbitrarily large value, which essentially means the text is laid out
in one long line, and the last message ensures that the text container does not resize horizontally with the text
view.
Putting an NSTextView Object in an NSScrollView
Assembling the Pieces
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
16A single NSLayoutManager can be assigned any number of NSTextContainers, in whose NSTextViews it lays
out textsequentially. In such a configuration, many of the attributes accessed through the NSTextView interface
are actually shared by all of these text views. Among these attributes are:
● The selection
● The delegate
● Selectability
● Editability
● Whether they act as a field editor
● Whether they display plain or rich text
● Whether they import graphics
● Whether they use the ruler
● Whether the ruler is visible
● Whether they use the Font panel (Fonts window)
Setting any of these attributes causes all associated NSTextView objects to share the new value.
With multiple NSTextViews, only one isthe first responder at any time. NSLayoutManager definesthese methods
for determining and appropriately setting the first responder:
● layoutManagerOwnsFirstResponderInWindow:
● firstTextView
● textViewForBeginningOfSelection
See their descriptions in the NSLayoutManager class specification for more information.
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
17
Using Multiple NSTextViewsText objects such as NSText and NSTextView can contain either plain text or rich text. Plain text objects allow
only one set of text attributes for all of their text; rich text objects allow multiple fonts, sizes, indents, and other
attributes for different sets of characters and paragraphs. You can control whether a text object is plain or rich
using the setRichText: method. Rich text objects are also capable of allowing the user to drag images and
files into them. This behavior is controlled by the setImportsGraphics: method.
A rich NSText object can use RTF (Rich Text Format) as an interchange format. Not all RTF control words are
supported, however. On input, an NSText object ignores any control word it doesn’t recognize; some of those
it can read and interpret it doesn’t write out. Table 1 lists the RTF control words that any text object recognizes.
Subclasses may recognize more.
Table 1 RTF control words recognized by all text objects
Control word Can be written out
\ansi yes
\b yes
\cb yes
\cf yes
\colortbl yes
\dnn yes
\fin yes
\fn yes
\fonttbl yes
\fsn yes
\i yes
\lin yes
\margrn yes
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
18
Plain and Rich Text ObjectsControl word Can be written out
\paperwn yes
\mac no
\margln yes
\par yes
\pard no
\pca no
\qc yes
\ql yes
\qr yes
\sn no
\tab yes
\upn yes
Plain and Rich Text Objects
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
19NSTextView allows you to change the attributes of its text programmatically through various methods, most
inherited from the superclass, NSText. NSTextView adds its own methods for setting the attributes of text that
the user types, for setting the baseline offset of text as an absolute value, and for adjusting kerning and use
of ligatures. Most of the methods for changing attributes are defined as action methods and apply to the
selected text or typing attributes for a rich text view, or to all of the text in a plain text view.
An NSTextView maintains a set of typing attributes (font, size, color, and so on) that it applies to newly entered
text, whether typed by the user or pasted as plain text. It automatically setsthe typing attributesto the attributes
of the first character immediately preceding the insertion point, of the first character of a paragraph if the
insertion point is at the beginning of a paragraph, or of the first character of a selection. The user can change
the typing attributes by choosing menu commands and using utilities such as the Font panel (Fonts window).
You can also set the typing attributes programmatically using setTypingAttributes:, though you should
rarely find need to do so unless creating a subclass.
NSText defines the action methods superscript:, subscript:, and unscript:, which raise and lower the
baseline of text by predefined increments. NSTextView gives you much finer control over the baseline offset
of text by defining the raiseBaseline: and lowerBaseline: action methods, which raise or lower text
by one point each time they’re invoked.
Kerning
NSTextView provides convenient action methods for adjusting the spacing between characters. By default, an
NSTextView object uses standard kerning (as provided by the data in a font’s AFM file). A turnOffKerning:
message causes this kerning information to be ignored and the selected text to be displayed using nominal
widths. The loosenKerning: and tightenKerning: methods adjust kerning values over the selected text
and useStandardKerning: reestablishes the default kerning values.
Kerning information is a character attribute that’s stored in the text view’s NSTextStorage object. If your
application needs finer control over kerning than the methods of this class provide, you should operate on
the NSTextStorage object directly through methods defined by its superclass, NSMutableAttributedString. See
the reference documentation for NSAttributedString Additions for information on setting attributes.
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
20
Setting Text AttributesLigatures
NSTextView’s support for ligatures provides the minimum required ligatures for a given font and script. The
required ligatures for a specific font and script are determined by the mechanisms that generate glyphs for a
specific language. Some scripts may well have no ligatures at all—English text, as an example, doesn’t require
ligatures, although certain ligatures such as “fi” and “fl” are desirable and are used if they’re available. Other
scripts,such as Arabic, demand that certain ligatures must be available even if a turnOffLigatures: message
is sent to the NSTextView. Other scripts and fonts have standard ligatures that are used if they’re available.
The useAllLigatures: method extends ligature support to include all possible ligatures available in each
font for a given script.
Ligature information is a character attribute that’s stored in the text view’s NSTextStorage object. If your
application needs finer control over ligature use than the methods of this class provide, you should operate
on the NSTextStorage object directly through methods defined by its superclass, NSMutableAttributedString.
See the reference documentation for NSAttributedString Additions for information on setting attributes.
Setting Text Attributes
Ligatures
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
21Many text system objects cooperate in the display of text, and several of them maintain inset values that affect
the apparent margins of text on a printed page or display. This article describesthose settings and their proper
use. Figure 1 illustrates the various margins and insets you can place around text.
Figure 1 Text margins and insets
Line fragment padding
Text container inset
Text view inset
in superview
Print settings margins
Text container
Text view
Superview of text view (if present)
Printed page
Paragraph
head indent
We the People of the United States, in Order to form
a more perfect Union, establish Justice, insure domestic
Tranquility, provide for the common defence, promote
the general Welfare, and secure the Blessings of Liberty
to ourselves and our Posterity, do ordain and establish
this Constitution for the United States of America.
Paragraph
tail indent
Paragraph
first line indent
Line fragment padding
Paragraph style objects maintain head indent values for the first and subsequent lines and a tail indent value.
These values describe space between the beginning and end of text lines and the edge of the text container.
For left-to-right text, as shown in Figure 1, the head indents appear on the left side of the paragraph and the
tail indent on the right side. You can find the indent values using the NSParagraphStyle methods
firstLineHeadIndent, headIndent, and tailIndent. You set the values using the corresponding
NSMutableParagraphStylemethods setFirstLineHeadIndent:, setHeadIndent:, and setTailIndent:.
By default, a text container covers its text view exactly. However, you can specify blank space between the
edges of the text container and the edges of the text view with the NSTextView method
setTextContainerInset:. This method specifies a width and height by which the text container’s top-left
origin point is offset from the origin of the text view. The text container’s right and bottom edges are then
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
22
Setting Text Marginsinset by an equal amount. The container inset is respected even when the container is set to track the height
and width of the text view. It’s possible to set the text container and text view sizes and resizing behavior so
that the inset cannot be maintained exactly, but the text system maintains it whenever possible.
The text container inset refers to the bounding rectangle of the text container’s region. However, you can
define the region to be a nonrectangular shape, in which case some lines of text can have additional space
between the ends of the lines and the bounding rectangle. See “Calculating Region, Bounding Rectangle, and Inset”
for more information.
Another parameter that you can set to leave space at the ends of lines of type is called line fragment padding.
You can setthe padding value with theNSTextContainermethod setLineFragmentPadding:. This adjustment
is meant to specify a small amount of blank space on each end of the line fragment rectangles in which the
typesetter sets lines of text. Line fragment padding keeps text from directly abutting any graphics or other
elements positioned next to the text container.
Finally, the text view itself can optionally be inset in a superview, as in TextEdit’s multiple-page view, and views
can be inset on a printed page using print settings.
Setting Text Margins
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
23This table describes the changes to Text System User Interface Layer Programming Guide .
Date Notes
2012-09-19 Fixed broken link.
Corrected line fragment padding representation in Figure 1 of "Setting
Text Margins."
2006-06-28
2004-07-27 Made editorial revisions to previously unedited articles.
Added section to “Putting an NSTextView Object in an NSScrollView.”
Added a new article titled “Setting Text Margins.” Rewrote introduction
and added an index.
2004-02-06
2003-05-02 Moved four articles to new Text Editing programming topic.
Corrected error in example code in the article “Putting an NSTextView
Object in an NSScrollView.”
2003-01-16
2002-11-12 Revision history added to existing topic.
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
24
Document Revision HistoryA
alloc method
to create an NSTextView object 12
E
Edit menu
and NSTextView 8, 9
F
field editor 11
first line indent 22
first responder 10, 13, 17
firstLineHeadIndent method 22
firstTextView method 17
H
head indent 22
headIndent method 22
I
init... methods
to create an NSTextView object 12
initWithFrame: method 12, 13
initWithFrame:textContainer: method 12
Interface Builder
to create a text view object 8
K
kerning of text 20
L
layoutManagerOwnsFirstResponderInWindow:
method 17
ligatures in fonts 21
line fragment padding 22
loosenKerning: method 20
lowerBaseline: method 20
M
makeFirstResponder: method 13
makeKeyAndOrderFront: method 13
margins of text 22
memory management
and Cocoa text objects 13
menu commands
of Cocoa text system 9
N
NSForm class 11
NSLayoutManager class 15, 17
NSMutableAttributedString class 20
NSScrollView class 8, 14
NSText class 6
NSTextContainer class 17
NSTextField class 11
NSTextStorage class 20
NSTextView class
configured as multiple text views 17
features of 6
in a scroll view 14
instantiating 8, 12
setting text attributes with 20
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
25
IndexP
plain text
and Cocoa text objects 18
print settings margins 22
R
raiseBaseline: method 20
Rich Text Format (RTF)
and NSText objects 18
RTF. See Rich Text Format
S
scroll bars
and NSTextView 14, 16
scroll views, setting up 14
Services menu
and NSTextView 10
setContentView: method 13
setFirstLineHeadIndent: method 22
setHeadIndent: method 22
setImportsGraphics: method 18
setLineFragmentPadding: method 23
setMaxSize: method 15
setMinSize: method 15
setRichText: method 18
setTailIndent: method 22
setTextContainerInset: method 22
setTypingAttributes: method 20
setWidthTracksTextView: method 16
subscript: method 20
superscript: method 20
T
tail indent 22
tailIndent method 22
text attributes 18, 20–21
text container insets 22
Text menu
and NSTextView 9
text views
configuring 15
insets 22
text-handling features of NSTextView 6–7
textViewForBeginningOfSelection method 17
tightenKerning: method 20
turnOffKerning: method 20
turnOffLigatures: method 21
typing attributes 20
U
unscript: method 20
useAllLigatures: method 21
useStandardKerning: method 20
Index
2012-09-19 | © 1997, 2012 Apple Inc. All Rights Reserved.
26Apple Inc.
© 1997, 2012 Apple Inc.
All rights reserved.
No part of this publication may be reproduced,
stored in a retrievalsystem, or transmitted, in any
form or by any means, mechanical, electronic,
photocopying, recording, or otherwise, without
prior written permission of Apple Inc., with the
following exceptions: Any person is hereby
authorized to store documentation on a single
computer for personal use only and to print
copies of documentation for personal use
provided that the documentation contains
Apple’s copyright notice.
No licenses, express or implied, are granted with
respect to any of the technology described in this
document. Apple retains all intellectual property
rights associated with the technology described
in this document. This document is intended to
assist application developers to develop
applications only for Apple-labeled computers.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010
Apple, the Apple logo, Cocoa, and Mac are
trademarks of Apple Inc., registered in the U.S.
and other countries.
Even though Apple has reviewed this document,
APPLE MAKES NO WARRANTY OR REPRESENTATION,
EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS
DOCUMENT, ITS QUALITY, ACCURACY,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED
“AS IS,” AND YOU, THE READER, ARE ASSUMING THE
ENTIRE RISK AS TO ITS QUALITY AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL
DAMAGES RESULTING FROM ANY DEFECT OR
INACCURACY IN THIS DOCUMENT, even if advised of
the possibility of such damages.
THE WARRANTY AND REMEDIES SET FORTH ABOVE
ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL
OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer,
agent, or employee is authorized to make any
modification, extension, or addition to this warranty.
Some states do not allow the exclusion or limitation
of implied warranties or liability for incidental or
consequential damages, so the above limitation or
exclusion may not apply to you. This warranty gives
you specific legal rights, and you may also have other
rights which vary from state to state.
Cocoa Text Architecture
GuideContents
About the Cocoa Text System 7
At a Glance 7
Most Applications Can Use the Cocoa Text System 8
Typographical Concepts Are Essential for Understanding the Text System 8
The Text System Comprises Views, Controllers, and Storage Classes 8
Attributes Characterize Text and Documents 8
Font Objects, the Font Panel, and the Font Manager Provide Typeface Handling 9
Text Objects Are Key to Text Editing 9
Prerequisites 9
See Also 9
Text Handling Technologies in OS X 11
Typographical Concepts 12
Characters and Glyphs 12
Typefaces and Fonts 13
Text Layout 14
Text System Organization 18
Functional Areas of the Cocoa Text System 19
Class Hierarchy of the Cocoa Text System 21
MVC and the Text System 23
Creating Text System Objects 23
Text View Creates the Objects 23
Your App Creates the Objects Explicitly 24
Common Configurations 26
Text Fields, Text Views, and the Field Editor 30
Text Fields 30
Text Views 31
The Field Editor 32
Text Attributes 33
Character Attributes 33
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
2Storing Character Attributes 34
Attribute Fixing 34
Temporary Attributes 35
Paragraph Attributes 35
Glyph Attributes 35
Document Attributes 36
Font Handling 37
The Font Panel 37
Creating a Font Panel 37
Using the Font Panel 38
Working with Font Objects 39
Querying Font Metrics 39
Querying Standard Font Variations 40
Characters, Glyphs, and the Layout Manager 41
Getting the View Coordinates of a Glyph 42
Working with the Font Manager 42
Creating a Font Manager 42
Handling Font Changes 43
Converting Fonts Manually 44
Setting Font Styles and Traits 45
Examining Fonts 46
Customizing the Font Conversion System 46
Text Editing 48
The Editing Environment 48
The Key-Input Message Sequence 49
Intercepting Key Events 51
Text View Delegation 52
Text View Delegate Messages and Notifications 53
Text Field Delegation 54
Synchronizing Editing 55
Batch-Editing Mode 55
Forcing the End of Editing 56
Setting Focus and Selection Programmatically 57
Subclassing NSTextView 58
Updating State 59
Custom Import Types 59
Altering Selection Behavior 60
Preparing to Change Text 60
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
3
ContentsText Change Notifications and Delegate Messages 60
Smart Insert and Delete 61
Creating a Custom Text View 61
Implementing Text Input Support 61
Managing Marked Text 62
Communicating with the Text Input Context 63
Working with the Field Editor 64
How the Field Editor Works 64
Using Delegation and Notification with the Field Editor 64
Using a Custom Field Editor 66
Field Editor–Related Methods 67
Document Revision History 71
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
4
ContentsFigures, Tables, and Listings
Typographical Concepts 12
Figure 2-1 Glyphs of the character A 12
Figure 2-2 Ligatures 13
Figure 2-3 Fonts in the Times font family 14
Figure 2-4 Glyph metrics 16
Figure 2-5 Kerning 16
Figure 2-6 Alignment of text relative to margins 17
Figure 2-7 Justified text 17
Text System Organization 18
Figure 3-1 Major functional areas of the Cocoa text system 19
Figure 3-2 Cocoa Text System Class Hierarchy 22
Figure 3-3 Text object configuration for a single flow of text 26
Figure 3-4 Text object configuration for paginated text 27
Figure 3-5 Text object configuration for a multicolumn document 27
Figure 3-6 Text object configuration for multiple views of the same text 28
Figure 3-7 Text object configuration with custom text containers 29
Text Fields, Text Views, and the Field Editor 30
Figure 4-1 A text field 30
Figure 4-2 A text view 31
Figure 4-3 The field editor 32
Text Attributes 33
Figure 5-1 The composition of an NSAttributedString object including its attributes dictionary 34
Font Handling 37
Figure 6-1 Font metrics 39
Table 6-1 Font metrics and related NSFont methods 39
Table 6-2 Standard font methods 40
Table 6-3 Font conversion methods 44
Table 6-4 Font menu item actions and tags 47
Text Editing 48
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
5Figure 7-1 Key-event processing 49
Figure 7-2 Input context key binding and interpretation 50
Figure 7-3 Delegate of an NSTextView object 53
Table 7-1 NSWindow field editor–related methods 67
Table 7-2 NSTextFieldCell field editor–related method 68
Table 7-3 NSCell field editor–related methods 68
Table 7-4 NSControl field editor–related methods 69
Table 7-5 NSResponder field editor–related methods 69
Table 7-6 NSText field editor–related methods 70
Listing 7-1 Forcing layout 56
Listing 7-2 Forcing the end of editing 57
Listing 7-3 Forcing the field editor to enter a newline character 65
Listing 7-4 Substituting a custom field editor 67
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
6
Figures, Tables, and ListingsThe Cocoa text system is the primary text-handling system in OS X, responsible for the processing and display
of all visible text in Cocoa. It provides a complete set of high-quality typographical services through the
text-related AppKit classes, which enable applications to create, edit, display, and store text with all the
characteristics of fine typesetting, such as kerning, ligatures, line-breaking, and justification.
Ruler views, font
and color panels
Glyph generator
Text input
Typesetter
Text containers Text storage
Text views
Layout
manager
Display
View Layer
Controller Layer
Storage Layer
At a Glance
The Cocoa text system provides text editing and layout for most applications. The object-oriented design of
the system provides flexibility and ease of use.
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
7
About the Cocoa Text SystemMost Applications Can Use the Cocoa Text System
If your application needs to display text, and especially if its users need to enter and edit text, then you should
use the Cocoa text system. The Cocoa text system is one of two text-handling systems in OS X. The other is
Core Text, which provides low-level, basic text layout and font-handling capabilities to higher-level engines
such as the AppKit.
Related Chapter: “Text Handling Technologies in OS X”
Typographical Concepts Are Essential for Understanding the Text System
The Cocoa text system encodes characters as Unicode values. It translates characters into glyphs, including
ligatures and other contextual forms, and handles typefaces, styles, fonts, and families. The system does text
layout, placing glyphs horizontally or vertically in either direction, using font metric information, and uses
kerning when appropriate. It performs high-quality line breaking and hyphenation to create lines of text with
proper alignment or justification.
Related Chapter: “Typographical Concepts” (page 12)
The Text System Comprises Views, Controllers, and Storage Classes
The Cocoa textsystem is abstracted as a set of classesthat represent modular, layered functional areasreflecting
the Model-View-Controller design paradigm. The top layer of the system is the user-interface layer of various
views, the bottom layer stores the data models, and the middle layer consists of controllers that interpret
keyboard input and arrange text for display.
The four primary text system classes—NSTextView, NSLayoutManager, NSTextContainer, and
NSTextStorage—can be configured in various ways to accomplish different text-handling goals.
Related Chapters: “Text System Organization” (page 18), “Text Fields, Text Views, and the Field
Editor” (page 30)
Attributes Characterize Text and Documents
The Cocoa text system handles five kinds of attributes: character attributes, such as font and size; temporary
attributes used during processing or display, such as underlining of misspelled words; paragraph attributes,
such as alignment and tab stops; glyph attributes that may control special handling of particular glyphs; and
document attributes, such as margins and paper size.
About the Cocoa Text System
At a Glance
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
8Related Chapter: “Text Attributes” (page 33)
Font Objects, the Font Panel, and the Font Manager Provide Typeface Handling
The Font panel, also called the Fonts window, is a user interface object that displays a list of available font
families and styles, letting the user preview them and change the font used to display text. Text views work
with NSFontPanel and NSFontManager objects to implement the font-handling system. You can create font
objects using the NSFont class and query them for font metrics and detailed glyph layout information.
Related Chapter: “Font Handling” (page 37)
Text Objects Are Key to Text Editing
Usually, text editing is performed by direct user action with a text view, but it can also be accomplished by
programmatic interaction with a text storage object. The text input system translates keyboard events into
commands and text input. You can customize editing behavior using many methods of text system objects,
through the powerful Cocoa mechanisms of notification and delegation, or, in extreme cases, by replacing the
text view itself with a custom subclass.
Related Chapter: “Text Editing” (page 48)
Prerequisites
To understand the information in this document, you should understand the material in Text System User
Interface Layer Programming Guide . In addition, you should have a general knowledge of Cocoa programming
paradigms and, to understand the code examples, familiarity with the Objective-C language.
See Also
The following documents describe other aspects of the Cocoa text system:
Text SystemUserInterface Layer ProgrammingGuide describesthe high-level interface to the Cocoa textsystem,
which is sufficient for most applications.
Text System Storage Layer Overview discusses the lower-level facilities that the Cocoa text system uses to store
text.
About the Cocoa Text System
Prerequisites
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
9Text Layout Programming Guide describes how the Cocoa text system lays out text on a page, suitable for
display and printing.
The following sample code projects illustrate how to use many of the APIs of the Cocoa text system:
CircleView is a small application with a demonstration subclass of NSView that draws text in a circle.
NSFontAttributeExplorer demonstrates how to gather and display various metric information for installed fonts
using NSFont.
TextInputView demonstrates how to gather and display various metric information for installed fonts using
NSFont.
TextViewConfig demonstrates configuration of multiple layout managers and multiple text container–text
view pairs on a single text storage object.
TextLinks programmatically creates links to URLs and other objects and handles clicks in non-URL links.
TextViewDelegate demonstrates using a text view's delegate to control selection and user input.
About the Cocoa Text System
See Also
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
10The Macintosh operating system has provided sophisticated text handling and typesetting capabilities from
its beginning. In fact, these featuressparked the desktop publishing revolution. Over the years, the text handling
facilities of the platform have continued to evolve to become more advanced, more efficient, and easier to
use. OS X provides modern text handling capabilities that are available to all applications through the classes
of the Cocoa text system and the opaque types and functions of Core Text.
The text-handling component of any application presents one of the greatest challengesto software designers.
Even the most basic text-handling system must be relatively sophisticated, allowing for text input, layout,
display, editing, copying and pasting, and many other features. But developers and users expect even more
than these basic features, expecting even simple editors to support multiple fonts, various paragraph styles,
embedded images, spell checking, and other features.
The Cocoa text system provides all these basic and advanced text-handling features, and it also satisfies
additional requirements from the ever-more-interconnected computing world: support for the character sets
of all of the world’s living languages, powerful layout capabilities to handle various text directionality and
nonrectangular text containers, and sophisticated typesetting capabilities such as control of kerning and
ligatures. Cocoa’s object-oriented text system is designed to provide all these capabilities without requiring
you to learn about or interact with more of the system than is necessary to meet the needs of your application.
Underlying the Cocoa text system is Core Text, which provides low-level, basic text layout and font-handling
capabilitiesto higher-level enginessuch as AppKit, WebKit, and others. Core Text providesthe implementation
for many Cocoa text technologies. Application developers typically have no need to use Core Text directly.
However, the Core Text API is accessible to developers who must use it directly,such asthose writing applications
with their own layout engine and those porting ATSUI- or QuickDraw-based codebases to the modern world.
To decide which OS X text technology is right for your application, apply the following guidelines:
●
If possible, use Cocoa text. The NSTextView class is the most advanced full-featured, flexible text view in
OS X. Forsmall amounts of text, use NSTextField. For more information about text views,see Text System
User Interface Layer Programming Guide .
● To display web content in your application, use WebKit. For more information about WebKit, see WebKit
Objective-C Programming Guide .
●
If you have your own page layout engine, you can use Core Text to generate the glyphs and position them
relative to each other. For more information about Core Text, see Core Text Programming Guide .
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
11
Text Handling Technologies in OS XThis chapter defines some important typographical concepts relevant to the text system. If you are already
familiar with typography, you can skip this chapter.
Characters and Glyphs
A character is the smallest unit of written language that carries meaning. Characters can correspond to a
particularsound in the spoken form of the language, as do the letters of the Roman alphabet; they can represent
entire words, such as Chinese ideographs; or they can represent independent concepts, such as mathematical
symbols. In every case, however, a character is an abstract concept.
Although characters must be represented in a display area by a recognizable shape, they are not identical to
that shape. That is, a character can be drawn in various forms and remain the same character. For example, an
“uppercase A” character can be drawn with a different size or a different stroke thickness, it can lean or be
vertical, and it can have certain optional variations in form, such as serifs. Any one of these various concrete
forms of a character is called a glyph. Figure 2-1 shows different glyphs that all represent the character
“uppercase A.”
Figure 2-1 Glyphs of the character A
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
12
Typographical ConceptsCharacters and glyphs do not have a one-to-one correspondence. In some cases a character may be represented
by multiple glyphs, such as an “é” which may be an “e” glyph combined with an acute accent glyph “´”. In other
cases, a single glyph may represent multiple characters, as in the case of a ligature, or joined letter. Figure 2-2
shows individual characters and the single-glyph ligature often used when they are adjacent.
Figure 2-2 Ligatures
+ =
+ = A ligature is an example of a contextual form in which the glyph used to represent a character changes
depending on the characters next to it. Other contextual formsinclude alternate glyphsfor characters beginning
or ending a word.
Computers store characters as numbers mapped by encoding tables to their corresponding characters. The
encoding scheme native to OS X is called Unicode. The Unicode standard provides a unique number for every
character in every modern written language in the world, independent of the platform, program, and
programming language being used. This universalstandard solves a longstanding problem of different computer
systems using hundreds of conflicting encoding schemes. It also hasfeaturesthatsimplify handling bidirectional
text and contextual forms.
Glyphs are also represented by numeric codes called glyph codes. The glyphs used to depict characters are
selected by the Cocoa layout manager during composition and layout processing. The layout manager
determines which glyphs to use and where to place them in the display, or view. The layout manager caches
the glyph codesin use and provides methodsto convert between characters and glyphs and between characters
and view coordinates. (See “Text Layout” (page 14) for more information about the layout process.)
Typefaces and Fonts
A typeface is a set of visually related shapesforsome or all of the charactersin a written language. For example,
Times is a typeface, designed by Stanley Morrison in 1931 for The Times newspaper of London. All of the letter
forms in Times are related in appearance, having consistent proportions between stems (vertical strokes) and
counters (rounded shapes in letter bodies) and other elements. When laid out in blocks of text, the shapes in
a typeface work together to enhance readability.
Typographical Concepts
Typefaces and Fonts
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
13A typestyle, orsimply style, is a distinguishing visual characteristic of a typeface. For example, roman typestyle
is characterized by upright letters having serifs and stems thicker than horizontal lines. In italic typestyle, the
letters slant to the right and are rounded, similar to cursive or handwritten letter shapes. A typeface usually
has several associated typestyles.
A font is a series of glyphs depicting the characters in a consistent size, typeface, and typestyle. A font is
intended for use in a specific display environment. Fonts contain glyphs for all the contextual forms, such as
ligatures, as well as the normal character forms.
A font family is a group of fontsthatshare a typeface but differ in typestyle. So, for example, Timesisthe name
of a font family (as well as the name of its typeface). Times Roman and Times Italic are the names of two
individual fonts belonging to the Times family. Figure 2-3 shows several of the fonts in the Times font family.
Figure 2-3 Fonts in the Times font family
Styles, also called traits, that are available in Cocoa include variationssuch as bold, italic, condensed, expanded,
narrow, small caps, poster fonts, and fixed pitch. Font descriptors in the Cocoa text system provide a
font-matching capability,so that you can partially describe a font by creating a font descriptor with, for example,
just a family name or weight, and you can then find all the fonts on the system that match the given trait.
Text Layout
Text layoutisthe process of arranging glyphs on a display device, in an area called a text view, which represents
an area similar to a page in traditional typesetting. The order in which glyphs are laid out relative to each other
is called text direction. In English and other languages derived from Latin, glyphs are placed side by side to
form words that are separated by spaces. Words are laid out in lines beginning at the top left of the text view
proceeding from left to right until the text reaches the right side of the view. Text then begins a new line at
the left side of the view under the beginning of the previous line, and layout proceeds in the same manner to
the bottom of the text view.
Typographical Concepts
Text Layout
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
14In other languages, glyph layout can be quite different. For example, some languages lay out glyphs from right
to left or vertically instead of horizontally. It is common, especially in technical writing, to mix languages with
differing text direction, such as English and Hebrew, in the same line. Some writing systems even alternate
layout direction in every other line (an arrangement called boustrophedonic writing). Some languages do not
group glyphs into words separated by spaces. Moreover, some applications call for arbitrary arrangements of
glyphs; for example, in a graphic design context, a layout may require glyphs to be arranged on a nonlinear
path.
To create lines from a string of glyphs, the layout engine must perform line breaking by finding a point at
which to end one line and begin the next. In the Cocoa text system, you can specify line breaking at either
word or glyph boundaries. In Roman text, a word broken between glyphs requires insertion of a hyphen glyph
at the breakpoint.
The Cocoa layout manager lays out glyphs along an invisible line called the baseline. In Roman text, the baseline
is horizontal, and the bottom edge of most of the glyphs rest on it. Some glyphs extend below the baseline,
including those for characters like “g” that have descenders, or “tails,” and large rounded characters like “O”
that must extend slightly below the baseline to compensate for optical effects. Other writing systems place
glyphs below or centered on the baseline. Every glyph includes an origin point that the layout manager uses
to align it properly with the baseline.
Glyph designers provide a set of measurements with a font, called metrics, which describe the spacing around
each glyph in the font. The layout manager uses these metrics to determining glyph placement. In horizontal
text, the glyph has a metric called the advance width, which measures the distance along the baseline to the
origin point of the next glyph. Typically there is some space between the origin point and the left side of the
glyph, which is called the left-side bearing. There may also be space between the right side of the glyph and
the point described by the advance width, which is called the right-side bearing. The vertical dimension of
the glyph is provided by two metrics called the ascent and the descent. The ascent is the distance from the
Typographical Concepts
Text Layout
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
15origin (on the baseline) to the top of the tallest glyphs in the font. The descent, which is the distance below
the baseline to the bottom of the font’s deepest descender. The rectangle enclosing the visible parts of the
glyph is called the bounding rectangle or bounding box. Figure 2-4 illustrates these metrics.
Figure 2-4 Glyph metrics
Advance width
= Origin
Ascent
Baseline
Right-side bearing
Descent
Left-side
bearing
Bounding
box
By default, in horizontal text, typesetters place glyphs side-by-side using the advance width, resulting in a
standard interglyph space. However, in some combinations, text is made more readable by kerning, which is
shrinking or stretching the space between two glyphs. A very common example of kerning occurs between
an uppercase W and uppercase A, as shown in Figure 2-5. Type designers include kerning information in the
metricsfor a font. The Cocoa textsystem provides methodsto turn kerning off, use the defaultsettings provided
with the font, or tighten or loosen the kerning throughout a selection of text.
Figure 2-5 Kerning
With kerning
Without kerning
Type systems usually measure font metrics in units called points, which in OS X measure exactly 72 per inch.
Adding the distance of the ascent and the descent of a font provides the font’s point size.
Space added during typesetting between lines of type is called leading, after the slugs of lead used for that
purpose in traditional metal-type page layout. (Leading is sometimes also called linegap .) The total amount
of ascent plus descent plus leading provides a font’s line height.
Typographical Concepts
Text Layout
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
16Although the preceding typographic concepts of type design may be somewhat esoteric, most people who
have created documents on a computer or typewriter are familiar with the elements of text layout on a page.
For example, the margins are the areas of white space between the edges of the page and the text area where
the layout engine places glyphs. Alignment describes the way text lines are placed relative to the margins.
For example, horizontal text can be aligned right, left, or centered, as shown in Figure 2-6.
Figure 2-6 Alignment of text relative to margins
Left aligned
Alignment or flushness, is the
process of placing text in relation to
one or both margins. You set
the alignment in the style object for
glyph and text shapes, not for
layout shapes.
Justification, is the process of
typographically “stretching” or
“shrinking” a line of text to fit
within a given width. Your
application can set the width of the
space in which the line of text
should appear; ATSUI then
distributes the white space available
on the line between words or
even between glyphs, depending on
the level of justification your
application or the user choses.
Centered
Alignment or flushness, is the
process of placing text in relation to
one or both margins. You set
the alignment in the style object for
glyph and text shapes, not for
layout shapes.
Justification, is the process of
typographically “stretching” or
“shrinking” a line of text to fit
within a given width. Your
application can set the width of the
space in which the line of text
should appear; ATSUI then
distributes the white space available
on the line between words or
even between glyphs, depending on
the level of justification your
application or the user choses.
Right aligned
Alignment or flushness, is the
process of placing text in relation to
one or both margins. You set
the alignment in the style object for
glyph and text shapes, not for
layout shapes.
Justification, is the process of
typographically “stretching” or
“shrinking” a line of text to fit
within a given width. Your
application can set the width of the
space in which the line of text
should appear; ATSUI then
distributes the white space available
on the line between words or
even between glyphs, depending on
the level of justification your
application or the user choses.
Lines of text can also be justified; for horizontal text the lines are aligned on both right and left margin by
varying interword and interglyph spacing, as shown in Figure 2-7. The system performs alignment and
justification, if requested, after the text stream has been broken into lines and hyphens added and other glyph
substitutions made.
Figure 2-7 Justified text
Justified
Glyph designers provide a set of measurements with a
font, called metrics, which describe the spacing around
each glyph placement. Layout engines use the metrics to
determine glyph placement. In horizontal text, the glyph
has a metric called the advanced width, which measures
the distance along the baseline where the origin point if
the next glyph is placed. Typically there is some space
between the origin point and the left side of the glyph,
which is called the left-side bearing. There may also be
space between the right side of the glyph and the point
described by the advanced width, called the right-side
bearing. Vertical spacing of the glyph is provided by two
metrics called the ascent, which is the distance from the
origin (on the baseline) to a height slightly above the top
of the tallest glyphs in the font, and the descent, which is
below the baseline. The rectangle enclosing the visible
Typographical Concepts
Text Layout
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
17The Cocoa textsystem is abstracted into a set of classesthat interact to provide all of the text-handling features
of the system. The classesrepresentspecific functional areas with well-defined interfacesthat enable application
programs to modify the behavior of the system or even to replace parts with custom subclasses. The Cocoa
text system is designed so that you don’t need to learn about or interact with more of the system than is
necessary to meet the needs of your application.
For most developers, the general-purpose programmatic interface of the NSTextView class is all you need to
learn. NSTextView provides the user interface to the text system. See NSTextView Class Reference for detailed
information about NSTextView.
If you need more flexible, programmatic access to the text, you’ll need to learn about the storage layer and
the NSTextStorage class. And, of course, to access all the available features, you can interact with any of the
classes that support the text system.
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
18
Text System OrganizationFunctional Areas of the Cocoa Text System
Figure 3-1 shows the major functional areas of the text system with the user interface layer on top, the storage
layer on the bottom, and, in the middle region, the components that lay out the text for display. These layers
represent view, controller, and model concepts, respectively, as described in “MVC and the Text System” (page
23).
Figure 3-1 Major functional areas of the Cocoa text system
Ruler views, font
and color panels
Glyph generator
Text input
Typesetter
Text containers Text storage
Text views
Layout
manager
Display
View Layer
Controller Layer
Storage Layer
The text classes exceed most other classes in the AppKit in the richness and complexity of their interface. One
of their design goals is to provide a comprehensive set of text-handling features so that you rarely need to
create a subclass. Among other things, a text object such as NSTextView can:
● Control whether the user can select or edit text.
● Control the font and layout characteristics of its text by working with the Font menu and Font panel (also
called the Fonts window).
● Let the user control the format of paragraphs by manipulating a ruler.
● Control the color of its text and background.
● Wrap text on a word or character basis.
● Display graphic images within its text.
● Write text to or read text from files in the form of RTFD—Rich Text Format files that contain TIFF or EPS
images, or attached files.
Text System Organization
Functional Areas of the Cocoa Text System
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
19● Let another object, the delegate, dynamically control its properties.
● Let the user copy and paste text within and between applications.
● Let the user copy and paste font and format information between NSTextView objects.
● Let the user check the spelling of words in its text.
Graphical user-interface building tools (such as Interface Builder) may give you access to text objects in several
different configurations,such asthose found in the NSTextField, NSForm, and NSScrollView objects. These
classes configure a text object for their own specific purposes. Additionally, all NSTextField, NSForm, or
NSButton objects within the same window—in short, all objects that access a text object through associated
cells—share the same text object, called the field editor. Thus, it’s generally best to use one of these classes
whenever it meets your needs, rather than create text objects yourself. But if one of these classes doesn’t
provide enough flexibility for your purposes, you can create text objects programmatically.
Text objects typically work closely with various other objects. Some of these—such as the delegate or an
embedded graphic object—require some programming on your part. Others—such as the Font panel, spell
checker, or ruler—take no effort other than deciding whether the service should be enabled or disabled.
To control layout of text on the screen or printed page, you work with the objectsthat link the NSTextStorage
repository to the NSTextView that displays its contents. These objects are of the NSLayoutManager and
NSTextContainer classes.
An NSTextContainer object defines a region where text can be laid out. Typically, a text container defines
a rectangular area, but by creating a subclass of NSTextContainer you can create other shapes: circles,
pentagons, or irregular shapes, for example. NSTextContainer isn’t a user-interface object, so it can’t display
anything or receive events from the keyboard or mouse. It simply describes an area that can be filled with text,
and it’s not tied to any particular coordinate system. Nor does an NSTextContainer object store text—that’s
the job of an NSTextStorage object.
A layout manager object, of the NSLayoutManager class, orchestratesthe operation of the other text handling
objects. It intercedes in operations that convert the data in an NSTextStorage object to rendered text in an
NSTextView object’s display. It also overseesthe layout of text within the areas defined by NSTextContainer
objects.
Text System Organization
Functional Areas of the Cocoa Text System
2012-09-19 | © 2012 Apple Inc. All Rights Reserved.
20Class Hierarchy of the Cocoa Text System
In addition to the four principal classes in the text system—NSTextStorage, NSLayoutManager,
NSTextContainer, NSTextView—there are a number of auxiliary classes and protocols. Figure 3-2 provides
a more complete picture of the text system. Names between angle brackets, such as