TAILIEUCHUNG - PHP and MySQL Web Development - P87

PHP and MySQL Web Development - P87: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | 402 Chapter 19 Generating Images There is one tricky thing about the values returned from the ImageTTFBBox are coordinate values specified from an origin. However unlike coordinates for images which are specified relative to the top-left corner they are specified relative to a baseline. Look at Figure will see that we have drawn a line along the bottom of most of the is known as the baseline. Some letters hang below the baseline such as y in this example. These are called descenders. The left side of the baseline is specified as the origin of measurements that is X coordinate 0 and Y coordinate 0. Coordinates above the baseline have a positive X coordinate and coordinates below the baseline have a negative X coordinate. In addition to this text might actually have coordinate values that sit outside the bounding box. For example the text might actually start at an X coordinate of 1. What this all adds up to is the fact that care is required when performing calculations with these numbers. We work out the width and height of the text as follows right_text bbox 2 right co-ordinate left_text bbox 0 left co-ordinate width_text right_text - left_text how wide is it height_text abs bbox 7 - bbox 1 how tall is it After we have this we test the loop condition while font_size 8 height_text height_image_wo_margins width_text width_image_wo_margins We are testing two sets of conditions here. The first is that the font is still readable there s no point in making it much smaller than 8 point because the button becomes too difficult to read. The second set of conditions tests whether the text will fit inside the drawing space we have for it. Next we check to see whether our iterative calculations found an acceptable font size or not and report an error if not if height_text height_image_wo_margins width_text width_image_wo_margins no readable font size will fit on button echo Text given will not fit on button. br Positioning the Text If .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.