您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Reflect Index

Reflect Page # 3

Discussion Topic 1 – Unavailable font resolution

The use of fonts is a bit of a headache for programming languages that are designed to encourage portability. If a program asks for a display in a given typeface, and that typeface is not available on a particular computer, clearly there is a problem. What options could Java take if a program requests a font that does not exist? For example, suppose we have the line

Font myFont = new Font("no_such_font", Font.PLAIN, 32);

and there is no font called ‘no_such_font'? If you have finished exercise 5 (the font list applet) you should have noticed one way in which the impact of this problem is being reduced.

What is it, and do you think it is successful? What disadvantages are there to this approach?

Contribution for Discussion Topic 1 – Unavailable font resolution

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg