Book contents
- Frontmatter
- Contents
- INTRODUCTION
- GETTING STARTED WITH JAVA
- MIGRATING TO JAVA
- TECHNIQUES 101
- JAVA PERMUTATIONS AND COMBINATIONS
- PREVENTION IS BETTER THAN A CURE
- INTERNATIONAL TEXT IN JDK 1.2
- MODELING AND PATTERNS
- JAVA IN A DISTRIBUTED WORLD
- THREADS
- USER INTERFACES
- SECURITY
- TESTING
- PERFORMANCE
- REALITY CHECK
- INDEX
INTERNATIONAL TEXT IN JDK 1.2
Published online by Cambridge University Press: 06 July 2010
- Frontmatter
- Contents
- INTRODUCTION
- GETTING STARTED WITH JAVA
- MIGRATING TO JAVA
- TECHNIQUES 101
- JAVA PERMUTATIONS AND COMBINATIONS
- PREVENTION IS BETTER THAN A CURE
- INTERNATIONAL TEXT IN JDK 1.2
- MODELING AND PATTERNS
- JAVA IN A DISTRIBUTED WORLD
- THREADS
- USER INTERFACES
- SECURITY
- TESTING
- PERFORMANCE
- REALITY CHECK
- INDEX
Summary
Aprimary design goal of Java is to enable developers to write software that can be deployed easily across a variety of world markets—these markets use very different languages and writing systems. To be acceptable in these markets, you must be able to present text in a way that conforms to the rules of their writing systems.
Displaying English text correctly is relatively simple—though not quite as simple as you may think! Other writing systems, particularly Arabic and Hebrew, are much more complex than English, requiring reshaping and reordering of text for acceptable display. Moreover, in a Graphical User Interface (GUI) you need to measure text properly; and if you are editing text, you also have to hittest it to find out what the mouse is selecting, highlight the text to show the selection, break the text into pieces that fit onto a line, and so on.
Fortunately, in the Java Development Kit (JDK) version 1.2, the new TextLayout class and its supporting classes can perform these functions for you, even if the text has multiple styles and contains characters from a mixture of different writing systems (including Arabic and Hebrew). We discuss several problems posed by these writing systems, and then describe how you can use the new TextLayout classes to handle these problems easily and efficiently.
Even if you write English-only software, you will find that using TextLayout is more convenient than writing your own utility for displaying and measuring text.
- Type
- Chapter
- Information
- More Java Gems , pp. 87 - 102Publisher: Cambridge University PressPrint publication year: 2000