In addition, Java SE provides you with theįontMetrics class, which enables you to obtain measurements of text rendered by aįont object such as the height of a line of text in the font. Positioning such text without taking the context into account produces The characters can change depending on the context, measuring and Individual character needs to be measured and positioned within theĬontext of neighboring characters. To properly display text in languages such as Hebrew and Arabic, each Measure, and render text, you need to keep track of each individualĬharacter and the style applied to that character. In this case, even the same character can have different shapesĪnd widths, depending on how it is styled. Text is often displayed using multiple fonts and styles, such as bold or To properly align the column, you need to know theĮxact width of each number so that you can adjust accordingly. For example, to right-align a column of numbersĭisplayed in a proportional font, you can't simply use extra spaces to Measuring of text has to take into account exactly which characters are Unless you are working with a monospaced font, different characters in aįont have different widths. Working with Bidirectional Text for more information. This means that Arabic and Hebrew, even with no embedded English text, are truly bidirectional. For example, Arabic and Hebrew numbers run left to right, even though the letters run right to left. Some writing systems have rules in addition to script order for arranging glyphs and words on lines of text. For example, the script order for Roman text is left-to-right and the script order for Arabic and Hebrew is right-to-left. The visual order for glyphs in a particular writing system (script) is called the script order. The logical order is not necessarily the same as the visual order, the order in which the corresponding glyphs are displayed. Logical order is the order in which characters and words are read and written. Text that uses Unicode character encoding is stored in memory in logical order. In the Java programming language, text is encoded using Unicode character encoding. For example, the following figure illustrates how two Arabic characters are combined into a single ligature when they appear together. When ligatures are formed fromĪrabic characters, the shapes change even more radically than they do inĮnglish. Mandatory it is unacceptable to present certain character combinations Ligatures are also used in Arabic and the use of some ligatures is The merged glyph takes into account the overhang on the letter f and combines the characters in a natural-looking way, instead of simply letting the letters collide. For example, most English fonts contain the ligature fi shown in the following figure: This type of merged glyph is called a ligature. In some contexts, two glyphs can change shape even more radically and For example, the Arabic letter heh has the four cursive forms shown in the following figure:Īlthough these four forms are quite different from one another, suchĬursive shape-changing is not fundamentally different from cursive Unlike in English, cursive forms are mandatory in Arabic it is unacceptable to present text without using cursive forms.ĭepending on the context, these cursive forms can differ radically in shape. In some writing systems, particularly Arabic, the context of a glyph must always be taken into account. Many different glyphs can be used to represent a single character or combination of characters, depending on the font and style.įor example, in handwritten cursive text, a particular character can take on different shapes depending on how it is connected to adjacent The shape, size, and position of a glyph isĭependent on its context. This section covers the following topics:Ī glyph is the visual representation of one or more characters. To develop software that can be deployed in international markets, text must be laid out in different languages in a way that conforms to the rules of the appropriate writing system. Working with Bidirectional Text for more information about these text operations. Text operations such as caret positioning, hit detection, and The information used to lay out text is also necessary for performing Shaping text using the appropriate glyphs and ligatures.The text layout process involves the following: This process is referred to as text layout. Before a piece of text can be displayed, it must be properly shaped and positioned using the appropriate glyphs and ligatures.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |