Context-Dependent and Directional Text
Total Page:16
File Type:pdf, Size:1020Kb
Technical Standard Portable Layout Services: Context-Dependent and Directional Text NICAL H S C T A E N T D A R D [This page intentionally left blank] CAE Specification Portable Layout Services: Context-dependent and Directional Text The Open Group February 1997, The Open Group All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owners. CAE Specification Portable Layout Services: Context-dependent and Directional Text ISBN: 1-85912-142-X Document Number: C616 Published in the U.K. by The Open Group, February 1997. Any comments relating to the material contained in this document may be submitted to: The Open Group Apex Plaza Forbury Road Reading Berkshire, RG1 1AX United Kingdom or by Electronic Mail to: [email protected] ii CAE Specification (1997) Contents Chapter 1 Introduction............................................................................................... 1 1.1 Scope.............................................................................................................. 1 1.2 Example ........................................................................................................ 2 1.3 Target Audience .......................................................................................... 3 1.4 Approach...................................................................................................... 3 Chapter 2 Complex-Text Languages — An Overview ............................ 5 2.1 Complex-text Languages .......................................................................... 5 2.1.1 Layout Transformations and Related Attributes .............................. 6 2.2 Bidirectional Languages............................................................................ 7 2.2.1 The Arabic Languages and their Writing System ............................. 7 2.2.2 The Hebrew Language and its Writing System................................. 9 2.3 Aspects of Bidirectional Language Writing Systems .......................... 11 2.3.1 Bidirectionality......................................................................................... 11 2.3.2 Shaping ...................................................................................................... 14 2.3.3 National Numbers................................................................................... 16 2.3.4 Bidirectional Data Entry......................................................................... 16 2.3.5 Common User Access and Bidirectional Languages ....................... 17 2.4 Thai Language and its Writing System .................................................. 18 2.4.1 Writing Thai Characters — Graphic Representation ....................... 18 2.4.2 Thai Written Symbols ............................................................................. 19 2.4.3 Writing Order ........................................................................................... 20 2.4.4 What is a Thai Character? ...................................................................... 20 2.4.5 Thai Numbers........................................................................................... 21 2.4.6 Character Composition .......................................................................... 21 2.4.7 Thai Character Rendering...................................................................... 21 2.5 Korean Language and its Writing System ............................................. 23 2.5.1 Hangul Writing System .......................................................................... 23 2.5.2 Character Set Considerations................................................................ 25 2.6 Conclusions and Guidelines..................................................................... 26 Chapter 3 Interface Overview................................................................................ 27 3.1 Opaque Data ................................................................................................ 27 3.2 Functions ...................................................................................................... 27 3.3 Descriptors and Data Types...................................................................... 28 Chapter 4 Header File <sys/layout.h> .............................................................. 29 4.1 LayoutObject................................................................................................ 29 4.1.1 Association with Attribute Objects and Locales............................... 29 4.1.2 LayoutObject Content............................................................................. 29 4.2 Layout Values ............................................................................................. 30 4.2.1 Descriptors................................................................................................ 30 Portable Layout Services: Context-dependent and Directional T ext iii Contents 4.2.2 Layout Value Data Types ....................................................................... 37 4.3 Layout Modifiers......................................................................................... 39 Chapter 5 Layout APIs................................................................................................ 45 m_create_layout( )............................................................................................ 46 m_destroy_layout( ) ......................................................................................... 47 m_getvalues_layout( )...................................................................................... 48 m_setvalues_layout( ) ...................................................................................... 49 m_transform_layout( )..................................................................................... 50 m_wtransform_layout( ).................................................................................. 54 5.1 Notes.............................................................................................................. 59 Appendix A Implementation Example.................................................................. 61 Appendix B LO_LTYPE Locale Category............................................................. 69 B.1 Character Classifications Related to Directionality............................. 69 B.2 Character Classifications of Control Characters.................................. 70 B.3 Character Classifications of National Numbers .................................. 70 B.4 Character Classifications of Composite Graphic Symbols ................ 70 B.5 Mapping Keywords.................................................................................... 71 B.6 Character Classification Related to Character Connectivity............. 72 Appendix C Dynamic Pluggable Interface......................................................... 73 C.1 Operating System Requirement .............................................................. 73 C.2 Design............................................................................................................ 74 C.3 Data Structure.............................................................................................. 75 C.4 Calling Sequence......................................................................................... 77 C.5 Sample Code ................................................................................................ 78 C.6 Common Naming for Layout Values ..................................................... 80 Glossary ....................................................................................................... 83 Index............................................................................................................... 91 List of Examples 2-1 Example of Symmetrical Swapping........................................................... 14 A-1 Internationalised Motif Program to Support Layout APIs ................... 61 A-2 Storage to Explicit Controls......................................................................... 65 A-3 Explicit to Visual Buffer................................................................................ 66 List of Figures 1-1 Layout Transformations in Motif ............................................................... 2 2-1 Arabic, Farsi and Urdu Characters............................................................. 7 2-2 The Arabic Character Ghayn in its Different Shapes ............................. 9 2-3 Shape of the National Numbers in Arabic, Farsi and Urdu.................. 9 2-4 Hebrew Alphabet........................................................................................... 10 iv CAE Specification (1997) Contents 2-5 Hebrew Long Vowels.................................................................................... 10 2-6 Hebrew Final Letters..................................................................................... 10 2-7 Thai Text Example ......................................................................................... 18 2-8 Shape of the National Numbers in Thai ................................................... 21 2-9 Korean Writing Direction............................................................................. 24 2-10 Syllable Composition and Writing Direction in Hangul....................... 25 List of Tables 3-1 Standard Layout Values